feat: marketplaces endpoints
This commit is contained in:
32
modules/fulfillment_base/models/marketplace.py
Normal file
32
modules/fulfillment_base/models/marketplace.py
Normal file
@ -0,0 +1,32 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sqlalchemy import ForeignKey, JSON
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from models.base import BaseModel
|
||||
from models.mixins import IdMixin, SoftDeleteMixin
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from modules.clients.models import Client
|
||||
|
||||
|
||||
class BaseMarketplace(BaseModel, IdMixin):
|
||||
__tablename__ = "fulfillment_base_base_marketplaces"
|
||||
|
||||
name: Mapped[str] = mapped_column()
|
||||
icon_url: Mapped[str] = mapped_column()
|
||||
|
||||
|
||||
class Marketplace(BaseModel, IdMixin, SoftDeleteMixin):
|
||||
__tablename__ = "fulfillment_base_marketplaces"
|
||||
|
||||
base_marketplace_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("fulfillment_base_base_marketplaces.id")
|
||||
)
|
||||
base_marketplace: Mapped["BaseMarketplace"] = relationship(lazy="joined")
|
||||
|
||||
client_id: Mapped[int] = mapped_column(ForeignKey("clients.id"))
|
||||
client: Mapped["Client"] = relationship()
|
||||
|
||||
name: Mapped[str] = mapped_column()
|
||||
auth_data: Mapped[dict] = mapped_column(type_=JSON)
|
||||
Reference in New Issue
Block a user