Package com.dzidzi.api
Interface CustomerServiceApi
public interface CustomerServiceApi
CustomerServiceApi contains all the api operations handling
CustomerService in the
DzidziApp.-
Method Summary
Modifier and TypeMethodDescriptioncreateCustomerRep(AddCustomerServiceRequest addCustomerServiceRequest, String verificationCode) Adds/creates a new customer service rep.voiddeactivateAccount(UUID serviceId) Deactivates the customer service account by the given service id.editCustomerRep(ChangeCustomerServiceRequest changeCustomerServiceRequest) Changes the fields/all fields of an existing customer service rep.findServiceById(UUID serviceId) Finds the customer service rep by id.findServices(FindServiceRequest findServiceRequest) Finds the paginated customer services based on the request.findServiceVerificationCode(String verificationCode) Finds the customer service by verification code.voidreactivateAccount(String email) An email is sent to verify the user and activates the account.voidremoveAccount(UUID serviceId) Removes a customer service user from the system by an admin.
-
Method Details
-
findServiceById
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. SeeCredentialApi.addNewUserCredentialByAdmin(String, UserRole)on how to create credential.- Parameters:
addCustomerServiceRequest- theAddCustomerServiceRequestto create/add a new customer service repverificationCode- the verification code- Returns:
- the newly created/added customer service rep
-
editCustomerRep
Changes the fields/all fields of an existing customer service rep. The service id is obtained from theDzidziContextHolder, that is a user can edit their information only when logged in.- Parameters:
changeCustomerServiceRequest- theChangeCustomerServiceRequestcontaining the fields to change- Returns:
- the updated customer service
-
findServiceVerificationCode
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
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
Removes a customer service user from the system by an admin. -
deactivateAccount
Deactivates the customer service account by the given service id. -
reactivateAccount
An email is sent to verify the user and activates the account.- Parameters:
email- the email of the deactivated account
-