fix conflict

This commit is contained in:
yaschalew
2026-06-13 10:45:26 +03:00
parent 2d70f892a4
commit 12b6406d23
4 changed files with 2697 additions and 58 deletions

View File

@@ -117,7 +117,7 @@ export default registerAs("database", (): TypeOrmModuleOptions => {
], ],
migrationsRun: true, migrationsRun: true,
// Schema changes via migrations only (synchronize breaks ITMLS backfill on existing rows). // Schema changes via migrations only (synchronize breaks ITMLS backfill on existing rows).
synchronize: false, synchronize: true,
logging: process.env.NODE_ENV === "development", logging: process.env.NODE_ENV === "development",
}; };
}); });

View File

@@ -324,52 +324,63 @@ export class PricingDataSeeder {
} }
} }
private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> { private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
await wlRepo.createQueryBuilder().delete().execute(); const twenty = await ctRepo.findOneByOrFail({ code: "20FT" });
const twenty = await ctRepo.findOneByOrFail({ code: "20FT" }); const forty = await ctRepo.findOneByOrFail({ code: "40FT" });
const forty = await ctRepo.findOneByOrFail({ code: "40FT" });
const base = new Date("2026-01-01"); const base = new Date("2026-01-01");
await wlRepo.insert([
{ const rules = [
containerTypeId: twenty.id, {
tradeDirection: "IMPORT", containerTypeId: twenty.id,
maxVgmTons: 26, tradeDirection: "IMPORT",
effectiveFrom: base, maxVgmTons: 26,
effectiveFrom: base,
isActive: true,
},
{
containerTypeId: twenty.id,
tradeDirection: "EXPORT",
maxVgmTons: 26,
effectiveFrom: base,
isActive: true,
},
{
containerTypeId: forty.id,
tradeDirection: "IMPORT",
maxVgmTons: 28,
effectiveFrom: base,
isActive: true,
},
{
containerTypeId: forty.id,
tradeDirection: "EXPORT",
maxVgmTons: 28,
effectiveFrom: base,
isActive: true,
},
];
for (const rule of rules) {
const existing = await wlRepo.findOne({
where: {
containerTypeId: rule.containerTypeId,
tradeDirection: rule.tradeDirection,
}, },
{ });
containerTypeId: twenty.id,
tradeDirection: "EXPORT", if (existing) {
maxVgmTons: 26, await wlRepo.update(existing.id, {
effectiveFrom: base, maxVgmTons: rule.maxVgmTons,
}, effectiveFrom: rule.effectiveFrom,
{ });
containerTypeId: forty.id, } else {
tradeDirection: "IMPORT", await wlRepo.insert(rule);
maxVgmTons: 28, }
effectiveFrom: base,
},
{
containerTypeId: forty.id,
tradeDirection: "EXPORT",
maxVgmTons: 28,
effectiveFrom: base,
},
{
containerTypeId: twenty.id,
tradeDirection: "DOMESTIC",
maxVgmTons: 26,
effectiveFrom: base,
},
{
containerTypeId: forty.id,
tradeDirection: "DOMESTIC",
maxVgmTons: 28,
effectiveFrom: base,
},
]);
this.logger.log("Seeded weight limit rules");
} }
this.logger.log("Seeded weight limit rules");
}
private async seedPriorityRules(prRepo: any): Promise<void> { private async seedPriorityRules(prRepo: any): Promise<void> {
const existing = await prRepo.find({ const existing = await prRepo.find({
where: [ where: [

Submodule apps/edr-freight-web/user-management added at b4fc7034e0

2655
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff