Subversion Repositories SmartDukaan

Rev

Rev 35828 | 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
 
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
34261 tejus.loha 4
import com.spice.profitmandi.common.model.CustomRetailer;
30740 amit.gupta 5
import com.spice.profitmandi.common.model.ProfitMandiConstants;
34261 tejus.loha 6
import com.spice.profitmandi.common.util.FileUtil;
23269 ashik.ali 7
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
25542 amit.gupta 8
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
34261 tejus.loha 9
import com.spice.profitmandi.dao.entity.transaction.AddWalletRequest;
32494 amit.gupta 10
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
22550 ashik.ali 11
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
12
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
34674 aman.kumar 13
import com.spice.profitmandi.dao.entity.user.User;
22550 ashik.ali 14
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
34261 tejus.loha 15
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
16
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
32494 amit.gupta 17
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
25542 amit.gupta 18
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
33845 tejus.loha 19
import com.spice.profitmandi.dao.repository.dtr.PartnerOnBoardingPanelRepository;
33172 tejus.loha 20
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
22550 ashik.ali 21
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
22
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
23
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
33845 tejus.loha 24
import com.spice.profitmandi.dao.repository.user.StoreTimelinetbRepository;
34674 aman.kumar 25
import com.spice.profitmandi.dao.repository.user.UserRepository;
30025 amit.gupta 26
import com.spice.profitmandi.service.NotificationService;
30740 amit.gupta 27
import com.spice.profitmandi.service.PartnerInvestmentService;
34261 tejus.loha 28
import com.spice.profitmandi.service.order.OrderService;
29
import com.spice.profitmandi.service.user.RetailerService;
33845 tejus.loha 30
import com.spice.profitmandi.service.user.StoreTimelineTatService;
22857 ashik.ali 31
import in.shop2020.model.v1.order.WalletReferenceType;
30025 amit.gupta 32
import org.apache.logging.log4j.LogManager;
33
import org.apache.logging.log4j.Logger;
34
import org.springframework.beans.factory.annotation.Autowired;
34261 tejus.loha 35
import org.springframework.http.ResponseEntity;
30025 amit.gupta 36
import org.springframework.stereotype.Component;
22857 ashik.ali 37
 
30025 amit.gupta 38
import java.time.LocalDateTime;
39
import java.util.*;
40
import java.util.stream.Collectors;
41
 
22550 ashik.ali 42
@Component
43
public class WalletServiceImpl implements WalletService {
44
 
32494 amit.gupta 45
    private static final Logger LOGGER = LogManager.getLogger(WalletServiceImpl.class);
25395 tejbeer 46
 
32494 amit.gupta 47
    @Autowired
48
    ManualPaymentRequestRepository manualPaymentRequestRepository;
34261 tejus.loha 49
    @Autowired
50
    AddWalletRequestRepository addWalletRequestRepository;
51
    @Autowired
52
    OrderService orderService;
53
    @Autowired
54
    RetailerService retailerService;
33194 amit.gupta 55
    ProfitMandiBusinessException pbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Wallet is under maintainance, please try after some time");
56
    ProfitMandiBusinessException inactivepbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Investment is incomplete, please add amount to wallet to complete the investment");
57
 
32494 amit.gupta 58
    @Autowired
59
    PartnerInvestmentService partnerInvestmentService;
60
    private boolean underMaintainance = false;
61
    @Autowired
62
    private UserAccountRepository userAccountRepository;
33172 tejus.loha 63
 
32494 amit.gupta 64
    @Autowired
65
    private UserWalletRepository userWalletRepository;
66
    @Autowired
67
    private FofoStoreRepository fofoStoreRepository;
68
    @Autowired
69
    private UserWalletHistoryRepository userWalletHistoryRepository;
70
    @Autowired
71
    private NotificationService notificationService;
24739 tejbeer 72
 
33172 tejus.loha 73
    @Autowired
74
    RetailerRepository retailerRepository;
33845 tejus.loha 75
    @Autowired
76
    PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
77
    @Autowired
78
    StoreTimelineTatService storeTimelineTatService;
79
    @Autowired
80
    StoreTimelinetbRepository storeTimelinetbRepository;
33172 tejus.loha 81
 
34674 aman.kumar 82
    @Autowired
83
    UserRepository userRepository;
84
 
32494 amit.gupta 85
    @Override
86
    public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
87
                                  String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
88
        if (Math.round(amount) == 0)
89
            return;
90
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 91
        userWallet.setAmount(userWallet.getAmount() + Math.round(amount));
32494 amit.gupta 92
        this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
36305 amit 93
        if (WalletReferenceType.AUTOMATED_ADVANCE.equals(referenceType)
94
                || WalletReferenceType.ADVANCE_AMOUNT.equals(referenceType)
95
                || WalletReferenceType.PAYMENT_GATEWAY.equals(referenceType)
96
                || WalletReferenceType.ONLINE_ORDER_PAYMENT.equals(referenceType)
97
                || WalletReferenceType.PURCHASE.equals(referenceType)) {
98
            partnerInvestmentService.evictInvestmentCache(retailerId);
99
        }
32494 amit.gupta 100
    }
25609 amit.gupta 101
 
32494 amit.gupta 102
    @Override
103
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
104
                                        String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
105
        if (underMaintainance) {
106
            throw pbse;
107
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
108
            throw inactivepbse;
109
        }
110
        if (amount == 0)
111
            return;
112
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 113
        int walletAmount = userWallet.getAmount();
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
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
121
    }
24739 tejbeer 122
 
32494 amit.gupta 123
    @Override
124
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
125
                                        String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException {
126
        if (underMaintainance) {
127
            throw pbse;
128
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
129
            throw inactivepbse;
130
        }
131
        if (amount == 0)
132
            return;
133
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 134
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 135
        if (!forced && amount > 2 && amount > walletAmount) {
136
            LOGGER.error("Wallet Balance is insufficient!");
137
            throw new ProfitMandiBusinessException("balance", walletAmount, "WLT_1000");
138
        }
139
        userWallet.setAmount(walletAmount - Math.round(amount));
140
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
141
    }
24739 tejbeer 142
 
32494 amit.gupta 143
    @Override
144
    public void rollbackAmountFromWallet(int retailerId, float amountToRollback, int rollbackReference,
145
                                         WalletReferenceType walletReferenceType, String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException {
25542 amit.gupta 146
 
32494 amit.gupta 147
        if (amountToRollback == 0)
148
            return;
149
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 150
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 151
        List<UserWalletHistory> uwh = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(rollbackReference, walletReferenceType)
152
                .stream().filter(x -> x.getWalletId() == userWallet.getId()).collect(Collectors.toList());
153
        if (uwh.size() == 0) {
154
            LOGGER.info("Retailer with id {} dont have valid reference {} and reference type {}",
155
                    retailerId, rollbackReference, walletReferenceType);
156
            throw new ProfitMandiBusinessException("Retailer specific wallet entries doesn't exist", retailerId, "Nothing to rollback");
157
        }
158
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
159
        userWallet.setAmount(walletAmount - Math.round(amountToRollback));
160
        this.createUserWalletHistory(-Math.round(amountToRollback), userWallet.getId(), rollbackReference,
161
                walletReferenceType, rollbackReason, businessTime);
162
        userWalletRepository.persist(userWallet);
24739 tejbeer 163
 
32494 amit.gupta 164
    }
30025 amit.gupta 165
 
32494 amit.gupta 166
    private void createUserWalletHistory(float amount, int walletId, int referenceId, WalletReferenceType referenceType,
167
                                         String description, LocalDateTime businessTimestamp) {
168
        if (amount == 0)
169
            return;
170
        UserWalletHistory userWalletHistory = new UserWalletHistory();
171
        userWalletHistory.setWalletId(walletId);
172
        userWalletHistory.setAmount(Math.round(amount));
173
        userWalletHistory.setReference(referenceId);
174
        userWalletHistory.setReferenceType(referenceType);
175
        userWalletHistory.setTimestamp(LocalDateTime.now());
176
        userWalletHistory.setDescription(description);
177
        userWalletHistory.setBusinessTimestamp(businessTimestamp);
178
        userWalletHistoryRepository.persist(userWalletHistory);
179
    }
24739 tejbeer 180
 
32494 amit.gupta 181
    @Override
182
    public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
183
        UserAccount userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
23509 amit.gupta 184
 
32494 amit.gupta 185
        if (underMaintainance) {
186
            throw pbse;
187
        }
188
        return userWalletRepository.selectByRetailerId(Integer.valueOf(userAccount.getAccountKey()));
189
    }
30889 amit.gupta 190
 
32494 amit.gupta 191
    @Override
192
    public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
193
        if (underMaintainance || !isActive(userId)) {
194
            throw pbse;
195
        }
196
        UserWallet userWallet = this.getUserWalletByUserId(userId);
197
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletId(userWallet.getId());
198
        return userWalletHistories;
199
    }
25395 tejbeer 200
 
32494 amit.gupta 201
    //Definition is now changed, active also means valid investment should be ok
202
    private boolean isActive(int userId) {
203
        boolean active = true;
204
        try {
205
            FofoStore fs = fofoStoreRepository.selectByRetailerId(userId);
206
            active = fs.isActive() && partnerInvestmentService.isInvestmentOk(userId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
207
        } catch (Exception e) {
24739 tejbeer 208
 
32494 amit.gupta 209
        }
210
        return active;
211
    }
24739 tejbeer 212
 
32494 amit.gupta 213
    @Override
214
    public List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId)
215
            throws ProfitMandiBusinessException {
216
        if (underMaintainance) {
217
            throw pbse;
218
        }
219
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
220
        return userWalletHistoryRepository.selectByWalletId(userWallet.getId());
221
    }
24739 tejbeer 222
 
32494 amit.gupta 223
    @Override
224
    public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime)
225
            throws ProfitMandiBusinessException {
226
        if (underMaintainance) {
227
            throw pbse;
228
        }
229
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
230
        return userWalletHistoryRepository.selectCountByWalletId(userWallet.getId(), startDateTime, endDateTime);
231
    }
25542 amit.gupta 232
 
32494 amit.gupta 233
    @Override
234
    public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId,
235
                                                                             LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit)
236
            throws ProfitMandiBusinessException {
237
        if (underMaintainance) {
238
            throw pbse;
239
        }
240
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
241
        return userWalletHistoryRepository.selectPaginatedByWalletId(userWallet.getId(), startDateTime, endDateTime,
242
                offset, limit);
243
    }
22550 ashik.ali 244
 
32494 amit.gupta 245
    @Override
33247 ranu 246
    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException {
32494 amit.gupta 247
        List<UserWallet> userWallets = userWalletRepository.selectByRetailerIds(retailerIds);
248
        Map<Integer, UserWallet> retailerIdUserWalletMap = new HashMap<>();
249
        for (UserWallet userWallet : userWallets) {
250
            retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
251
        }
252
        return retailerIdUserWalletMap;
253
    }
24739 tejbeer 254
 
32494 amit.gupta 255
    @Override
33247 ranu 256
    public Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> walletIds) throws ProfitMandiBusinessException {
32494 amit.gupta 257
        List<UserWallet> userWallets = userWalletRepository.selectAllById(walletIds);
258
        Map<Integer, Integer> walletRetailerMap = new HashMap<>();
259
        for (UserWallet userWallet : userWallets) {
260
            walletRetailerMap.put(userWallet.getId(), userWallet.getUserId());
261
        }
262
        return walletRetailerMap;
263
    }
30740 amit.gupta 264
 
32494 amit.gupta 265
    @Override
266
    public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
267
            throws ProfitMandiBusinessException {
268
        if (underMaintainance) {
269
            throw pbse;
270
        }
271
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
272
        return userWalletHistoryRepository.isExist(userWallet.getId(), referenceType, referenceId);
273
    }
25542 amit.gupta 274
 
32494 amit.gupta 275
    @Override
276
    public UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException {
277
        if (underMaintainance) {
278
            throw pbse;
279
        }
280
        try {
281
            return userWalletRepository.selectByRetailerId(retailerId);
282
        } catch (Exception e) {
283
            UserWallet uw = new UserWallet();
284
            uw.setAmount(0);
285
            uw.setRefundableAmount(0);
286
            uw.setUserId(retailerId);
287
            userWalletRepository.persist(uw);
288
            return uw;
289
        }
290
    }
25542 amit.gupta 291
 
32494 amit.gupta 292
    @Override
293
    public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
294
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
295
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date);
296
    }
24739 tejbeer 297
 
32494 amit.gupta 298
    @Override
299
    public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
300
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
301
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date) - userWalletHistoryRepository.getSumTillDate(wallet.getId(), date, WalletReferenceType.PURCHASE);
302
    }
24739 tejbeer 303
 
32494 amit.gupta 304
    @Override
305
    public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
306
                                  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
24739 tejbeer 307
 
32494 amit.gupta 308
        List<UserWalletHistory> all_entries = userWalletHistoryRepository
309
                .selectAllByreferenceIdandreferenceType(transactionId, walletReferenceType);
30449 amit.gupta 310
 
32494 amit.gupta 311
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 312
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 313
        LOGGER.info("userWallet" + userWallet);
314
        int max_eligible_credit_amount = 0;
24739 tejbeer 315
 
32494 amit.gupta 316
        LOGGER.info("all_entries {}", all_entries);
317
        for (UserWalletHistory history : all_entries) {
318
            max_eligible_credit_amount -= history.getAmount();
319
        }
320
        if (max_eligible_credit_amount < amountToRefund) {
321
            LOGGER.info("Cant be credited back to wallet as most of it has been already credited");
322
            return false;
323
        }
22550 ashik.ali 324
 
32494 amit.gupta 325
        userWallet.setAmount(walletAmount + Math.round(amountToRefund));
23509 amit.gupta 326
 
32494 amit.gupta 327
        LOGGER.info("userWallet" + userWallet);
30449 amit.gupta 328
 
32494 amit.gupta 329
        UserWalletHistory userWalletHistory = new UserWalletHistory();
330
        userWalletHistory.setAmount(Math.round(amountToRefund));
331
        userWalletHistory.setReference(transactionId);
332
        userWalletHistory.setReferenceType(walletReferenceType);
333
        userWalletHistory.setWalletId(userWallet.getId());
334
        userWalletHistory.setTimestamp(LocalDateTime.now());
335
        userWalletHistory.setDescription(description);
336
        userWalletHistory.setBusinessTimestamp(all_entries.get(0).getBusinessTimestamp());
30449 amit.gupta 337
 
32494 amit.gupta 338
        userWalletHistoryRepository.persist(userWalletHistory);
339
        return true;
24739 tejbeer 340
 
32494 amit.gupta 341
    }
26254 amit.gupta 342
 
32494 amit.gupta 343
    @Override
344
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
345
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
346
        if (userWallet == null) {
33421 amit.gupta 347
            userWallet = new UserWallet();
348
            userWallet.setUserId(retailerId);
349
            userWalletRepository.persist(userWallet);
32494 amit.gupta 350
        }
35828 amit 351
        int sum = (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
352
        userWallet.setAmount(sum);
353
        return sum;
32494 amit.gupta 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