Subversion Repositories SmartDukaan

Rev

Rev 34575 | Rev 34752 | 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
 
30066 amit.gupta 3
import com.spice.profitmandi.common.enumuration.MessageType;
22550 ashik.ali 4
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
34261 tejus.loha 5
import com.spice.profitmandi.common.model.CustomRetailer;
30740 amit.gupta 6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
34261 tejus.loha 7
import com.spice.profitmandi.common.util.FileUtil;
30025 amit.gupta 8
import com.spice.profitmandi.common.util.FormattingUtils;
23269 ashik.ali 9
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
25542 amit.gupta 10
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
34261 tejus.loha 11
import com.spice.profitmandi.dao.entity.transaction.AddWalletRequest;
32494 amit.gupta 12
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
22550 ashik.ali 13
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
14
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
34674 aman.kumar 15
import com.spice.profitmandi.dao.entity.user.User;
22550 ashik.ali 16
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
34261 tejus.loha 17
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
18
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
32494 amit.gupta 19
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
25542 amit.gupta 20
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
33845 tejus.loha 21
import com.spice.profitmandi.dao.repository.dtr.PartnerOnBoardingPanelRepository;
33172 tejus.loha 22
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
22550 ashik.ali 23
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
24
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
25
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
33845 tejus.loha 26
import com.spice.profitmandi.dao.repository.user.StoreTimelinetbRepository;
34674 aman.kumar 27
import com.spice.profitmandi.dao.repository.user.UserRepository;
30025 amit.gupta 28
import com.spice.profitmandi.service.NotificationService;
30740 amit.gupta 29
import com.spice.profitmandi.service.PartnerInvestmentService;
34261 tejus.loha 30
import com.spice.profitmandi.service.order.OrderService;
31
import com.spice.profitmandi.service.user.RetailerService;
33845 tejus.loha 32
import com.spice.profitmandi.service.user.StoreTimelineTatService;
22857 ashik.ali 33
import in.shop2020.model.v1.order.WalletReferenceType;
30025 amit.gupta 34
import org.apache.logging.log4j.LogManager;
35
import org.apache.logging.log4j.Logger;
36
import org.springframework.beans.factory.annotation.Autowired;
34261 tejus.loha 37
import org.springframework.http.ResponseEntity;
30025 amit.gupta 38
import org.springframework.stereotype.Component;
22857 ashik.ali 39
 
30025 amit.gupta 40
import java.time.LocalDateTime;
41
import java.util.*;
42
import java.util.stream.Collectors;
43
 
22550 ashik.ali 44
@Component
45
public class WalletServiceImpl implements WalletService {
46
 
32494 amit.gupta 47
    private static final Logger LOGGER = LogManager.getLogger(WalletServiceImpl.class);
25395 tejbeer 48
 
32494 amit.gupta 49
    @Autowired
50
    ManualPaymentRequestRepository manualPaymentRequestRepository;
34261 tejus.loha 51
    @Autowired
52
    AddWalletRequestRepository addWalletRequestRepository;
53
    @Autowired
54
    OrderService orderService;
55
    @Autowired
56
    RetailerService retailerService;
33194 amit.gupta 57
    ProfitMandiBusinessException pbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Wallet is under maintainance, please try after some time");
58
    ProfitMandiBusinessException inactivepbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Investment is incomplete, please add amount to wallet to complete the investment");
59
 
32494 amit.gupta 60
    @Autowired
61
    PartnerInvestmentService partnerInvestmentService;
62
    private boolean underMaintainance = false;
63
    @Autowired
64
    private UserAccountRepository userAccountRepository;
33172 tejus.loha 65
 
32494 amit.gupta 66
    @Autowired
67
    private UserWalletRepository userWalletRepository;
68
    @Autowired
69
    private FofoStoreRepository fofoStoreRepository;
70
    @Autowired
71
    private UserWalletHistoryRepository userWalletHistoryRepository;
72
    @Autowired
73
    private NotificationService notificationService;
24739 tejbeer 74
 
33172 tejus.loha 75
    @Autowired
76
    RetailerRepository retailerRepository;
33845 tejus.loha 77
    @Autowired
78
    PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
79
    @Autowired
80
    StoreTimelineTatService storeTimelineTatService;
81
    @Autowired
82
    StoreTimelinetbRepository storeTimelinetbRepository;
33172 tejus.loha 83
 
34674 aman.kumar 84
    @Autowired
85
    UserRepository userRepository;
86
 
32494 amit.gupta 87
    @Override
88
    public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
89
                                  String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
90
        if (Math.round(amount) == 0)
91
            return;
92
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
33172 tejus.loha 93
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 94
        userWallet.setAmount(walletAmount + Math.round(amount));
95
        if (amount > 0) {
96
            notificationService.sendNotification(retailerId, "walletcredit", MessageType.wallet, "Rs." + FormattingUtils.formatDecimal(amount) + " credited in SD Wallet", description);
97
        }
98
        this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
99
    }
25609 amit.gupta 100
 
32494 amit.gupta 101
    @Override
102
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
103
                                        String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
104
        if (underMaintainance) {
105
            throw pbse;
106
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
107
            throw inactivepbse;
108
        }
109
        if (amount == 0)
110
            return;
111
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
33172 tejus.loha 112
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 113
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
33547 tejus.loha 114
        if (!WalletReferenceType.DAMAGE_PROTECTION.equals(referenceType) && amount > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE && Math.floor(amount) > walletAmount) {
34575 vikas.jang 115
            LOGGER.error("Wallet Balance is insufficient!, needed - {}, wallet has - {}, for retailer - {}", Math.floor(amount), walletAmount, retailerId);
34674 aman.kumar 116
            User user = userRepository.selectById(retailerId);
117
            throw new ProfitMandiBusinessException(user.getName(), walletAmount, "WLT_1000");
32494 amit.gupta 118
        }
119
        userWallet.setAmount(walletAmount - Math.round(amount));
120
        userWalletRepository.persist(userWallet);
121
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
122
    }
24739 tejbeer 123
 
32494 amit.gupta 124
    @Override
125
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
126
                                        String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException {
127
        if (underMaintainance) {
128
            throw pbse;
129
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
130
            throw inactivepbse;
131
        }
132
        if (amount == 0)
133
            return;
134
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
33172 tejus.loha 135
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 136
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
137
        if (!forced && amount > 2 && amount > walletAmount) {
138
            LOGGER.error("Wallet Balance is insufficient!");
139
            throw new ProfitMandiBusinessException("balance", walletAmount, "WLT_1000");
140
        }
141
        userWallet.setAmount(walletAmount - Math.round(amount));
142
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
143
    }
24739 tejbeer 144
 
32494 amit.gupta 145
    @Override
146
    public void rollbackAmountFromWallet(int retailerId, float amountToRollback, int rollbackReference,
147
                                         WalletReferenceType walletReferenceType, String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException {
25542 amit.gupta 148
 
32494 amit.gupta 149
        if (amountToRollback == 0)
150
            return;
33172 tejus.loha 151
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 152
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
153
        List<UserWalletHistory> uwh = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(rollbackReference, walletReferenceType)
154
                .stream().filter(x -> x.getWalletId() == userWallet.getId()).collect(Collectors.toList());
155
        if (uwh.size() == 0) {
156
            LOGGER.info("Retailer with id {} dont have valid reference {} and reference type {}",
157
                    retailerId, rollbackReference, walletReferenceType);
158
            throw new ProfitMandiBusinessException("Retailer specific wallet entries doesn't exist", retailerId, "Nothing to rollback");
159
        }
160
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
161
        userWallet.setAmount(walletAmount - Math.round(amountToRollback));
162
        this.createUserWalletHistory(-Math.round(amountToRollback), userWallet.getId(), rollbackReference,
163
                walletReferenceType, rollbackReason, businessTime);
164
        userWalletRepository.persist(userWallet);
24739 tejbeer 165
 
32494 amit.gupta 166
    }
30025 amit.gupta 167
 
32494 amit.gupta 168
    private void createUserWalletHistory(float amount, int walletId, int referenceId, WalletReferenceType referenceType,
169
                                         String description, LocalDateTime businessTimestamp) {
170
        if (amount == 0)
171
            return;
172
        UserWalletHistory userWalletHistory = new UserWalletHistory();
173
        userWalletHistory.setWalletId(walletId);
174
        userWalletHistory.setAmount(Math.round(amount));
175
        userWalletHistory.setReference(referenceId);
176
        userWalletHistory.setReferenceType(referenceType);
177
        userWalletHistory.setTimestamp(LocalDateTime.now());
178
        userWalletHistory.setDescription(description);
179
        userWalletHistory.setBusinessTimestamp(businessTimestamp);
180
        userWalletHistoryRepository.persist(userWalletHistory);
181
    }
24739 tejbeer 182
 
32494 amit.gupta 183
    @Override
184
    public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
185
        UserAccount userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
23509 amit.gupta 186
 
32494 amit.gupta 187
        if (underMaintainance) {
188
            throw pbse;
189
        }
190
        return userWalletRepository.selectByRetailerId(Integer.valueOf(userAccount.getAccountKey()));
191
    }
30889 amit.gupta 192
 
32494 amit.gupta 193
    @Override
194
    public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
195
        if (underMaintainance || !isActive(userId)) {
196
            throw pbse;
197
        }
198
        UserWallet userWallet = this.getUserWalletByUserId(userId);
199
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletId(userWallet.getId());
200
        return userWalletHistories;
201
    }
25395 tejbeer 202
 
32494 amit.gupta 203
    //Definition is now changed, active also means valid investment should be ok
204
    private boolean isActive(int userId) {
205
        boolean active = true;
206
        try {
207
            FofoStore fs = fofoStoreRepository.selectByRetailerId(userId);
208
            active = fs.isActive() && partnerInvestmentService.isInvestmentOk(userId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
209
        } catch (Exception e) {
24739 tejbeer 210
 
32494 amit.gupta 211
        }
212
        return active;
213
    }
24739 tejbeer 214
 
32494 amit.gupta 215
    @Override
216
    public List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId)
217
            throws ProfitMandiBusinessException {
218
        if (underMaintainance) {
219
            throw pbse;
220
        }
221
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
222
        return userWalletHistoryRepository.selectByWalletId(userWallet.getId());
223
    }
24739 tejbeer 224
 
32494 amit.gupta 225
    @Override
226
    public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime)
227
            throws ProfitMandiBusinessException {
228
        if (underMaintainance) {
229
            throw pbse;
230
        }
231
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
232
        return userWalletHistoryRepository.selectCountByWalletId(userWallet.getId(), startDateTime, endDateTime);
233
    }
25542 amit.gupta 234
 
32494 amit.gupta 235
    @Override
236
    public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId,
237
                                                                             LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit)
238
            throws ProfitMandiBusinessException {
239
        if (underMaintainance) {
240
            throw pbse;
241
        }
242
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
243
        return userWalletHistoryRepository.selectPaginatedByWalletId(userWallet.getId(), startDateTime, endDateTime,
244
                offset, limit);
245
    }
22550 ashik.ali 246
 
32494 amit.gupta 247
    @Override
33247 ranu 248
    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException {
32494 amit.gupta 249
        List<UserWallet> userWallets = userWalletRepository.selectByRetailerIds(retailerIds);
250
        Map<Integer, UserWallet> retailerIdUserWalletMap = new HashMap<>();
251
        for (UserWallet userWallet : userWallets) {
252
            retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
253
        }
254
        return retailerIdUserWalletMap;
255
    }
24739 tejbeer 256
 
32494 amit.gupta 257
    @Override
33247 ranu 258
    public Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> walletIds) throws ProfitMandiBusinessException {
32494 amit.gupta 259
        List<UserWallet> userWallets = userWalletRepository.selectAllById(walletIds);
260
        Map<Integer, Integer> walletRetailerMap = new HashMap<>();
261
        for (UserWallet userWallet : userWallets) {
262
            walletRetailerMap.put(userWallet.getId(), userWallet.getUserId());
263
        }
264
        return walletRetailerMap;
265
    }
30740 amit.gupta 266
 
32494 amit.gupta 267
    @Override
268
    public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
269
            throws ProfitMandiBusinessException {
270
        if (underMaintainance) {
271
            throw pbse;
272
        }
273
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
274
        return userWalletHistoryRepository.isExist(userWallet.getId(), referenceType, referenceId);
275
    }
25542 amit.gupta 276
 
32494 amit.gupta 277
    @Override
278
    public UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException {
279
        if (underMaintainance) {
280
            throw pbse;
281
        }
282
        try {
283
            return userWalletRepository.selectByRetailerId(retailerId);
284
        } catch (Exception e) {
285
            UserWallet uw = new UserWallet();
286
            uw.setAmount(0);
287
            uw.setRefundableAmount(0);
288
            uw.setUserId(retailerId);
289
            userWalletRepository.persist(uw);
290
            return uw;
291
        }
292
    }
25542 amit.gupta 293
 
32494 amit.gupta 294
    @Override
295
    public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
296
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
297
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date);
298
    }
24739 tejbeer 299
 
32494 amit.gupta 300
    @Override
301
    public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
302
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
303
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date) - userWalletHistoryRepository.getSumTillDate(wallet.getId(), date, WalletReferenceType.PURCHASE);
304
    }
24739 tejbeer 305
 
32494 amit.gupta 306
    @Override
307
    public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
308
                                  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
24739 tejbeer 309
 
32494 amit.gupta 310
        List<UserWalletHistory> all_entries = userWalletHistoryRepository
311
                .selectAllByreferenceIdandreferenceType(transactionId, walletReferenceType);
30449 amit.gupta 312
 
32494 amit.gupta 313
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
33172 tejus.loha 314
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 315
        LOGGER.info("userWallet" + userWallet);
316
        int max_eligible_credit_amount = 0;
24739 tejbeer 317
 
32494 amit.gupta 318
        LOGGER.info("all_entries {}", all_entries);
319
        for (UserWalletHistory history : all_entries) {
320
            max_eligible_credit_amount -= history.getAmount();
321
        }
322
        if (max_eligible_credit_amount < amountToRefund) {
323
            LOGGER.info("Cant be credited back to wallet as most of it has been already credited");
324
            return false;
325
        }
22550 ashik.ali 326
 
32494 amit.gupta 327
        userWallet.setAmount(walletAmount + Math.round(amountToRefund));
23509 amit.gupta 328
 
32494 amit.gupta 329
        LOGGER.info("userWallet" + userWallet);
30449 amit.gupta 330
 
32494 amit.gupta 331
        UserWalletHistory userWalletHistory = new UserWalletHistory();
332
        userWalletHistory.setAmount(Math.round(amountToRefund));
333
        userWalletHistory.setReference(transactionId);
334
        userWalletHistory.setReferenceType(walletReferenceType);
335
        userWalletHistory.setWalletId(userWallet.getId());
336
        userWalletHistory.setTimestamp(LocalDateTime.now());
337
        userWalletHistory.setDescription(description);
338
        userWalletHistory.setBusinessTimestamp(all_entries.get(0).getBusinessTimestamp());
30449 amit.gupta 339
 
32494 amit.gupta 340
        userWalletHistoryRepository.persist(userWalletHistory);
341
        return true;
24739 tejbeer 342
 
32494 amit.gupta 343
    }
26254 amit.gupta 344
 
32494 amit.gupta 345
    @Override
346
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
347
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
348
        if (userWallet == null) {
33421 amit.gupta 349
            userWallet = new UserWallet();
350
            userWallet.setUserId(retailerId);
351
            userWalletRepository.persist(userWallet);
32494 amit.gupta 352
        }
353
        return (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
354
    }
24739 tejbeer 355
 
32494 amit.gupta 356
    @Override
357
    public List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType)
358
            throws ProfitMandiBusinessException {
359
        UserWallet userWallet = userWalletRepository.selectByRetailerId(fofoId);
360
        if (userWallet == null) {
361
            return new ArrayList<UserWalletHistory>();
362
        }
363
        return userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(userWallet.getId(), reference,
364
                walletReferenceType);
365
    }
30449 amit.gupta 366
 
32494 amit.gupta 367
    @Override
368
    public void resetWallet() throws ProfitMandiBusinessException {
369
        List<UserWallet> userWallets = userWalletRepository.selectAll();
370
        for (UserWallet userWallet : userWallets) {
371
            userWallet.setAmount(this.getWalletAmount(userWallet.getUserId()));
24739 tejbeer 372
 
32494 amit.gupta 373
        }
374
    }
25395 tejbeer 375
 
32494 amit.gupta 376
    @Override
377
    public int getManualReference(WalletReferenceType referenceType) {
378
        ManualPaymentType paymentType = manualPaymentRequestRepository.selectByReferenceType(referenceType);
24739 tejbeer 379
 
32494 amit.gupta 380
        if (paymentType == null) {
381
            paymentType = new ManualPaymentType();
382
            paymentType.setReferenceType(referenceType);
383
            manualPaymentRequestRepository.persist(paymentType);
384
        }
385
        paymentType.setCounter(paymentType.getCounter() + 1);
386
        return paymentType.getCounter();
24739 tejbeer 387
 
32494 amit.gupta 388
    }
34261 tejus.loha 389
 
390
    @Override
391
    public ResponseEntity<?> createAddWalletRequestReport(LocalDateTime startDate, LocalDateTime endDate, AddWalletRequestStatus status) throws Exception {
392
        List<List<?>> rows = new ArrayList<>();
393
        List<String> header = Arrays.asList(
394
                "Retailer Id",
395
                "Retailer Name",
396
                "Email",
397
                "City",
398
                "State",
399
                "Transaction Reference",
400
                "Bank Name",
401
                "Reference Date",
402
                "Amount",
403
                "status",
404
                "Created On",
405
                "Updated On"
406
        );
407
 
408
        List<AddWalletRequest> addWalletRequests = addWalletRequestRepository.selectAllRetailerIdByDateAndStatus(startDate, endDate, status);
409
        Map<Integer, CustomRetailer> customRetailerMap = retailerService.getAllFofoRetailers();
410
        for (AddWalletRequest addWalletRequest : addWalletRequests) {
411
            CustomRetailer customRetailer = customRetailerMap.get(addWalletRequest.getRetailerId());
412
            rows.add(Arrays
413
                    .asList(
414
                            addWalletRequest.getRetailerId(),
415
                            customRetailer.getBusinessName(),
416
                            customRetailer.getEmail(),
417
                            customRetailer.getAddress().getCity(),
418
                            customRetailer.getAddress().getState(),
419
                            addWalletRequest.getTransaction_reference(),
420
                            addWalletRequest.getBank_name(),
421
                            addWalletRequest.getReference_date(),
422
                            addWalletRequest.getAmount(),
423
                            addWalletRequest.getStatus(),
424
                            addWalletRequest.getCreateTimestamp(),
425
                            addWalletRequest.getUpdateTimestamp()
426
                    )
427
            );
428
        }
429
        org.apache.commons.io.output.ByteArrayOutputStream baos = FileUtil.getCSVByteStream(header, rows);
430
        ResponseEntity<?> responseEntity = orderService.downloadReportInCsv(baos, rows, "Add-wallet-request-"+status+"-Reort-" + startDate.toLocalDate() + "-To-" + endDate.toLocalDate());
431
        return responseEntity;
432
    }
32494 amit.gupta 433
}
24739 tejbeer 434