Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36521 2 d 13 h amit /trunk/ Added RequestCachingFilter  
36486 6 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/ offer batch: add reprocess guard and hasUnfinishedBatch check in submitBatchAsync  
36451 11 d 11 h amit /trunk/profitmandi-dao/src/main/ Add reference field to catalog.offer and catalog.scheme for payout collation  
36374 19 d 14 h ranu /trunk/ schemes and offer for v2 version  
36357 21 d 11 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 21 d 12 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 21 d 13 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 21 d 14 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 21 d 16 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 21 d 17 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 24 d 21 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 44 d 9 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 48 d 9 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 50 d 13 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 50 d 15 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 69 d 10 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 72 d 11 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 74 d 7 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  
35887 74 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix: use partner_criteria JSON instead of offer_partners table for partner management  
35885 74 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Admin offer management: add/remove partners, clone offer, update targets + empty guard fix in getCreateOfferRequest  

Show All