[object Object]

← back to Hollywood Mfr Trim

recover24 APPLIED (144/144, verified live); add mint14 for the 14 cleared collides (incl HAR-04/TR-CL-07), dry-run 42/14 clean, gated

71a981d4a831438eba2bf18c7cb1b0396f1d8767 · 2026-08-18 11:03:51 -0700 · steve

Files touched

Diff

commit 71a981d4a831438eba2bf18c7cb1b0396f1d8767
Author: steve <steve@designerwallcoverings.com>
Date:   Tue Aug 18 11:03:51 2026 -0700

    recover24 APPLIED (144/144, verified live); add mint14 for the 14 cleared collides (incl HAR-04/TR-CL-07), dry-run 42/14 clean, gated
---
 remediate.mjs | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/remediate.mjs b/remediate.mjs
index c02b9fc..2546202 100644
--- a/remediate.mjs
+++ b/remediate.mjs
@@ -88,7 +88,26 @@ if(PART==='archived'){
     UNION ALL SELECT pid,'global','manufacturer_sku',msku FROM r
   )
   SELECT COALESCE(json_agg(json_build_object('ownerId','gid://shopify/Product/'||pid,'namespace',ns,'key',k,'type','single_line_text_field','value',v) ORDER BY pid,k,ns),'[]') FROM w;`;
-} else { console.error('Pass --part archived | mint75 | recover24'); process.exit(1); }
+} else if(PART==='mint14'){
+  // 14 collides: provenance-verified Momentum products whose mfr code collides on a shared pattern string.
+  // Their manufacturer_sku already holds the pattern code; just mint the unique HWC canonical into dw_sku.
+  // recover24 consumed HWC-61320..61343, so this continues at 61344.
+  SQL = `WITH b AS (
+    SELECT DISTINCT regexp_replace(shopify_id,'\\D','','g') AS pid, TRIM(mfr_sku) AS mfr
+    FROM shopify_products sp
+    WHERE (vendor='Hollywood Wallcoverings' OR dw_sku LIKE 'HWC-%')
+      AND status='ACTIVE' AND dw_sku IS NULL AND ${FAB}
+      AND mfr_sku IS NOT NULL AND TRIM(mfr_sku)<>''
+      AND EXISTS (SELECT 1 FROM momentum_colorways m WHERE TRIM(sp.mfr_sku) IN (TRIM(m.pattern_sku),TRIM(m.lcode)))
+      AND EXISTS (SELECT 1 FROM shopify_products o WHERE TRIM(o.mfr_sku)=TRIM(sp.mfr_sku) AND o.shopify_id<>sp.shopify_id)
+  ), r AS (SELECT pid,'HWC-'||(61343 + row_number() OVER (ORDER BY pid))::text AS hwc FROM b),
+  w AS (
+    SELECT pid,'custom' ns,'dw_sku' k,hwc v FROM r
+    UNION ALL SELECT pid,'dwc','dw_sku',hwc FROM r
+    UNION ALL SELECT pid,'global','dw_sku',hwc FROM r
+  )
+  SELECT COALESCE(json_agg(json_build_object('ownerId','gid://shopify/Product/'||pid,'namespace',ns,'key',k,'type','single_line_text_field','value',v) ORDER BY pid,ns),'[]') FROM w;`;
+} else { console.error('Pass --part archived | mint75 | recover24 | mint14'); process.exit(1); }
 
 const payload = psql(SQL);   // json_agg -> a single JSON array, parsed by the psql() helper
 

← 651e394 Add recover24: write recovered Momentum SKUs->manufacturer_s  ·  back to Hollywood Mfr Trim  ·  (newest)