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 EmailProperties
emailProperties
private EmailSenderService
emailSenderService
private GeoLocationService
geoLocationService
private static com.fasterxml.jackson.databind.ObjectMapper
mapper
private org.springframework.data.mongodb.core.MongoTemplate
mongoTemplate
private ProfileManagementService
profileManagementService
private SellerRepository
sellerRepository
private SequenceGeneratorService
sequenceGenerator
private MongoStorageService
storageService
private TokenService
tokenService
private TranslationService
translationService
private UserManagementService
userManagementService
-
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.SellerRepository
getRepository()
SellerDTO
mapSellerToDto(Seller seller, boolean optimal)
This method does map product entity to dto objectSellerDTO
mapSellerToDto(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)
This method does map product entity to dto objectSeller
registerCustomerFull(java.util.LinkedHashMap<java.lang.String,java.lang.Object> customerAsMap)
This method does a registration for customerProfile
registerCustomerSimplified(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)
This method does a registration for userco.mastermindcms.modules.beans.SearchResponse
searchCustomers(java.util.LinkedHashMap<java.lang.String,java.lang.Object> requestAsMap)
This method does search requests and returns data as list.co.mastermindcms.modules.beans.SearchResponse
searchCustomersLightweight(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.void
sendVerificationEmail(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userAsMap)
Sends a verification email to the user.Seller
updateCustomer(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.Profile
updateCustomerProfile(java.util.LinkedHashMap<java.lang.String,java.lang.Object> userProfileAsMap)
Updates the customer profile with the provided user profile information.boolean
validatePasswordResetToken(java.lang.String passwordResetToken)
This method returns a boolean value.boolean
validateVerificationToken(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:
getRepository
in 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:CustomerService
This method does calculation for a pages based on the request.- Specified by:
getPaginationCustomers
in 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:CustomerService
This method returns a boolean value.- Specified by:
validateVerificationToken
in interfaceCustomerService
- Parameters:
verificationToken
- database entity id- Returns:
- boolean value to externally interaction
-
validatePasswordResetToken
public boolean validatePasswordResetToken(java.lang.String passwordResetToken)
Description copied from interface:CustomerService
This method returns a boolean value.- Specified by:
validatePasswordResetToken
in 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:CustomerService
Sends a verification email to the user.- Specified by:
sendVerificationEmail
in 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:CustomerService
This method does search requests and returns data as list.- Specified by:
searchCustomers
in 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:CustomerService
Retrieves lightweight customers based on the given request JSON.- Specified by:
searchCustomersLightweight
in 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:CustomerService
This method does search requests and returns data as pages.- Specified by:
getCustomersPaged
in 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:CustomerService
This method does a registration for customer- Specified by:
registerCustomerFull
in 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:CustomerService
This method does search requests and returns data as list.- Specified by:
searchEmployees
in 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:CustomerService
This method does search requests and returns data as pages.- Specified by:
searchEmployeesPaged
in 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:CustomerService
This method does a registration for user- Specified by:
registerCustomerSimplified
in 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:CustomerService
Updates the customer object of the seller with the provided data in the form of a LinkedHashMap.- Specified by:
updateCustomer
in 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:CustomerService
Updates the customer profile with the provided user profile information.- Specified by:
updateCustomerProfile
in 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:CustomerService
This method does map product entity to dto object- Specified by:
mapSellerToDto
in 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:CustomerService
This method does map product entity to dto object- Specified by:
mapSellerToDto
in interfaceCustomerService
- Parameters:
seller
- database entity which be used to map to dtooptimal
- this pointer optimises the data transfer object- Returns:
- data transport object
-
-