Subversion Repositories SmartDukaan

Rev

Rev 28517 | Rev 30677 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.service.wallet;

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

import org.springframework.stereotype.Service;

import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;

import in.shop2020.model.v1.order.WalletReferenceType;

@Service
public interface WalletService {
        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);
        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);
        
}