rule engine and configration and fix booking for custoemr

This commit is contained in:
marshal
2026-06-01 23:15:11 +03:00
parent b9ca0b8a82
commit 452ebdbc0a
52 changed files with 3355 additions and 3358 deletions

View File

@@ -0,0 +1,15 @@
/**
* Derives a stable, uppercase, underscore-separated code from a human-readable name.
*
* Examples:
* "Hazard Surcharge" → "HAZARD_SURCHARGE"
* "20ft Dry Container" → "20FT_DRY_CONTAINER"
* "Kality Yard (ET)" → "KALITY_YARD_ET"
*/
export function generateCode(name: string): string {
return name
.trim()
.toUpperCase()
.replace(/[^A-Z0-9]+/g, '_')
.replace(/^_+|_+$/g, '');
}