feat: patronymic and passport data for user

This commit is contained in:
2024-11-22 15:12:35 +04:00
parent e36fad70c5
commit 8652d31f6d
3 changed files with 5 additions and 1 deletions

View File

@@ -59,11 +59,13 @@ class User(BaseModel):
first_name: Mapped[str] = mapped_column(nullable=False, server_default='')
second_name: Mapped[str] = mapped_column(nullable=False, server_default='')
patronymic: Mapped[str] = mapped_column(nullable=False, server_default='')
comment: Mapped[str] = mapped_column(nullable=False, server_default='')
telegram_id: Mapped[int] = mapped_column(BigInteger,
nullable=False,
index=True)
phone_number: Mapped[str] = mapped_column(nullable=True)
passport_data: Mapped[str] = mapped_column(nullable=True, comment='Серия и номер паспорта')
is_admin: Mapped[bool] = mapped_column(nullable=False, default=False)
is_blocked: Mapped[bool] = mapped_column(nullable=False, server_default='0')
is_deleted: Mapped[bool] = mapped_column(nullable=False, server_default='0')

View File

@@ -13,7 +13,9 @@ class BasicUser(BaseSchema):
phone_number: str | None = None
first_name: str
second_name: str
patronymic: str
comment: str
passport_data: str | None = None
is_admin: bool
is_blocked: bool

View File

@@ -51,7 +51,7 @@ class UserService(BaseService):
await self.session.execute(stmt)
await self.session.commit()
return UpdateUserResponse(ok=True, message='Пользователь успешно обновлен')
return CreateUserResponse(ok=True, message='Пользователь успешно создан')
except Exception as e:
return CreateUserResponse(ok=False, message=str(e))