83 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			83 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
import datetime
 | 
						|
from typing import List
 | 
						|
 | 
						|
from schemas.base import CustomModelCamel
 | 
						|
from schemas.client import ClientSchema
 | 
						|
 | 
						|
 | 
						|
# region Entities
 | 
						|
class FastDeal(CustomModelCamel):
 | 
						|
    name: str
 | 
						|
    client: ClientSchema
 | 
						|
    comment: str
 | 
						|
    acceptance_date: datetime.datetime
 | 
						|
 | 
						|
 | 
						|
class DealSummary(CustomModelCamel):
 | 
						|
    id: int
 | 
						|
    name: str
 | 
						|
    client_name: str
 | 
						|
    changed_at: datetime.datetime
 | 
						|
    status: int
 | 
						|
    total_price: int
 | 
						|
 | 
						|
 | 
						|
class DealServiceSchema(CustomModelCamel):
 | 
						|
    id: int
 | 
						|
    quantity: int
 | 
						|
 | 
						|
 | 
						|
# endregion Entities
 | 
						|
 | 
						|
# region Requests
 | 
						|
class DealChangeStatusRequest(CustomModelCamel):
 | 
						|
    deal_id: int
 | 
						|
    new_status: int
 | 
						|
 | 
						|
 | 
						|
class DealCreateRequest(CustomModelCamel):
 | 
						|
    name: str
 | 
						|
 | 
						|
 | 
						|
class DealQuickCreateRequest(CustomModelCamel):
 | 
						|
    name: str
 | 
						|
    client_name: str
 | 
						|
    client_address: str
 | 
						|
    comment: str
 | 
						|
    acceptance_date: datetime.datetime
 | 
						|
 | 
						|
 | 
						|
class DealSummaryRequest(CustomModelCamel):
 | 
						|
    pass
 | 
						|
 | 
						|
 | 
						|
class DealAddServicesRequest(CustomModelCamel):
 | 
						|
    deal_id: int
 | 
						|
    services: list[DealServiceSchema]
 | 
						|
 | 
						|
 | 
						|
# endregion Requests
 | 
						|
 | 
						|
# region Responses
 | 
						|
 | 
						|
class DealChangeStatusResponse(CustomModelCamel):
 | 
						|
    ok: bool
 | 
						|
 | 
						|
 | 
						|
class DealCreateResponse(CustomModelCamel):
 | 
						|
    ok: bool
 | 
						|
 | 
						|
 | 
						|
class DealQuickCreateResponse(CustomModelCamel):
 | 
						|
    deal_id: int
 | 
						|
 | 
						|
 | 
						|
class DealSummaryResponse(CustomModelCamel):
 | 
						|
    summaries: List[DealSummary]
 | 
						|
 | 
						|
 | 
						|
class DealAddServicesResponse(CustomModelCamel):
 | 
						|
    ok: bool
 | 
						|
    message: str
 | 
						|
# endregion Responses
 |