feat(bookings): support multiple containers per booking via JSONB array

This commit is contained in:
marshal
2026-05-23 11:08:35 +03:00
parent 2064e6efda
commit ae317540c1
5 changed files with 88 additions and 85 deletions

View File

@@ -105,20 +105,9 @@ export class Booking extends BaseEntity {
@Column({ name: "version_number", type: "int", default: 1 })
versionNumber!: number;
// ── container ─────────────────────────────────────────────────────────
@Column({ name: "container_type", type: "varchar", length: 10 })
containerType!: string;
@Column({ name: "container_quantity", type: "int" })
containerQuantity!: number;
@Column({
name: "container_vgm_per_unit",
type: "numeric",
precision: 10,
scale: 3,
})
containerVgmPerUnit!: number;
// ── containers ─────────────────────────────────────────────────────────
@Column({ name: "containers", type: "jsonb", nullable: true })
containers!: Array<{ type: string; qty: number; vgm: number }> | null;
// ── approval ───────────────────────────────────────────────────────────
@Column({ name: "approved_by_staff_id", type: "uuid", nullable: true })