Subversion Repositories SmartDukaan

Rev

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

Filtering Options

Rev Age Author Path Log message Diff
36269 2 d 6 h ranu /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ consolidate email sent of l3 escaltion  
36253 4 d 11 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Separate secondary/tertiary IMEI activation crons for Vivo/Oppo/Realme, perf fixes: shared saveActivation, Response leak fixes, /tmp cleanup, OpenCV static init, early break, remove class-level @Transactional from StandAlone  
36220 8 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Cron: add --genDNs CLI arg for monthly debit note generation. Use SDCreditServiceImpl.computeInterestStartDate for daily interest accrual (single source of truth, fixes off-by-one that delayed accrual by 1 day).  
36197 10 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Add --recoverCreditNote and --resendCNReport CLI args for credit note recovery and report resend  
36188 12 d 7 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Revert rerenderCNs CLI option - downloadCN already re-renders on the fly  
36187 12 d 7 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Add --rerenderCNs CLI option to re-generate old CN PDFs with new format  
36046 24 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Clean up DC regeneration: revert to saveInvoice, remove debug logging  
36043 24 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Debug DC invoice regeneration: bypass saveInvoice, log title, print stack trace on failure  
36042 24 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix app config  
36039 24 d 5 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Add one-off task to regenerate 7 DC invoices for seller 13 with correct Delivery Challan title  
36034 24 d 8 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Removed cron optimized logic for smartdukaan  
35959 40 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Migrate SMTP calls to mailOutboxService in cron - mail outbox pattern  
35929 44 d 20 h vikas /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Update Existing Shopify Product  
35928 44 d 21 h vikas /trunk/ Update Existing Shopify Product  
35915 45 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Notifications: use loan-level overdue/penalty rates instead of global constants  
35877 48 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Credit cron fixes: correct interest rates in notifications, show total+bifurcation in messages, fix internal email text, filter limit blocks, limit WhatsApp to 2 per run, replace N+1 loan statement queries with loan fields, use selectAllBlockedLoans for fixBlockedCredit.  
35866 48 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Use Loan::isLimit instead of freeDays >= 365 in fixBlockedCredit  
35848 50 d 6 h amit /trunk/ Refactor investment logic to use own investment (total - utilized), remove minimumInvestmentOld, add OK_INVESTMENT_SHORT_PERCENTAGE constant, update thresholds CUTOFF_INVESTMENT=10 MIN_INVESTMENT_PERCENTAGE=5  
35811 54 d 23 h amit /trunk/ Centralize credit/loan summary: CreditSummary DTO, bulk query, fix stale utilization, re-enable overdue check, fix interestPaid bug, optimize fresh money (3 queries vs 21), remove dead code  
35803 56 d 2 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Support WebApplicationType.NONE for non-web cron runs, add sendCreditNote log line  
35788 57 d 4 h vikas /trunk/ Schedule Shopify Product Sync  
35666 69 d 6 h vikas /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fetch PineLabs Offers Daily by Items  
35591 79 d 9 h aman /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix:Remove Account team from default partner and partner credit report and only send to neeraj sir  
35568 89 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Refactor ticket scheduled tasks: fix bugs, add test mode, improve performance

Bug fixes:
- Remove break statement in alertforTicket that stopped after first user
- Remove duplicate ticketClosed() method (used 7 calendar days vs 8 working days)
- Update Application.java CLI handler to use refactored escalateTicket()

New features:
- Add email test mode: redirect all emails to tester via config
- ticket.email.testMode.enabled=true/false
- ticket.email.testMode.recipient=tester@email.com
- Add configurable auto-escalation: ticket.autoEscalation.enabled
- Working days calculation using WorkingDaysService (excludes Sun + holidays)

Performance improvements:
- Batch fetch ticketSubCategoryMap once per job, not per email
- All repository calls moved outside loops (N+1 query fix)

Escalation thresholds updated:
- L1 -> L2: 3 working days
- L2 -> L3: 3 working days
- L3 -> Final: 2 working days

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35531 99 d 12 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 99 d 12 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Added migration for 2 parties for gold  
35524 100 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35521 100 d 5 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Added migration for 2 parties for gold  
35461 116 d 19 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 118 d 2 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix N+1 query in refundDnAmount() - batch fetch TagListings  
35446 118 d 2 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 118 d 3 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 119 d 3 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 120 d 20 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Fixed MongoDB close method  
35330 140 d 2 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed loan issue  
35329 140 d 20 h ranu /trunk/ fix openinng stock  
35326 141 d 3 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Schedule Tasks  
35299 148 d 4 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed Scheduled Task Logic  
35295 150 d 7 h amit /trunk/ Added reset logic  
35177 186 d 3 h amit /trunk/ Added SD Credit Scheduler