Skip to content

Commit

Permalink
Integrate dataclass
Browse files Browse the repository at this point in the history
  • Loading branch information
armanddidierjean committed Nov 17, 2024
1 parent 0efe07c commit 1777ada
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 10 additions & 10 deletions app/core/myeclpay/models_myeclpay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from uuid import UUID

from sqlalchemy import ForeignKey
from sqlalchemy.orm import Mapped, MappedAsDataclass, mapped_column, relationship
from sqlalchemy.orm import Mapped, mapped_column, relationship

from app.core import models_core
from app.core.myeclpay.types_myeclpay import (
Expand All @@ -17,7 +17,7 @@
from app.types.sqlalchemy import Base, PrimaryKey


class Wallet(MappedAsDataclass, Base):
class Wallet(Base):
__tablename__ = "myeclpay_wallet"

id: Mapped[PrimaryKey]
Expand All @@ -32,7 +32,7 @@ class Wallet(MappedAsDataclass, Base):
)


class WalletDevice(MappedAsDataclass, Base):
class WalletDevice(Base):
__tablename__ = "myeclpay_wallet_device"

id: Mapped[PrimaryKey]
Expand All @@ -44,7 +44,7 @@ class WalletDevice(MappedAsDataclass, Base):
activation_token: Mapped[str] = mapped_column(unique=True)


class Transaction(MappedAsDataclass, Base):
class Transaction(Base):
__tablename__ = "myeclpay_transaction"

id: Mapped[PrimaryKey]
Expand Down Expand Up @@ -76,7 +76,7 @@ class Transaction(MappedAsDataclass, Base):
)


class Store(MappedAsDataclass, Base):
class Store(Base):
__tablename__ = "myeclpay_store"

id: Mapped[PrimaryKey]
Expand All @@ -90,7 +90,7 @@ class Store(MappedAsDataclass, Base):
)


class Request(MappedAsDataclass, Base):
class Request(Base):
__tablename__ = "myeclpay_request"

id: Mapped[PrimaryKey]
Expand All @@ -107,7 +107,7 @@ class Request(MappedAsDataclass, Base):
)


class Transfer(MappedAsDataclass, Base):
class Transfer(Base):
__tablename__ = "myeclpay_transfer"

id: Mapped[PrimaryKey]
Expand All @@ -122,7 +122,7 @@ class Transfer(MappedAsDataclass, Base):
creation: Mapped[datetime]


class Seller(MappedAsDataclass, Base):
class Seller(Base):
__tablename__ = "myeclpay_seller"

user_id: Mapped[str] = mapped_column(primary_key=True)
Expand All @@ -137,7 +137,7 @@ class Seller(MappedAsDataclass, Base):
store_admin: Mapped[bool]


class UserPayment(MappedAsDataclass, Base):
class UserPayment(Base):
__tablename__ = "myeclpay_user_payment"

user_id: Mapped[str] = mapped_column(ForeignKey("core_user.id"), primary_key=True)
Expand All @@ -149,7 +149,7 @@ class UserPayment(MappedAsDataclass, Base):
accepted_cgu_version: Mapped[int]


class UsedQRCode(MappedAsDataclass, Base):
class UsedQRCode(Base):
__tablename__ = "myeclpay_used_qrcode"

qr_code_id: Mapped[PrimaryKey]
1 change: 0 additions & 1 deletion tests/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ async def create_user_with_groups(
nickname=nickname,
floor=floor,
external=external,
nickname=None,
birthday=None,
promo=None,
phone=None,
Expand Down

0 comments on commit 1777ada

Please sign in to comment.