Subversion Repositories SmartDukaan

Rev

Rev 32494 | Rev 33247 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22550 ashik.ali 1
package com.spice.profitmandi.service.wallet;
2
 
30677 amit.gupta 3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
4
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
5
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
6
import in.shop2020.model.v1.order.WalletReferenceType;
7
import org.springframework.stereotype.Service;
8
 
22550 ashik.ali 9
import java.time.LocalDateTime;
33194 amit.gupta 10
import java.util.Arrays;
22550 ashik.ali 11
import java.util.List;
23110 ashik.ali 12
import java.util.Map;
13
import java.util.Set;
22550 ashik.ali 14
 
15
@Service
16
public interface WalletService {
33194 amit.gupta 17
 
18
	List<WalletReferenceType> CN_WALLET_REFERENCES = Arrays.asList(WalletReferenceType.PRICE_DROP, WalletReferenceType.SCHEME_IN, WalletReferenceType.SCHEME_OUT, WalletReferenceType.ADDITIONAL_SCHEME, WalletReferenceType.SPECIAL_SUPPORT);
26498 amit.gupta 19
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
30889 amit.gupta 20
 
26498 amit.gupta 21
	public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
30889 amit.gupta 22
 
22550 ashik.ali 23
	UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException;
30889 amit.gupta 24
 
23509 amit.gupta 25
	UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException;
30889 amit.gupta 26
 
22550 ashik.ali 27
	List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;
30889 amit.gupta 28
 
22550 ashik.ali 29
	List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;
30889 amit.gupta 30
 
22550 ashik.ali 31
	public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;
30889 amit.gupta 32
 
22550 ashik.ali 33
	public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;
30889 amit.gupta 34
 
23110 ashik.ali 35
	public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds);
30677 amit.gupta 36
 
30889 amit.gupta 37
	void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
38
								 String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException;
39
 
23509 amit.gupta 40
	public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
30677 amit.gupta 41
										 String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;
42
 
23504 ashik.ali 43
	public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 44
 
24509 amit.gupta 45
	public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 46
 
28517 amit.gupta 47
	public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 48
 
28241 amit.gupta 49
	public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
30677 amit.gupta 50
								  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;
51
 
25547 amit.gupta 52
	public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;
30677 amit.gupta 53
 
25609 amit.gupta 54
	List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 55
 
28596 amit.gupta 56
	Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds);
30677 amit.gupta 57
 
58
	void resetWallet() throws ProfitMandiBusinessException;
32494 amit.gupta 59
 
60
	int getManualReference(WalletReferenceType referenceType);
22550 ashik.ali 61
}