Interface CustomerServiceApi


public interface CustomerServiceApi
CustomerServiceApi contains all the api operations handling CustomerService in the DzidziApp.
  • Method Details

    • findServiceById

      CustomerService findServiceById(UUID serviceId)
      Finds the customer service rep by id.
      Parameters:
      serviceId - the service id
      Returns:
      the customer service found
      Throws:
      com.dzidzi.exception.EntityNotFoundException - when customer service is not found
    • createCustomerRep

      CustomerService createCustomerRep(AddCustomerServiceRequest addCustomerServiceRequest, String verificationCode)
      Adds/creates a new customer service rep. To be able to create a new customer service rep, credential is needed. See CredentialApi.addNewUserCredentialByAdmin(String, UserRole) on how to create credential.
      Parameters:
      addCustomerServiceRequest - the AddCustomerServiceRequest to create/add a new customer service rep
      verificationCode - the verification code
      Returns:
      the newly created/added customer service rep
    • editCustomerRep

      CustomerService editCustomerRep(ChangeCustomerServiceRequest changeCustomerServiceRequest)
      Changes the fields/all fields of an existing customer service rep. The service id is obtained from the DzidziContextHolder, that is a user can edit their information only when logged in.
      Parameters:
      changeCustomerServiceRequest - the ChangeCustomerServiceRequest containing the fields to change
      Returns:
      the updated customer service
    • findServiceVerificationCode

      CustomerService findServiceVerificationCode(String verificationCode)
      Finds the customer service by verification code.
      Parameters:
      verificationCode - the verification code
      Returns:
      the customer serviceDTO found
      Throws:
      com.dzidzi.exception.EntityNotFoundException - when customer service is not found
    • getUserByCredentialId

      CustomerService getUserByCredentialId()
    • findServices

      DzidziPaginationDTO<CustomerService> findServices(FindServiceRequest findServiceRequest)
      Finds the paginated customer services based on the request.
      Parameters:
      findServiceRequest - the request containing the params to filter customer services on
      Returns:
      the DzidziPaginationDTO
    • removeAccount

      void removeAccount(UUID serviceId)
      Removes a customer service user from the system by an admin.
    • deactivateAccount

      void deactivateAccount(UUID serviceId)
      Deactivates the customer service account by the given service id.
    • reactivateAccount

      void reactivateAccount(String email)
      An email is sent to verify the user and activates the account.
      Parameters:
      email - the email of the deactivated account