39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
"""
|
|
Consolidated schemas for Pedimento catalog responses
|
|
"""
|
|
|
|
from typing import List, Optional
|
|
from pydantic import BaseModel
|
|
|
|
# Import DTOs for catalog items
|
|
from api.v1.modules.public.reference_data.pedimento_codes.dto import PedimentoCodeDTO
|
|
from api.v1.modules.public.reference_data.customs_sections.dto import CustomsSectionDTO
|
|
from api.v1.modules.public.reference_data.code_pedimento_regimens.dto import CodePedimentoRegimenDTO
|
|
from api.v1.modules.a76.customs_brokers.dto import CustomsBrokerResponseDTO
|
|
from api.v1.modules.a76.clients_and_providers.dto import ClientProviderResponseDTO
|
|
from .dtos.pedimentos import PedimentosResponse
|
|
|
|
|
|
class PedimentoCatalogsResponse(BaseModel):
|
|
"""Base response containing all catalogs needed for pedimento views"""
|
|
|
|
pedimento_codes: List[PedimentoCodeDTO] = []
|
|
customs_sections: List[CustomsSectionDTO] = []
|
|
code_pedimento_regimens: List[CodePedimentoRegimenDTO] = []
|
|
customs_brokers: List[CustomsBrokerResponseDTO] = []
|
|
clients: List[ClientProviderResponseDTO] = []
|
|
|
|
|
|
class PedimentoCreationResponse(PedimentoCatalogsResponse):
|
|
"""Response for creating a new pedimento (catalogs only)"""
|
|
|
|
is_create: bool = True
|
|
|
|
|
|
class PedimentoEditionResponse(PedimentoCatalogsResponse):
|
|
"""Response for editing an existing pedimento (catalogs + pedimento data)"""
|
|
|
|
is_create: bool = False
|
|
pedimento: Optional[PedimentosResponse] = None
|
|
pedimento_id: Optional[int] = None
|