forked from Yara724/api
feat(claims): enforce insurer working hours
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user