mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 04:15:43 +00:00
implement file module and add files relation to booking entity and populate on fetch
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BaseEntity } from "@edr/api-common";
|
||||
import { Column, Entity } from "typeorm";
|
||||
import { Column, Entity, OneToMany } from "typeorm";
|
||||
import { FileRecord } from "../../files/entities/file.entity";
|
||||
|
||||
@Entity({ schema:"freight",name: "bookings" })
|
||||
export class Booking extends BaseEntity {
|
||||
@@ -138,7 +139,10 @@ export class Booking extends BaseEntity {
|
||||
@Column({ name: "consolidation_partner_id", type: "uuid", nullable: true })
|
||||
consolidationPartnerId?: string | null;
|
||||
|
||||
// ── documents (JSONB) ──────────────────────────────────────────────────
|
||||
@Column({ name: "documents", type: "jsonb", nullable: true })
|
||||
documents?: Record<string, { originalName: string; size: number; mimeType: string; url?: string }> | null;
|
||||
// ── files ────────────────────────────────────────────────────────────
|
||||
@OneToMany(() => FileRecord, (file) => file.resourceId, {
|
||||
createForeignKeyConstraints: false,
|
||||
})
|
||||
files?: FileRecord[];
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user