mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 17:10:56 +00:00
feat: add showFreeTextBox field to cargo type seeder and improve reference data validation in draft bookings seed
This commit is contained in:
@@ -246,6 +246,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "GRAIN",
|
||||
cargoTypeName: "Grain / Cereals",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: false,
|
||||
isActive: true,
|
||||
displayOrder: 1,
|
||||
@@ -253,6 +254,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "FERTILIZER",
|
||||
cargoTypeName: "Fertilizer",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: false,
|
||||
isActive: true,
|
||||
displayOrder: 2,
|
||||
@@ -260,6 +262,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "CEMENT",
|
||||
cargoTypeName: "Cement / Clinker",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: false,
|
||||
isActive: true,
|
||||
displayOrder: 3,
|
||||
@@ -267,6 +270,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "STEEL",
|
||||
cargoTypeName: "Steel / Rebar",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: true,
|
||||
isActive: true,
|
||||
displayOrder: 4,
|
||||
@@ -274,6 +278,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "MACHINERY",
|
||||
cargoTypeName: "Heavy Machinery",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: true,
|
||||
isActive: true,
|
||||
displayOrder: 5,
|
||||
@@ -281,6 +286,7 @@ export class PricingDataSeeder {
|
||||
{
|
||||
code: "OTHER_BULK",
|
||||
cargoTypeName: "Other Bulk Cargo",
|
||||
showFreeTextBox: false,
|
||||
requiresDirectorApproval: false,
|
||||
isActive: true,
|
||||
displayOrder: 6,
|
||||
@@ -623,15 +629,29 @@ private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
|
||||
slByCode: Map<string, any>,
|
||||
cargoByCode: Map<string, any>,
|
||||
): Promise<void> {
|
||||
const djibouti = yardByCode.get("DJIBOUTI")!;
|
||||
const addis = yardByCode.get("ADDIS_ABABA")!;
|
||||
const railContainer = stByCode.get("RAIL_CONTAINER")!;
|
||||
const railBulk = stByCode.get("RAIL_BULK")!;
|
||||
const maersk = slByCode.get("MAERSK")!;
|
||||
const grain = cargoByCode.get("GRAIN")!;
|
||||
const twenty = ctByCode.get("20FT")!;
|
||||
const forty = ctByCode.get("40FT")!;
|
||||
const twentyReefer = ctByCode.get("20FT_REEFER")!;
|
||||
const djibouti = yardByCode.get("DJIBOUTI");
|
||||
const addis = yardByCode.get("ADDIS_ABABA");
|
||||
const railContainer = stByCode.get("RAIL_CONTAINER");
|
||||
const railBulk = stByCode.get("RAIL_BULK");
|
||||
const maersk = slByCode.get("MAERSK");
|
||||
const grain = cargoByCode.get("GRAIN");
|
||||
const twenty = ctByCode.get("20FT");
|
||||
const forty = ctByCode.get("40FT");
|
||||
const twentyReefer = ctByCode.get("20FT_REEFER");
|
||||
|
||||
const missing: string[] = [];
|
||||
if (!djibouti) missing.push("yard:DJIBOUTI");
|
||||
if (!addis) missing.push("yard:ADDIS_ABABA");
|
||||
if (!railContainer) missing.push("serviceType:RAIL_CONTAINER");
|
||||
if (!railBulk) missing.push("serviceType:RAIL_BULK");
|
||||
if (!grain) missing.push("cargoType:GRAIN");
|
||||
if (!twenty) missing.push("containerType:20FT");
|
||||
if (!forty) missing.push("containerType:40FT");
|
||||
if (!twentyReefer) missing.push("containerType:20FT_REEFER");
|
||||
if (missing.length > 0) {
|
||||
this.logger.warn(`seedDraftBookings: skipping — missing reference data: ${missing.join(", ")}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const drafts = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user