Se mejoro el disenio de agentes y clientes-proveedores

This commit is contained in:
2026-01-14 12:47:01 -06:00
parent e16eafec1b
commit ae1d7f0c58
8 changed files with 1362 additions and 1028 deletions

View File

@@ -2,6 +2,7 @@ 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;
@@ -19,28 +20,8 @@ export interface CustomsBroker {
license: string;
company?: string | null;
contact?: string | null;
tenant_id: string;
tenant_id?: string;
company_id: string;
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 {
@@ -112,7 +93,7 @@ export const customsBrokersApi = {
get: (brokerKey: string, companyId: string) => {
return api.get<CustomsBroker>(`/v1/a76/customs-brokers/${brokerKey}?company_id=${companyId}`);
},
create: (data: CreateCustomsBrokerData, companyId: string) => {
return api.post<CustomsBroker>(`/v1/a76/customs-brokers/?company_id=${companyId}`, data);
},
@@ -124,20 +105,6 @@ export const customsBrokersApi = {
delete: (brokerKey: string, companyId: string) => {
return api.delete<void>(`/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}`);
},
/**
* 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);
},
updateVU: (brokerKey: string, data: CustomsBrokerVU, companyId: string) => {
return api.put<CustomsBrokerVU>(`/v1/a76/customs-broker-vu/${brokerKey}?company_id=${companyId}`, data);