Nuevo formulario de extension para partes SCAI con nuevas tablas de aphis con catalogos fijos nuevos

This commit is contained in:
2026-03-18 10:50:36 -05:00
parent adfa82c707
commit 546b1ea56f
39 changed files with 30627 additions and 98 deletions

View File

@@ -0,0 +1,26 @@
import { api } from '$lib/api';
export interface AgencyTariffCode {
id: number;
tariff_flag_code: string;
agency_code: string;
requirement_level: string;
program_code: string;
definition: string;
}
export const agencyTariffCodesApi = {
list: async (page = 1, pageSize = 50, q = '') => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString(),
q: q
});
return api.get<{ items: AgencyTariffCode[]; total: number }>(
`/v1/public/reference_data/agency-tariff-codes/?${params.toString()}`
);
},
get: async (id: number) => {
return api.get<AgencyTariffCode>(`/v1/public/reference_data/agency_tariff_codes/${id}`);
}
};

View File

@@ -0,0 +1,27 @@
import { api } from '$lib/api';
export interface CartaPorte {
id: number;
code: string;
description: string;
similar_words?: string;
is_hazardous?: number;
start_date?: string;
end_date?: string;
}
export const cartaPorteApi = {
list: async (page = 1, pageSize = 50, q = '') => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString(),
q: q
});
return api.get<{ items: CartaPorte[]; total: number }>(
`/v1/public/reference_data/carta-porte/?${params.toString()}`
);
},
get: async (id: number) => {
return api.get<CartaPorte>(`/v1/public/reference_data/carta-porte/${id}`);
}
};

View File

@@ -0,0 +1,25 @@
import { api } from '$lib/api';
export interface IdentifierCatalog {
id?: number;
key: string;
description: string;
level: string;
complement: string;
}
export const identifiersApi = {
list: async (page = 1, pageSize = 50, q = '') => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString(),
q: q
});
return api.get<{ items: IdentifierCatalog[]; total: number }>(
`/v1/public/reference_data/identifiers/?${params.toString()}`
);
},
get: async (id: number) => {
return api.get<IdentifierCatalog>(`/v1/public/reference_data/identifiers/${id}`);
}
};

View File

@@ -0,0 +1,23 @@
import { api } from '$lib/api';
export interface LicenseException {
id?: number;
key: string;
description: string;
}
export const licenseExceptionsApi = {
list: async (page = 1, pageSize = 50, q = '') => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString(),
q: q
});
return api.get<{ items: LicenseException[]; total: number }>(
`/v1/public/reference_data/license-exceptions/?${params.toString()}`
);
},
get: async (id: number) => {
return api.get<LicenseException>(`/v1/public/reference_data/license-exceptions/${id}`);
}
};