import { Body, Controller, Get, HttpCode, Param, Patch, Post, UseGuards } from '@nestjs/common'; import { AdminGuard, JwtAuthGuard } from '../common/guards'; import { CreateStaffDto, UpdateStaffDto } from './dto/staff.dto'; import { StaffService } from './staff.service'; @Controller('admin/stores/:storeId/staff') @UseGuards(JwtAuthGuard, AdminGuard) export class StaffController { constructor(private staff: StaffService) {} @Get() list(@Param('storeId') storeId: string) { return this.staff.list(storeId); } @Post() create(@Param('storeId') storeId: string, @Body() dto: CreateStaffDto) { return this.staff.create(storeId, dto); } @Patch(':id') update(@Param('storeId') storeId: string, @Param('id') id: string, @Body() dto: UpdateStaffDto) { return this.staff.update(storeId, id, dto); } @Post(':id/reset-password') @HttpCode(200) resetPassword(@Param('storeId') storeId: string, @Param('id') id: string) { return this.staff.resetPassword(storeId, id); } }