DODA mejorado
This commit is contained in:
@@ -20,7 +20,7 @@ export interface DodaContainer {
|
||||
container_line: number;
|
||||
container_value?: string;
|
||||
seals?: string;
|
||||
seals_detail?: DodaContainerSeal[];
|
||||
seals_detail?: DodaContainerSeal[];
|
||||
}
|
||||
|
||||
export interface DodaContainerCreate {
|
||||
@@ -79,13 +79,13 @@ export interface Doda {
|
||||
dispatch_customs?: string;
|
||||
customs_sections?: string;
|
||||
patent?: string;
|
||||
pedimentos?: string;
|
||||
pedimentos?: string;
|
||||
caat?: string;
|
||||
transport_identification?: string;
|
||||
fast_id?: string;
|
||||
operation_type?: string;
|
||||
status?: string;
|
||||
|
||||
|
||||
// Relaciones
|
||||
containers?: DodaContainer[];
|
||||
american_pedimentos?: DodaAmericanPedimento[];
|
||||
@@ -95,7 +95,7 @@ export interface Doda {
|
||||
tenant_id?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
|
||||
|
||||
// Campos extra del formulario que vimos en el frontend
|
||||
selected?: boolean;
|
||||
user_selected?: string;
|
||||
@@ -152,7 +152,7 @@ export interface DodaCreate {
|
||||
unique_badge_number?: string;
|
||||
}
|
||||
|
||||
export interface DodaUpdate extends Partial<DodaCreate> {}
|
||||
export interface DodaUpdate extends Partial<DodaCreate> { }
|
||||
|
||||
export interface DodaListResponse {
|
||||
items: Doda[];
|
||||
@@ -187,7 +187,7 @@ export async function getDoda(id: number, companyId?: number): Promise<Doda> {
|
||||
if (companyId) {
|
||||
params.append('company_id', companyId.toString());
|
||||
}
|
||||
const response = await api.get(`/v1/a76/doda/${id}/?${params.toString()}`);
|
||||
const response = await api.get(`/v1/a76/doda/${id}/detail?${params.toString()}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
@@ -202,5 +202,5 @@ export async function updateDoda(id: number, data: DodaUpdate, companyId: number
|
||||
}
|
||||
|
||||
export async function deleteDoda(id: number, companyId: number): Promise<void> {
|
||||
await api.delete(`/v1/a76/doda/${id}/?company_id=${companyId}`);
|
||||
await api.delete(`/v1/a76/doda/${id}?company_id=${companyId}`);
|
||||
}
|
||||
@@ -5,25 +5,25 @@
|
||||
import { api } from '$lib/api';
|
||||
|
||||
export interface CustomsSection {
|
||||
customs_code: string;
|
||||
section_name: string;
|
||||
customs_code: string;
|
||||
section_name: string;
|
||||
}
|
||||
|
||||
export interface CustomsSectionListResponse {
|
||||
items: CustomsSection[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
items: CustomsSection[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export interface CreateCustomsSectionData {
|
||||
customs_code: string;
|
||||
section_name: string;
|
||||
customs_code: string;
|
||||
section_name: string;
|
||||
}
|
||||
|
||||
export interface UpdateCustomsSectionData {
|
||||
customs_code?: string;
|
||||
section_name?: string;
|
||||
customs_code?: string;
|
||||
section_name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,6 @@ export const customsSectionsApi = {
|
||||
*/
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<CustomsSectionListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes de los parámetros
|
||||
`/v1/public/reference_data/customs-sections/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
@@ -45,7 +44,7 @@ export const customsSectionsApi = {
|
||||
* Obtiene una sección aduanera por código
|
||||
* @param customs_code - Código de la sección aduanera
|
||||
*/
|
||||
get: (customs_code: string) =>
|
||||
get: (customs_code: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<CustomsSection>(`/v1/public/reference_data/customs-sections/${customs_code}/`),
|
||||
|
||||
@@ -70,7 +69,7 @@ export const customsSectionsApi = {
|
||||
* Elimina una sección aduanera
|
||||
* @param customs_code - Código de la sección aduanera a eliminar
|
||||
*/
|
||||
delete: (customs_code: string) =>
|
||||
delete: (customs_code: string) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.delete(`/v1/public/reference_data/customs-sections/${customs_code}/`)
|
||||
};
|
||||
Reference in New Issue
Block a user