feat(doctor): implement Doctors / Vets CRUD backend and DB model (TASK-2.18)
This commit is contained in:
1 parent
d784f3fcc7
commit
47bff2c6ed
4 files changed
+63
-1
No files matched your search
@@ -236,4 +236,36 @@ export class AdminController {
|
||||
const settings = await this.adminService.updateSettings(data);
|
||||
return { success: true, data: settings };
|
||||
}
|
||||
|
||||
// --- Doctors / Vets ---
|
||||
@Get('doctors')
|
||||
@ApiOperation({ summary: 'لیست پزشکان و متخصصان' })
|
||||
async getDoctors() {
|
||||
const doctors = await this.adminService.getDoctors();
|
||||
return { success: true, data: doctors };
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('doctors')
|
||||
@ApiOperation({ summary: 'افزودن پزشک جدید' })
|
||||
async createDoctor(@Body() body: any) {
|
||||
const doctor = await this.adminService.createDoctor(body);
|
||||
return { success: true, data: doctor };
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Put('doctors/:id')
|
||||
@ApiOperation({ summary: 'ویرایش اطلاعات پزشک' })
|
||||
async updateDoctor(@Param('id') id: string, @Body() body: any) {
|
||||
const doctor = await this.adminService.updateDoctor(id, body);
|
||||
return { success: true, data: doctor };
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Delete('doctors/:id')
|
||||
@ApiOperation({ summary: 'حذف پزشک' })
|
||||
async deleteDoctor(@Param('id') id: string) {
|
||||
await this.adminService.deleteDoctor(id);
|
||||
return { success: true };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user