diff --git a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_dates.py b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_dates.py index bd69786e..c83cebbc 100644 --- a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_dates.py +++ b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_dates.py @@ -23,10 +23,21 @@ class PedimentoDatesBase(BaseModel): capture_time: Optional[time] = Field(None, description="Capture time") -class PedimentoDatesCreate(PedimentoDatesBase): - """Schema for creating a new Pedimento Dates""" +class PedimentoDatesCreate(BaseModel): + """Schema for creating a new Pedimento Dates - pedimento_id and tenant_id are set by backend""" - pass + entry_date: Optional[datetime] = Field(None, description="Entry date") + pedimento_date: Optional[datetime] = Field(None, description="Pedimento date") + payment_date: Optional[datetime] = Field(None, description="Payment date") + rectification_payment_date: Optional[datetime] = Field(None, description="Rectification payment date") + extraction_date: Optional[datetime] = Field(None, description="Extraction date") + submission_date: Optional[datetime] = Field(None, description="Submission date") + eucan_date: Optional[datetime] = Field(None, description="EUCAN date") + original_date: Optional[datetime] = Field(None, description="Original date") + start_date: Optional[datetime] = Field(None, description="Start date") + end_date: Optional[datetime] = Field(None, description="End date") + capture_date: Optional[datetime] = Field(None, description="Capture date") + capture_time: Optional[time] = Field(None, description="Capture time") class PedimentoDatesUpdate(BaseModel): diff --git a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_payments.py b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_payments.py index eeaf384c..bdd98381 100644 --- a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_payments.py +++ b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_payments.py @@ -25,14 +25,23 @@ class PedimentoPaymentsBase(BaseModel): total_cash_paid: Optional[int] = Field(None, description="Total cash paid") total_contributions: Optional[int] = Field(None, description="Total contributions") counter_payment: Optional[int] = Field(None, description="Counter payment") - pece_code: Optional[str] = Field(None, max_length=5, description="PECE code") - payment_id: Optional[int] = Field(None, description="Payment ID") + pece_code: Optional[str] = Field(None, max_length=5, description="PECE code") -class PedimentoPaymentsCreate(PedimentoPaymentsBase): - """Schema for creating a new Pedimento Payments""" +class PedimentoPaymentsCreate(BaseModel): + """Schema for creating a new Pedimento Payments - pedimento_id and tenant_id are set by backend""" - pass + acknowledgment: Optional[str] = Field(None, max_length=20, description="Acknowledgment") + operation_number: Optional[str] = Field(None, max_length=14, description="Operation number") + bank_code: Optional[int] = Field(None, description="Bank code") + cashier: Optional[str] = Field(None, max_length=2, description="Cashier") + date: Optional[Date] = Field(None, description="Date") + time: Optional[Time] = Field(None, description="Time") + shift: Optional[str] = Field(None, max_length=1, description="Shift") + total_cash_paid: Optional[int] = Field(None, description="Total cash paid") + total_contributions: Optional[int] = Field(None, description="Total contributions") + counter_payment: Optional[int] = Field(None, description="Counter payment") + pece_code: Optional[str] = Field(None, max_length=5, description="PECE code") class PedimentoPaymentsUpdate(BaseModel): @@ -48,8 +57,7 @@ class PedimentoPaymentsUpdate(BaseModel): total_cash_paid: Optional[int] = None total_contributions: Optional[int] = None counter_payment: Optional[int] = None - pece_code: Optional[str] = Field(None, max_length=5) - payment_id: Optional[int] = None + pece_code: Optional[str] = Field(None, max_length=5) class PedimentoPaymentsResponse(PedimentoPaymentsBase): diff --git a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_transport_means.py b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_transport_means.py index 560446f2..f5639249 100644 --- a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_transport_means.py +++ b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_transport_means.py @@ -15,10 +15,13 @@ class PedimentoTransportMeansBase(BaseModel): departure: Optional[str] = Field(None, max_length=2, description="Departure") -class PedimentoTransportMeansCreate(PedimentoTransportMeansBase): - """Schema for creating a new Pedimento Transport Means""" +class PedimentoTransportMeansCreate(BaseModel): + """Schema for creating a new Pedimento Transport Means - pedimento_id and tenant_id are set by backend""" - pass + destination: Optional[int] = Field(None, description="Destination") + entry_exit: Optional[str] = Field(None, max_length=2, description="Entry/exit") + arrival: Optional[str] = Field(None, max_length=2, description="Arrival") + departure: Optional[str] = Field(None, max_length=2, description="Departure") class PedimentoTransportMeansUpdate(BaseModel): diff --git a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_validation.py b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_validation.py index 568f784d..649ce3cb 100644 --- a/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_validation.py +++ b/backend/api/v1/modules/a76/pedmientos/dtos/pedimento_validation.py @@ -27,10 +27,17 @@ class PedimentoValidationBase(BaseModel): responsible_id: Optional[int] = Field(None, description="Responsible ID") -class PedimentoValidationCreate(PedimentoValidationBase): - """Schema for creating a new Pedimento Validation""" +class PedimentoValidationCreate(BaseModel): + """Schema for creating a new Pedimento Validation - pedimento_id and tenant_id are set by backend""" - pass + 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="Previous 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 PedimentoValidationUpdate(BaseModel): diff --git a/backend/api/v1/modules/a76/pedmientos/dtos/pedimentos.py b/backend/api/v1/modules/a76/pedmientos/dtos/pedimentos.py index 7a89c050..c34dc9ff 100644 --- a/backend/api/v1/modules/a76/pedmientos/dtos/pedimentos.py +++ b/backend/api/v1/modules/a76/pedmientos/dtos/pedimentos.py @@ -5,22 +5,22 @@ from typing import Optional from pydantic import BaseModel, ConfigDict, Field -from .pedimento_config_additional import PedimentoConfigAdditionalCreate -from .pedimento_config_calculations import PedimentoConfigCalculationsCreate -from .pedimento_config_parameters import PedimentoConfigParametersCreate -from .pedimento_config_surcharges import PedimentoConfigSurchargesCreate -from .pedimento_config_update_rectification import PedimentoConfigUpdateRectificationCreate -from .pedimento_config_updates import PedimentoConfigUpdatesCreate -from .pedimento_customs_offices import PedimentoCustomsOfficesCreate -from .pedimento_dates import PedimentoDatesCreate -from .pedimento_decrementables import PedimentoDecrementablesCreate -from .pedimento_incrementables import PedimentoIncrementablesCreate -from .pedimento_indexes import PedimentoIndexesCreate -from .pedimento_payments import PedimentoPaymentsCreate -from .pedimento_rectification_destination import PedimentoRectificationDestinationCreate -from .pedimento_rectification_origin import PedimentoRectificationOriginCreate -from .pedimento_transport_means import PedimentoTransportMeansCreate -from .pedimento_validation import PedimentoValidationCreate +from .pedimento_config_additional import PedimentoConfigAdditionalCreate, PedimentoConfigAdditionalResponse +from .pedimento_config_calculations import PedimentoConfigCalculationsCreate, PedimentoConfigCalculationsResponse +from .pedimento_config_parameters import PedimentoConfigParametersCreate, PedimentoConfigParametersResponse +from .pedimento_config_surcharges import PedimentoConfigSurchargesCreate, PedimentoConfigSurchargesResponse +from .pedimento_config_update_rectification import PedimentoConfigUpdateRectificationCreate, PedimentoConfigUpdateRectificationResponse +from .pedimento_config_updates import PedimentoConfigUpdatesCreate, PedimentoConfigUpdatesResponse +from .pedimento_customs_offices import PedimentoCustomsOfficesCreate, PedimentoCustomsOfficesResponse +from .pedimento_dates import PedimentoDatesCreate, PedimentoDatesResponse +from .pedimento_decrementables import PedimentoDecrementablesCreate, PedimentoDecrementablesResponse +from .pedimento_incrementables import PedimentoIncrementablesCreate, PedimentoIncrementablesResponse +from .pedimento_indexes import PedimentoIndexesCreate, PedimentoIndexesResponse +from .pedimento_payments import PedimentoPaymentsCreate, PedimentoPaymentsResponse +from .pedimento_rectification_destination import PedimentoRectificationDestinationCreate, PedimentoRectificationDestinationResponse +from .pedimento_rectification_origin import PedimentoRectificationOriginCreate, PedimentoRectificationOriginResponse +from .pedimento_transport_means import PedimentoTransportMeansCreate, PedimentoTransportMeansResponse +from .pedimento_validation import PedimentoValidationCreate, PedimentoValidationResponse class OperationType(IntEnum): @@ -50,8 +50,22 @@ class PedimentosBase(BaseModel): usd_value: Optional[Decimal] = Field(None, description="USD value") paid_price: Optional[Decimal] = Field(None, description="Paid price") gross_weight: Optional[Decimal] = Field(None, description="Gross weight") - exchange_rate: Optional[Decimal] = Field(None, description="Exchange rate") + exchange_rate: Optional[Decimal] = Field(None, description="Exchange rate") +class PedimentosCreate(PedimentosBase): + """Schema for creating a new Pedimento""" + + # Override to make required fields non-optional + year: str = Field(..., max_length=2, description="Year") + customs_office: str = Field(..., max_length=2, description="Customs office") + license: str = Field(..., max_length=4, description="License") + pedimento_number: str = Field(..., max_length=7, description="Pedimento number") + client_id: int = Field(..., description="Client ID") + operation_type: int = Field(..., description="Operation type") + pedimento_type: int = Field(..., description="Pedimento type") + regime: str = Field(..., max_length=3, description="Regime") + status: str = Field(..., max_length=30, description="Status") + pedimento_dates: Optional[PedimentoDatesCreate] = None pedimento_decrementables: Optional[PedimentoDecrementablesCreate] = None pedimento_incrementables: Optional[PedimentoIncrementablesCreate] = None @@ -69,37 +83,41 @@ class PedimentosBase(BaseModel): pedimento_config_update_rectification: Optional[PedimentoConfigUpdateRectificationCreate] = None pedimento_config_updates: Optional[PedimentoConfigUpdatesCreate] = None -class PedimentosCreate(PedimentosBase): - """Schema for creating a new Pedimento""" - - # Override to make required fields non-optional - year: str = Field(..., max_length=2, description="Year") - customs_office: str = Field(..., max_length=2, description="Customs office") - license: str = Field(..., max_length=4, description="License") - pedimento_number: str = Field(..., max_length=7, description="Pedimento number") - client_id: int = Field(..., description="Client ID") - operation_type: int = Field(..., description="Operation type") - pedimento_type: int = Field(..., description="Pedimento type") - regime: str = Field(..., max_length=3, description="Regime") - status: str = Field(..., max_length=30, description="Status") - class PedimentosUpdate(BaseModel): """Schema for updating a Pedimento""" - year: Optional[str] = Field(..., max_length=2) - customs_office: Optional[str] = Field(..., max_length=2) - license: Optional[str] = Field(..., max_length=4) - pedimento_number: Optional[str] = Field(..., max_length=7) - client_id: Optional[int] - operation_type: Optional[OperationType] - pedimento_type: Optional[int] - pedimento_code: Optional[str] = Field(..., max_length=2) - regime: Optional[str] = Field(..., max_length=3) - status: Optional[str] = Field(..., max_length=30) + year: Optional[str] = Field(None, max_length=2) + customs_office: Optional[str] = Field(None, max_length=2) + license: Optional[str] = Field(None, max_length=4) + pedimento_number: Optional[str] = Field(None, max_length=7) + client_id: Optional[int] = None + operation_type: Optional[int] = None + pedimento_type: Optional[int] = None + pedimento_code: Optional[str] = Field(None, max_length=2) + regime: Optional[str] = Field(None, max_length=3) + status: Optional[str] = Field(None, max_length=30) usd_value: Optional[Decimal] = None paid_price: Optional[Decimal] = None gross_weight: Optional[Decimal] = None exchange_rate: Optional[Decimal] = None + + # Sub-resources + pedimento_dates: Optional[PedimentoDatesCreate] = None + pedimento_decrementables: Optional[PedimentoDecrementablesCreate] = None + pedimento_incrementables: Optional[PedimentoIncrementablesCreate] = None + pedimento_indexes: Optional[PedimentoIndexesCreate] = None + pedimento_validation: Optional[PedimentoValidationCreate] = None + pedimento_customs_offices: Optional[PedimentoCustomsOfficesCreate] = None + pedimento_payments: Optional[PedimentoPaymentsCreate] = None + pedimento_rectification_destination: Optional[PedimentoRectificationDestinationCreate] = None + pedimento_rectification_origin: Optional[PedimentoRectificationOriginCreate] = None + pedimento_transport_means: Optional[PedimentoTransportMeansCreate] = None + pedimento_config_additional: Optional[PedimentoConfigAdditionalCreate] = None + pedimento_config_calculations: Optional[PedimentoConfigCalculationsCreate] = None + pedimento_config_parameters: Optional[PedimentoConfigParametersCreate] = None + pedimento_config_surcharges: Optional[PedimentoConfigSurchargesCreate] = None + pedimento_config_update_rectification: Optional[PedimentoConfigUpdateRectificationCreate] = None + pedimento_config_updates: Optional[PedimentoConfigUpdatesCreate] = None class PedimentosResponse(PedimentosBase): @@ -108,5 +126,22 @@ class PedimentosResponse(PedimentosBase): id: int tenant_id: int created_at: datetime + + pedimento_dates: Optional[PedimentoDatesResponse] = None + pedimento_decrementables: Optional[PedimentoDecrementablesResponse] = None + pedimento_incrementables: Optional[PedimentoIncrementablesResponse] = None + pedimento_indexes: Optional[PedimentoIndexesResponse] = None + pedimento_validation: Optional[PedimentoValidationResponse] = None + pedimento_customs_offices: Optional[PedimentoCustomsOfficesResponse] = None + pedimento_payments: Optional[PedimentoPaymentsResponse] = None + pedimento_rectification_destination: Optional[PedimentoRectificationDestinationResponse] = None + pedimento_rectification_origin: Optional[PedimentoRectificationOriginResponse] = None + pedimento_transport_means: Optional[PedimentoTransportMeansResponse] = None + pedimento_config_additional: Optional[PedimentoConfigAdditionalResponse] = None + pedimento_config_calculations: Optional[PedimentoConfigCalculationsResponse] = None + pedimento_config_parameters: Optional[PedimentoConfigParametersResponse] = None + pedimento_config_surcharges: Optional[PedimentoConfigSurchargesResponse] = None + pedimento_config_update_rectification: Optional[PedimentoConfigUpdateRectificationResponse] = None + pedimento_config_updates: Optional[PedimentoConfigUpdatesResponse] = None model_config = ConfigDict(from_attributes=True) diff --git a/backend/api/v1/modules/a76/pedmientos/models/pedimento_payments.py b/backend/api/v1/modules/a76/pedmientos/models/pedimento_payments.py index f67f06c5..2f636f99 100644 --- a/backend/api/v1/modules/a76/pedmientos/models/pedimento_payments.py +++ b/backend/api/v1/modules/a76/pedmientos/models/pedimento_payments.py @@ -49,7 +49,6 @@ class PedimentoPayments(Base, TenantScopedMixin, TimestampMixin): id: Mapped[int] = mapped_column(Integer) pedimento_id: Mapped[int] = mapped_column(Integer, nullable=False) - payment_id: Mapped[int] = mapped_column(Integer) acknowledgment: Mapped[str] = mapped_column(String(20)) operation_number: Mapped[str] = mapped_column(String(14)) diff --git a/backend/api/v1/modules/a76/pedmientos/routes/pedimento_payments.py b/backend/api/v1/modules/a76/pedmientos/routes/pedimento_payments.py index 02dbfd0d..7078e26f 100644 --- a/backend/api/v1/modules/a76/pedmientos/routes/pedimento_payments.py +++ b/backend/api/v1/modules/a76/pedmientos/routes/pedimento_payments.py @@ -35,10 +35,10 @@ async def list_payments( return payments -@router.get("/{payment_id}", response_model=PedimentoPaymentsResponse) +@router.get("/{id}", response_model=PedimentoPaymentsResponse) async def get_payment( pedimento_id: int, - payment_id: int, + id: int, company_id: int = Query(..., description="Company ID"), db: Session = Depends(get_core_db), current_user: Dict[str, Any] = Depends(get_current_user), @@ -47,7 +47,7 @@ async def get_payment( tenant_id = validate_access_to_resource(db, company_id, current_user) payment = PedimentoPaymentsService.get_by_id( - db, payment_id, pedimento_id, tenant_id, company_id + db, id, pedimento_id, tenant_id, company_id ) if not payment: raise HTTPException(status_code=404, detail="Payment not found") @@ -74,10 +74,10 @@ async def create_payment( return payment -@router.put("/{payment_id}", response_model=PedimentoPaymentsResponse) +@router.put("/{id}", response_model=PedimentoPaymentsResponse) async def update_payment( pedimento_id: int, - payment_id: int, + id: int, data: PedimentoPaymentsUpdate, company_id: int = Query(..., description="Company ID"), db: Session = Depends(get_core_db), @@ -87,7 +87,7 @@ async def update_payment( tenant_id = validate_access_to_resource(db, company_id, current_user) payment = PedimentoPaymentsService.update( - db, payment_id, pedimento_id, tenant_id, company_id, data + db, id, pedimento_id, tenant_id, company_id, data ) if not payment: raise HTTPException(status_code=404, detail="Payment not found") @@ -95,10 +95,10 @@ async def update_payment( return payment -@router.delete("/{payment_id}", status_code=204) +@router.delete("/{id}", status_code=204) async def delete_payment( pedimento_id: int, - payment_id: int, + id: int, company_id: int = Query(..., description="Company ID"), db: Session = Depends(get_core_db), current_user: Dict[str, Any] = Depends(get_current_user), @@ -107,7 +107,7 @@ async def delete_payment( tenant_id = validate_access_to_resource(db, company_id, current_user) success = PedimentoPaymentsService.delete( - db, payment_id, pedimento_id, tenant_id, company_id + db, id, pedimento_id, tenant_id, company_id ) if not success: raise HTTPException(status_code=404, detail="Payment not found") diff --git a/backend/api/v1/modules/a76/pedmientos/services/pedimentos.py b/backend/api/v1/modules/a76/pedmientos/services/pedimentos.py index ddfca359..b2ef0719 100644 --- a/backend/api/v1/modules/a76/pedmientos/services/pedimentos.py +++ b/backend/api/v1/modules/a76/pedmientos/services/pedimentos.py @@ -6,7 +6,8 @@ import logging from typing import Any, Dict, List, Optional from sqlalchemy import desc -from sqlalchemy.orm import Session +from sqlalchemy.orm import Session, joinedload +from sqlalchemy.orm import selectinload from ..dtos.pedimentos import PedimentosCreate, PedimentosUpdate @@ -85,8 +86,31 @@ class PedimentosService: query = query.filter(Pedimentos.year == filters["year"]) total = query.count() + + # Eager load all relationships for the response schema items = ( - query.order_by(desc(Pedimentos.created_at)).offset(skip).limit(limit).all() + query.options( + selectinload(Pedimentos.pedimento_dates), + selectinload(Pedimentos.pedimento_decrementables), + selectinload(Pedimentos.pedimento_incrementables), + selectinload(Pedimentos.pedimento_indexes), + selectinload(Pedimentos.pedimento_validation), + selectinload(Pedimentos.pedimento_customs_offices), + selectinload(Pedimentos.pedimento_payments), + selectinload(Pedimentos.pedimento_rectification_destination), + selectinload(Pedimentos.pedimento_rectification_origin), + selectinload(Pedimentos.pedimento_transport_means), + selectinload(Pedimentos.pedimento_config_additional), + selectinload(Pedimentos.pedimento_config_calculations), + selectinload(Pedimentos.pedimento_config_parameters), + selectinload(Pedimentos.pedimento_config_surcharges), + selectinload(Pedimentos.pedimento_config_update_rectification), + selectinload(Pedimentos.pedimento_config_updates), + ) + .order_by(desc(Pedimentos.created_at)) + .offset(skip) + .limit(limit) + .all() ) return items, total @@ -113,6 +137,26 @@ class PedimentosService: if company_id is not None: query = query.filter(Pedimentos.company_id == company_id) + + # Eager load all relationships for the response schema + query = query.options( + selectinload(Pedimentos.pedimento_dates), + selectinload(Pedimentos.pedimento_decrementables), + selectinload(Pedimentos.pedimento_incrementables), + selectinload(Pedimentos.pedimento_indexes), + selectinload(Pedimentos.pedimento_validation), + selectinload(Pedimentos.pedimento_customs_offices), + selectinload(Pedimentos.pedimento_payments), + selectinload(Pedimentos.pedimento_rectification_destination), + selectinload(Pedimentos.pedimento_rectification_origin), + selectinload(Pedimentos.pedimento_transport_means), + selectinload(Pedimentos.pedimento_config_additional), + selectinload(Pedimentos.pedimento_config_calculations), + selectinload(Pedimentos.pedimento_config_parameters), + selectinload(Pedimentos.pedimento_config_surcharges), + selectinload(Pedimentos.pedimento_config_update_rectification), + selectinload(Pedimentos.pedimento_config_updates), + ) return query.first() @@ -247,23 +291,25 @@ class PedimentosService: # Helper function para actualizar o crear objetos relacionados def update_or_create_related(service_class, model_class, data_attr): - if not hasattr(pedimento_data, data_attr): + # Obtener datos del payload completo (no solo exclude_unset) + full_data = pedimento_data.model_dump() + + if data_attr not in full_data: return - data = getattr(pedimento_data, data_attr) + data = full_data[data_attr] if not data: return existing = service_class.get_by_pedimento_id(db, pedimento_id, tenant_id) if existing: # Actualizar existente - update_dict = data.model_dump(exclude_unset=True) - for field, value in update_dict.items(): - setattr(existing, field, value) + for field, value in data.items(): + if hasattr(existing, field): + setattr(existing, field, value) else: # Crear nuevo - obj_dict = data.model_dump() - obj = model_class(**obj_dict) + obj = model_class(**data) obj.pedimento_id = pedimento_id obj.tenant_id = tenant_id obj.company_id = company_id diff --git a/frontend/src/lib/api/dashboard/a76/pedimento-payments.ts b/frontend/src/lib/api/dashboard/a76/pedimento-payments.ts index cbe39e93..ac5bfa08 100644 --- a/frontend/src/lib/api/dashboard/a76/pedimento-payments.ts +++ b/frontend/src/lib/api/dashboard/a76/pedimento-payments.ts @@ -17,8 +17,7 @@ export interface PedimentoPayments { total_cash_paid?: number | null; total_contributions?: number | null; counter_payment?: number | null; - pece_code?: string | null; - payment_id?: number | null; + pece_code?: string | null; created_at: string; } @@ -33,8 +32,7 @@ export interface CreatePedimentoPaymentsData { total_cash_paid?: number | null; total_contributions?: number | null; counter_payment?: number | null; - pece_code?: string | null; - payment_id?: number | null; + pece_code?: string | null; } export interface UpdatePedimentoPaymentsData { @@ -48,8 +46,7 @@ export interface UpdatePedimentoPaymentsData { total_cash_paid?: number | null; total_contributions?: number | null; counter_payment?: number | null; - pece_code?: string | null; - payment_id?: number | null; + pece_code?: string | null; } export const pedimentoPaymentsApi = { diff --git a/frontend/src/lib/api/dashboard/a76/pedimentos.ts b/frontend/src/lib/api/dashboard/a76/pedimentos.ts index 4532022a..339ada55 100644 --- a/frontend/src/lib/api/dashboard/a76/pedimentos.ts +++ b/frontend/src/lib/api/dashboard/a76/pedimentos.ts @@ -9,22 +9,47 @@ export interface PedimentoDates { entry_date?: string | null; pedimento_date?: string | null; payment_date?: string | null; + rectification_payment_date?: string | null; + extraction_date?: string | null; + submission_date?: string | null; + eucan_date?: string | null; + original_date?: string | null; + start_date?: string | null; + end_date?: string | null; + capture_date?: string | null; + capture_time?: string | null; } export interface PedimentoPayments { - payment_form?: string | null; - bank_identifier?: string | null; + acknowledgment?: string | null; + operation_number?: string | null; + bank_code?: string | null; + cashier?: string | null; + date?: string | null; + time?: string | null; + shift?: string | null; + total_cash_paid?: string | null; + total_contributions?: string | null; + counter_payment?: string | null; + pece_code?: string | null; } export interface PedimentoTransportMeans { - arrival_key?: string | null; - arrival_data?: string | null; - departure_key?: string | null; - departure_data?: string | null; + destination?: number | null; + entry_exit?: string | null; + arrival?: string | null; + departure?: string | null; } export interface PedimentoValidation { - document?: string | null; + validator?: string | null; + validation_ack?: string | null; + pre_ack?: string | null; + line_signature?: string | null; + electronic_signature?: string | null; + certificate_number?: string | null; + validator_id?: number | null; + responsible_id?: number | null; } export interface Pedimento { @@ -49,7 +74,7 @@ export interface Pedimento { pedimento_dates?: PedimentoDates | null; pedimento_payments?: PedimentoPayments | null; pedimento_transport_means?: PedimentoTransportMeans | null; - pedimento_validation?: PedimentoValidation | null; + pedimento_validation?: PedimentoValidation | null; } export interface PedimentoListResponse { diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte index e8847fc9..897a610c 100644 --- a/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/dates-tab-form.svelte @@ -1,90 +1,42 @@ @@ -113,15 +63,8 @@ - {#if loading} -
- - - -
- {:else} -
-
+
+
@@ -243,6 +186,5 @@
- {/if} - - + + \ No newline at end of file diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/payments-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/payments-tab-form.svelte index 430726a4..fb004236 100644 --- a/frontend/src/lib/components/dashboard/pedimentos/edit/payments-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/payments-tab-form.svelte @@ -1,106 +1,54 @@ @@ -113,145 +61,128 @@ - {#if loading} -
- - -
- {:else} -
-
- -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
+
+
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
- {/if} +
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/transport-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/transport-tab-form.svelte index 3c42a633..17ffeeb1 100644 --- a/frontend/src/lib/components/dashboard/pedimentos/edit/transport-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/transport-tab-form.svelte @@ -1,74 +1,40 @@ @@ -81,61 +47,52 @@ - {#if loading} -
- - - - -
- {:else} -
-
- -
- - -
+
+
+ +
+ + +
- -
- - -
+ +
+ + +
- -
- - -
+ +
+ + +
- -
- - -
+ +
+ +
- {/if} +
diff --git a/frontend/src/lib/components/dashboard/pedimentos/edit/validation-tab-form.svelte b/frontend/src/lib/components/dashboard/pedimentos/edit/validation-tab-form.svelte index baabf978..3c5d8c35 100644 --- a/frontend/src/lib/components/dashboard/pedimentos/edit/validation-tab-form.svelte +++ b/frontend/src/lib/components/dashboard/pedimentos/edit/validation-tab-form.svelte @@ -1,79 +1,39 @@ @@ -98,110 +56,96 @@ - {#if loading} -
- - - - -
- {:else} -
-
- -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
+
+
+ +
+ +
- +
- + + +
+ + +
+ + +
+ + +
+
-
+
-