| Rev |
Age |
Author |
Path |
Log message |
Diff |
| 36367 |
6 m |
amit |
/trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/hdfc/ |
HDFC webhook: delegate writes to HdfcProcessingHelper; always respond OK
Fixes the concurrent-duplicate deadlock observed on hadb1 2026-04-23 12:54:11
(two HDFC retries inserting same utr='308490624083' → InnoDB deadlock →
LockAcquisitionException → 500 → HDFC retries again → amplification).
- addPayment: the HDFC row build + persist + wallet/sidbi is now a single call
to hdfcProcessingHelper.processPayment() which runs in REQUIRES_NEW. The
helper catches DataIntegrityViolationException and logs silently; our tx
is unaffected.
- The else branch (pre-select found an existing row) now returns the same
code=100 status=Success as the main path instead of code=200 Duplicate.
Per product direction: HDFC should see 'OK' regardless of whether the row
already existed from a prior webhook, manual entry, or reconciliation —
retries stop cleanly, no 'Duplicate' surface distinction.
Did NOT add @Transactional(readOnly=true) on the outer method despite its
read-heavy shape — checkManualPayments() at line 277 has a write side-effect
(rejecting pending manual wallet requests for the same utr) which would be
silently dropped in a read-only session. Kept class-level writable tx for
the outer; only HDFC writes moved to REQUIRES_NEW helper. |
|
| 36366 |
6 m |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ |
Add HdfcProcessingHelper: per-payment REQUIRES_NEW wrapper for HDFC credit writes
Isolates the hdfc_payment insert + wallet-credit / sidbi-sanction writes in
their own transaction so concurrent duplicate webhooks (HDFC retry, manual
entry, reconciliation) can't poison the caller's session. On the deadlock/
duplicate-key path (DataIntegrityViolationException), logs once at INFO and
returns silently — the row's side-effects are owned by whichever path
inserted it first; re-applying would double-credit.
Mirrors the OfferProcessingHelper pattern (also REQUIRES_NEW per item),
keeping the controller's outer transaction clean and making this method
safe to invoke from a batch loop later without refactor. |
|
| 36365 |
14 m |
vikas |
/trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/ |
Homepage API |
|
| 36364 |
2 h 29 m |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ |
Fix /activateFinanceServices returning empty row for retailers without partner_onboarding_panel
Change selectFinanceServicesByFofoId named query to LEFT JOIN PartnerOnBoardingPanel.
Previously an inner join filtered out 32 fofo_stores (16 internal + 16 external)
lacking an onboarding panel row, so the /activateFinanceServices response rendered
empty for them (e.g. codeInt=1359 / UPGBN1359) even though the partner_service
save itself worked. |
|
| 36363 |
21 h 24 m |
amit |
/trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ |
Idempotent fofo_order creation in UpSaleController (mirrors r36362 in dao)
Same change as OrderServiceImpl.createAndGetFofoOrder: pre-select by
(fofo_id, invoice_number) and catch DataIntegrityViolationException as the
slow-race fallback. Paired with uk_fofo_order_fofo_invoice unique key. |
|
| 36362 |
21 h 24 m |
amit |
/trunk/profitmandi-dao/src/main/ |
Make fofo_order creation idempotent on (fofo_id, invoice_number)
Fixes insert-intention gap-lock deadlocks on idx_invoice_number observed in
SHOW ENGINE INNODB STATUS at 2026-04-22 13:01:54 — two concurrent requests
inserting the same invoice_number for the same customer (client retry /
upstream webhook retry pattern).
- OrderServiceImpl.createAndGetFofoOrder: select-then-insert idempotency.
Fast path returns existing row if already created; slow-race path catches
DataIntegrityViolationException and re-selects the winner's row.
- add_uk_fofo_order_fofo_invoice.sql: adds UNIQUE KEY (fofo_id, invoice_number)
so the loser of a concurrent-insert race gets a clean DIVE instead of a
silent duplicate row (pre-check showed zero existing dup groups, safe).
findExistingFofoOrder wraps the repo call to swallow the repo's declared
ProfitMandiBusinessException — the impl actually returns null on not-found
(constructs an exception but never throws), so the swallow matches reality. |
|
| 36361 |
21 h 34 m |
amit |
/trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ |
Switch @Scheduled updatePartnerLimit to batch-tracked version. Was calling legacy scheduledTasks.updatePartnerLimit (one synchronized tx, writes to all ~1500 partners each run, no audit). Now calls batchScheduledTasks.updatePartnerLimitWithBatch (writes only changed partners in per-partner REQUIRES_NEW, records each run in cron_batch / cron_batch_item, sends failure email on partial failures). Same cadence (every 20 min), same business logic. Runs are now visible in /admin/cron-batches UI. |
|
| 36360 |
22 h 31 m |
ranu |
/trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/monitors/ |
login talktime hours cap on 100% |
|
| 36359 |
22 h 46 m |
ranu |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ |
rbm rating dashboard view commited |
|
| 36358 |
22 h 52 m |
amit |
/trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ |
Replace non-ASCII separators in cron-batches modal with ASCII. Title middle-dot (U+00B7) and empty-timestamp em-dash (U+2014) were rendering as mojibake ('·' and 'â€') — response was being served without charset=UTF-8 in the Content-Type header despite Velocity being UTF-8 configured. Swapped to '|' and '-' to avoid the encoding issue without chasing it through Velocity/Tomcat config. |
|
| 36357 |
23 h 30 m |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ |
Fix background-thread 'no session' error in DB guard. CronBatchRepository.selectRunningForOffer uses getCurrentSession() which needs an open tx; when OfferBatchService.processOfferWithBatch is called from the async worker thread (no outer tx), the guard query crashed with 'Could not obtain transaction-synchronized Session'. Offer 8819 submit succeeded but the background run died at the guard — before createBatch, so no cron_batch / cron_batch_item rows. Added CronBatchService.findRunningForOffer wrapping the repo call in @Transactional(readOnly=true); orchestrator calls the service method instead of repo directly. Matches the pattern used by loadOfferRequest / createBatch / calculate*Payouts — every caller opens its own tx. |
|
| 36356 |
23 h 57 m |
ranu |
/trunk/ |
rbm rating dashboard view commited |
|
| 36355 |
1 d 0 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ |
Skip already-paid partners before creating cron_batch_item rows. Adds hasRemainingSellinPayout / hasRemainingOfferPayout predicates on OfferProcessingHelper that mirror the amount calc in processPartner*Payout. Orchestrator filters partnerPayouts through these before createBatch — partners whose serials are fully paid (amount=0 after subtracting serialNumberPaid) are excluded entirely. Reruns of a completed offer now create no batch at all (log says 'all N eligible partners already fully paid, skipping batch'); partial reruns log filtered count. Avoids audit-trail noise of SUCCESS items that did zero work. |
|
| 36354 |
1 d 0 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ |
DB-backed concurrent-run guard for OfferBatchService.processOfferWithBatch. Adds CronBatchRepository.selectRunningForOffer(offerId) — single HQL query for RUNNING cron_batch rows named processSellinOffer-N or processActivationOffer-N. OfferBatchService early-returns (with a log) if any such row exists. Covers the three gaps the in-memory guard can't: JVM restart, multi-JVM, cron CLI + user click racing. Applies to both sync (cron --processOffersWithBatch) and async (/offer/process HTTP) paths. |
|
| 36353 |
1 d 2 h |
vikas |
/trunk/ |
Login issue |
|
| 36352 |
1 d 2 h |
amit |
/trunk/profitmandi-fofo/src/main/ |
Add admin cron batch review UI at /admin/cron-batches. Single page lists recent 200 batches grouped by date (most recent on top), clicking a row opens a modal with per-partner items (fofoId, partner, status, error, timestamps). Manual Refresh button re-fetches JSON. Admin-only via roleManager.isAdmin. Uses existing velocity layout (1-line passthrough). Three endpoints: GET /admin/cron-batches (HTML), /list (JSON), /{batchId}/items (JSON). Uses dao r36351 repo methods. |
|
| 36351 |
1 d 2 h |
amit |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/ |
Add CronBatchRepository.selectRecent(limit) and CronBatchItemRepository.selectByBatchId(batchId) for admin batch review UI. selectRecent returns most-recent-first via selectAllOrderByDescPaginated('id'); selectByBatchId uses selectAllByEqualOrderByDesc. |
|
| 36350 |
1 d 2 h |
aman |
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/ |
Fix:Add brand commitment, ASM details, and finance option in WOD initiation email |
|
| 36349 |
1 d 2 h |
amit |
/trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/ |
V2 /offer/process/{offerId} now fire-and-forget via submitBatchAsync (dao r36347). Response adds a 'message' field alongside success=true so the UI can surface 'Offer N submitted for processing' or 'already being processed'. |
|
| 36348 |
1 d 2 h |
amit |
/trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ |
/offer/process/{offerId} now fire-and-forget: calls offerBatchService.submitBatchAsync (dao r36347) and returns the status message immediately. User no longer waits on the 5+ min batch run; duplicate clicks for the same offer return 'already being processed' instead of spawning parallel deadlocking batches. |
|