Class SellerRegistrationServiceImpl

    • Constructor Detail

      • SellerRegistrationServiceImpl

        public SellerRegistrationServiceImpl()
    • Method Detail

      • registerSeller

        @Transactional
        public java.util.Optional<Seller> registerSeller​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerAsMap)
        Description copied from interface: SellerRegistrationService
        This method creates a database entity.
        Specified by:
        registerSeller in interface SellerRegistrationService
        Parameters:
        sellerAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • sendContactSupplierEmail

        public void sendContactSupplierEmail​(java.lang.String sellerId,
                                             java.lang.String messageText,
                                             java.lang.String topic)
        Description copied from interface: SellerRegistrationService
        This method sends a email for contact supplier.
        Specified by:
        sendContactSupplierEmail in interface SellerRegistrationService
        Parameters:
        sellerId - identification database entity who send email
        messageText - email massage text
        topic - email message topic
      • saveSeller

        @Transactional
        public Seller saveSeller​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerAsMap)
        Description copied from interface: SellerRegistrationService
        This method saves database entity.
        Specified by:
        saveSeller in interface SellerRegistrationService
        Parameters:
        sellerAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • updateSeller

        @Transactional
        public Seller updateSeller​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> sellerAsMap,
                                   java.lang.Boolean verifyRequired)
        Description copied from interface: SellerRegistrationService
        This method save an updates of database entity.
        Specified by:
        updateSeller in interface SellerRegistrationService
        Parameters:
        sellerAsMap - map-representation of database entity
        verifyRequired - boolean value
        Returns:
        saved instance of database entity
      • removeSellerAndClean

        @Transactional
        public void removeSellerAndClean​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeSellerAndClean in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be removed
      • removeSellersByIds

        @Transactional
        public void removeSellersByIds​(java.util.ArrayList<java.lang.String> sellersIds)
        Description copied from interface: SellerRegistrationService
        This method removes a list of database entities.
        Specified by:
        removeSellersByIds in interface SellerRegistrationService
        Parameters:
        sellersIds - the list of database entities which will be removed
      • getSellerSellerSkus

        public java.util.List<SellerSKU> getSellerSellerSkus​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method returns data as list.
        Specified by:
        getSellerSellerSkus in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which related entities list be returned
        Returns:
        database entities as list
      • getCountryBySellerId

        public Country getCountryBySellerId​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method returns data as list.
        Specified by:
        getCountryBySellerId in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which related entities list be returned
        Returns:
        country entity
      • isTariffPaid

        public boolean isTariffPaid​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method checks is database entity field had some value.
        Specified by:
        isTariffPaid in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isTariffNotPaid

        public boolean isTariffNotPaid​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method checks is database entity field had some value.
        Specified by:
        isTariffNotPaid in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isFavoriteSellerNotExists

        public boolean isFavoriteSellerNotExists​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method checks is not exists database entity.
        Specified by:
        isFavoriteSellerNotExists in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isFavoriteSellerExists

        public boolean isFavoriteSellerExists​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method checks is exists database entity.
        Specified by:
        isFavoriteSellerExists in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isFavoriteSellerSkuNotExists

        public boolean isFavoriteSellerSkuNotExists​(java.lang.String sellerSkuId)
        Description copied from interface: SellerRegistrationService
        This method checks is not exists database entity.
        Specified by:
        isFavoriteSellerSkuNotExists in interface SellerRegistrationService
        Parameters:
        sellerSkuId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isFavoriteSellerSkuExists

        public boolean isFavoriteSellerSkuExists​(java.lang.String sellerSkuId)
        Description copied from interface: SellerRegistrationService
        This method checks is exists database entity.
        Specified by:
        isFavoriteSellerSkuExists in interface SellerRegistrationService
        Parameters:
        sellerSkuId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isEmailNotificationEnabled

        public java.util.Map<java.lang.String,​java.lang.Boolean> isEmailNotificationEnabled​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method checks and returns map
        Specified by:
        isEmailNotificationEnabled in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which will be checked
        Returns:
        value as boolean
      • getSellerDocumentUrls

        public java.util.List<Attachment> getSellerDocumentUrls​(java.lang.String sellerId,
                                                                java.lang.String type)
        Description copied from interface: SellerRegistrationService
        This method returns data as list.
        Specified by:
        getSellerDocumentUrls in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which related beans list be returned
        type - field for database entity from filter
        Returns:
        database beans as list
      • addFavoriteSeller

        @Transactional
        public java.util.HashSet<java.lang.String> addFavoriteSeller​(java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method adds database entity at already in the existing database entities list.
        Specified by:
        addFavoriteSeller in interface SellerRegistrationService
        Parameters:
        sellerId - identification for database entity which added in list
        Returns:
        database entities as list
      • addFavoriteSellerSKU

        @Transactional
        public java.util.LinkedHashSet<java.lang.String> addFavoriteSellerSKU​(java.lang.String sellerSkuId)
        Description copied from interface: SellerRegistrationService
        This method adds database entity at already in the existing database entities list.
        Specified by:
        addFavoriteSellerSKU in interface SellerRegistrationService
        Parameters:
        sellerSkuId - identification for database entity which added in list
        Returns:
        database entities as list
      • getSellers

        public java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSellers()
        Description copied from interface: SellerRegistrationService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getSellers in interface SellerRegistrationService
        Returns:
        map-representation of data
      • changeProfileEmbeddedParent

        @Transactional
        public void changeProfileEmbeddedParent​(java.lang.String profileId,
                                                java.lang.String sellerId)
        Description copied from interface: SellerRegistrationService
        This method updates database entities.
        Specified by:
        changeProfileEmbeddedParent in interface SellerRegistrationService
        Parameters:
        profileId - identification for database entity which will be updated
        sellerId - identification for database entity which will be updated
      • addRelations

        private void addRelations​(Seller seller)
      • prepareRelations

        private void prepareRelations​(Seller seller)
      • removeRelations

        private void removeRelations​(Seller sUI,
                                     Seller sDB)
      • removeProfilesFromSeller

        private void removeProfilesFromSeller​(java.lang.String sellerId)
      • removeProfileFromSeller

        private void removeProfileFromSeller​(java.lang.String sellerId,
                                             java.lang.String profileId)
      • removeSellerFromCertificates

        private void removeSellerFromCertificates​(java.lang.String sellerId)
      • removeSellerFromCertificate

        private void removeSellerFromCertificate​(java.lang.String sellerId,
                                                 java.lang.String certificateId)
      • removeSellerAndSellerSKUs

        private void removeSellerAndSellerSKUs​(java.lang.String sellerId)
      • removeSellerSkuFromSeller

        private void removeSellerSkuFromSeller​(java.lang.String sellerId,
                                               java.lang.String sellerSkuId)
      • removeSellerFromAddress

        private void removeSellerFromAddress​(java.lang.String sellerId)
      • removeDocumentFromSeller

        private void removeDocumentFromSeller​(java.lang.String sellerId,
                                              java.lang.String docUrl)
      • removeImageUrlFromSeller

        private void removeImageUrlFromSeller​(java.lang.String sellerId,
                                              java.lang.String imageUrl)
      • removeCategoryFromSeller

        private void removeCategoryFromSeller​(java.lang.String sellerId,
                                              java.lang.String catId)
      • removeProductFromSeller

        private void removeProductFromSeller​(java.lang.String sellerId,
                                             java.lang.String prodId)
      • deactivateAllProfiles

        private void deactivateAllProfiles​(java.lang.String sellerId)
      • updateAddressFromSeller

        private void updateAddressFromSeller​(Seller seller,
                                             Seller sellerDB)
      • updateProfilesFromSeller

        private void updateProfilesFromSeller​(Seller seller,
                                              Seller sellerDB,
                                              boolean verifyRequired)
      • updateUser

        @NotNull
        private User updateUser​(User user,
                                Profile profileDB,
                                User userDB,
                                java.lang.String password,
                                boolean verifyRequired)