diff --git a/apps/edr-freight-api/src/seed/pricing-data.seeder.ts b/apps/edr-freight-api/src/seed/pricing-data.seeder.ts index cddc34757..bd3e8f112 100644 --- a/apps/edr-freight-api/src/seed/pricing-data.seeder.ts +++ b/apps/edr-freight-api/src/seed/pricing-data.seeder.ts @@ -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 { slByCode: Map, cargoByCode: Map, ): Promise { - 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 = [ {