mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 08:48:11 +00:00
resolve confilict
This commit is contained in:
@@ -156,4 +156,18 @@ export const URL_CONSTANTS = {
|
||||
APPROVAL_RULE_BY_ID: (id: string) => `/approval-rules/${id}`,
|
||||
APPROVAL_RULES_CHAIN: "/approval-rules/chain",
|
||||
},
|
||||
RATE_MATRIX: {
|
||||
BASE: '/api/rate-matrices',
|
||||
DRAFT: '/api/rate-matrices/draft',
|
||||
SUBMIT: (id: string) => `/api/rate-matrices/${id}/submit`,
|
||||
AUTHORIZE: (id: string) => `/api/rate-matrices/${id}/authorize`,
|
||||
LIST: '/api/rate-matrices',
|
||||
DETAIL: (id: string) => `/api/rate-matrices/${id}`,
|
||||
},
|
||||
REFERENCE: {
|
||||
PORTS: '/api/reference/ports',
|
||||
CITIES: '/api/reference/cities',
|
||||
CONTAINER_TYPES: '/api/reference/container-types',
|
||||
CURRENCIES: '/api/reference/currencies',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
// constants/rateMatrixConstants.ts
|
||||
export const RATE_TYPES = {
|
||||
CONTAINER_IMPORT: 'container_import',
|
||||
CONTAINER_EXPORT: 'container_export',
|
||||
BULK_IMPORT: 'bulk_import',
|
||||
BULK_EXPORT: 'bulk_export',
|
||||
INTER_CITY_BULK: 'inter_city_bulk',
|
||||
INTER_CITY_CONTAINER: 'inter_city_container',
|
||||
FIRST_MILE: 'first_mile',
|
||||
LAST_MILE: 'last_mile',
|
||||
DEMURRAGE: 'demurrage',
|
||||
LASHING: 'lashing',
|
||||
DOUBLE_HANDLING: 'double_handling',
|
||||
CONTAINER_WITH_RETURN: 'container_with_return',
|
||||
CANCELLATION_FEE: 'cancellation_fee',
|
||||
} as const;
|
||||
|
||||
export const RATE_TYPE_LABELS = {
|
||||
[RATE_TYPES.CONTAINER_IMPORT]: 'Container Import Rates',
|
||||
[RATE_TYPES.CONTAINER_EXPORT]: 'Container Export Rates',
|
||||
[RATE_TYPES.BULK_IMPORT]: 'Bulk Import Rates',
|
||||
[RATE_TYPES.BULK_EXPORT]: 'Bulk Export Rates',
|
||||
[RATE_TYPES.INTER_CITY_BULK]: 'Inter City Bulk Rates',
|
||||
[RATE_TYPES.INTER_CITY_CONTAINER]: 'Inter City Container Rates',
|
||||
[RATE_TYPES.FIRST_MILE]: 'First Mile Cost Rates',
|
||||
[RATE_TYPES.LAST_MILE]: 'Last Mile Cost Rates',
|
||||
[RATE_TYPES.DEMURRAGE]: 'Demurrage Cost Rates',
|
||||
[RATE_TYPES.LASHING]: 'Lashing Cost Rates',
|
||||
[RATE_TYPES.DOUBLE_HANDLING]: 'Double Handling Cost Rates',
|
||||
[RATE_TYPES.CONTAINER_WITH_RETURN]: 'Container With Return Cost Rates',
|
||||
[RATE_TYPES.CANCELLATION_FEE]: 'Cancellation Fee Cost Rates',
|
||||
} as const;
|
||||
|
||||
export const REQUIRED_RATE_TYPES = Object.values(RATE_TYPES);
|
||||
|
||||
export const RATE_FIELDS_CONFIG = {
|
||||
[RATE_TYPES.CONTAINER_IMPORT]: [
|
||||
{ name: 'portOfLoading', label: 'Port of Loading', type: 'text', required: true },
|
||||
{ name: 'portOfDischarge', label: 'Port of Discharge', type: 'text', required: true },
|
||||
{ name: 'containerType', label: 'Container Type', type: 'select', required: true },
|
||||
{ name: 'baseRate', label: 'Base Rate', type: 'number', required: true, min: 0, step: '0.01' },
|
||||
{ name: 'baf', label: 'Bunker Adjustment Factor', type: 'number', required: false, min: 0 },
|
||||
{ name: 'caf', label: 'Currency Adjustment Factor', type: 'number', required: false, min: 0 },
|
||||
],
|
||||
[RATE_TYPES.DEMURRAGE]: [
|
||||
{ name: 'containerType', label: 'Container Type', type: 'select', required: true },
|
||||
{ name: 'freeDays', label: 'Free Days', type: 'number', required: true, min: 0 },
|
||||
{ name: 'ratePerDay', label: 'Rate per Day', type: 'number', required: true, min: 0 },
|
||||
{ name: 'maximumDays', label: 'Maximum Days', type: 'number', required: false, min: 1 },
|
||||
],
|
||||
// ... define for all 13 rate types
|
||||
} as const;
|
||||
|
||||
export const MATRIX_STATUS = {
|
||||
DRAFT: 'draft',
|
||||
PENDING_APPROVAL: 'pending_approval',
|
||||
ACTIVE: 'active',
|
||||
REJECTED: 'rejected',
|
||||
EXPIRED: 'expired',
|
||||
} as const;
|
||||
Reference in New Issue
Block a user