mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 09:30:59 +00:00
Warehouse
This commit is contained in:
@@ -23,6 +23,11 @@ export class CreateWarehouseDto {
|
||||
@IsUUID()
|
||||
stationId?: string;
|
||||
|
||||
@ApiPropertyOptional({ format: 'uuid', description: 'Parent facility / port this warehouse belongs to.' })
|
||||
@IsOptional()
|
||||
@IsUUID()
|
||||
facilityId?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -86,7 +86,7 @@ export class WarehouseInventoryService {
|
||||
|
||||
return this.inventoryRepository.findAll({
|
||||
where,
|
||||
relations: { warehouse: true, yard: true, zone: true },
|
||||
relations: { warehouse: { facility: true }, yard: true, zone: true, booking: true },
|
||||
order: { createdAt: 'DESC' },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -29,13 +29,14 @@ export class WarehousesService {
|
||||
|
||||
return this.warehousesRepository.findAll({
|
||||
where: whereClauses,
|
||||
relations: { facility: true },
|
||||
order: { code: 'ASC' },
|
||||
});
|
||||
}
|
||||
|
||||
async findById(id: string): Promise<Warehouse> {
|
||||
const warehouse = await this.warehousesRepository.findById(id, {
|
||||
relations: { yards: { zones: true } },
|
||||
relations: { facility: true, yards: { zones: true } },
|
||||
});
|
||||
|
||||
if (!warehouse) {
|
||||
@@ -53,6 +54,7 @@ export class WarehousesService {
|
||||
code: dto.code.trim(),
|
||||
type: dto.type,
|
||||
stationId: dto.stationId ?? null,
|
||||
facilityId: dto.facilityId ?? null,
|
||||
locationName: dto.locationName?.trim() ?? null,
|
||||
capacityWeight: dto.capacityWeight ?? null,
|
||||
capacityContainers: dto.capacityContainers ?? null,
|
||||
@@ -80,6 +82,7 @@ export class WarehousesService {
|
||||
code: dto.code?.trim() ?? existing.code,
|
||||
type: dto.type ?? existing.type,
|
||||
stationId: dto.stationId ?? existing.stationId,
|
||||
facilityId: dto.facilityId ?? existing.facilityId,
|
||||
locationName: dto.locationName?.trim() ?? existing.locationName,
|
||||
capacityWeight: dto.capacityWeight ?? existing.capacityWeight,
|
||||
capacityContainers: dto.capacityContainers ?? existing.capacityContainers,
|
||||
|
||||
Reference in New Issue
Block a user