- API NestJS + Prisma (base mep) : auth admin/employés, magasins, design de carte avec récompenses et images, comptes du personnel - Admin Vite/React : liste et fiche magasin, assistant de carte avec aperçu Apple/Google Wallet, gestion des employés - Logo MonEspacePro (Claude Design) en SVG, favicon Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1,010 B
TypeScript
31 lines
1,010 B
TypeScript
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);
|
|
}
|
|
}
|