mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
31 lines
994 B
TypeScript
31 lines
994 B
TypeScript
import { Body, Controller, Get, Param, ParseUUIDPipe, Patch } from '@nestjs/common';
|
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
|
|
import { UpdateWarehouseZoneDto } from './dto/update-warehouse-zone.dto';
|
|
import { WarehouseZonesService } from './warehouse-zones.service';
|
|
|
|
@ApiTags('warehouse-zones')
|
|
@ApiBearerAuth()
|
|
@Controller('warehouse-zones')
|
|
export class WarehouseZonesController {
|
|
constructor(private readonly zonesService: WarehouseZonesService) {}
|
|
|
|
@Get()
|
|
@ApiOperation({ summary: 'List all warehouse zones' })
|
|
findAll() {
|
|
return this.zonesService.findAll();
|
|
}
|
|
|
|
@Get(':id')
|
|
@ApiOperation({ summary: 'Get warehouse zone by ID' })
|
|
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.zonesService.findById(id);
|
|
}
|
|
|
|
@Patch(':id')
|
|
@ApiOperation({ summary: 'Update warehouse zone' })
|
|
update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateWarehouseZoneDto) {
|
|
return this.zonesService.update(id, dto);
|
|
}
|
|
}
|