1000 endpoints
This commit is contained in:
36
app/domain/mass_machine_00735.py
Normal file
36
app/domain/mass_machine_00735.py
Normal file
@ -0,0 +1,36 @@
|
||||
from typing import Annotated
|
||||
|
||||
from litestar.contrib.sqlalchemy.base import BigIntBase
|
||||
from litestar.contrib.sqlalchemy.dto import SQLAlchemyDTO
|
||||
from litestar.dto import DTOConfig
|
||||
from sqlalchemy.orm import Mapped
|
||||
|
||||
from app.lib import service
|
||||
from app.lib.company_owned_repository import CompanyOwnedRepository
|
||||
|
||||
|
||||
class Machine_00735(BigIntBase):
|
||||
__tablename__ = "machines" # type: ignore[assignment]
|
||||
__table_args__ = {'extend_existing': True}
|
||||
|
||||
caption: Mapped[str]
|
||||
enabled: Mapped[bool]
|
||||
alive: Mapped[bool]
|
||||
deleted: Mapped[bool]
|
||||
external_id: Mapped[str]
|
||||
owner_id: Mapped[int]
|
||||
|
||||
|
||||
class Repository(CompanyOwnedRepository[Machine_00735]):
|
||||
model_type = Machine_00735
|
||||
alive_flag = "alive"
|
||||
company_id_field = "owner_id"
|
||||
|
||||
|
||||
class Service(service.Service[Machine_00735]):
|
||||
repository_type = Repository
|
||||
|
||||
|
||||
write_config = DTOConfig(exclude={"id"})
|
||||
Machine_00735_WriteDTO = SQLAlchemyDTO[Annotated[Machine_00735, write_config]]
|
||||
Machine_00735_ReadDTO = SQLAlchemyDTO[Machine_00735]
|
||||
Reference in New Issue
Block a user