add lashing surcharge for cargo types with hasLashing flag

add lashing surcharge for cargo types with hasLashing flag
This commit is contained in:
Marshal
2026-07-17 23:25:53 +00:00
parent 6467173c76
commit 3a1a08b1e1
59 changed files with 1919 additions and 140 deletions

View File

@@ -53,6 +53,14 @@ export class CargoType extends BaseEntity {
@Column({ name: 'requires_director_approval', type: 'boolean', default: false })
requiresDirectorApproval!: boolean;
/**
* When true, any booking of this cargo type incurs the flat LASHING surcharge
* (the LASHING-trigger rate). Set on commodities that need EDR-provided
* lashing/securing; leave false for cargo that ships without it.
*/
@Column({ name: 'has_lashing', type: 'boolean', default: false })
hasLashing!: boolean;
@Column({ name: 'is_active', type: 'boolean', default: true })
isActive!: boolean;

View File

@@ -30,6 +30,7 @@ export function deriveRateType(input: {
case 'SHIPPING_LINE':
return 'DOUBLE_HANDLING';
case 'CONSOLIDATION':
case 'LASHING':
return 'LASHING';
case 'CANCELLATION':
return 'CANCELLATION_FEE';

View File

@@ -36,6 +36,9 @@ export function allowedRateUnits(input: {
case 'CUSTOMS_CLEARANCE':
// Flat per clearance (ONE_TIME contract) / per shipment request (GENERAL).
return ['FLAT'];
case 'LASHING':
// Flat cargo-securing fee, billed once per booking.
return ['FLAT'];
case 'CONSOLIDATION':
return ['PER_CONTAINER', 'FLAT'];
case 'SHIPPING_LINE':

View File

@@ -78,6 +78,9 @@ export const RATE_TRIGGERS = [
'WITH_RETURN',
'SHIPPING_LINE',
'CONSOLIDATION',
// Cargo securing / lashing. Fires when the booking's cargo type has
// hasLashing = true. Flat fee, billed once per booking.
'LASHING',
'CANCELLATION',
'DEMURRAGE',
'PIL_EXTRA_FEE',