feat: applied model mixins
All checks were successful
ci / ruff (push) Successful in 3s
ci / ty (push) Successful in 4s
ci / tests (push) Successful in 16s

IdMixin used on every table with an ID index (no changes needed to db)

Timestamp and Deleted mixins applied to org and user tables.

ActivatedMixin added to users.
This commit is contained in:
Chris Milne 2026-06-22 13:45:37 +01:00
parent 7e1ab6c6ee
commit c28b4dc37b
6 changed files with 60 additions and 15 deletions

View file

@ -6,16 +6,17 @@ Models:
street_address, street_address_line_2, post_office_box_number, address_locality, country_code, address_region, postal_code
"""
from src.models import IdMixin
from sqlalchemy import ForeignKey
from sqlalchemy.orm import mapped_column, Mapped
from src.models import CustomBase
class Contact(CustomBase):
class Contact(CustomBase, IdMixin):
__tablename__ = "contact"
id: Mapped[int] = mapped_column(primary_key=True)
email: Mapped[str] = mapped_column(default=None, nullable=True)
first_name: Mapped[str] = mapped_column(default=None, nullable=True)
last_name: Mapped[str] = mapped_column(default=None, nullable=True)