[object Object]

← back to Hollywood Import

TK-11757: price>0 guard on RESUME path of danapoint-promote (never stamp on_hand=2026 CONTINUE onto a $0 variant, TK-11357 class)

d248f232bc1b4ab6a9c73ef37d23fb96ba393593 · 2026-09-15 00:50:44 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit d248f232bc1b4ab6a9c73ef37d23fb96ba393593
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Sep 15 00:50:44 2026 -0700

    TK-11757: price>0 guard on RESUME path of danapoint-promote (never stamp on_hand=2026 CONTINUE onto a $0 variant, TK-11357 class)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 tk11337-danapoint-promote.mjs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tk11337-danapoint-promote.mjs b/tk11337-danapoint-promote.mjs
index 83a1546..c5063fe 100644
--- a/tk11337-danapoint-promote.mjs
+++ b/tk11337-danapoint-promote.mjs
@@ -97,6 +97,11 @@ async function upsertMF(namespace,key,type,value){
     console.log('  ✓ sample re-healed');
     after=(await gql(LOOKUP,{id:GID})).node.variants.nodes;
   }
+  // 2) inventory 2026 on yard — price>0 guard (mirrors the create-path sample-only guard; TK-11357 $0-orderable class):
+  //    on the RESUME path yardV is an EXISTING variant; never stamp on_hand=2026 + CONTINUE onto a $0/priceless variant,
+  //    which would make it checkout-orderable for $0.00. Create path always sets PRICE (56.83) so this passes there.
+  const yardPrice=parseFloat(yardV.price);
+  if(!(yardPrice>0)){console.log(`GUARD: yard variant price is ${yardV.price==null?'null':'$'+yardV.price} — refusing to stamp on_hand=${QTY} (CONTINUE) on a $0/priceless variant (TK-11357). No inventory change.`);return;}
   // 2) inventory 2026 on yard
   if(yardV.inventoryItem?.id){const iid=yardV.inventoryItem.id;await gql(M_TRACK,{id:iid});await gql(M_ACT,{iid,loc:LOC});await gql(M_QTY,{input:{name:'on_hand',reason:'correction',ignoreCompareQuantity:true,quantities:[{inventoryItemId:iid,locationId:LOC,quantity:QTY}]}});console.log('  ✓ inventory 2026');}
   // 3) relabel sample sku (only if it still carries the old code, and wasn't just re-healed to SAMP_SKU)

← add48d6 security: strip hardcoded dw_admin secret -> env-first/passw  ·  back to Hollywood Import  ·  hollywood-add-yard: guard against $0-orderable yard variant d995321 →