Se termino de incorprar la edicion y la creacion en DODA, ademas de acortar el nombre de unidades
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { api } from '$lib/api';
|
||||
import type { ApiResponse } from '$lib/api';
|
||||
|
||||
// --- Interfaces para detalles (Hijos) ---
|
||||
|
||||
export interface DodaContainerSeal {
|
||||
id: number;
|
||||
@@ -28,7 +29,6 @@ export interface DodaContainerCreate {
|
||||
seals_detail?: DodaContainerSealCreate[];
|
||||
}
|
||||
|
||||
|
||||
export interface DodaAmericanPedimento {
|
||||
id: number;
|
||||
doda_sys_id: number;
|
||||
@@ -66,14 +66,13 @@ export interface DodaPedimentoCreate {
|
||||
authorization_patent?: string;
|
||||
document?: string;
|
||||
shipment?: string;
|
||||
|
||||
effective_amount_usd?: number;
|
||||
}
|
||||
|
||||
// --- Interfaces Principales (Padre) ---
|
||||
|
||||
export interface Doda {
|
||||
id: number;
|
||||
|
||||
integration_number?: string;
|
||||
doda_date?: number;
|
||||
doda_time?: number;
|
||||
@@ -87,18 +86,38 @@ export interface Doda {
|
||||
operation_type?: string;
|
||||
status?: string;
|
||||
|
||||
|
||||
// Relaciones
|
||||
containers?: DodaContainer[];
|
||||
american_pedimentos?: DodaAmericanPedimento[];
|
||||
pedimentos_detail?: DodaPedimento[];
|
||||
|
||||
|
||||
// Metadata
|
||||
tenant_id?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
|
||||
// Campos extra del formulario que vimos en el frontend
|
||||
selected?: boolean;
|
||||
user_selected?: string;
|
||||
last_user?: string;
|
||||
responsible?: string;
|
||||
carrier?: string;
|
||||
shipments?: string;
|
||||
pedimento_type?: string;
|
||||
original_chain?: string;
|
||||
serial_number?: string;
|
||||
electronic_signature?: string;
|
||||
transaction_number?: string;
|
||||
linq_sat_qr?: string;
|
||||
sat_certificate?: string;
|
||||
sat_digital_seal?: string;
|
||||
xml_doda_sent_path?: string;
|
||||
xml_doda_response_path?: string;
|
||||
sat_original_chain?: string;
|
||||
customs_clearance?: number;
|
||||
unique_badge_number?: string;
|
||||
}
|
||||
|
||||
|
||||
export interface DodaCreate {
|
||||
integration_number?: string;
|
||||
doda_date?: number;
|
||||
@@ -143,6 +162,7 @@ export interface DodaListResponse {
|
||||
pages: number;
|
||||
}
|
||||
|
||||
// --- Funciones de API ---
|
||||
|
||||
export async function getDodas(
|
||||
page: number = 1,
|
||||
@@ -177,7 +197,7 @@ export async function createDoda(data: DodaCreate, companyId: number): Promise<D
|
||||
}
|
||||
|
||||
export async function updateDoda(id: number, data: DodaUpdate, companyId: number): Promise<Doda> {
|
||||
const response = await api.patch(`/v1/a76/doda/${id}?company_id=${companyId}`, data);
|
||||
const response = await api.put(`/v1/a76/doda/${id}?company_id=${companyId}`, data);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user