<?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/delist_inactive_listings_rolling_24m.sql</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Wed, 07 Oct 2026 16:57:25 +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%2Fdelist_inactive_listings_rolling_24m.sql&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Tue, 29 Sep 2026 04:14:47 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37805 – fix(catalog): trim f_ colour prefix space; age delisted listings from ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 8 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(catalog): trim f_ colour prefix space; age delisted listings from last activation&lt;br /&gt;
&lt;br /&gt;
- Item.normalizeColor drops the space after f_ on every write (upload sheets typed&lt;br /&gt;
  &apos;f_ Black&apos;, which read &apos; Black&apos; everywhere); ItemLoaderService uses it so the&lt;br /&gt;
  duplicate-colour check compares the clean value&lt;br /&gt;
- tag_listing.last_activated, stamped by TagListing.setActive on off-&gt;on;&lt;br /&gt;
  updateActiveById now goes through the entity (+flush) so the toggle stamps it&lt;br /&gt;
- delist cron + SQL script age a listing from GREATEST(start_date, last_activated),&lt;br /&gt;
  so a re-activated listing is not delisted again the next morning&lt;br /&gt;
- migrations: add_tag_listing_last_activated_20260929.sql, fix_item_color_prefix_space_20260929.sql&lt;br /&gt;
  (both applied on hadb1 2026-09-29; 174 items trimmed, 36830 excluded - clashes with 37089)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/Item.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListing.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepositoryImpl.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/java/com/spice/profitmandi/service/catalog/ItemLoaderService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_tag_listing_last_activated_20260929.sql&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/fix_item_color_prefix_space_20260929.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37805</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37805</guid></item>
<item><pubDate>Thu, 24 Sep 2026 22:37:06 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37778 – fix(catalog): delist cron retires only models it darkened in the ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(catalog): delist cron retires only models it darkened in the same run&lt;br /&gt;
&lt;br /&gt;
Step 4 scanned every mobile model with no active listing and moved it to OTHER,&lt;br /&gt;
so new launches (categorised before listing) and hand-paused models were retired&lt;br /&gt;
the next morning, e.g. Nothing Phone 4 1026596-603 on 2026-09-15. Scope it to&lt;br /&gt;
models whose listing this run delisted (_delist_audit run_date = today).&lt;br /&gt;
Add fix_dark_model_retire_20260924.sql to restore the 16 models still stuck on OTHER.&lt;/div&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/fix_dark_model_retire_20260924.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37778</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37778</guid></item>
<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%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37566</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37566</guid></item>
<item><pubDate>Thu, 10 Sep 2026 02:52:18 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37563 – Filter delisted SKUs out of creation pickers; add rolling 24m ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 7 file(s) modified&lt;/strong&gt;&lt;br/&gt;Filter delisted SKUs out of creation pickers; add rolling 24m delist migration&lt;br /&gt;
&lt;br /&gt;
Creation screens could offer items whose catalog.tag_listing.active = 0:&lt;br /&gt;
- Item.selectAllModels (scheme/offer model dropdown) joined tag_listing with&lt;br /&gt;
  no active predicate. Adding tl.active = true also gives the model-level&lt;br /&gt;
  rollup, since callers dedupe to catalogItemId: a model whose colours are&lt;br /&gt;
  all inactive now yields no rows, one keeping a listed colour stays.&lt;br /&gt;
- The shared partner item picker had no active filter at all. Added a second&lt;br /&gt;
  basis via getAllPartnerItemStringDescription(anyColor, activeOnly);&lt;br /&gt;
  activeOnly participates in the fofoItems cache key so the two bases cannot&lt;br /&gt;
  serve each other&apos;s cached results. Default stays false for screens that&lt;br /&gt;
  inspect or edit existing records.&lt;br /&gt;
- New TagListing.selectActiveItemIds named query backs the filter.&lt;br /&gt;
&lt;br /&gt;
Also adds the rolling 24-month delist migration: zero stock both sides, no&lt;br /&gt;
outstanding vendor PO (status IN (1,2), external supplier, unfulfilled &gt; 0 --&lt;br /&gt;
INIT is excluded as it is a drawer of stale drafts), and re-categorises&lt;br /&gt;
fully-dark mobile models to OTHER. Idempotent, audited, rollback documented.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/Item.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListing.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/InventoryService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/InventoryServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37563</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2Fdelist_inactive_listings_rolling_24m.sql&amp;rev=37563</guid></item>
</channel></rss>