Subversion Repositories SmartDukaan

Rev

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

Filtering Options

Rev Age Author Path Log message Diff
37589 4 h 26 m amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Drive credit limits off the investment sweep; stop phantom limit writes

Adds the 2-minute sweep schedule and points the limit recalculation at the
partners whose base_value actually moved, instead of rescanning all 980 every
20 minutes. Measured on production: 3 partners change per 2-minute window on
average, peak 18.

- ScheduledSkeleton: 2-min sweepPartnerInvestment, daily refreshAgedStockDaily
at 00:20; the 20-min full pass is kept as a backstop for inputs base does not
capture (risk, the SIDBI floor, hard_limit)
- BatchScheduledTasks.sweepPartnerInvestment: sweep, then limits for changed
bases only
- calculateChangedPartnerLimits(restrictTo) to support that
- scaleMoney(): round to paise before comparing and storing. The limit comes out
of a double multiply, so 65123.7400 round-tripped as 65123.740000000005 and
compareTo called it a change. 208 of 230 'changed' partners in one production
run differed by under half a paisa, rewriting sd_credit_requirement and
dtr.credit_account ~14,000 times a day for identical values and churning the
SIDBI mirror. Real changes were never below a rupee, so 2dp cannot suppress one.
- getFirstBillingDates: one grouped query instead of one per partner

Credit limits for 24 partners will rise on the first sweep after deploy - that is
the aged-Apple double-deduction correction landing (see r37588), not a defect.

NOTE: cron is a standalone Spring Boot jar; the new schedules only fire once it
is restarted with --spring.profiles.active=scheduled.
 
37465 11 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Exclude aged Apple stock from investment when suggesting partner credit limits

Apple handsets a partner has held more than 30 days from GRN no longer count
toward the investment that drives the suggested limit. Applied in
getSuggestedAmount via getCreditableInvestment, covering the SDDIRECT,
hundred-percent and SIDBI branches. The aged amount is logged alongside each
limit change so a drop can be traced.

Scoped to the limit calculation only -- getTotalInvestment() is untouched, so
checkout payment options, the investment-OK gates and partner-facing screens
see the same stock value as before.

Measured on prod at time of commit: 580 units / ~3.94 Cr across 88 partners.
 
37352 23 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed max limit to 15 lac for Credit limit  
37339 24 d 8 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fixed max limit to 15 lac for Credit limit  
37087 59 d 6 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Partner limit read-phase per-partner isolation + drop dead reject wrapper

- PartnerLimitHelper.calculateChangedPartnerLimits: wrap the per-partner body in
try/catch so one partner's bad data (null limit/util in compareTo, or a
billing-date / risk lookup failure) no longer aborts the whole read phase and
silently updates zero partners every 20 min. Mirrors the write phase's
REQUIRES_NEW isolation.
- Remove dead ScheduledTasks.rejectPriceDropsOfApprovedImeis wrapper; the
@Scheduled trigger now delegates to PriceDropBatchService.
 
36338 142 d 10 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Remove CronBatchService and OfferProcessingHelper (moved to profitmandi-dao r36337); update imports in BatchScheduledTasks and PartnerLimitHelper  
36306 145 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/ Batch processing: BatchScheduledTasks, helpers for offer/sellin/partnerLimit, CronBatchService, OpenCV fix for Apple Silicon, CLI triggers