Files
plantillas-proyectos/frontend/src/lib/api/dashboard/a76/pedimento-dates.ts

62 lines
1.7 KiB
TypeScript

/**
* API Client para Fechas de Pedimentos
*/
import { api } from '$lib/api';
export interface PedimentoDates {
id: number;
pedimento_id: number;
tenant_id: number;
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;
created_at: string;
}
export interface CreatePedimentoDatesData {
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;
}
export interface UpdatePedimentoDatesData {
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;
}
export const pedimentoDatesApi = {
get: (pedimentoId: number) =>
api.get<PedimentoDates>(`/v1/a76/pedimentos/${pedimentoId}/dates/`),
create: (pedimentoId: number, data: CreatePedimentoDatesData) =>
api.post<PedimentoDates>(`/v1/a76/pedimentos/${pedimentoId}/dates/`, data),
update: (pedimentoId: number, data: UpdatePedimentoDatesData) =>
api.put<PedimentoDates>(`/v1/a76/pedimentos/${pedimentoId}/dates/`, data),
delete: (pedimentoId: number) =>
api.delete(`/v1/a76/pedimentos/${pedimentoId}/dates/`)
};