<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SmartDukaan &#x2013; //trunk/profitmandi-dao/src/main/resources/sql/rollback_delist_recent_movement_20260910.sql</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Wed, 07 Oct 2026 16:57:26 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Frollback_delist_recent_movement_20260910.sql&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Frollback_delist_recent_movement_20260910.sql&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Thu, 10 Sep 2026 11:58:08 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37566 – Delist logic v3: require a month of no movement; add ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Delist logic v3: require a month of no movement; add CatalogDelistService&lt;br /&gt;
&lt;br /&gt;
Zero stock alone was too weak a test. It fired on SKUs partners were still&lt;br /&gt;
transacting, where the recent movement was often the very sale that emptied the&lt;br /&gt;
stock. v3 additionally requires no movement for a month on either side:&lt;br /&gt;
- SmartDukaan via warehouse.scanNew (3.4M rows, live). Note warehouse.scan is a&lt;br /&gt;
  dead Saholic relic - 2,476 rows, last write 2012.&lt;br /&gt;
- any partner via fofo.scan_record, any scan type.&lt;br /&gt;
Phrased as NOT EXISTS so they short-circuit on the first recent row and use the&lt;br /&gt;
(inventoryItemId, scannedAt) / (inventory_item_id, create_timestamp) indexes.&lt;br /&gt;
An item that has never moved still qualifies, which is correct.&lt;br /&gt;
&lt;br /&gt;
Also in v3:&lt;br /&gt;
- the internal pseudo-brands (Dummy, FOC, FOC HANDSET, Live Demo) are no longer&lt;br /&gt;
  excluded and are swept like anything else.&lt;br /&gt;
- vendor-PO guard narrowed to status = 1. PARTIALLY_FULFILLED is UNREACHABLE,&lt;br /&gt;
  not merely rare: none of the 8 PO-status writes in the codebase sets it, no&lt;br /&gt;
  native SQL writes the column, and status = 2 has 0 rows across 51,593+ POs&lt;br /&gt;
  back to 2011. Partial receipt is modelled per line (unfulfilledQuantity), so a&lt;br /&gt;
  part-received PO sits in READY and is already caught. Documented so it is not&lt;br /&gt;
  &apos;restored&apos; later as a supposed gap.&lt;br /&gt;
&lt;br /&gt;
CatalogDelistService/Impl mirrors the migration statement for statement, for the&lt;br /&gt;
daily scheduled run. Bulk SQL rather than per-row updateActiveById +&lt;br /&gt;
publishStatusChange, which would commit to Solr once per catalog (~1,750 times&lt;br /&gt;
on the 2026-09-10 backlog); the job is instead scheduled ahead of the existing&lt;br /&gt;
06:00 full reindex. The dark-model step is deliberately house-wide rather than&lt;br /&gt;
run-scoped so it converges instead of leaving pre-existing dark models on a&lt;br /&gt;
stale RUNNING forever.&lt;br /&gt;
&lt;br /&gt;
rollback_delist_recent_movement_20260910.sql restores the 24 listings / 21&lt;br /&gt;
models that the v2 run delisted before NEW 3 existed; their partners had&lt;br /&gt;
transacted them within the month. Id list frozen, not re-derived.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/rollback_delist_recent_movement_20260910.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Frollback_delist_recent_movement_20260910.sql&amp;rev=37566</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Frollback_delist_recent_movement_20260910.sql&amp;rev=37566</guid></item>
</channel></rss>