feat: update users

This commit is contained in:
2026-05-12 21:36:04 +03:00
parent 46b1e336d9
commit e2a1d7e1b4
6 changed files with 26 additions and 31 deletions

View File

@@ -17,10 +17,9 @@ class UserEntity:
crypto_wallet: str | None = None
phone: str | None = None
bik: str | None = None
account_number: str | None = None
card_number: str | None = None
passport_data: str | None = None
inn: str | None = None
erc20: str | None = None
kyc_verified: bool | None = None
is_deleted: bool | None = None

View File

@@ -42,10 +42,9 @@ class KeydbCache(ICache):
'birth_date': str(user.birth_date) if user.birth_date else None,
'crypto_wallet': user.crypto_wallet,
'phone': user.phone,
'bik': user.bik,
'account_number': user.account_number,
'card_number': user.card_number,
'passport_data': user.passport_data,
'inn': user.inn,
'erc20': user.erc20,
'kyc_verified': user.kyc_verified,
'is_deleted': user.is_deleted,
'created_at': user.created_at.isoformat() if user.created_at else None,

View File

@@ -55,10 +55,9 @@ class RemoteCache(ICache):
'birth_date': str(user.birth_date) if user.birth_date else None,
'crypto_wallet': user.crypto_wallet,
'phone': user.phone,
'bik': user.bik,
'account_number': user.account_number,
'card_number': user.card_number,
'passport_data': user.passport_data,
'inn': user.inn,
'erc20': user.erc20,
'kyc_verified': user.kyc_verified,
'is_deleted': user.is_deleted,
'created_at': user.created_at.isoformat() if user.created_at else None,

View File

@@ -1,30 +1,29 @@
from __future__ import annotations
from sqlalchemy import Boolean,Date,DateTime,String
from sqlalchemy import Boolean,Date,String,DateTime
from sqlalchemy.orm import Mapped,mapped_column
from src.infrastructure.database.models.base import Base
from src.infrastructure.database.models.mixins import AuditTimestampsMixin,SoftDeleteMixin,UlidPrimaryKeyMixin
from src.infrastructure.database.models.mixins import UlidPrimaryKeyMixin,AuditTimestampsMixin,SoftDeleteMixin
class UserModel(Base,UlidPrimaryKeyMixin,AuditTimestampsMixin,SoftDeleteMixin):
__tablename__='users'
class UserModel(Base, UlidPrimaryKeyMixin, AuditTimestampsMixin, SoftDeleteMixin):
__tablename__ = 'users'
email: Mapped[str]=mapped_column(String(255),nullable=False,unique=True,index=True)
password_hash: Mapped[str]=mapped_column(String(255),nullable=False)
email: Mapped[str] = mapped_column(String(255), nullable=False, unique=True, index=True)
password_hash: Mapped[str] = mapped_column(String(255), nullable=False)
last_name: Mapped[str|None]=mapped_column(String(128),nullable=True)
first_name: Mapped[str|None]=mapped_column(String(128),nullable=True)
middle_name: Mapped[str|None]=mapped_column(String(128),nullable=True)
birth_date: Mapped[Date|None]=mapped_column(Date,nullable=True)
last_name: Mapped[str | None] = mapped_column(String(128), nullable=True)
first_name: Mapped[str | None] = mapped_column(String(128), nullable=True)
middle_name: Mapped[str | None] = mapped_column(String(128), nullable=True)
birth_date: Mapped[Date | None] = mapped_column(Date, nullable=True)
crypto_wallet: Mapped[str|None]=mapped_column(String(255),nullable=True)
phone: Mapped[str|None]=mapped_column(String(16),nullable=True)
crypto_wallet: Mapped[str | None] = mapped_column(String(255), nullable=True)
phone: Mapped[str | None] = mapped_column(String(16), nullable=True)
bik: Mapped[str|None]=mapped_column(String(9),nullable=True)
account_number: Mapped[str|None]=mapped_column(String(20),nullable=True)
card_number: Mapped[str|None]=mapped_column(String(19),nullable=True)
inn: Mapped[str|None]=mapped_column(String(12),nullable=True)
passport_data: Mapped[str | None] = mapped_column(String(255), nullable=True)
inn: Mapped[str | None] = mapped_column(String(12), nullable=True)
erc20: Mapped[str | None] = mapped_column(String(255), nullable=True)
kyc_verified: Mapped[bool]=mapped_column(Boolean,nullable=False,server_default='false',default=False)
kyc_verified_at: Mapped[DateTime|None]=mapped_column(DateTime(timezone=True),nullable=True)
kyc_verified: Mapped[bool] = mapped_column(Boolean, nullable=False, server_default='false', default=False)
kyc_verified_at: Mapped[DateTime | None] = mapped_column(DateTime(timezone=True), nullable=True)

View File

@@ -26,10 +26,9 @@ class UserRepository(IUserRepository):
birth_date=model.birth_date,
crypto_wallet=model.crypto_wallet,
phone=model.phone,
bik=model.bik,
account_number=model.account_number,
card_number=model.card_number,
passport_data=model.passport_data,
inn=model.inn,
erc20=model.erc20,
kyc_verified=model.kyc_verified,
is_deleted=model.is_deleted,
created_at=model.created_at,

View File

@@ -88,7 +88,7 @@ app.add_middleware(
hsts_preload=False,
frame_options='DENY',
referrer_policy='strict-origin-when-cross-origin',
content_security_policy="default-src 'self'; frame-ancestors 'none'; base-uri 'self'; object-src 'none'",
content_security_policy="default-src 'self'; script-src 'self' 'unsafe-inline' https://unpkg.com https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://unpkg.com; img-src 'self' data: https://fastapi.tiangolo.com; frame-ancestors 'none'; base-uri 'self'; object-src 'none'",
)