| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service.wallet;
|
1 |
package com.spice.profitmandi.service.wallet;
|
| 2 |
|
2 |
|
| 3 |
import java.time.LocalDateTime;
|
- |
|
| 4 |
import java.util.List;
|
- |
|
| 5 |
import java.util.Map;
|
- |
|
| 6 |
import java.util.Set;
|
- |
|
| 7 |
|
- |
|
| 8 |
import org.springframework.stereotype.Service;
|
- |
|
| 9 |
|
- |
|
| 10 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 11 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
4 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
| 12 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
5 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 13 |
|
- |
|
| 14 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
6 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| - |
|
7 |
import org.springframework.stereotype.Service;
|
| - |
|
8 |
|
| - |
|
9 |
import java.time.LocalDateTime;
|
| - |
|
10 |
import java.util.List;
|
| - |
|
11 |
import java.util.Map;
|
| - |
|
12 |
import java.util.Set;
|
| 15 |
|
13 |
|
| 16 |
@Service
|
14 |
@Service
|
| 17 |
public interface WalletService {
|
15 |
public interface WalletService {
|
| 18 |
public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
|
16 |
public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType, String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException;
|
| 19 |
public void consumeAmountFromWallet(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;
|
| Line 22... |
Line 20... |
| 22 |
List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;
|
20 |
List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException;
|
| 23 |
List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;
|
21 |
List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId) throws ProfitMandiBusinessException;
|
| 24 |
public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;
|
22 |
public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit) throws ProfitMandiBusinessException;
|
| 25 |
public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;
|
23 |
public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime) throws ProfitMandiBusinessException;
|
| 26 |
public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds);
|
24 |
public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds);
|
| - |
|
25 |
|
| 27 |
public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
|
26 |
public void rollbackAmountFromWallet(int fofoId, float amountToRollback, int rollbackReference, WalletReferenceType walletReferenceType,
|
| 28 |
String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;
|
27 |
String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException;
|
| - |
|
28 |
|
| 29 |
public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;
|
29 |
public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType) throws ProfitMandiBusinessException;
|
| - |
|
30 |
|
| 30 |
public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
|
31 |
public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
|
| - |
|
32 |
|
| 31 |
public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
|
33 |
public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException;
|
| - |
|
34 |
|
| 32 |
public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
|
35 |
public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
|
| 33 |
WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;
|
36 |
WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException;
|
| - |
|
37 |
|
| 34 |
public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;
|
38 |
public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException;
|
| - |
|
39 |
|
| 35 |
List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;
|
40 |
List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType) throws ProfitMandiBusinessException;
|
| - |
|
41 |
|
| 36 |
Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds);
|
42 |
Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> retailerIds);
|
| 37 |
|
43 |
|
| - |
|
44 |
void resetWallet() throws ProfitMandiBusinessException;
|
| 38 |
}
|
45 |
}
|