Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36702 54 d 22 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ Add evictMonthCaches for centralized month-level offer cache eviction. Fix createOffers upload path missing catalog.published_yearmonth eviction. Add cache inventory comments to evictOfferCaches.  
36633 60 d 15 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ Fix offer activation cache race: REQUIRES_NEW ensures DB commit before cache eviction, notification failures no longer rollback activation  
36521 70 d 19 h amit /trunk/ Added RequestCachingFilter  
36486 74 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ offer batch: add reprocess guard and hasUnfinishedBatch check in submitBatchAsync  
36451 79 d 18 h amit /trunk/profitmandi-dao/src/main/ Add reference field to catalog.offer and catalog.scheme for payout collation  
36374 87 d 20 h ranu /trunk/ schemes and offer for v2 version  
36357 89 d 18 h 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.  
36355 89 d 19 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 89 d 19 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.  
36347 89 d 21 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ Add submitBatchAsync for fire-and-forget /offer/process — schedules processOfferWithBatch on a bounded background pool (3 daemon threads) and returns immediately with a human-readable message. In-memory ConcurrentHashMap.newKeySet() per-offerId guard prevents duplicate concurrent runs for the same offer (the scenario that caused offer 8802 deadlocks). Sync processOfferWithBatch kept unchanged for cron CLI (--processOffersWithBatch).  
36342 89 d 23 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ Add OfferBatchService orchestrator — shared batch entrypoint for offer processing, used by cron CLI and /offer/process controllers. Loads offer, calls calculate*Payouts (read), creates cron_batch, runs each partner in REQUIRES_NEW via OfferProcessingHelper, finalizes batch and emails on partial failure. No @Transactional on the class — must not carry outer tx.  
36337 90 d 0 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Move CronBatchService and OfferProcessingHelper from cron to dao so web/fofo can reuse the batch infra; fix empty-IMEI NPE in getInventoryItemMap that broke /offer/process for partners with no billed/scanned serials  
36305 93 d 3 h amit /trunk/profitmandi-dao/src/main/ Batch processing infrastructure + per-partner offer processing + partner limit optimization + investment cache eviction on billing/payment/cancellation with 3hr TTL  
36103 112 d 16 h amit /trunk/profitmandi-dao/src/main/ Add DN rejection with full reversal: restore inventory, schemes, price drops, offers; add deny reason to purchase return items; add purchase return notification service  
36081 116 d 15 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Use JDK serialization for Redis caches with Map<Integer,...> keys

GenericJackson2JsonRedisSerializer converts Map Integer keys to String
during JSON serialization. On deserialization, map.get(Integer) returns
null since keys are now Strings. This broke allOffers, offer.slabpayout,
catalog.published_yearmonth, and offer.achievement caches.

Fix: Use JdkSerializationRedisSerializer for these specific caches to
preserve exact Java types. Added Serializable to 9 model classes in the
offer object graph: CreateOfferRequest, TargetSlab, ItemCriteriaPayout,
ItemCriteria, PartnerCriteria, PayoutSlab, AmountModel, QtyAmountModel,
DateRangeModel.
 
36051 118 d 19 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Support FIXED per-pc payout with VALUE target: use per-criteria qty for payout calculation, sort payoutSlabs ascending  
36049 118 d 22 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Redesign offer caching: separate definition from achievement, per-partner Redis cache, deep-copy before mutation, centralized eviction  
35942 137 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Reduce log noise: demote verbose INFO to DEBUG, fix empty list SQLGrammarException in getItemAvailability, fix copy-paste bug in PartnerTypeChangeServiceImpl, fix string concatenation in log statements  
35924 140 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Per-criteria target and payout editing for offers

- Add UpdateSlabRequest/UpdateOfferSlabsRequest models for per-slab updates
- Add id field to PayoutSlab, populate from TargetSlabEntity.id
- Add updateOfferSlabs() service method: validates slab ownership, updates payoutTarget and payoutValue independently
- Keep updateOfferTargets() for backward compatibility
 
35889 142 d 13 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ Fix updateOfferTargets unique key constraint - group slabs by payout_target and use updateById  

Show All