Subversion Repositories SmartDukaan

Rev

Rev 25253 | Rev 25255 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25253 Rev 25254
Line 26... Line 26...
26
@Component
26
@Component
27
public class WalletServiceImpl implements WalletService {
27
public class WalletServiceImpl implements WalletService {
28
 
28
 
29
	private static final Logger LOGGER = LogManager.getLogger(WalletServiceImpl.class);
29
	private static final Logger LOGGER = LogManager.getLogger(WalletServiceImpl.class);
30
	
30
	
31
	private boolean underMaintainance = false;
31
	private boolean underMaintainance = true;
32
	ProfitMandiBusinessException pbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Wallet is under maintainance, please try after some time");
32
	ProfitMandiBusinessException pbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Wallet is under maintainance, please try after some time");
33
 
33
 
34
	@Autowired
34
	@Autowired
35
	private UserAccountRepository userAccountRepository;
35
	private UserAccountRepository userAccountRepository;
36
 
36
 
Line 41... Line 41...
41
	private UserWalletHistoryRepository userWalletHistoryRepository;
41
	private UserWalletHistoryRepository userWalletHistoryRepository;
42
 
42
 
43
	@Override
43
	@Override
44
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
44
	public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
45
			String description, float amount) throws ProfitMandiBusinessException {
45
			String description, float amount) throws ProfitMandiBusinessException {
46
		if(underMaintainance) {
46
		if(underMaintainance && !referenceType.equals(WalletReferenceType.SCHEME_OUT)) {
47
			throw pbse;
47
			throw pbse;
48
		}
48
		}
49
		if (amount == 0)
49
		if (amount == 0)
50
			return;
50
			return;
51
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
51
		UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);