Commit b9652481 authored by Jakob Moser's avatar Jakob Moser
Browse files

Merge branch 'backend/add-card-model' into 'master'

Add basic Card type

See merge request moser/poolpay!6
parents 4411d0de 143c8a54
Loading
Loading
Loading
Loading

poolpay/model/Card.py

0 → 100644
+21 −0
Original line number Diff line number Diff line
from uuid import UUID

from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy.schema import ForeignKey

from poolpay.model.Retrievable import Retrievable


class Card(Retrievable):
    """
    A card, most likely a pool card. It has an id (which is read from the card), and belongs to a person.
    """

    __tablename__ = "card"

    id: Mapped[int] = mapped_column(primary_key=True)
    owner_uuid: Mapped[UUID] = mapped_column(ForeignKey("person.uuid"))

    @property
    def primary_key(self) -> int:
        return self.id