feat(crm): tarifario — editor de cargos adicionales + alta manual de rutas
- Backend: CRUD de cargos (rate_charges) por tarifario. - Frontend: detalle del tarifario con alta manual de rutas (con editor de quiebres para aéreo/LCL) y sección de cargos adicionales (agregar/eliminar). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,12 @@ export type RateSheetInput = Partial<Omit<RateSheet, 'id' | 'created_at' | 'upda
|
||||
mode: RateMode; name: string;
|
||||
};
|
||||
|
||||
export interface RateCharge {
|
||||
id: number; rate_sheet_id: number | null; rate_lane_id: number | null;
|
||||
concept: string; charge_type: string; value: number | null; condition: string | null;
|
||||
}
|
||||
export interface RateChargeInput { concept: string; charge_type: string; value?: number | null; condition?: string | null; rate_lane_id?: number | null; }
|
||||
|
||||
export interface ImportPreviewRow { row: number; data: Record<string, unknown>; ok: boolean; warnings: string[]; errors: string[]; }
|
||||
export interface ImportPreview { mode: RateMode; total: number; valid: number; rows: ImportPreviewRow[]; columns: string[]; }
|
||||
|
||||
@@ -61,6 +67,9 @@ export const rateSheetsAPI = {
|
||||
lanes: (id: number, companyId: number) => unwrap<RateLane[]>(api.get(`/v1/crm/rate-sheets/${id}/lanes?${qp(companyId)}`)),
|
||||
addLane: (id: number, data: Partial<RateLane>, companyId: number) => unwrap<RateLane>(api.post(`/v1/crm/rate-sheets/${id}/lanes?${qp(companyId)}`, data)),
|
||||
removeLane: (id: number, laneId: number, companyId: number) => unwrap(api.delete(`/v1/crm/rate-sheets/${id}/lanes/${laneId}?${qp(companyId)}`)),
|
||||
charges: (id: number, companyId: number) => unwrap<RateCharge[]>(api.get(`/v1/crm/rate-sheets/${id}/charges?${qp(companyId)}`)),
|
||||
addCharge: (id: number, data: RateChargeInput, companyId: number) => unwrap<RateCharge>(api.post(`/v1/crm/rate-sheets/${id}/charges?${qp(companyId)}`, data)),
|
||||
removeCharge: (id: number, chargeId: number, companyId: number) => unwrap(api.delete(`/v1/crm/rate-sheets/${id}/charges/${chargeId}?${qp(companyId)}`)),
|
||||
|
||||
/** Descarga la plantilla Excel del modo. */
|
||||
async downloadTemplate(mode: RateMode, companyId: number): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user