feat(claims): enforce insurer working hours

This commit is contained in:
SepehrYahyaee
2026-11-24 12:18:39 +03:30
parent 475780f17e
commit f29461fa67
35 changed files with 879 additions and 3 deletions
+27 -2
View File
@@ -1,3 +1,4 @@
import { ClientWorkingHoursService } from "src/client/working-hours/client-working-hours.service";
import {
Body,
Controller,
@@ -42,7 +43,19 @@ const validation = new ValidationPipe({
@UsePipes(validation)
@Controller("super-admin/management")
export class SuperAdminManagementController {
constructor(private management: ManagementService) {}
constructor(
private management: ManagementService,
private readonly workingHours: ClientWorkingHoursService,
) {}
@Get("working-hours")
readHours(@Query("clientId") clientId: string) {
return this.workingHours.read(clientId);
}
@Patch("working-hours")
updateHours(@Query("clientId") clientId: string, @Body() body: unknown) {
return this.workingHours.update(clientId, body);
}
@Get("clients") clients() {
return this.management.listClients();
}
@@ -129,7 +142,19 @@ export class SuperAdminManagementController {
@UsePipes(validation)
@Controller("expert-insurer/management")
export class InsurerManagementController {
constructor(private management: ManagementService) {}
constructor(
private management: ManagementService,
private readonly workingHours: ClientWorkingHoursService,
) {}
@Get("working-hours")
readHours(@CurrentUser() actor: { clientKey: string }) {
return this.workingHours.read(actor.clientKey);
}
@Patch("working-hours")
updateHours(@CurrentUser() actor: { clientKey: string }, @Body() body: unknown) {
return this.workingHours.update(actor.clientKey, body);
}
@Get("staff") staff(
@CurrentUser() actor,
@Query() query: ManagedListQueryDto,