fix issues

This commit is contained in:
Marshal
2026-07-03 13:53:17 +00:00
parent 52f48b688d
commit 57d3752ea5
9 changed files with 132 additions and 64 deletions

View File

@@ -83,6 +83,7 @@ export class RatesService {
*/
private async assertNoDuplicatePattern(pattern: {
rateType: string;
rateUnit: string;
containerTypeId: string | null;
cargoTypeId: string | null;
tradeDirection: string | null;
@@ -115,7 +116,7 @@ export class RatesService {
});
const rateUnit = this.resolveRateUnit(appliesTo, trigger, dto.rateUnit as Rate['rateUnit']);
await this.assertNoDuplicatePattern({ rateType, containerTypeId, cargoTypeId, tradeDirection });
await this.assertNoDuplicatePattern({ rateType, rateUnit, containerTypeId, cargoTypeId, tradeDirection });
return this.repository.create({
appliesTo,
@@ -183,6 +184,7 @@ export class RatesService {
// Guard the pattern uniqueness for the new identity, ignoring this row.
await this.assertNoDuplicatePattern({
rateType,
rateUnit: updates.rateUnit,
containerTypeId: updates.containerTypeId,
cargoTypeId: updates.cargoTypeId,
tradeDirection: updates.tradeDirection,