Subversion Repositories SmartDukaan

Rev

Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37588 25 d 6 h amit /trunk/profitmandi-dao/src/main/ Serve partner investment from a 2-minute snapshot instead of a 3-hour cache

getInvestment() was @Cacheable on a 3-hour Redis cache that addAmountToWallet
evicted but consumeAmountFromWallet did not. A partner whose advance payment was
swept straight to a loan had the money counted twice - once as a still-cached
wallet balance, once as the reduced utilisation - overstating their credit limit
by the payment x their tier until the cache expired.

Replaced with fofo.partner_investment, refreshed every 2 minutes by
PartnerInvestmentSweepService. Every coupled term is read in one pass, so wallet
and utilisation (and in-stock and aged-Apple) can never come from different
moments. A shorter TTL would only have made the error rarer - it scales with the
payment, not the delay.

- PartnerInvestment entity/repository + partner_investment_snapshot.sql
- PartnerInvestmentSweepService: 9 batched reads, stores base_value for change
detection, refreshes aged-Apple for partners whose stock moved intra-day
- getInvestment/getInvestmentsForFofoStores both read the snapshot, so the two
paths no longer disagree; live compute retained as fallback
- selectActivatedStockAmountByFofoIds: batches an N+1 that cost 233ms x 1690
partners (6.6 min -> 1.0 s)
- getFirstBillingDates: batches another N+1 (4.6 s -> 0.67 s)
- selectPendingGrnOrders(List) now applies the same SD_START_DATE floor as the
single-partner overload; the two were reporting different GRN-pending
- selectPartnerStockValueMap takes excludeActivated: an activated Apple handset
held past the aging window was added once to in-stock and subtracted twice
(activated stock, then the aged haircut). 90 units, 24 partners, Rs 65.19 lakh
double-deducted. Live-demo passes false - no overlap there.
- applyManualAdjustment: routes the two hand-rolled admin wallet adjustments
through WalletServiceImpl so they take the FOR UPDATE lock
- add_idx_order_grn_pending.sql: covering index, GRN query 1320ms -> 514ms
 
36777 124 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/ Remove unused getOpeningTillExcludingPurchase (no callers)  
34261 581 d 7 h tejus.lohani /trunk/ Give (a pending,approved,reject)add-wallet-req report  
33685 777 d 7 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/ Fixed investment  
33247 899 d 9 h ranu /trunk/ warehouse billing phase one and added signature exception  
33194 910 d 11 h amit.gupta /trunk/ Added 10K for Referral  
32494 1103 d 10 h amit.gupta /trunk/ Merged changes related to Smartdukaan  
30889 1502 d 7 h amit.gupta /trunk/ Fixed commit  
30677 1561 d 3 h amit.gupta /trunk/ Added scheme in processing for specified scheme ids  
28596 1912 d 5 h amit.gupta /trunk/ Added logic to get closing of all retailers.  
28517 1928 d 5 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/  
28241 1996 d 12 h amit.gupta /trunk/ Added changes to handle Partner payments online  
26498 2380 d 9 h amit.gupta /trunk/ Fixed the changes related to wallet as well as added comparision feature  
26256 2448 d 10 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/ Fixed wallet issue while grn  
25609 2573 d 6 h amit.gupta /trunk/ Trying to generate grouping  
25547 2582 d 7 h amit.gupta /trunk/ Fixed Wallet  
25266 2646 d 9 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/ Fixed wallet Changes  
25265 2646 d 9 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/ Fixed wallet  
24739 2759 d 5 h tejbeer /trunk/ keep a tab feature  
24509 2792 d 13 h amit.gupta /trunk/ Added Wallet Statement  

Show All