Subversion Repositories SmartDukaan

Rev

Rev 33685 | 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;
34261 tejus.loha 6
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
30677 amit.gupta 7
import in.shop2020.model.v1.order.WalletReferenceType;
34261 tejus.loha 8
import org.springframework.http.ResponseEntity;
30677 amit.gupta 9
import org.springframework.stereotype.Service;
10
 
22550 ashik.ali 11
import java.time.LocalDateTime;
33194 amit.gupta 12
import java.util.Arrays;
22550 ashik.ali 13
import java.util.List;
23110 ashik.ali 14
import java.util.Map;
15
import java.util.Set;
22550 ashik.ali 16
 
17
@Service
18
public interface WalletService {
33194 amit.gupta 19
 
33685 amit.gupta 20
	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);
26498 amit.gupta 21
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
30889 amit.gupta 22
 
26498 amit.gupta 23
	public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
30889 amit.gupta 24
 
22550 ashik.ali 25
	UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException;
30889 amit.gupta 26
 
23509 amit.gupta 27
	UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException;
30889 amit.gupta 28
 
22550 ashik.ali 29
	List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;
30889 amit.gupta 30
 
22550 ashik.ali 31
	List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;
30889 amit.gupta 32
 
22550 ashik.ali 33
	public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;
30889 amit.gupta 34
 
22550 ashik.ali 35
	public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;
30889 amit.gupta 36
 
33247 ranu 37
    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException;
30677 amit.gupta 38
 
30889 amit.gupta 39
	void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
40
								 String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException;
41
 
23509 amit.gupta 42
	public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
30677 amit.gupta 43
										 String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;
44
 
23504 ashik.ali 45
	public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 46
 
24509 amit.gupta 47
	public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 48
 
28517 amit.gupta 49
	public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
30677 amit.gupta 50
 
28241 amit.gupta 51
	public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
30677 amit.gupta 52
								  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;
53
 
25547 amit.gupta 54
	public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;
30677 amit.gupta 55
 
25609 amit.gupta 56
	List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;
30677 amit.gupta 57
 
33247 ranu 58
    Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException;
30677 amit.gupta 59
 
60
	void resetWallet() throws ProfitMandiBusinessException;
32494 amit.gupta 61
 
62
	int getManualReference(WalletReferenceType referenceType);
34261 tejus.loha 63
 
64
	ResponseEntity<?> createAddWalletRequestReport(LocalDateTime startDate, LocalDateTime endDate, AddWalletRequestStatus status) throws Exception;
22550 ashik.ali 65
}