mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 16:00:56 +00:00
Backend (edr-freight-api): - Warehouse, WarehouseYard, WarehouseZone, WarehouseInventory entities - CRUD for warehouses/yards/zones with scoped code uniqueness - Inventory receive with location-hierarchy + capacity validation and transactional capacity-counter updates - inspect / ready-for-loading status transitions - inventory inquiry (booking/customer/container/cargo-type joins) - migration creating freight.warehouse* tables Frontend (freight backoffice): - types, service, react-query hooks, URL constants - reusable components: badges, filters, table/card views, inventory and inquiry tables, create/receive modals - pages: Warehouse list, detail (overview/yards/zones/inventory tabs), inventory, inventory inquiry - Warehouse Information card + Receive At Warehouse on booking detail - routes + sidebar nav; app-wide ErrorBoundary Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { Body, Controller, Get, Param, ParseUUIDPipe, Patch, Post } from '@nestjs/common';
|
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
|
|
import { CreateWarehouseZoneDto } from './dto/create-warehouse-zone.dto';
|
|
import { UpdateWarehouseYardDto } from './dto/update-warehouse-yard.dto';
|
|
import { WarehouseYardsService } from './warehouse-yards.service';
|
|
import { WarehouseZonesService } from './warehouse-zones.service';
|
|
|
|
@ApiTags('warehouse-yards')
|
|
@ApiBearerAuth()
|
|
@Controller('warehouse-yards')
|
|
export class WarehouseYardsController {
|
|
constructor(
|
|
private readonly yardsService: WarehouseYardsService,
|
|
private readonly zonesService: WarehouseZonesService,
|
|
) {}
|
|
|
|
@Get(':id')
|
|
@ApiOperation({ summary: 'Get warehouse yard by ID' })
|
|
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.yardsService.findById(id);
|
|
}
|
|
|
|
@Patch(':id')
|
|
@ApiOperation({ summary: 'Update warehouse yard' })
|
|
update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateWarehouseYardDto) {
|
|
return this.yardsService.update(id, dto);
|
|
}
|
|
|
|
@Get(':yardId/zones')
|
|
@ApiOperation({ summary: 'List zones within a yard' })
|
|
listZones(@Param('yardId', ParseUUIDPipe) yardId: string) {
|
|
return this.zonesService.findByYard(yardId);
|
|
}
|
|
|
|
@Post(':yardId/zones')
|
|
@ApiOperation({ summary: 'Create a zone within a yard' })
|
|
createZone(
|
|
@Param('yardId', ParseUUIDPipe) yardId: string,
|
|
@Body() dto: CreateWarehouseZoneDto,
|
|
) {
|
|
return this.zonesService.create(yardId, dto);
|
|
}
|
|
}
|