feat: patronymic and passport data for user
This commit is contained in:
		@@ -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')
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user