Subversion Repositories SmartDukaan

Rev

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

Filtering Options

Rev Age Author Path Log message Diff
37588 45 d 19 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
 
36518 168 d 21 h aman /trunk/ Fix:Fix first po and edge case for bulk order  
35856 242 d 20 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Optimize activated stock query (no cache), move offer cache to Redis, add bulk publish and delete offer  
33306 907 d 23 h amit.gupta /trunk/ Fixed logic for sale in inventory history  
33182 935 d 18 h shampa /trunk/ add fields in price drop table. Add purchase billing summery and sale summery table.  
33120 952 d 18 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ patch for  
33115 952 d 23 h shampa /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ spelling correction  
33023 971 d 18 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/ fixed InventoryItem  
33015 972 d 17 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/ Fixed added lower case  
31860 1276 d 22 h tejbeer /trunk/ change  
31163 1439 d 20 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ Fixed  
30652 1585 d 19 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Added sellin margin payout  
30523 1611 d 1 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ Fixed ahead issue  
29571 1812 d 17 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/  
29095 1882 d 22 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/  
29093 1882 d 22 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/  
26304 2459 d 0 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/  
26303 2459 d 2 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/  
26299 2459 d 8 h amit.gupta /trunk/ Added activation as seperate table  
26213 2473 d 1 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/  

Show All