
from __future__ import annotations
from dataclasses import dataclass
from datetime import date
from typing import Any, Optional

from ....typing import UserID


@dataclass(frozen=True)
class User:
    id: UserID
    screen_name: Optional[str]
    suspended: bool
    deleted: bool
    locale: Optional[str]
    avatar_url: Optional[str]
    is_orga: bool


@dataclass(frozen=True)
class UserDetail:
    first_names: Optional[str]
    last_name: Optional[str]
    date_of_birth: Optional[date]
    country: Optional[str]
    zip_code: Optional[str]
    city: Optional[str]
    street: Optional[str]
    phone_number: Optional[str]
    internal_comment: Optional[str]
    extras: dict[str, Any]


@dataclass(frozen=True)
class UserWithDetail(User):
    detail: UserDetail


from __future__ import annotations
from dataclasses import dataclass
from datetime import date
from typing import Any, Optional

from ....typing import UserID


@dataclass(frozen=True)
class User:
    id: UserID
    screen_name: Optional[str]
    suspended: bool
    deleted: bool
    locale: Optional[str]
    avatar_url: Optional[str]
    is_orga: bool


@dataclass(frozen=True)
class UserDetail:
    first_names: Optional[str]
    last_name: Optional[str]
    date_of_birth: Optional[date]
    country: Optional[str]
    zip_code: Optional[str]
    city: Optional[str]
    street: Optional[str]
    phone_number: Optional[str]
    internal_comment: Optional[str]
    extras: dict[str, Any]

    @property
    def full_name(self) -> Optional[str]:
        names = [self.first_names, self.last_name]
        return ' '.join(filter(None, names)) or None


@dataclass(frozen=True)
class UserWithDetail(User):
    detail: UserDetail

Fix display of full user name at least on current user's settings page
Fix display of full user name at least on current user's settings page

  
  from __future__ import annotations
  from dataclasses import dataclass
  from datetime import date
  from typing import Any, Optional
  
  from ....typing import UserID
  
  
  @dataclass(frozen=True)
  class User:
      id: UserID
      screen_name: Optional[str]
      suspended: bool
      deleted: bool
      locale: Optional[str]
      avatar_url: Optional[str]
      is_orga: bool
  
  
  @dataclass(frozen=True)
  class UserDetail:
      first_names: Optional[str]
      last_name: Optional[str]
      date_of_birth: Optional[date]
      country: Optional[str]
      zip_code: Optional[str]
      city: Optional[str]
      street: Optional[str]
      phone_number: Optional[str]
      internal_comment: Optional[str]
      extras: dict[str, Any]
  
+     @property
+     def full_name(self) -> Optional[str]:
+         names = [self.first_names, self.last_name]
+         return ' '.join(filter(None, names)) or None
+ 
  
  @dataclass(frozen=True)
  class UserWithDetail(User):
      detail: UserDetail
  
Fix display of full user name at least on current user's settings page
## Code Before:

from __future__ import annotations
from dataclasses import dataclass
from datetime import date
from typing import Any, Optional

from ....typing import UserID


@dataclass(frozen=True)
class User:
    id: UserID
    screen_name: Optional[str]
    suspended: bool
    deleted: bool
    locale: Optional[str]
    avatar_url: Optional[str]
    is_orga: bool


@dataclass(frozen=True)
class UserDetail:
    first_names: Optional[str]
    last_name: Optional[str]
    date_of_birth: Optional[date]
    country: Optional[str]
    zip_code: Optional[str]
    city: Optional[str]
    street: Optional[str]
    phone_number: Optional[str]
    internal_comment: Optional[str]
    extras: dict[str, Any]


@dataclass(frozen=True)
class UserWithDetail(User):
    detail: UserDetail

## Instruction:
Fix display of full user name at least on current user's settings page
## Code After:

from __future__ import annotations
from dataclasses import dataclass
from datetime import date
from typing import Any, Optional

from ....typing import UserID


@dataclass(frozen=True)
class User:
    id: UserID
    screen_name: Optional[str]
    suspended: bool
    deleted: bool
    locale: Optional[str]
    avatar_url: Optional[str]
    is_orga: bool


@dataclass(frozen=True)
class UserDetail:
    first_names: Optional[str]
    last_name: Optional[str]
    date_of_birth: Optional[date]
    country: Optional[str]
    zip_code: Optional[str]
    city: Optional[str]
    street: Optional[str]
    phone_number: Optional[str]
    internal_comment: Optional[str]
    extras: dict[str, Any]

    @property
    def full_name(self) -> Optional[str]:
        names = [self.first_names, self.last_name]
        return ' '.join(filter(None, names)) or None


@dataclass(frozen=True)
class UserWithDetail(User):
    detail: UserDetail
