Initial commit: svg backend
This commit is contained in:
29
backend/app/models/pricing_category.py
Normal file
29
backend/app/models/pricing_category.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import BigInteger, DateTime, ForeignKey, String, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.db.base import Base
|
||||
|
||||
|
||||
class PricingCategoryRecord(Base):
|
||||
__tablename__ = "pricing_categories"
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
pricing_category_id: Mapped[str] = mapped_column(String(32), unique=True, index=True, nullable=False)
|
||||
|
||||
scheme_id: Mapped[str] = mapped_column(
|
||||
String(32),
|
||||
ForeignKey("schemes.scheme_id", ondelete="RESTRICT"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
|
||||
name: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
code: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
)
|
||||
Reference in New Issue
Block a user