Subversion Repositories SmartDukaan

Rev

Rev 28596 | Rev 30889 | 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;
10
import java.util.List;
23110 ashik.ali 11
import java.util.Map;
12
import java.util.Set;
22550 ashik.ali 13
 
14
@Service
15
public interface WalletService {
26498 amit.gupta 16
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
17
	public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
22550 ashik.ali 18
	UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException;
23509 amit.gupta 19
	UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException;
22550 ashik.ali 20
	List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;
21
	List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;
22
	public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;
23
	public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;
23110 ashik.ali 24
	public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds);
30677 amit.gupta 25
 
23509 amit.gupta 26
	public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
30677 amit.gupta 27
										 String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;
28
 
23504 ashik.ali 29
	public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 30
 
24509 amit.gupta 31
	public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 32
 
28517 amit.gupta 33
	public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 34
 
28241 amit.gupta 35
	public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
30677 amit.gupta 36
								  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;
37
 
25547 amit.gupta 38
	public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;
30677 amit.gupta 39
 
25609 amit.gupta 40
	List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 41
 
28596 amit.gupta 42
	Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds);
30677 amit.gupta 43
 
44
	void resetWallet() throws ProfitMandiBusinessException;
22550 ashik.ali 45
}