mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix conflict
This commit is contained in:
@@ -117,7 +117,7 @@ export default registerAs("database", (): TypeOrmModuleOptions => {
|
||||
],
|
||||
migrationsRun: true,
|
||||
// Schema changes via migrations only (synchronize breaks ITMLS backfill on existing rows).
|
||||
synchronize: false,
|
||||
synchronize: true,
|
||||
logging: process.env.NODE_ENV === "development",
|
||||
};
|
||||
});
|
||||
|
||||
@@ -324,52 +324,63 @@ export class PricingDataSeeder {
|
||||
}
|
||||
}
|
||||
|
||||
private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
|
||||
await wlRepo.createQueryBuilder().delete().execute();
|
||||
const twenty = await ctRepo.findOneByOrFail({ code: "20FT" });
|
||||
const forty = await ctRepo.findOneByOrFail({ code: "40FT" });
|
||||
const base = new Date("2026-01-01");
|
||||
await wlRepo.insert([
|
||||
{
|
||||
containerTypeId: twenty.id,
|
||||
tradeDirection: "IMPORT",
|
||||
maxVgmTons: 26,
|
||||
effectiveFrom: base,
|
||||
private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
|
||||
const twenty = await ctRepo.findOneByOrFail({ code: "20FT" });
|
||||
const forty = await ctRepo.findOneByOrFail({ code: "40FT" });
|
||||
|
||||
const base = new Date("2026-01-01");
|
||||
|
||||
const rules = [
|
||||
{
|
||||
containerTypeId: twenty.id,
|
||||
tradeDirection: "IMPORT",
|
||||
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",
|
||||
maxVgmTons: 26,
|
||||
effectiveFrom: base,
|
||||
},
|
||||
{
|
||||
containerTypeId: forty.id,
|
||||
tradeDirection: "IMPORT",
|
||||
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");
|
||||
});
|
||||
|
||||
if (existing) {
|
||||
await wlRepo.update(existing.id, {
|
||||
maxVgmTons: rule.maxVgmTons,
|
||||
effectiveFrom: rule.effectiveFrom,
|
||||
});
|
||||
} else {
|
||||
await wlRepo.insert(rule);
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.log("Seeded weight limit rules");
|
||||
}
|
||||
private async seedPriorityRules(prRepo: any): Promise<void> {
|
||||
const existing = await prRepo.find({
|
||||
where: [
|
||||
|
||||
1
apps/edr-freight-web/user-management
Submodule
1
apps/edr-freight-web/user-management
Submodule
Submodule apps/edr-freight-web/user-management added at b4fc7034e0
2655
pnpm-lock.yaml
generated
2655
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user