2024-06-06 22:13:58 +03:30
from uuid import UUID
from fastapi import Body
from app.models.financial_status import StatusFinancialModel
from app.repositories.financial_status import FinancialStatusRepository
from core.app import app
from core.utils.router import generate_router , shrink
from core.utils.table_engine import TableEngineExport , TableEngineRequestType
ThisModel = StatusFinancialModel
router_base_url = 'financial_status'
_tag_base = [ router_base_url ]
router = generate_router ( router_base_url , auth_dependencies = False , version = 'v2' )
repo = FinancialStatusRepository ()
2024-06-07 20:09:18 +03:30
@router.post ( '/create' , response_model = ThisModel , tags = _tag_base , description = 'اگه پروژه تفویضی بود اون اطلاعاتی که باید از قسمت رسیدگی پر بشه را وارد نکن فقط status_id را وارد کن' )
2024-06-06 22:13:58 +03:30
@shrink ( repo . create )
def create ( coding : ThisModel = Body ( ... )):
pass
@router.put ( '/ {_id} ' , response_model = ThisModel , tags = _tag_base , description = 'صورت وضعیت' )
@shrink ( repo . update )
def update ( _id : UUID , coding : ThisModel = Body ( ... )):
pass
@router.get ( '/ {_id} ' , response_model = ThisModel , tags = _tag_base , description = 'صورت وضعیت' )
@shrink ( repo . get )
def get ( _id : UUID ):
pass
@router.delete ( '/ {_id} ' , response_model = ThisModel , tags = _tag_base , description = 'صورت وضعیت' )
@shrink ( repo . delete )
def delete ( _id : UUID ):
pass
@router.post ( '' , response_model = TableEngineExport [ ThisModel ], tags = _tag_base , description = 'صورت وضعیت' )
@shrink ( repo . fetch )
def fetch ( body : TableEngineRequestType = Body ( ... )):
pass
app . include_router ( router )