Subversion Repositories SmartDukaan

Rev

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