Faciklity add

This commit is contained in:
Hagernesh
2026-06-16 09:06:11 +00:00
parent 95c6a71438
commit 314e9b79cc
13 changed files with 564 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import { BaseEntity } from '@edr/api-common';
import { Column, Entity, Index, OneToMany } from 'typeorm';
import { Column, Entity, Index, ManyToOne, OneToMany } from 'typeorm';
import { Facility } from '../../facilities/entities/facility.entity';
import { WarehouseYard } from './warehouse-yard.entity';
export const WAREHOUSE_TYPES = ['OPEN_WAREHOUSE', 'CLOSED_WAREHOUSE'] as const;
@@ -58,6 +59,12 @@ export class Warehouse extends BaseEntity {
@Column({ name: 'is_active', type: 'boolean', default: true })
isActive!: boolean;
@Column({ name: 'facility_id', type: 'uuid', nullable: true })
facilityId?: string | null;
@ManyToOne(() => Facility, (facility) => facility.warehouses, { nullable: true })
facility?: Facility | null;
@OneToMany(() => WarehouseYard, (yard) => yard.warehouse)
yards?: WarehouseYard[];
}