Class CustomerServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.CustomerServiceImpl
-
- All Implemented Interfaces:
CustomerService
@Service public class CustomerServiceImpl extends java.lang.Object implements CustomerService
-
-
Field Summary
Fields Modifier and Type Field Description private EmailPropertiesemailPropertiesprivate EmailSenderServiceemailSenderServiceprivate GeoLocationServicegeoLocationServiceprivate static com.fasterxml.jackson.databind.ObjectMappermapperprivate org.springframework.data.mongodb.core.MongoTemplatemongoTemplateprivate ProfileManagementServiceprofileManagementServiceprivate SellerRepositorysellerRepositoryprivate SequenceGeneratorServicesequenceGeneratorprivate MongoStorageServicestorageServiceprivate TokenServicetokenServiceprivate TranslationServicetranslationServiceprivate UserManagementServiceuserManagementService
-
Constructor Summary
Constructors Constructor Description CustomerServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.springframework.data.domain.Page<Seller>getCustomersPaged(java.lang.String requestJson)Deprecated.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>getPaginationCustomers(java.lang.String requestJson)Deprecated.SellerRepositorygetRepository()SellerDTOmapSellerToDto(Seller seller, boolean optimal)This method does map product entity to dto objectSellerDTOmapSellerToDto(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)This method does map product entity to dto objectSellerregisterCustomerFull(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)This method does a registration for customerProfileregisterCustomerSimplified(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)This method does a registration for userco.mastermindcms.modules.beans.SearchResponsesearchCustomers(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestAsMap)This method does search requests and returns data as list.co.mastermindcms.modules.beans.SearchResponsesearchCustomersLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestAsMap)Retrieves lightweight customers based on the given request JSON.java.util.LinkedHashSet<Profile>searchEmployees(java.lang.String requestJson)This method does search requests and returns data as list.org.springframework.data.domain.Page<Profile>searchEmployeesPaged(java.lang.String requestJson)This method does search requests and returns data as pages.voidsendVerificationEmail(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userAsMap)Sends a verification email to the user.SellerupdateCustomer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> sellerAsMap)Updates the customer object of the seller with the provided data in the form of a LinkedHashMap.ProfileupdateCustomerProfile(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)Updates the customer profile with the provided user profile information.booleanvalidatePasswordResetToken(java.lang.String passwordResetToken)This method returns a boolean value.booleanvalidateVerificationToken(java.lang.String verificationToken)This method returns a boolean value.
-
-
-
Field Detail
-
mongoTemplate
@Autowired private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
-
sellerRepository
@Autowired private SellerRepository sellerRepository
-
geoLocationService
@Autowired private GeoLocationService geoLocationService
-
storageService
@Autowired private MongoStorageService storageService
-
translationService
@Autowired private TranslationService translationService
-
userManagementService
@Autowired private UserManagementService userManagementService
-
profileManagementService
@Autowired private ProfileManagementService profileManagementService
-
sequenceGenerator
@Autowired private SequenceGeneratorService sequenceGenerator
-
emailSenderService
@Autowired private EmailSenderService emailSenderService
-
emailProperties
@Autowired private EmailProperties emailProperties
-
tokenService
@Autowired private TokenService tokenService
-
mapper
private static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
getRepository
public SellerRepository getRepository()
- Specified by:
getRepositoryin interfaceCustomerService
-
getPaginationCustomers
@Deprecated public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationCustomers(java.lang.String requestJson)
Deprecated.Description copied from interface:CustomerServiceThis method does calculation for a pages based on the request.- Specified by:
getPaginationCustomersin interfaceCustomerService- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
validateVerificationToken
public boolean validateVerificationToken(java.lang.String verificationToken)
Description copied from interface:CustomerServiceThis method returns a boolean value.- Specified by:
validateVerificationTokenin interfaceCustomerService- Parameters:
verificationToken- database entity id- Returns:
- boolean value to externally interaction
-
validatePasswordResetToken
public boolean validatePasswordResetToken(java.lang.String passwordResetToken)
Description copied from interface:CustomerServiceThis method returns a boolean value.- Specified by:
validatePasswordResetTokenin interfaceCustomerService- Parameters:
passwordResetToken- database entity id- Returns:
- boolean value to externally interaction
-
sendVerificationEmail
public void sendVerificationEmail(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userAsMap)
Description copied from interface:CustomerServiceSends a verification email to the user.- Specified by:
sendVerificationEmailin interfaceCustomerService- Parameters:
userAsMap- the user information as a LinkedHashMap<String, Object>. It contains the user's email and other relevant details.
-
searchCustomers
public co.mastermindcms.modules.beans.SearchResponse searchCustomers(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestAsMap)
Description copied from interface:CustomerServiceThis method does search requests and returns data as list.- Specified by:
searchCustomersin interfaceCustomerService- Parameters:
requestAsMap- search request- Returns:
- data transport entities as list
-
searchCustomersLightweight
public co.mastermindcms.modules.beans.SearchResponse searchCustomersLightweight(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestAsMap)
Description copied from interface:CustomerServiceRetrieves lightweight customers based on the given request JSON.- Specified by:
searchCustomersLightweightin interfaceCustomerService- Parameters:
requestAsMap- a LinkedHashMap containing the request parameters- Returns:
- a SearchResponse object containing the lightweight customers
-
getCustomersPaged
@Deprecated public org.springframework.data.domain.Page<Seller> getCustomersPaged(java.lang.String requestJson)
Deprecated.Description copied from interface:CustomerServiceThis method does search requests and returns data as pages.- Specified by:
getCustomersPagedin interfaceCustomerService- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
registerCustomerFull
public Seller registerCustomerFull(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)
Description copied from interface:CustomerServiceThis method does a registration for customer- Specified by:
registerCustomerFullin interfaceCustomerService- Parameters:
customerAsMap- map-representation of database entity- Returns:
- registered customer as database object
-
searchEmployees
public java.util.LinkedHashSet<Profile> searchEmployees(java.lang.String requestJson)
Description copied from interface:CustomerServiceThis method does search requests and returns data as list.- Specified by:
searchEmployeesin interfaceCustomerService- Parameters:
requestJson- search request- Returns:
- data transport entities as list
-
searchEmployeesPaged
public org.springframework.data.domain.Page<Profile> searchEmployeesPaged(java.lang.String requestJson)
Description copied from interface:CustomerServiceThis method does search requests and returns data as pages.- Specified by:
searchEmployeesPagedin interfaceCustomerService- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
registerCustomerSimplified
public Profile registerCustomerSimplified(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)
Description copied from interface:CustomerServiceThis method does a registration for user- Specified by:
registerCustomerSimplifiedin interfaceCustomerService- Parameters:
userProfileAsMap- map-representation of database entity- Returns:
- registered user profile as database object
-
updateCustomer
public Seller updateCustomer(java.util.LinkedHashMap<java.lang.String,java.lang.Object> sellerAsMap)
Description copied from interface:CustomerServiceUpdates the customer object of the seller with the provided data in the form of a LinkedHashMap.- Specified by:
updateCustomerin interfaceCustomerService- Parameters:
sellerAsMap- a LinkedHashMap containing the updated customer data- Returns:
- the updated Seller object after updating the customer
-
updateCustomerProfile
public Profile updateCustomerProfile(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)
Description copied from interface:CustomerServiceUpdates the customer profile with the provided user profile information.- Specified by:
updateCustomerProfilein interfaceCustomerService- Parameters:
userProfileAsMap- A LinkedHashMap containing the user profile information as key-value pairs. The keys represent the profile attributes (e.g., "firstName", "emailAddress", "phone"), and the values represent the updated values for each attribute.- Returns:
- A Profile object containing the updated customer profile information.
-
mapSellerToDto
public SellerDTO mapSellerToDto(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)
Description copied from interface:CustomerServiceThis method does map product entity to dto object- Specified by:
mapSellerToDtoin interfaceCustomerService- Parameters:
customerAsMap- a LinkedHashMap containing the updated customer data- Returns:
- data transport object
-
mapSellerToDto
public SellerDTO mapSellerToDto(Seller seller, boolean optimal)
Description copied from interface:CustomerServiceThis method does map product entity to dto object- Specified by:
mapSellerToDtoin interfaceCustomerService- Parameters:
seller- database entity which be used to map to dtooptimal- this pointer optimises the data transfer object- Returns:
- data transport object
-
-