Files
plantillas-proyectos/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_validation.py
acazares 07dfe1edb1 Add service layers and models for Pedimento CRUD operations
- Implemented service classes for PedimentoConfigParameters, PedimentoConfigSurcharges, PedimentoConfigUpdateRectification, PedimentoConfigUpdates, PedimentoCustomsOffices, PedimentoDates, PedimentoDecrementables, PedimentoIncrementables, PedimentoIndexes, PedimentoPayments, PedimentoRectificationDestination, PedimentoRectificationOrigin, PedimentoTransportMeans, and PedimentoValidation.
- Each service class includes methods for CRUD operations: create, read, update, and delete.
- Added a main router for the API v1, integrating various modules including authentication, tenants, licenses, and pedimentos.
- Created models for PedimentoValidation with appropriate constraints and relationships.
2025-11-06 17:16:29 -06:00

43 lines
1.9 KiB
Python

from pydantic import BaseModel, Field, ConfigDict
from typing import Optional
from datetime import datetime
class PedimentoValidationBase(BaseModel):
"""Base schema for Pedimento Validation"""
pedimento_id: int = Field(..., description="Pedimento ID")
tenant_id: int = Field(..., description="Tenant ID")
validator: Optional[str] = Field(None, max_length=3, description="Validator")
validation_ack: Optional[str] = Field(None, max_length=8, description="Validation acknowledgment")
pre_ack: Optional[str] = Field(None, max_length=8, description="Pre-acknowledgment")
line_signature: Optional[str] = Field(None, max_length=50, description="Line signature")
electronic_signature: Optional[str] = Field(None, max_length=999, description="Electronic signature")
certificate_number: Optional[str] = Field(None, max_length=99, description="Certificate number")
validator_id: Optional[int] = Field(None, description="Validator ID")
responsible_id: Optional[int] = Field(None, description="Responsible ID")
class PedimentoValidationCreate(PedimentoValidationBase):
"""Schema for creating a new Pedimento Validation"""
pass
class PedimentoValidationUpdate(BaseModel):
"""Schema for updating a Pedimento Validation"""
validator: Optional[str] = Field(None, max_length=3)
validation_ack: Optional[str] = Field(None, max_length=8)
pre_ack: Optional[str] = Field(None, max_length=8)
line_signature: Optional[str] = Field(None, max_length=50)
electronic_signature: Optional[str] = Field(None, max_length=999)
certificate_number: Optional[str] = Field(None, max_length=99)
validator_id: Optional[int] = None
responsible_id: Optional[int] = None
class PedimentoValidationResponse(PedimentoValidationBase):
"""Schema for Pedimento Validation response"""
id: int
created_at: datetime
model_config = ConfigDict(from_attributes=True)