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(':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);
  }
}
