Subversion Repositories SmartDukaan

Rev

Rev 33685 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.service.wallet;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
import in.shop2020.model.v1.order.WalletReferenceType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public interface WalletService {

        List<WalletReferenceType> CN_WALLET_REFERENCES = Arrays.asList(WalletReferenceType.PRICE_DROP, WalletReferenceType.SCHEME_IN, WalletReferenceType.SCHEME_OUT, WalletReferenceType.ADDITIONAL_SCHEME, WalletReferenceType.SPECIAL_SUPPORT, WalletReferenceType.INVESTMENT_PAYOUT);
        public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;

        public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;

        UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException;

        UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException;

        List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;

        List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;

        public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;

        public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;

    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException;

        void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
                                                                 String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException;

        public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
                                                                                 String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;

        public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;

        public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;

        public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;

        public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
                                                                  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;

        public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;

        List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;

    Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException;

        void resetWallet() throws ProfitMandiBusinessException;

        int getManualReference(WalletReferenceType referenceType);

        ResponseEntity<?> createAddWalletRequestReport(LocalDateTime startDate, LocalDateTime endDate, AddWalletRequestStatus status) throws Exception;
}