@Test public void testCreateShift() { this.createTwoShiftsAndVerify(); }
@PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) public GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request) { if (AuthConstant.AUTHORIZATION_AUTHENTICATED_USER.equals(AuthContext.getAuthz())) { permissionService.checkPermissionCompanyAdmin(request.getCompanyId()); } ShiftDto shiftDto = this.shiftService.createShift(request); return new GenericShiftResponse(shiftDto); }
ShiftController { @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) public GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request) { if (AuthConstant.AUTHORIZATION_AUTHENTICATED_USER.equals(AuthContext.getAuthz())) { permissionService.checkPermissionCompanyAdmin(request.getCompanyId()); } ShiftDto shiftDto = this.shiftService.createShift(request); return new GenericShiftResponse(shiftDto); } }
ShiftController { @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) public GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request) { if (AuthConstant.AUTHORIZATION_AUTHENTICATED_USER.equals(AuthContext.getAuthz())) { permissionService.checkPermissionCompanyAdmin(request.getCompanyId()); } ShiftDto shiftDto = this.shiftService.createShift(request); return new GenericShiftResponse(shiftDto); }  }
ShiftController { @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) public GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request) { if (AuthConstant.AUTHORIZATION_AUTHENTICATED_USER.equals(AuthContext.getAuthz())) { permissionService.checkPermissionCompanyAdmin(request.getCompanyId()); } ShiftDto shiftDto = this.shiftService.createShift(request); return new GenericShiftResponse(shiftDto); }  @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request); @PostMapping(path = "/list_worker_shifts") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER, AuthConstant.AUTHORIZATION_BOT_SERVICE, AuthConstant.AUTHORIZATION_ICAL_SERVICE }) GenericShiftListResponse listWorkerShifts(@RequestBody @Validated WorkerShiftListRequest request); @PostMapping(path = "/list_shifts") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftListResponse listShifts(@RequestBody @Validated ShiftListRequest request); @PostMapping(path = "/bulk_publish") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftListResponse bulkPublishShifts(@RequestBody @Validated BulkPublishShiftsRequest request); @GetMapping(path = "/get") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse getShift(@RequestParam String shiftId, @RequestParam String teamId, @RequestParam  String companyId); @PutMapping(path = "/update") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse updateShift(@RequestBody @Validated ShiftDto shiftDto); @DeleteMapping(path = "/delete") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) BaseResponse deleteShift(@RequestParam String shiftId, @RequestParam String teamId, @RequestParam String companyId); }
ShiftController { @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) public GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request) { if (AuthConstant.AUTHORIZATION_AUTHENTICATED_USER.equals(AuthContext.getAuthz())) { permissionService.checkPermissionCompanyAdmin(request.getCompanyId()); } ShiftDto shiftDto = this.shiftService.createShift(request); return new GenericShiftResponse(shiftDto); }  @PostMapping(path = "/create") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse createShift(@RequestBody @Validated CreateShiftRequest request); @PostMapping(path = "/list_worker_shifts") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER, AuthConstant.AUTHORIZATION_BOT_SERVICE, AuthConstant.AUTHORIZATION_ICAL_SERVICE }) GenericShiftListResponse listWorkerShifts(@RequestBody @Validated WorkerShiftListRequest request); @PostMapping(path = "/list_shifts") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftListResponse listShifts(@RequestBody @Validated ShiftListRequest request); @PostMapping(path = "/bulk_publish") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftListResponse bulkPublishShifts(@RequestBody @Validated BulkPublishShiftsRequest request); @GetMapping(path = "/get") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse getShift(@RequestParam String shiftId, @RequestParam String teamId, @RequestParam  String companyId); @PutMapping(path = "/update") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) GenericShiftResponse updateShift(@RequestBody @Validated ShiftDto shiftDto); @DeleteMapping(path = "/delete") @Authorize(value = { AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.AUTHORIZATION_SUPPORT_USER }) BaseResponse deleteShift(@RequestParam String shiftId, @RequestParam String teamId, @RequestParam String companyId);  }