Subversion Repositories SmartDukaan

Rev

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

Filtering Options

Rev Age Author Path Log message Diff
35531 8 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Add manual partner type upgrade detection in rolloutMarginForStoreOnMonth

- Check if there's a MANUAL partner type change on day 1 of the month
- If manual upgrade detected, proceed with margin rollout for all orders in that month
- Existing calculated upgrade logic remains unchanged
 
35530 8 d 14 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Added migration for 2 parties for gold  
35524 9 d 6 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35521 9 d 7 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35461 25 d 20 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix LockAcquisitionException: Use bulk partner type fetch in ScheduledTasks

Use getTypesForFofoIds() bulk method in rollOutUpgardedMargins to avoid N+1 queries
 
35447 27 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix N+1 query in refundDnAmount() - batch fetch TagListings  
35446 27 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Use selectAllByItems() to avoid duplicate item fetch in checkfocusedModelInPartnerStock

- Pass pre-fetched items to tagListingRepository.selectAllByItems()
- Eliminates redundant itemRepository.selectAllByCatalogIds() call

🤖 Generated with Claude Code
 
35442 27 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Optimize checkfocusedModelInPartnerStock() - fix N+1 queries with batch fetching

- Reduced ~23,500 DB calls to ~12 batch queries
- Batch fetch customRetailers, inventory snapshots, GRN orders, items, tagListings upfront
- Fixed bug: partnerIdSalesHeadersMap.get(fofoStore.getId()) instead of get(fofoStore)

🤖 Generated with Claude Code
 
35424 28 d 4 h amit /trunk/ Fix order billing vs cancellation race condition with pessimistic locking

Problem:
- Concurrent billing and cancellation of the same order caused data inconsistency
- Money was refunded to wallet while order was also getting billed

Solution:
- Added pessimistic locking (SELECT FOR UPDATE) to prevent concurrent modifications
- Added validation methods to check order state before billing/cancellation
- Optimized billing method to reduce lock duration with pre-fetching

Changes:
- OrderRepository: Added selectByIdForUpdate, selectByOrderIdsForUpdate,
selectByInvoiceNumbersForUpdate, selectAllByTransactionIdForUpdate,
validateOrdersForBilling, validateOrderForRefund methods
- OrderRepositoryImpl: Implemented locking methods with PESSIMISTIC_WRITE
- TransactionServiceImpl: Updated billing methods with locking, fail-fast
validation, pre-fetching to avoid N+1 queries
- ScheduledTasks: Updated removePartialBillingForTransaction with locking
- TransactionRelatedTasks: Updated reverseRTO with locking
 
35393 29 d 22 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed MongoDB close method  
35330 49 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed loan issue  
35329 49 d 22 h ranu /trunk/ fix openinng stock  
35326 50 d 5 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Schedule Tasks  
35299 57 d 5 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Scheduled Task Logic  
35295 59 d 9 h amit /trunk/ Added reset logic  
35177 95 d 5 h amit /trunk/ Added SD Credit Scheduler  
35165 98 d 7 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed system.exit(0)  
35160 98 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed SD Credit HardLimit Check  
35157 98 d 10 h amit /trunk/ Fixed SD Credit HardLimit Check  
35151 100 d 0 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ donotcommit  
35150 100 d 0 h vikas /trunk/ Oppo Sale Rewards Duration Wise  
35145 100 d 5 h amit /trunk/ Now minimum investment is changed dynamically based on total investment and limit utilized for retailers whose credit is marked as hard limit.  
35132 101 d 5 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added scheduled Tasks  
35115 103 d 4 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35114 103 d 4 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35113 103 d 4 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35112 103 d 4 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35111 103 d 5 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ due date cross added all active loan and change title this mail  
35110 103 d 7 h ranu /trunk/ due date cross added all active loan and change title this mail  
35107 103 d 8 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ rajj added in stock to fulfil report  
35106 103 d 8 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ rajj added in stock to fulfil report  
35105 103 d 10 h vikas /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Oppo Sale Rewards  
35102 105 d 14 h amit /trunk/ Added csvn report  
35094 110 d 11 h ranu /trunk/ rajj added in stock to fulfil report  
35056 115 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ donotcommit  
35053 117 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ donotcommit  
35021 121 d 3 h amit /trunk/ Fixed order cancellation  
34993 126 d 4 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ change sidwi limit logic  
34903 146 d 3 h ranu /trunk/ bi report chnage  
34858 162 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed scheme upgrade when done manually