Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
38043 1 h 9 m amit /trunk/profitmandi-dao/src/ Scheme re-run: do not pay margin again on units the customer returned

After a partial return, the returned units' scheme rows are REJECTED and the
payout treated them as unpaid, so a re-run (process-schemes / category upgrade)
credited their margin again on the still-live invoice.
- processSchemeOut leaves out units with a SALE_RET / SALE_RET_UNUSABLE scan on the same order
- missed-activation special support query skips the same units (forced inventory_item index; the order_id index walks ~0.9M order_id=0 scans)
- ProcessSchemeOutReturnedUnitTest
 
38041 1 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/scheme/ fix(scheme): don't re-reject already-rejected scheme_in_out rows on scheme re-runs

processSchemeOut category-upgrade loop and processSchemeIn CD free-days reject
re-stamped rows already REJECTED (e.g. from a cancelled invoice sharing the
scheme id with the rebilled CREDITED row). This moved the rollback month (broke
the margin CN reconciliation) and debited the wallet a second time.
Skip REJECTED rows in both loops; the CD reject now covers every live CD row
instead of only the first.
 
38038 2 d 5 h amit /trunk/profitmandi-dao/src/ Phase 1 partner-app tracking: PartnerAppLauncher (store check, access check, launch audit, token) + PartnerAccessService; JWTUtil.createLaunchToken (partner token + staff claims, 12h)  
38033 2 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ fix(onboarding): remove unused PartnerOnBoardingPanel.address mapping

Column never held data (0 of 2,026 rows). Store address single source = user default address,
LOI billing address as fallback. Column drop: claude-data/sql-migrations/wod_store_address_single_source_20261114.sql
(run after deploy).
 
38031 2 d 6 h amit /trunk/profitmandi-dao/src/ Phase 0 partner-app tracking: JWTUtil reads staff claims (authUserId/email/launchId) without impersonation flag; user_action_audit entity + ActionAuditService (no callers yet)  
38027 2 d 22 h amit /trunk/profitmandi-dao/src/ feat(credit): overdue (not yet defaulted) dues for the Credit Details screen

- SDCreditService.getOverdueDuesByFofo: principal + interest on Loan.isOverdue loans, with the earliest default date
- LoanDefaultDues carries defaultsOn; dues calculation shared between defaulted and overdue loans
- Tests for overdue amount and default date
 
38025 2 d 23 h amit /trunk/profitmandi-dao/src/ feat(credit): default dues and latest block reason for the Credit Details screen

- SDCreditService.getDefaultDuesByFofo: principal + interest needed to close every defaulted loan
(same isDefault() set as the LOAN_DEFAULT block; total from loan_statement as settleLoan reads it)
- SDCreditService.getLatestBlockLogs + CreditBlockLogRepository.selectByFofoIds (bulk, typed HQL)
- LoanDefaultDues model; SDCreditServiceDefaultDuesTest
 
38024 3 d 3 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/ fix(cart): drop delisted or missing items from cart in getCartValidation

A line whose item is missing or whose tag_listing is inactive (active=0) is now
removed from the cart and reported as a PRODUCT_UNAVAILABLE cart message, so
createOrder (which rejects on any cart message) no longer bills a delisted item.
Runs before the carry bag allowance so removed phones earn no free bags.
Stock and the 400 max-qty cap are unchanged.
 
38021 3 d 21 h ranu /trunk/ call history given on brand wise placement page  
38020 4 d 1 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali offer live  
38019 5 d 0 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali offer live  
38018 8 d 0 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali online scratch offer, otp send to email  
38015 8 d 21 h amit /trunk/profitmandi-dao/src/ Hot Deals admin: list every Hot Deal model (incl. ones with no attributes row), needs-attention filter + stats, and OEM brand set on save

- ModelHotDealRepository: list/count driven from Catalog (brand = Hot Deal) LEFT JOIN model_hot_deal; needsAttentionOnly = no row or NULL oem_brand; countStats()
- ModelHotDealService: saveAttributes takes oemBrand (requested > stored > suggested from catalog.model_name); must be a brand master name, never Hot Deal; stored in master spelling. Root cause of Ai+ models missing from the partner-app brand filter (NULL oem_brand -> no oem_brand_s in Solr)
- oemBrandNames(), suggestOemBrand(), stats()
- ModelHotDeal: transient suggestedOemBrand, isSaved()
- Tests: 18 passing
 
38014 9 d 22 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali offer live  
38012 9 d 22 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ fix(finance): list only active payment options on finance-service screens

Finance-service setup, grids, add-brand dropdown, partner payment-option page and
paper-finance lists (LOI form, WOD mapping report) used selectAll(), ignoring
payment_option.active. Switched-off options kept showing, and every finance-services
page open created a PENDING partner_service row for them (IDFC id 21, inactive since
2022, had 1,786). New PaymentOptionRepository.selectAllActive(); selectAllPaperFinanceOption
is active-only. Name lookups for existing payments/invoices still use selectAll().
Services created from the UI are now saved active (were saved active=0).
 
38011 10 d 0 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ fix(credit-note): margin CN dry run must not consume CN/DN numbers or lock sellerwarehouse

The 06:00-on-1st monthlyMarginsCnDryRun (dryRun=true) bumped cn_sequence / fofo_dn_sequence for
every document it would issue and committed them, so each live run started after a burned block:
every gap Jul-Nov 2026 equals that month's live margin CN count per prefix (e.g. CN-NSDL13802..13976
never issued for Oct). It also held the sellerwarehouse rows billing locks.

- issueMarginsCNForPartner marks its REQUIRES_NEW transaction rollback-only when !runActual.
- Dry run reads sellerwarehouse without FOR UPDATE; live keeps selectByPrefixForUpdate.
 
38010 10 d 1 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ fix(onboarding): retire previous brand commitments when a revival LOI completes

A revival LOI completes on the store's original onboarding panel and its brand
commitments are attached to that panel, but the original LOI's commitments stayed
attached too. The panel then had two rows per re-committed brand and kept dropped
brands as committed, which broke /partnerDealerSubmit (toMap duplicate key) and
selectBrandCommitmentByOnboardingIdAndBrand (NonUniqueResult), and showed wrong
brands on the WOD finance mapping report.

createPartnerOnboardingPanel now deactivates and detaches (onBoardingId=0) every
other commitment on the panel before attaching the revival LOI's rows; loiId keeps
them tied to their own LOI. Adds LoiBrandCommitmentRepository.selectAllByOnboardingId.
Existing data (PBFZK1322, PBSMS1240, HRMWT1158) fixed by separate SQL.
 
38007 11 d 3 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali offer live  
38006 11 d 3 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/ diwali online scratch offer, otp send to email  
38005 11 d 21 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ fix(credit-note): commit monthly margin CN run per partner; drop one-time CN/DN remediation

issueMonthlyMarginsCN ran as one transaction for the whole month (2026-11-04: 51 min, 1,441 docs,
a NIC IRN call per doc inside it). The cn_sequence/fofo_dn_sequence bump X-locked every
sellerwarehouse row it touched until commit, so billing's getInvoiceNumber (SELECT ... FOR UPDATE
on the same row) hit innodb_lock_wait_timeout.

- issueMonthlyMarginsCN is now a NOT_SUPPORTED orchestrator: loadMarginRunInput (REQUIRES_NEW
readOnly) -> issueMarginsCNForPartner per fofo (REQUIRES_NEW) -> queueMarginRunReports
(REQUIRES_NEW). Per-partner body unchanged; the partner mail stays in the partner txn.
- sellerwarehouse is read with new SellerWarehouseRepository.selectByPrefixForUpdate (the lock
billing takes) and prefixes are processed in sorted order.
- Removed one-time remediation tools, no live callers: issueCorrectiveMarginCNs (never ran live),
generateDebitNotesForCancelled x2 + processSingleCancelledCnTx (last ran 2026-05-09),
cancelMarginDnIrns + cancelSingleMarginDn, regenerateMarginIrns; repo
selectCancelledByMonth / selectByCreditNoteNumbers.
 

Show All