Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37805 9 d 22 h amit /trunk/profitmandi-dao/src/main/ fix(catalog): trim f_ colour prefix space; age delisted listings from last activation

- Item.normalizeColor drops the space after f_ on every write (upload sheets typed
'f_ Black', which read ' Black' everywhere); ItemLoaderService uses it so the
duplicate-colour check compares the clean value
- tag_listing.last_activated, stamped by TagListing.setActive on off->on;
updateActiveById now goes through the entity (+flush) so the toggle stamps it
- delist cron + SQL script age a listing from GREATEST(start_date, last_activated),
so a re-activated listing is not delisted again the next morning
- migrations: add_tag_listing_last_activated_20260929.sql, fix_item_color_prefix_space_20260929.sql
(both applied on hadb1 2026-09-29; 174 items trimmed, 36830 excluded - clashes with 37089)
 
37778 14 d 4 h amit /trunk/profitmandi-dao/src/main/ fix(catalog): delist cron retires only models it darkened in the same run

Step 4 scanned every mobile model with no active listing and moved it to OTHER,
so new launches (categorised before listing) and hand-paused models were retired
the next morning, e.g. Nothing Phone 4 1026596-603 on 2026-09-15. Scope it to
models whose listing this run delisted (_delist_audit run_date = today).
Add fix_dark_model_retire_20260924.sql to restore the 16 models still stuck on OTHER.
 
37640 23 d 9 h amit /trunk/profitmandi-dao/src/ Hot Deal brand: brand-driven membership, model_hot_deal reduced to attributes + oem_brand + oem_catalog_id, migration SQL  
37634 23 d 9 h amit /trunk/profitmandi-dao/src/main/ feat(pricing): tag_listing price change log; retire vendoritempricing writes/reads in dao; price drops no longer touch vendor catalog pricing

- New catalog.tag_listing_price_log (sql/create_tag_listing_price_log_20260915.sql, applied on prod 2026-09-15) + TagListingPriceService: the single setter for tag_listing DP/MOP/MRP, logging old/new values, source and user
- Remove applyPriceDrop (r37622): price drops write only price_drop + tag_listing; sql/revert_price_drop_vendor_catalog_pricing_20260915.sql restores the 30 rows it wrote (run on prod)
- VendorCatalogPricingService: reference TP = latest approved external TP (single + batched); internal suppliers rejected on create, bulk upload and approval
- Stop copying pricing into vendoritempricing on approval and item upload; tag listing detail TP from reference TP; indent DP from tag_listing only
 
37566 28 d 14 h amit /trunk/profitmandi-dao/src/main/ Delist logic v3: require a month of no movement; add CatalogDelistService

Zero stock alone was too weak a test. It fired on SKUs partners were still
transacting, where the recent movement was often the very sale that emptied the
stock. v3 additionally requires no movement for a month on either side:
- SmartDukaan via warehouse.scanNew (3.4M rows, live). Note warehouse.scan is a
dead Saholic relic - 2,476 rows, last write 2012.
- any partner via fofo.scan_record, any scan type.
Phrased as NOT EXISTS so they short-circuit on the first recent row and use the
(inventoryItemId, scannedAt) / (inventory_item_id, create_timestamp) indexes.
An item that has never moved still qualifies, which is correct.

Also in v3:
- the internal pseudo-brands (Dummy, FOC, FOC HANDSET, Live Demo) are no longer
excluded and are swept like anything else.
- vendor-PO guard narrowed to status = 1. PARTIALLY_FULFILLED is UNREACHABLE,
not merely rare: none of the 8 PO-status writes in the codebase sets it, no
native SQL writes the column, and status = 2 has 0 rows across 51,593+ POs
back to 2011. Partial receipt is modelled per line (unfulfilledQuantity), so a
part-received PO sits in READY and is already caught. Documented so it is not
'restored' later as a supposed gap.

CatalogDelistService/Impl mirrors the migration statement for statement, for the
daily scheduled run. Bulk SQL rather than per-row updateActiveById +
publishStatusChange, which would commit to Solr once per catalog (~1,750 times
on the 2026-09-10 backlog); the job is instead scheduled ahead of the existing
06:00 full reindex. The dark-model step is deliberately house-wide rather than
run-scoped so it converges instead of leaving pre-existing dark models on a
stale RUNNING forever.

rollback_delist_recent_movement_20260910.sql restores the 24 listings / 21
models that the v2 run delisted before NEW 3 existed; their partners had
transacted them within the month. Id list frozen, not re-derived.
 
37289 59 d 6 h amit /trunk/profitmandi-dao/src/ external api v2: space-separated ram/storage pair in catalog titles (refurb naming)  
37284 59 d 9 h amit /trunk/profitmandi-dao/src/ external api v2: derive specs from catalog brand/model title (pair + lone-storage forms) as last resort; migration file marks applied state, legacy update() note  
37281 59 d 10 h amit /trunk/profitmandi-dao/src/ external api v2: storeMaster visibility by fofo_type=FRANCHISE (drop internal flag check); spec derivation supports MB sizes (feature phones)  
37276 59 d 14 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Hot deals Solr: derive hot_deal_b from model_hot_deal active windows at index time (full push, single-catalog update, parent + child docs) - catalog.model_hot_deal is the only source, tag_listing.hot_deals no longer read; drop unused tag_listing write-through methods; syncHotDealFlags javadoc reflects reindex-based daily sync  
37268 59 d 16 h amit /trunk/profitmandi-dao/src/ Hot deals: rename attribute activated -> fresh with polarity inversion (fresh = device unused/sealed). Entity/attributes/service/tests migrated; prod DDL (unapplied) now creates fresh directly; model_hot_deal_activated_to_fresh.sql migrates envs that had the old column (applied on local + saholic-test)  
37254 63 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ feat: hot-deals admin search/pagination + tag_listing.hot_deals write-through and daily sync

- searchAllWithCatalog/countSearchAll: all-brands deal listing joined with
Catalog (brandName transient), server-side search on model/brand, paginated
- add/removeDeal write through to tag_listing.hot_deals (Solr hot_deal_b
source) and publish a re-index event (prod-gated in TagListingChangeListener)
- syncHotDealFlags: daily reconcile of date-windowed model_hot_deal into
tag_listing.hot_deals so deal windows start/expire on time
 
37244 63 d 15 h amit /trunk/profitmandi-dao/src/ Hot deal attributes: five mandatory fields (warranty_months 0-12, item_condition NEW/OPEN_BOX/REFURBISHED, activated, finance_mapping, affordability) on model_hot_deal - entity+enum+attributes holder, service validation (no defaults), addDeal/updateDeal signatures, selectActiveByCatalogItemIds/selectAllActive repo queries, hotDealTags on FofoCatalogResponse, DDL script, tests (14 green)  
37218 65 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/ external api v2: optional BrandIdentifier column in bulk item upload  
37215 65 d 11 h amit /trunk/profitmandi-dao/src/ external api v2: one-time ram/memory derivation from detailedSpecs/keySpecs  
37213 65 d 12 h amit /trunk/profitmandi-dao/src/ external api v2: CategorySpecUtil - positional spec values validated against category definitions  
37211 65 d 13 h amit /trunk/profitmandi-dao/src/ Hot Deals: model_hot_deal entity, repository and service with 15-active-per-brand cap, duplicate-active and date validation  
37143 76 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Brand eligibility: unified blocked + LOI-ineligible enforcement — new BlockedBrandService; BrandsService restrictedBrands/applyRestrictedSolrExclusion/validateOrderableBrands; hard-validate at add-to-cart (fofoId-aware addItemsToCart) and bulk order; cart validation uses restricted union  
37071 87 d 8 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Normalize whitespace on Catalog/Item setters + ItemLoaderService bulk upload (T9.5 sanitizer)  
36960 100 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/ Combo cancellation: resolve combo linkage from catalog definition; force-cancel linked main on non-FOC secondary cancel (confirmation) and auto-cancel FOC freebies when main is cancelled  
36482 155 d 7 h vikas /trunk/ V2 Weekly feedback and All Brands API  

Show All