lavkach3
1import uuid2from enum import Enum3from typing import Optional4
5from sqlalchemy import Sequence, Uuid6from sqlalchemy.orm import relationship, mapped_column, Mapped7
8from core.db import Base9from core.db.mixins import AllMixin10
11
12class StoreType(str, Enum):13INTERNAL: str = 'internal'14WMS: str = 'wms'15
16
17class Store(Base, AllMixin):18__tablename__ = "store"19lsn_seq = Sequence(f'store_lsn_seq')20id: Mapped[uuid.UUID] = mapped_column(Uuid, primary_key=True, index=True, default=uuid.uuid4)21title: Mapped[str] = mapped_column(index=True)22external_number: Mapped[Optional[str]] = mapped_column(unique=True)23address: Mapped[str]24source: Mapped[str] = mapped_column(default=StoreType.INTERNAL)25
26
27