class MonitoringOfficerInviteController {

    @PostMapping("/create-pending-monitoring-officer")
    public RestResult<Void> createPendingMonitoringOfficer(@RequestBody MonitoringOfficerCreateResource resource) {

        boolean userAlreadyExists = userService.findByEmail(resource.getEmailAddress()).isSuccess();
        if (userAlreadyExists) {
            return restSuccess();
        }
        return registrationService.createUser(anUserCreationResource()
                .withFirstName(resource.getFirstName())
                .withLastName(resource.getLastName())
                .withEmail(resource.getEmailAddress())
                .withRole(Role.MONITORING_OFFICER)
                .build())
                .andOnSuccessReturnVoid()
                .toPostCreateResponse();
    }

    public  MonitoringOfficerInviteController(MonitoringOfficerInviteService monitoringOfficerInviteService,
                                             RegistrationService registrationService,
                                             CrmService crmService,
                                             UserService userService);

}