Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
35530 200 d 19 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Added migration for 2 parties for gold  
35524 201 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35522 201 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Added migration for 2 parties for gold  
35521 201 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35520 201 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed method Number to comma for Cr. Values  
35461 218 d 1 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 219 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix N+1 query in refundDnAmount() - batch fetch TagListings  
35446 219 d 9 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 219 d 9 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 220 d 9 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 222 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed MongoDB close method  
35361 229 d 10 h aman /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Feat:Trial user mails for pending Verification and store code  
35358 229 d 15 h ranu /trunk/ eol item remove from listing b2b (solr)  
35330 241 d 8 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed loan issue  
35329 242 d 3 h ranu /trunk/ fix openinng stock  
35326 242 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Schedule Tasks  
35299 249 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Scheduled Task Logic  
35295 251 d 14 h amit /trunk/ Added reset logic  
35277 256 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Migrations  
35276 256 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Migrations  

Show All