Se integro el modulo de manifestacion base
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import { api } from '$lib/api';
|
||||
import type { ApiResponse } from '$lib/api';
|
||||
|
||||
export interface CustomsBroker {
|
||||
id: number;
|
||||
type?: string | null;
|
||||
broker_key: string;
|
||||
name?: string | null;
|
||||
address?: string | null;
|
||||
postal_code?: string | null;
|
||||
city?: string | null;
|
||||
state?: string | null;
|
||||
phone?: string | null;
|
||||
fax?: string | null;
|
||||
email?: string | null;
|
||||
country?: string | null;
|
||||
tax_id?: string | null;
|
||||
personal_id?: string | null;
|
||||
position?: string | null;
|
||||
license: string;
|
||||
company?: string | null;
|
||||
contact?: string | null;
|
||||
tenant_id: string;
|
||||
company_id: string;
|
||||
export interface CustomsBroker {
|
||||
id: number;
|
||||
type?: string | null;
|
||||
broker_key: string;
|
||||
name?: string | null;
|
||||
address?: string | null;
|
||||
postal_code?: string | null;
|
||||
city?: string | null;
|
||||
state?: string | null;
|
||||
phone?: string | null;
|
||||
fax?: string | null;
|
||||
email?: string | null;
|
||||
country?: string | null;
|
||||
tax_id?: string | null;
|
||||
personal_id?: string | null;
|
||||
position?: string | null;
|
||||
license: string;
|
||||
company?: string | null;
|
||||
contact?: string | null;
|
||||
tenant_id: string;
|
||||
company_id: string;
|
||||
}
|
||||
|
||||
export interface CustomsBrokerVU {
|
||||
@@ -82,12 +82,19 @@ export interface CreateCustomsBrokerData {
|
||||
company_id: string;
|
||||
}
|
||||
|
||||
export interface CustomsBrokerListResponse {
|
||||
items: CustomsBroker[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* API para Agentes Aduanales
|
||||
*/
|
||||
export const customsBrokersApi = {
|
||||
list: (companyId: string) => {
|
||||
return api.get<CustomsBroker[]>(`/v1/a76/customs-brokers?company_id=${companyId}`);
|
||||
list: (companyId: string, page = 1, pageSize = 50) => {
|
||||
return api.get<CustomsBrokerListResponse>(`/v1/a76/customs-brokers?company_id=${companyId}&page=${page}&page_size=${pageSize}`);
|
||||
},
|
||||
|
||||
get: (brokerKey: string, companyId: string) => {
|
||||
@@ -99,21 +106,21 @@ export const customsBrokersApi = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Actualiza la información de un agente aduanal
|
||||
*/
|
||||
update: (brokerKey: string, data: CreateCustomsBrokerData) => {
|
||||
const companyId = data.company_id;
|
||||
return api.put<CustomsBroker>(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`, data);
|
||||
},
|
||||
* Actualiza la información de un agente aduanal
|
||||
*/
|
||||
update: (brokerKey: string, data: CreateCustomsBrokerData) => {
|
||||
const companyId = data.company_id;
|
||||
return api.put<CustomsBroker>(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`, data);
|
||||
},
|
||||
|
||||
/**
|
||||
* Elimina un agente aduanal
|
||||
*/
|
||||
delete: (brokerKey: string, companyId: string) => {
|
||||
return api.delete<CustomsBroker>(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Elimina un agente aduanal
|
||||
*/
|
||||
delete: (brokerKey: string, companyId: string) => {
|
||||
return api.delete<CustomsBroker>(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`);
|
||||
},
|
||||
|
||||
|
||||
|
||||
updateVU: (brokerKey: string, data: CustomsBrokerVU, companyId: string) => {
|
||||
return api.put<CustomsBrokerVU>(`/v1/a76/customs-broker-vu/${brokerKey}?company_id=${companyId}`, data);
|
||||
|
||||
@@ -29,42 +29,36 @@ export interface LocationFilters {
|
||||
page_size?: number;
|
||||
}
|
||||
|
||||
import { portsApi, PortType } from './ports';
|
||||
|
||||
export async function getLocations(
|
||||
companyId: number,
|
||||
filters?: LocationFilters
|
||||
): Promise<LocationListResponse> {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
|
||||
if (filters) {
|
||||
if (filters.location_code) params.append('location_code', filters.location_code);
|
||||
if (filters.location_description) params.append('location_description', filters.location_description);
|
||||
if (filters.page) params.append('page', filters.page.toString());
|
||||
if (filters.page_size) params.append('page_size', filters.page_size.toString());
|
||||
}
|
||||
|
||||
return api.get<LocationListResponse>(`/v1/a76/ports/?${params.toString()}`);
|
||||
const res = await portsApi.list(companyId, filters || {});
|
||||
return (res.data || res) as unknown as LocationListResponse;
|
||||
}
|
||||
|
||||
export async function getLocation(
|
||||
locationId: number,
|
||||
companyId: number
|
||||
): Promise<Location> {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
return api.get<Location>(`/v1/a76/ports/${locationId}/?${params.toString()}`);
|
||||
const res = await portsApi.get(locationId, companyId);
|
||||
return (res.data || res) as unknown as Location;
|
||||
}
|
||||
|
||||
export async function createLocation(
|
||||
data: LocationCreate,
|
||||
companyId: number
|
||||
): Promise<Location> {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
return api.post<Location>(`/v1/a76/ports/?${params.toString()}`, {
|
||||
const res = await portsApi.create({
|
||||
port_code: data.location_code,
|
||||
location_code: data.location_code,
|
||||
description: null,
|
||||
location_description: data.location_description || null,
|
||||
port_type: 'ENTRY'
|
||||
});
|
||||
port_type: PortType.ENTRY
|
||||
}, companyId);
|
||||
return (res.data || res) as unknown as Location;
|
||||
}
|
||||
|
||||
export async function updateLocation(
|
||||
@@ -72,19 +66,15 @@ export async function updateLocation(
|
||||
data: LocationUpdate,
|
||||
companyId: number
|
||||
): Promise<Location> {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
return api.put<Location>(
|
||||
`/v1/a76/ports/${locationId}/?${params.toString()}`,
|
||||
{
|
||||
location_description: data.location_description
|
||||
}
|
||||
);
|
||||
const res = await portsApi.update(locationId, {
|
||||
location_description: data.location_description
|
||||
}, companyId);
|
||||
return (res.data || res) as unknown as Location;
|
||||
}
|
||||
|
||||
export async function deleteLocation(
|
||||
locationId: number,
|
||||
companyId: number
|
||||
): Promise<void> {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
return api.delete(`/v1/a76/ports/${locationId}/?${params.toString()}`);
|
||||
await portsApi.delete(locationId, companyId);
|
||||
}
|
||||
@@ -37,38 +37,56 @@ export interface PortUpdate {
|
||||
export interface PortListResponse {
|
||||
items: Port[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
pages: number;
|
||||
}
|
||||
|
||||
export async function getPorts(
|
||||
page = 1,
|
||||
pageSize = 50,
|
||||
filters: Record<string, any> = {},
|
||||
companyId?: number
|
||||
): Promise<ApiResponse<PortListResponse>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
page: page.toString(),
|
||||
page_size: pageSize.toString(),
|
||||
...filters
|
||||
});
|
||||
class PortsApi {
|
||||
private baseUrl = '/v1/a76/ports';
|
||||
|
||||
if (companyId) {
|
||||
queryParams.append('company_id', companyId.toString());
|
||||
async list(
|
||||
companyId: string | number,
|
||||
params?: Record<string, any>
|
||||
): Promise<ApiResponse<PortListResponse>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString(),
|
||||
...params
|
||||
});
|
||||
return api.get<PortListResponse>(`${this.baseUrl}/?${queryParams.toString()}`);
|
||||
}
|
||||
|
||||
return await api.get(`/v1/a76/ports/?${queryParams.toString()}`);
|
||||
async get(id: string | number, companyId: string | number): Promise<ApiResponse<Port>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.get<Port>(`${this.baseUrl}/${id}/?${queryParams.toString()}`);
|
||||
}
|
||||
|
||||
async create(data: PortCreate, companyId: string | number): Promise<ApiResponse<Port>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.post<Port>(`${this.baseUrl}/?${queryParams.toString()}`, data);
|
||||
}
|
||||
|
||||
async update(id: string | number, data: PortUpdate, companyId: string | number): Promise<ApiResponse<Port>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.put<Port>(`${this.baseUrl}/${id}/?${queryParams.toString()}`, data);
|
||||
}
|
||||
|
||||
async delete(id: string | number, companyId: string | number): Promise<ApiResponse<void>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.delete(`${this.baseUrl}/${id}/?${queryParams.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function createPort(data: PortCreate, companyId: number): Promise<ApiResponse<Port>> {
|
||||
return await api.post(`/v1/a76/ports/?company_id=${companyId}`, data);
|
||||
}
|
||||
export const portsApi = new PortsApi();
|
||||
|
||||
export async function updatePort(id: number, data: PortUpdate, companyId: number): Promise<ApiResponse<Port>> {
|
||||
return await api.put(`/v1/a76/ports/${id}/?company_id=${companyId}`, data);
|
||||
}
|
||||
|
||||
export async function deletePort(id: number, companyId: number): Promise<ApiResponse<void>> {
|
||||
return await api.delete(`/v1/a76/ports/${id}/?company_id=${companyId}`);
|
||||
}
|
||||
/**
|
||||
* @deprecated Use portsApi.list Instead
|
||||
*/
|
||||
export const getPorts = (page = 1, pageSize = 50, filters = {}, companyId?: number) => {
|
||||
return portsApi.list(companyId || '', { page, page_size: pageSize, ...filters });
|
||||
};
|
||||
|
||||
@@ -231,6 +231,8 @@ export interface Invoice {
|
||||
logistics?: InvoiceLogistics;
|
||||
details?: InvoiceSalesDetails[];
|
||||
collections?: InvoiceCollections[];
|
||||
// Client-side only properties
|
||||
is_selected?: boolean;
|
||||
}
|
||||
|
||||
export interface InvoiceListResponse {
|
||||
|
||||
117
frontend/src/lib/api/dashboard/a76/manifests.ts
Normal file
117
frontend/src/lib/api/dashboard/a76/manifests.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import { api, type ApiResponse } from '$lib/api';
|
||||
|
||||
export interface Manifest {
|
||||
id: number;
|
||||
manifest_number?: string;
|
||||
importer_details?: string;
|
||||
person_in_charge?: string;
|
||||
consigned_to?: string;
|
||||
sent_by?: string;
|
||||
foreign_exit_port?: string;
|
||||
foreign_exit_port_loc?: string;
|
||||
destination_port?: string;
|
||||
destination_port_loc?: string;
|
||||
entry_port?: string;
|
||||
entry_port_loc?: string;
|
||||
entry_date?: number;
|
||||
net_weight?: number;
|
||||
gross_weight?: number;
|
||||
total_value?: number;
|
||||
description?: string;
|
||||
broker_code?: string;
|
||||
carrier_code?: string;
|
||||
payment_invoice_number?: string;
|
||||
seal_number?: string;
|
||||
entry_hour?: number;
|
||||
hazardous_material?: string;
|
||||
transport_mode?: string;
|
||||
transport_code?: string;
|
||||
trailer_number?: string;
|
||||
status?: string;
|
||||
status_description?: string;
|
||||
manifest_type?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
company_id?: number;
|
||||
tenant_id?: string;
|
||||
}
|
||||
|
||||
export interface ManifestResponse {
|
||||
items: Manifest[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export type ManifestCreate = Omit<Manifest, 'id' | 'created_at' | 'updated_at'>;
|
||||
export type ManifestUpdate = Partial<ManifestCreate>;
|
||||
|
||||
class ManifestApi {
|
||||
private baseUrl = '/v1/a76/manifests';
|
||||
|
||||
async list(
|
||||
companyId: string | number,
|
||||
filters?: Record<string, any>
|
||||
): Promise<ApiResponse<ManifestResponse>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
|
||||
if (filters) {
|
||||
Object.entries(filters).forEach(([key, value]) => {
|
||||
if (value !== undefined && value !== null && value !== '') {
|
||||
params.append(key, value.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return api.get<ManifestResponse>(`${this.baseUrl}?${params.toString()}`);
|
||||
}
|
||||
|
||||
async get(companyId: string | number, id: number): Promise<ApiResponse<Manifest>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.get<Manifest>(`${this.baseUrl}/${id}?${params.toString()}`);
|
||||
}
|
||||
|
||||
async create(companyId: string | number, manifest: ManifestCreate): Promise<ApiResponse<Manifest>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.post<Manifest>(`${this.baseUrl}?${params.toString()}`, manifest);
|
||||
}
|
||||
|
||||
async update(
|
||||
companyId: string | number,
|
||||
id: number,
|
||||
manifest: ManifestUpdate
|
||||
): Promise<ApiResponse<Manifest>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.patch<Manifest>(`${this.baseUrl}/${id}?${params.toString()}`, manifest);
|
||||
}
|
||||
|
||||
async delete(companyId: string | number, id: number): Promise<ApiResponse<any>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.delete(`${this.baseUrl}/${id}?${params.toString()}`);
|
||||
}
|
||||
|
||||
async updateInvoiceCompliance(
|
||||
invoiceId: number,
|
||||
companyId: string | number,
|
||||
manifestNumber: string | null
|
||||
): Promise<ApiResponse<boolean>> {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.patch<boolean>(`${this.baseUrl}/invoices/${invoiceId}/compliance?${params.toString()}`, {
|
||||
manifest_number: manifestNumber
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const manifestApi = new ManifestApi();
|
||||
40
frontend/src/lib/api/dashboard/a76/trailers.ts
Normal file
40
frontend/src/lib/api/dashboard/a76/trailers.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { api, type ApiResponse } from '$lib/api';
|
||||
|
||||
export interface Trailer {
|
||||
trailer_number: string;
|
||||
plate_number?: string;
|
||||
trailer_type_key?: string;
|
||||
is_active: boolean;
|
||||
tenant_id?: string;
|
||||
}
|
||||
|
||||
export interface TrailerResponse {
|
||||
items: Trailer[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
class TrailersApi {
|
||||
private baseUrl = '/v1/a76/trailers';
|
||||
|
||||
async list(
|
||||
companyId: string | number,
|
||||
params?: Record<string, any>
|
||||
): Promise<ApiResponse<TrailerResponse>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString(),
|
||||
...params
|
||||
});
|
||||
return api.get<TrailerResponse>(`${this.baseUrl}?${queryParams.toString()}`);
|
||||
}
|
||||
|
||||
async get(id: string, companyId: string | number): Promise<ApiResponse<Trailer>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.get<Trailer>(`${this.baseUrl}/${id}?${queryParams.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const trailersApi = new TrailersApi();
|
||||
40
frontend/src/lib/api/dashboard/a76/transporters.ts
Normal file
40
frontend/src/lib/api/dashboard/a76/transporters.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { api, type ApiResponse } from '$lib/api';
|
||||
|
||||
export interface Transporter {
|
||||
transporter_key: string;
|
||||
name: string;
|
||||
rfc?: string;
|
||||
is_active: boolean;
|
||||
tenant_id?: string;
|
||||
}
|
||||
|
||||
export interface TransporterResponse {
|
||||
items: Transporter[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
class TransportersApi {
|
||||
private baseUrl = '/v1/a76/transporters';
|
||||
|
||||
async list(
|
||||
companyId: string | number,
|
||||
params?: Record<string, any>
|
||||
): Promise<ApiResponse<TransporterResponse>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString(),
|
||||
...params
|
||||
});
|
||||
return api.get<TransporterResponse>(`${this.baseUrl}?${queryParams.toString()}`);
|
||||
}
|
||||
|
||||
async get(id: string, companyId: string | number): Promise<ApiResponse<Transporter>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.get<Transporter>(`${this.baseUrl}/${id}?${queryParams.toString()}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const transportersApi = new TransportersApi();
|
||||
32
frontend/src/lib/api/dashboard/a76/vehicles.ts
Normal file
32
frontend/src/lib/api/dashboard/a76/vehicles.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { api } from '$lib/api';
|
||||
|
||||
export interface Vehicle {
|
||||
vehicle_key: string;
|
||||
brand?: string;
|
||||
plate_number?: string;
|
||||
description?: string;
|
||||
transport_type?: string;
|
||||
year?: string;
|
||||
}
|
||||
|
||||
export interface VehicleListResponse {
|
||||
items: Vehicle[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* API para Vehículos
|
||||
*/
|
||||
export const vehiclesApi = {
|
||||
list: (companyId: string, page = 1, pageSize = 50) => {
|
||||
return api.get<VehicleListResponse>(
|
||||
`/v1/a76/transportation/vehicles?company_id=${companyId}&page=${page}&page_size=${pageSize}`
|
||||
);
|
||||
},
|
||||
|
||||
get: (vehicleKey: string, companyId: string) => {
|
||||
return api.get<Vehicle>(
|
||||
`/v1/a76/transportation/vehicles/${vehicleKey}?company_id=${companyId}`
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -40,7 +40,7 @@ export const codePedimentoRegimensApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<CodePedimentoRegimenListResponse>(
|
||||
// CORRECTO: Slash antes del signo '?'
|
||||
`/v1/public/refrence_data/code-pedimento-regimens/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/code-pedimento-regimens/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -55,19 +55,19 @@ export const codePedimentoRegimensApi = {
|
||||
*/
|
||||
create: (data: CreateCodePedimentoRegimenData) =>
|
||||
// CORREGIDO: Añadido slash al final de la ruta
|
||||
api.post<CodePedimentoRegimen>('/v1/public/refrence_data/code-pedimento-regimens/', data),
|
||||
api.post<CodePedimentoRegimen>('/v1/public/reference_data/code-pedimento-regimens/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un code pedimento regimen existente
|
||||
*/
|
||||
update: (id: number, data: UpdateCodePedimentoRegimenData) =>
|
||||
// CORRECTO: Slash después del ID
|
||||
api.put<CodePedimentoRegimen>(`/v1/public/refrence_data/code-pedimento-regimens/${id}/`, data),
|
||||
api.put<CodePedimentoRegimen>(`/v1/public/reference_data/code-pedimento-regimens/${id}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un code pedimento regimen
|
||||
*/
|
||||
delete: (id: number) =>
|
||||
// CORRECTO: Slash después del ID
|
||||
api.delete(`/v1/public/refrence_data/code-pedimento-regimens/${id}/`)
|
||||
api.delete(`/v1/public/reference_data/code-pedimento-regimens/${id}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const containersApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<ContainerListResponse>(
|
||||
// CORRECTO: Slash antes del ?
|
||||
`/v1/public/refrence_data/containers/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/containers/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@ export const containersApi = {
|
||||
*/
|
||||
create: (data: CreateContainerData) =>
|
||||
// CORREGIDO: Se añadió el slash '/' al final para evitar redirección en POST
|
||||
api.post<Container>('/v1/public/refrence_data/containers/', data),
|
||||
api.post<Container>('/v1/public/reference_data/containers/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un container existente
|
||||
@@ -64,7 +64,7 @@ export const containersApi = {
|
||||
*/
|
||||
update: (key: number, data: UpdateContainerData) =>
|
||||
// CORRECTO: Slash final después de la key
|
||||
api.put<Container>(`/v1/public/refrence_data/containers/${key}/`, data),
|
||||
api.put<Container>(`/v1/public/reference_data/containers/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un container
|
||||
@@ -72,5 +72,5 @@ export const containersApi = {
|
||||
*/
|
||||
delete: (key: number) =>
|
||||
// CORRECTO: Slash final después de la key
|
||||
api.delete(`/v1/public/refrence_data/containers/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/containers/${key}/`)
|
||||
};
|
||||
@@ -46,7 +46,7 @@ export const countriesApi = {
|
||||
* @param search - Término de búsqueda (opcional)
|
||||
*/
|
||||
list: (page = 1, pageSize = 50, search?: string) => {
|
||||
let url = `/v1/public/refrence_data/countries/?page=${page}&page_size=${pageSize}`;
|
||||
let url = `/v1/public/reference_data/countries/?page=${page}&page_size=${pageSize}`;
|
||||
if (search) {
|
||||
url += `&search=${encodeURIComponent(search)}`;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ export const countriesApi = {
|
||||
*/
|
||||
get: (m3_key: string) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.get<Country>(`/v1/public/refrence_data/countries/${m3_key}/`),
|
||||
api.get<Country>(`/v1/public/reference_data/countries/${m3_key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo país
|
||||
@@ -67,7 +67,7 @@ export const countriesApi = {
|
||||
*/
|
||||
create: (data: CreateCountryData) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.post<Country>('/v1/public/refrence_data/countries/', data),
|
||||
api.post<Country>('/v1/public/reference_data/countries/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un país existente
|
||||
@@ -76,7 +76,7 @@ export const countriesApi = {
|
||||
*/
|
||||
update: (m3_key: string, data: UpdateCountryData) =>
|
||||
// CORREGIDO: Añadido '/' después de la clave
|
||||
api.put<Country>(`/v1/public/refrence_data/countries/${m3_key}/`, data),
|
||||
api.put<Country>(`/v1/public/reference_data/countries/${m3_key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un país
|
||||
@@ -84,5 +84,5 @@ export const countriesApi = {
|
||||
*/
|
||||
delete: (m3_key: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la clave
|
||||
api.delete(`/v1/public/refrence_data/countries/${m3_key}/`)
|
||||
api.delete(`/v1/public/reference_data/countries/${m3_key}/`)
|
||||
};
|
||||
@@ -41,7 +41,7 @@ export const currencyTypesApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<CurrencyTypeListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/currency-types/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/currency-types/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ export const currencyTypesApi = {
|
||||
*/
|
||||
get: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.get<CurrencyType>(`/v1/public/refrence_data/currency-types/${code}/`),
|
||||
api.get<CurrencyType>(`/v1/public/reference_data/currency-types/${code}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo tipo de moneda
|
||||
@@ -58,7 +58,7 @@ export const currencyTypesApi = {
|
||||
*/
|
||||
create: (data: CreateCurrencyTypeData) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.post<CurrencyType>('/v1/public/refrence_data/currency-types/', data),
|
||||
api.post<CurrencyType>('/v1/public/reference_data/currency-types/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un tipo de moneda existente
|
||||
@@ -67,7 +67,7 @@ export const currencyTypesApi = {
|
||||
*/
|
||||
update: (code: string, data: UpdateCurrencyTypeData) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.put<CurrencyType>(`/v1/public/refrence_data/currency-types/${code}/`, data),
|
||||
api.put<CurrencyType>(`/v1/public/reference_data/currency-types/${code}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un tipo de moneda
|
||||
@@ -75,5 +75,5 @@ export const currencyTypesApi = {
|
||||
*/
|
||||
delete: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.delete(`/v1/public/refrence_data/currency-types/${code}/`)
|
||||
api.delete(`/v1/public/reference_data/currency-types/${code}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const customsSectionsApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<CustomsSectionListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes de los parámetros
|
||||
`/v1/public/refrence_data/customs-sections/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/customs-sections/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export const customsSectionsApi = {
|
||||
*/
|
||||
get: (customs_code: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<CustomsSection>(`/v1/public/refrence_data/customs-sections/${customs_code}/`),
|
||||
api.get<CustomsSection>(`/v1/public/reference_data/customs-sections/${customs_code}/`),
|
||||
|
||||
/**
|
||||
* Crea una nueva sección aduanera
|
||||
@@ -55,7 +55,7 @@ export const customsSectionsApi = {
|
||||
*/
|
||||
create: (data: CreateCustomsSectionData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<CustomsSection>('/v1/public/refrence_data/customs-sections/', data),
|
||||
api.post<CustomsSection>('/v1/public/reference_data/customs-sections/', data),
|
||||
|
||||
/**
|
||||
* Actualiza una sección aduanera existente
|
||||
@@ -64,7 +64,7 @@ export const customsSectionsApi = {
|
||||
*/
|
||||
update: (customs_code: string, data: UpdateCustomsSectionData) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.put<CustomsSection>(`/v1/public/refrence_data/customs-sections/${customs_code}/`, data),
|
||||
api.put<CustomsSection>(`/v1/public/reference_data/customs-sections/${customs_code}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina una sección aduanera
|
||||
@@ -72,5 +72,5 @@ export const customsSectionsApi = {
|
||||
*/
|
||||
delete: (customs_code: string) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.delete(`/v1/public/refrence_data/customs-sections/${customs_code}/`)
|
||||
api.delete(`/v1/public/reference_data/customs-sections/${customs_code}/`)
|
||||
};
|
||||
@@ -41,7 +41,7 @@ export const customsWarehousesApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<CustomsWarehouseListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/customs-warehouses/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/customs-warehouses/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ export const customsWarehousesApi = {
|
||||
*/
|
||||
get: (key: string, customs: string) =>
|
||||
// CORREGIDO: Añadido '/' al final de la ruta compuesta
|
||||
api.get<CustomsWarehouse>(`/v1/public/refrence_data/customs-warehouses/${key}/${customs}/`),
|
||||
api.get<CustomsWarehouse>(`/v1/public/reference_data/customs-warehouses/${key}/${customs}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo recinto fiscalizado
|
||||
@@ -59,7 +59,7 @@ export const customsWarehousesApi = {
|
||||
*/
|
||||
create: (data: CreateCustomsWarehouseData) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.post<CustomsWarehouse>('/v1/public/refrence_data/customs-warehouses/', data),
|
||||
api.post<CustomsWarehouse>('/v1/public/reference_data/customs-warehouses/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un recinto fiscalizado existente
|
||||
@@ -69,7 +69,7 @@ export const customsWarehousesApi = {
|
||||
*/
|
||||
update: (key: string, customs: string, data: UpdateCustomsWarehouseData) =>
|
||||
// CORREGIDO: Añadido '/' al final de la ruta compuesta
|
||||
api.put<CustomsWarehouse>(`/v1/public/refrence_data/customs-warehouses/${key}/${customs}/`, data),
|
||||
api.put<CustomsWarehouse>(`/v1/public/reference_data/customs-warehouses/${key}/${customs}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un recinto fiscalizado
|
||||
@@ -78,5 +78,5 @@ export const customsWarehousesApi = {
|
||||
*/
|
||||
delete: (key: string, customs: string) =>
|
||||
// CORREGIDO: Añadido '/' al final de la ruta compuesta
|
||||
api.delete(`/v1/public/refrence_data/customs-warehouses/${key}/${customs}/`)
|
||||
api.delete(`/v1/public/reference_data/customs-warehouses/${key}/${customs}/`)
|
||||
};
|
||||
@@ -41,7 +41,7 @@ export const incotermsApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<IncotermListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/incoterms/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/incoterms/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ export const incotermsApi = {
|
||||
*/
|
||||
get: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<Incoterm>(`/v1/public/refrence_data/incoterms/${code}/`),
|
||||
api.get<Incoterm>(`/v1/public/reference_data/incoterms/${code}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo incoterm
|
||||
@@ -58,7 +58,7 @@ export const incotermsApi = {
|
||||
*/
|
||||
create: (data: CreateIncotermData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<Incoterm>('/v1/public/refrence_data/incoterms/', data),
|
||||
api.post<Incoterm>('/v1/public/reference_data/incoterms/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un incoterm existente
|
||||
@@ -67,7 +67,7 @@ export const incotermsApi = {
|
||||
*/
|
||||
update: (code: string, data: UpdateIncotermData) =>
|
||||
// CORREGIDO: Añadido '/' final después del código
|
||||
api.put<Incoterm>(`/v1/public/refrence_data/incoterms/${code}/`, data),
|
||||
api.put<Incoterm>(`/v1/public/reference_data/incoterms/${code}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un incoterm
|
||||
@@ -75,5 +75,5 @@ export const incotermsApi = {
|
||||
*/
|
||||
delete: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' final después del código
|
||||
api.delete(`/v1/public/refrence_data/incoterms/${code}/`)
|
||||
api.delete(`/v1/public/reference_data/incoterms/${code}/`)
|
||||
};
|
||||
@@ -53,7 +53,7 @@ export const invoiceTypesApi = {
|
||||
}
|
||||
return api.get<InvoiceTypeListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/invoice-types/?${params.toString()}`
|
||||
`/v1/public/reference_data/invoice-types/?${params.toString()}`
|
||||
);
|
||||
},
|
||||
|
||||
@@ -63,7 +63,7 @@ export const invoiceTypesApi = {
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<InvoiceType>(`/v1/public/refrence_data/invoice-types/${key}/`),
|
||||
api.get<InvoiceType>(`/v1/public/reference_data/invoice-types/${key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo tipo de factura
|
||||
@@ -71,7 +71,7 @@ export const invoiceTypesApi = {
|
||||
*/
|
||||
create: (data: CreateInvoiceTypeData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<InvoiceType>('/v1/public/refrence_data/invoice-types/', data),
|
||||
api.post<InvoiceType>('/v1/public/reference_data/invoice-types/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un tipo de factura existente
|
||||
@@ -80,7 +80,7 @@ export const invoiceTypesApi = {
|
||||
*/
|
||||
update: (key: string, data: UpdateInvoiceTypeData) =>
|
||||
// CORREGIDO: Añadido '/' después de la key
|
||||
api.put<InvoiceType>(`/v1/public/refrence_data/invoice-types/${key}/`, data),
|
||||
api.put<InvoiceType>(`/v1/public/reference_data/invoice-types/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un tipo de factura
|
||||
@@ -88,5 +88,5 @@ export const invoiceTypesApi = {
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la key
|
||||
api.delete(`/v1/public/refrence_data/invoice-types/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/invoice-types/${key}/`)
|
||||
};
|
||||
@@ -49,7 +49,7 @@ export const materialTypesApi = {
|
||||
}
|
||||
return api.get<MaterialTypeListResponse>(
|
||||
// CORRECTO: Ya tiene el '/' antes del '?'
|
||||
`/v1/public/refrence_data/material-types/?${params.toString()}`
|
||||
`/v1/public/reference_data/material-types/?${params.toString()}`
|
||||
);
|
||||
},
|
||||
|
||||
@@ -59,7 +59,7 @@ export const materialTypesApi = {
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORRECTO: Ya tiene el '/' al final
|
||||
api.get<MaterialType>(`/v1/public/refrence_data/material-types/${key}/`),
|
||||
api.get<MaterialType>(`/v1/public/reference_data/material-types/${key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo tipo de material
|
||||
@@ -67,7 +67,7 @@ export const materialTypesApi = {
|
||||
*/
|
||||
create: (data: CreateMaterialTypeData) =>
|
||||
// CORRECTO: Ya tiene el '/' al final
|
||||
api.post<MaterialType>('/v1/public/refrence_data/material-types/', data),
|
||||
api.post<MaterialType>('/v1/public/reference_data/material-types/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un tipo de material existente
|
||||
@@ -76,7 +76,7 @@ export const materialTypesApi = {
|
||||
*/
|
||||
update: (key: string, data: UpdateMaterialTypeData) =>
|
||||
// CORRECTO: Ya tiene el '/' al final
|
||||
api.put<MaterialType>(`/v1/public/refrence_data/material-types/${key}/`, data),
|
||||
api.put<MaterialType>(`/v1/public/reference_data/material-types/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un tipo de material
|
||||
@@ -84,5 +84,5 @@ export const materialTypesApi = {
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORRECTO: Ya tiene el '/' al final
|
||||
api.delete(`/v1/public/refrence_data/material-types/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/material-types/${key}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const paymentMethodsApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<PaymentMethodListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/payment-methods/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/payment-methods/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export const paymentMethodsApi = {
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<PaymentMethod>(`/v1/public/refrence_data/payment-methods/${key}/`),
|
||||
api.get<PaymentMethod>(`/v1/public/reference_data/payment-methods/${key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo método de pago
|
||||
@@ -55,7 +55,7 @@ export const paymentMethodsApi = {
|
||||
*/
|
||||
create: (data: CreatePaymentMethodData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<PaymentMethod>('/v1/public/refrence_data/payment-methods/', data),
|
||||
api.post<PaymentMethod>('/v1/public/reference_data/payment-methods/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un método de pago existente
|
||||
@@ -64,7 +64,7 @@ export const paymentMethodsApi = {
|
||||
*/
|
||||
update: (key: string, data: UpdatePaymentMethodData) =>
|
||||
// CORREGIDO: Añadido '/' después de la key
|
||||
api.put<PaymentMethod>(`/v1/public/refrence_data/payment-methods/${key}/`, data),
|
||||
api.put<PaymentMethod>(`/v1/public/reference_data/payment-methods/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un método de pago
|
||||
@@ -72,5 +72,5 @@ export const paymentMethodsApi = {
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la key
|
||||
api.delete(`/v1/public/refrence_data/payment-methods/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/payment-methods/${key}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const pedimentoCodesApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<PedimentoCodeListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/pedimento-codes/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/pedimento-codes/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export const pedimentoCodesApi = {
|
||||
*/
|
||||
get: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<PedimentoCode>(`/v1/public/refrence_data/pedimento-codes/${code}/`),
|
||||
api.get<PedimentoCode>(`/v1/public/reference_data/pedimento-codes/${code}/`),
|
||||
|
||||
/**
|
||||
* Crea una nueva clave de pedimento
|
||||
@@ -55,7 +55,7 @@ export const pedimentoCodesApi = {
|
||||
*/
|
||||
create: (data: CreatePedimentoCodeData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<PedimentoCode>('/v1/public/refrence_data/pedimento-codes/', data),
|
||||
api.post<PedimentoCode>('/v1/public/reference_data/pedimento-codes/', data),
|
||||
|
||||
/**
|
||||
* Actualiza una clave de pedimento existente
|
||||
@@ -64,7 +64,7 @@ export const pedimentoCodesApi = {
|
||||
*/
|
||||
update: (code: string, data: UpdatePedimentoCodeData) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.put<PedimentoCode>(`/v1/public/refrence_data/pedimento-codes/${code}/`, data),
|
||||
api.put<PedimentoCode>(`/v1/public/reference_data/pedimento-codes/${code}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina una clave de pedimento
|
||||
@@ -72,5 +72,5 @@ export const pedimentoCodesApi = {
|
||||
*/
|
||||
delete: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' después del código
|
||||
api.delete(`/v1/public/refrence_data/pedimento-codes/${code}/`)
|
||||
api.delete(`/v1/public/reference_data/pedimento-codes/${code}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const pedimentoRegimensApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<PedimentoRegimenListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/pedimento-regimens/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/pedimento-regimens/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export const pedimentoRegimensApi = {
|
||||
*/
|
||||
get: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<PedimentoRegimen>(`/v1/public/refrence_data/pedimento-regimens/${code}/`),
|
||||
api.get<PedimentoRegimen>(`/v1/public/reference_data/pedimento-regimens/${code}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo régimen de pedimento
|
||||
@@ -55,7 +55,7 @@ export const pedimentoRegimensApi = {
|
||||
*/
|
||||
create: (data: CreatePedimentoRegimenData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<PedimentoRegimen>('/v1/public/refrence_data/pedimento-regimens/', data),
|
||||
api.post<PedimentoRegimen>('/v1/public/reference_data/pedimento-regimens/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un régimen de pedimento existente
|
||||
@@ -64,7 +64,7 @@ export const pedimentoRegimensApi = {
|
||||
*/
|
||||
update: (code: string, data: UpdatePedimentoRegimenData) =>
|
||||
// CORREGIDO: Añadido '/' final después del código
|
||||
api.put<PedimentoRegimen>(`/v1/public/refrence_data/pedimento-regimens/${code}/`, data),
|
||||
api.put<PedimentoRegimen>(`/v1/public/reference_data/pedimento-regimens/${code}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un régimen de pedimento
|
||||
@@ -72,5 +72,5 @@ export const pedimentoRegimensApi = {
|
||||
*/
|
||||
delete: (code: string) =>
|
||||
// CORREGIDO: Añadido '/' final después del código
|
||||
api.delete(`/v1/public/refrence_data/pedimento-regimens/${code}/`)
|
||||
api.delete(`/v1/public/reference_data/pedimento-regimens/${code}/`)
|
||||
};
|
||||
@@ -41,7 +41,7 @@ export const sectorsApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<SectorListResponse>(
|
||||
// CORREGIDO: Slash antes del '?'
|
||||
`/v1/public/refrence_data/sectors/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/sectors/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ export const sectorsApi = {
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORREGIDO: Slash final
|
||||
api.get<Sector>(`/v1/public/refrence_data/sectors/${key}/`),
|
||||
api.get<Sector>(`/v1/public/reference_data/sectors/${key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo sector
|
||||
@@ -58,7 +58,7 @@ export const sectorsApi = {
|
||||
*/
|
||||
create: (data: CreateSectorData) =>
|
||||
// CORREGIDO: Slash final
|
||||
api.post<Sector>('/v1/public/refrence_data/sectors/', data),
|
||||
api.post<Sector>('/v1/public/reference_data/sectors/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un sector existente
|
||||
@@ -67,7 +67,7 @@ export const sectorsApi = {
|
||||
*/
|
||||
update: (key: string, data: UpdateSectorData) =>
|
||||
// CORREGIDO: Slash final después de la variable
|
||||
api.put<Sector>(`/v1/public/refrence_data/sectors/${key}/`, data),
|
||||
api.put<Sector>(`/v1/public/reference_data/sectors/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un sector
|
||||
@@ -75,5 +75,5 @@ export const sectorsApi = {
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORREGIDO: Slash final después de la variable
|
||||
api.delete(`/v1/public/refrence_data/sectors/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/sectors/${key}/`)
|
||||
};
|
||||
@@ -44,7 +44,7 @@ export const statesApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<StateListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes de '?'
|
||||
`/v1/public/refrence_data/states/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/states/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ export const statesApi = {
|
||||
*/
|
||||
get: (m3Key: string) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.get<State>(`/v1/public/refrence_data/states/${m3Key}/`),
|
||||
api.get<State>(`/v1/public/reference_data/states/${m3Key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo estado
|
||||
@@ -61,7 +61,7 @@ export const statesApi = {
|
||||
*/
|
||||
create: (data: CreateStateData) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.post<State>('/v1/public/refrence_data/states/', data),
|
||||
api.post<State>('/v1/public/reference_data/states/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un estado existente
|
||||
@@ -70,7 +70,7 @@ export const statesApi = {
|
||||
*/
|
||||
update: (m3Key: string, data: UpdateStateData) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable
|
||||
api.put<State>(`/v1/public/refrence_data/states/${m3Key}/`, data),
|
||||
api.put<State>(`/v1/public/reference_data/states/${m3Key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un estado
|
||||
@@ -78,5 +78,5 @@ export const statesApi = {
|
||||
*/
|
||||
delete: (m3Key: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable
|
||||
api.delete(`/v1/public/refrence_data/states/${m3Key}/`)
|
||||
api.delete(`/v1/public/reference_data/states/${m3Key}/`)
|
||||
};
|
||||
@@ -5,25 +5,25 @@
|
||||
import { api } from '$lib/api';
|
||||
|
||||
export interface TransportMode {
|
||||
key: string;
|
||||
name: string;
|
||||
key: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface TransportModeListResponse {
|
||||
items: TransportMode[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
items: TransportMode[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export interface CreateTransportModeData {
|
||||
key: string;
|
||||
name: string;
|
||||
key: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface UpdateTransportModeData {
|
||||
key?: string;
|
||||
name?: string;
|
||||
key?: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,6 @@ export const transportModesApi = {
|
||||
*/
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<TransportModeListResponse>(
|
||||
// CORREGIDO: Slash antes del ?
|
||||
`/v1/public/refrence_data/transport-modes/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
@@ -45,8 +44,7 @@ export const transportModesApi = {
|
||||
* Obtiene un modo de transporte por key
|
||||
* @param key - Clave del modo de transporte
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORREGIDO: Slash final después de la key
|
||||
get: (key: string) =>
|
||||
api.get<TransportMode>(`/v1/public/refrence_data/transport-modes/${key}/`),
|
||||
|
||||
/**
|
||||
@@ -54,7 +52,6 @@ export const transportModesApi = {
|
||||
* @param data - Datos del modo de transporte a crear
|
||||
*/
|
||||
create: (data: CreateTransportModeData) =>
|
||||
// CORREGIDO: Slash final en la ruta base
|
||||
api.post<TransportMode>('/v1/public/refrence_data/transport-modes/', data),
|
||||
|
||||
/**
|
||||
@@ -63,14 +60,12 @@ export const transportModesApi = {
|
||||
* @param data - Datos a actualizar
|
||||
*/
|
||||
update: (key: string, data: UpdateTransportModeData) =>
|
||||
// CORREGIDO: Slash final después de la key
|
||||
api.put<TransportMode>(`/v1/public/refrence_data/transport-modes/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un modo de transporte
|
||||
* @param key - Clave del modo de transporte a eliminar
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORREGIDO: Slash final después de la key
|
||||
delete: (key: string) =>
|
||||
api.delete(`/v1/public/refrence_data/transport-modes/${key}/`)
|
||||
};
|
||||
@@ -5,25 +5,25 @@
|
||||
import { api } from '$lib/api';
|
||||
|
||||
export interface TransportType {
|
||||
transport_code: string;
|
||||
description: string;
|
||||
transport_code: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface TransportTypeListResponse {
|
||||
items: TransportType[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
items: TransportType[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
}
|
||||
|
||||
export interface CreateTransportTypeData {
|
||||
transport_code: string;
|
||||
description: string;
|
||||
transport_code: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface UpdateTransportTypeData {
|
||||
transport_code?: string;
|
||||
description?: string;
|
||||
transport_code?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,35 +35,30 @@ export const transportTypesApi = {
|
||||
*/
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<TransportTypeListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/transport-types/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
* Obtiene un tipo de transporte por transport_code
|
||||
*/
|
||||
get: (transportCode: string) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
get: (transportCode: string) =>
|
||||
api.get<TransportType>(`/v1/public/refrence_data/transport-types/${transportCode}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo tipo de transporte
|
||||
*/
|
||||
create: (data: CreateTransportTypeData) =>
|
||||
// CORREGIDO: Añadido '/' al final
|
||||
api.post<TransportType>('/v1/public/refrence_data/transport-types/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un tipo de transporte existente
|
||||
*/
|
||||
update: (transportCode: string, data: UpdateTransportTypeData) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable
|
||||
api.put<TransportType>(`/v1/public/refrence_data/transport-types/${transportCode}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un tipo de transporte
|
||||
*/
|
||||
delete: (transportCode: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable
|
||||
delete: (transportCode: string) =>
|
||||
api.delete(`/v1/public/refrence_data/transport-types/${transportCode}/`)
|
||||
};
|
||||
@@ -38,7 +38,7 @@ export const valuationMethodsApi = {
|
||||
list: (page = 1, pageSize = 50) =>
|
||||
api.get<ValuationMethodListResponse>(
|
||||
// CORREGIDO: Añadido '/' antes del '?'
|
||||
`/v1/public/refrence_data/valuation-methods/?page=${page}&page_size=${pageSize}`
|
||||
`/v1/public/reference_data/valuation-methods/?page=${page}&page_size=${pageSize}`
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ export const valuationMethodsApi = {
|
||||
*/
|
||||
get: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.get<ValuationMethod>(`/v1/public/refrence_data/valuation-methods/${key}/`),
|
||||
api.get<ValuationMethod>(`/v1/public/reference_data/valuation-methods/${key}/`),
|
||||
|
||||
/**
|
||||
* Crea un nuevo método de valoración
|
||||
@@ -55,7 +55,7 @@ export const valuationMethodsApi = {
|
||||
*/
|
||||
create: (data: CreateValuationMethodData) =>
|
||||
// CORREGIDO: Añadido '/' final
|
||||
api.post<ValuationMethod>('/v1/public/refrence_data/valuation-methods/', data),
|
||||
api.post<ValuationMethod>('/v1/public/reference_data/valuation-methods/', data),
|
||||
|
||||
/**
|
||||
* Actualiza un método de valoración existente
|
||||
@@ -64,7 +64,7 @@ export const valuationMethodsApi = {
|
||||
*/
|
||||
update: (key: string, data: UpdateValuationMethodData) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable key
|
||||
api.put<ValuationMethod>(`/v1/public/refrence_data/valuation-methods/${key}/`, data),
|
||||
api.put<ValuationMethod>(`/v1/public/reference_data/valuation-methods/${key}/`, data),
|
||||
|
||||
/**
|
||||
* Elimina un método de valoración
|
||||
@@ -72,5 +72,5 @@ export const valuationMethodsApi = {
|
||||
*/
|
||||
delete: (key: string) =>
|
||||
// CORREGIDO: Añadido '/' después de la variable key
|
||||
api.delete(`/v1/public/refrence_data/valuation-methods/${key}/`)
|
||||
api.delete(`/v1/public/reference_data/valuation-methods/${key}/`)
|
||||
};
|
||||
Reference in New Issue
Block a user