Subversion Repositories SmartDukaan

Rev

Rev 34674 | Rev 34966 | 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
        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);
33172 tejus.loha 134
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 135
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
136
        if (!forced && amount > 2 && amount > walletAmount) {
137
            LOGGER.error("Wallet Balance is insufficient!");
138
            throw new ProfitMandiBusinessException("balance", walletAmount, "WLT_1000");
139
        }
140
        userWallet.setAmount(walletAmount - Math.round(amount));
141
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime);
142
    }
24739 tejbeer 143
 
32494 amit.gupta 144
    @Override
145
    public void rollbackAmountFromWallet(int retailerId, float amountToRollback, int rollbackReference,
146
                                         WalletReferenceType walletReferenceType, String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException {
25542 amit.gupta 147
 
32494 amit.gupta 148
        if (amountToRollback == 0)
149
            return;
33172 tejus.loha 150
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 151
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
152
        List<UserWalletHistory> uwh = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(rollbackReference, walletReferenceType)
153
                .stream().filter(x -> x.getWalletId() == userWallet.getId()).collect(Collectors.toList());
154
        if (uwh.size() == 0) {
155
            LOGGER.info("Retailer with id {} dont have valid reference {} and reference type {}",
156
                    retailerId, rollbackReference, walletReferenceType);
157
            throw new ProfitMandiBusinessException("Retailer specific wallet entries doesn't exist", retailerId, "Nothing to rollback");
158
        }
159
        // userWallet = userWalletRepository.selectByIdForUpdate(userWallet.getId());
160
        userWallet.setAmount(walletAmount - Math.round(amountToRollback));
161
        this.createUserWalletHistory(-Math.round(amountToRollback), userWallet.getId(), rollbackReference,
162
                walletReferenceType, rollbackReason, businessTime);
163
        userWalletRepository.persist(userWallet);
24739 tejbeer 164
 
32494 amit.gupta 165
    }
30025 amit.gupta 166
 
32494 amit.gupta 167
    private void createUserWalletHistory(float amount, int walletId, int referenceId, WalletReferenceType referenceType,
168
                                         String description, LocalDateTime businessTimestamp) {
169
        if (amount == 0)
170
            return;
171
        UserWalletHistory userWalletHistory = new UserWalletHistory();
172
        userWalletHistory.setWalletId(walletId);
173
        userWalletHistory.setAmount(Math.round(amount));
174
        userWalletHistory.setReference(referenceId);
175
        userWalletHistory.setReferenceType(referenceType);
176
        userWalletHistory.setTimestamp(LocalDateTime.now());
177
        userWalletHistory.setDescription(description);
178
        userWalletHistory.setBusinessTimestamp(businessTimestamp);
179
        userWalletHistoryRepository.persist(userWalletHistory);
180
    }
24739 tejbeer 181
 
32494 amit.gupta 182
    @Override
183
    public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
184
        UserAccount userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
23509 amit.gupta 185
 
32494 amit.gupta 186
        if (underMaintainance) {
187
            throw pbse;
188
        }
189
        return userWalletRepository.selectByRetailerId(Integer.valueOf(userAccount.getAccountKey()));
190
    }
30889 amit.gupta 191
 
32494 amit.gupta 192
    @Override
193
    public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
194
        if (underMaintainance || !isActive(userId)) {
195
            throw pbse;
196
        }
197
        UserWallet userWallet = this.getUserWalletByUserId(userId);
198
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletId(userWallet.getId());
199
        return userWalletHistories;
200
    }
25395 tejbeer 201
 
32494 amit.gupta 202
    //Definition is now changed, active also means valid investment should be ok
203
    private boolean isActive(int userId) {
204
        boolean active = true;
205
        try {
206
            FofoStore fs = fofoStoreRepository.selectByRetailerId(userId);
207
            active = fs.isActive() && partnerInvestmentService.isInvestmentOk(userId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
208
        } catch (Exception e) {
24739 tejbeer 209
 
32494 amit.gupta 210
        }
211
        return active;
212
    }
24739 tejbeer 213
 
32494 amit.gupta 214
    @Override
215
    public List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId)
216
            throws ProfitMandiBusinessException {
217
        if (underMaintainance) {
218
            throw pbse;
219
        }
220
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
221
        return userWalletHistoryRepository.selectByWalletId(userWallet.getId());
222
    }
24739 tejbeer 223
 
32494 amit.gupta 224
    @Override
225
    public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime)
226
            throws ProfitMandiBusinessException {
227
        if (underMaintainance) {
228
            throw pbse;
229
        }
230
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
231
        return userWalletHistoryRepository.selectCountByWalletId(userWallet.getId(), startDateTime, endDateTime);
232
    }
25542 amit.gupta 233
 
32494 amit.gupta 234
    @Override
235
    public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId,
236
                                                                             LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit)
237
            throws ProfitMandiBusinessException {
238
        if (underMaintainance) {
239
            throw pbse;
240
        }
241
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
242
        return userWalletHistoryRepository.selectPaginatedByWalletId(userWallet.getId(), startDateTime, endDateTime,
243
                offset, limit);
244
    }
22550 ashik.ali 245
 
32494 amit.gupta 246
    @Override
33247 ranu 247
    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException {
32494 amit.gupta 248
        List<UserWallet> userWallets = userWalletRepository.selectByRetailerIds(retailerIds);
249
        Map<Integer, UserWallet> retailerIdUserWalletMap = new HashMap<>();
250
        for (UserWallet userWallet : userWallets) {
251
            retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
252
        }
253
        return retailerIdUserWalletMap;
254
    }
24739 tejbeer 255
 
32494 amit.gupta 256
    @Override
33247 ranu 257
    public Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> walletIds) throws ProfitMandiBusinessException {
32494 amit.gupta 258
        List<UserWallet> userWallets = userWalletRepository.selectAllById(walletIds);
259
        Map<Integer, Integer> walletRetailerMap = new HashMap<>();
260
        for (UserWallet userWallet : userWallets) {
261
            walletRetailerMap.put(userWallet.getId(), userWallet.getUserId());
262
        }
263
        return walletRetailerMap;
264
    }
30740 amit.gupta 265
 
32494 amit.gupta 266
    @Override
267
    public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
268
            throws ProfitMandiBusinessException {
269
        if (underMaintainance) {
270
            throw pbse;
271
        }
272
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
273
        return userWalletHistoryRepository.isExist(userWallet.getId(), referenceType, referenceId);
274
    }
25542 amit.gupta 275
 
32494 amit.gupta 276
    @Override
277
    public UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException {
278
        if (underMaintainance) {
279
            throw pbse;
280
        }
281
        try {
282
            return userWalletRepository.selectByRetailerId(retailerId);
283
        } catch (Exception e) {
284
            UserWallet uw = new UserWallet();
285
            uw.setAmount(0);
286
            uw.setRefundableAmount(0);
287
            uw.setUserId(retailerId);
288
            userWalletRepository.persist(uw);
289
            return uw;
290
        }
291
    }
25542 amit.gupta 292
 
32494 amit.gupta 293
    @Override
294
    public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
295
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
296
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date);
297
    }
24739 tejbeer 298
 
32494 amit.gupta 299
    @Override
300
    public float getOpeningTillExcludingPurchase(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
301
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
302
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date) - userWalletHistoryRepository.getSumTillDate(wallet.getId(), date, WalletReferenceType.PURCHASE);
303
    }
24739 tejbeer 304
 
32494 amit.gupta 305
    @Override
306
    public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
307
                                  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
24739 tejbeer 308
 
32494 amit.gupta 309
        List<UserWalletHistory> all_entries = userWalletHistoryRepository
310
                .selectAllByreferenceIdandreferenceType(transactionId, walletReferenceType);
30449 amit.gupta 311
 
32494 amit.gupta 312
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
33172 tejus.loha 313
        int walletAmount = this.getWalletAmount(retailerId);
32494 amit.gupta 314
        LOGGER.info("userWallet" + userWallet);
315
        int max_eligible_credit_amount = 0;
24739 tejbeer 316
 
32494 amit.gupta 317
        LOGGER.info("all_entries {}", all_entries);
318
        for (UserWalletHistory history : all_entries) {
319
            max_eligible_credit_amount -= history.getAmount();
320
        }
321
        if (max_eligible_credit_amount < amountToRefund) {
322
            LOGGER.info("Cant be credited back to wallet as most of it has been already credited");
323
            return false;
324
        }
22550 ashik.ali 325
 
32494 amit.gupta 326
        userWallet.setAmount(walletAmount + Math.round(amountToRefund));
23509 amit.gupta 327
 
32494 amit.gupta 328
        LOGGER.info("userWallet" + userWallet);
30449 amit.gupta 329
 
32494 amit.gupta 330
        UserWalletHistory userWalletHistory = new UserWalletHistory();
331
        userWalletHistory.setAmount(Math.round(amountToRefund));
332
        userWalletHistory.setReference(transactionId);
333
        userWalletHistory.setReferenceType(walletReferenceType);
334
        userWalletHistory.setWalletId(userWallet.getId());
335
        userWalletHistory.setTimestamp(LocalDateTime.now());
336
        userWalletHistory.setDescription(description);
337
        userWalletHistory.setBusinessTimestamp(all_entries.get(0).getBusinessTimestamp());
30449 amit.gupta 338
 
32494 amit.gupta 339
        userWalletHistoryRepository.persist(userWalletHistory);
340
        return true;
24739 tejbeer 341
 
32494 amit.gupta 342
    }
26254 amit.gupta 343
 
32494 amit.gupta 344
    @Override
345
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
346
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
347
        if (userWallet == null) {
33421 amit.gupta 348
            userWallet = new UserWallet();
349
            userWallet.setUserId(retailerId);
350
            userWalletRepository.persist(userWallet);
32494 amit.gupta 351
        }
352
        return (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
353
    }
24739 tejbeer 354
 
32494 amit.gupta 355
    @Override
356
    public List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType)
357
            throws ProfitMandiBusinessException {
358
        UserWallet userWallet = userWalletRepository.selectByRetailerId(fofoId);
359
        if (userWallet == null) {
360
            return new ArrayList<UserWalletHistory>();
361
        }
362
        return userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(userWallet.getId(), reference,
363
                walletReferenceType);
364
    }
30449 amit.gupta 365
 
32494 amit.gupta 366
    @Override
367
    public void resetWallet() throws ProfitMandiBusinessException {
368
        List<UserWallet> userWallets = userWalletRepository.selectAll();
369
        for (UserWallet userWallet : userWallets) {
370
            userWallet.setAmount(this.getWalletAmount(userWallet.getUserId()));
24739 tejbeer 371
 
32494 amit.gupta 372
        }
373
    }
25395 tejbeer 374
 
32494 amit.gupta 375
    @Override
376
    public int getManualReference(WalletReferenceType referenceType) {
377
        ManualPaymentType paymentType = manualPaymentRequestRepository.selectByReferenceType(referenceType);
24739 tejbeer 378
 
32494 amit.gupta 379
        if (paymentType == null) {
380
            paymentType = new ManualPaymentType();
381
            paymentType.setReferenceType(referenceType);
382
            manualPaymentRequestRepository.persist(paymentType);
383
        }
384
        paymentType.setCounter(paymentType.getCounter() + 1);
385
        return paymentType.getCounter();
24739 tejbeer 386
 
32494 amit.gupta 387
    }
34261 tejus.loha 388
 
389
    @Override
390
    public ResponseEntity<?> createAddWalletRequestReport(LocalDateTime startDate, LocalDateTime endDate, AddWalletRequestStatus status) throws Exception {
391
        List<List<?>> rows = new ArrayList<>();
392
        List<String> header = Arrays.asList(
393
                "Retailer Id",
394
                "Retailer Name",
395
                "Email",
396
                "City",
397
                "State",
398
                "Transaction Reference",
399
                "Bank Name",
400
                "Reference Date",
401
                "Amount",
402
                "status",
403
                "Created On",
404
                "Updated On"
405
        );
406
 
407
        List<AddWalletRequest> addWalletRequests = addWalletRequestRepository.selectAllRetailerIdByDateAndStatus(startDate, endDate, status);
408
        Map<Integer, CustomRetailer> customRetailerMap = retailerService.getAllFofoRetailers();
409
        for (AddWalletRequest addWalletRequest : addWalletRequests) {
410
            CustomRetailer customRetailer = customRetailerMap.get(addWalletRequest.getRetailerId());
411
            rows.add(Arrays
412
                    .asList(
413
                            addWalletRequest.getRetailerId(),
414
                            customRetailer.getBusinessName(),
415
                            customRetailer.getEmail(),
416
                            customRetailer.getAddress().getCity(),
417
                            customRetailer.getAddress().getState(),
418
                            addWalletRequest.getTransaction_reference(),
419
                            addWalletRequest.getBank_name(),
420
                            addWalletRequest.getReference_date(),
421
                            addWalletRequest.getAmount(),
422
                            addWalletRequest.getStatus(),
423
                            addWalletRequest.getCreateTimestamp(),
424
                            addWalletRequest.getUpdateTimestamp()
425
                    )
426
            );
427
        }
428
        org.apache.commons.io.output.ByteArrayOutputStream baos = FileUtil.getCSVByteStream(header, rows);
429
        ResponseEntity<?> responseEntity = orderService.downloadReportInCsv(baos, rows, "Add-wallet-request-"+status+"-Reort-" + startDate.toLocalDate() + "-To-" + endDate.toLocalDate());
430
        return responseEntity;
431
    }
32494 amit.gupta 432
}
24739 tejbeer 433