← back to Harlequin Sample Price Analysis
artifacts/REPRICE-PLAN.md
34 lines
# TK-10870 — read-only reprice PLAN (for gated Action 1)
Generated read-only from the `dw_unified` mirror. **Nothing here is executed — the write stays
Steve-gated.** Machine-readable: `artifacts/reprice-plan.json`; validated by `tests/plan.test.mjs`.
## Accounting (all 32 on-Shopify rows dispositioned — corrected after Cody gate)
- **27 `reprice_now`** — have a roll variant + confirmed cost; target retail computed.
- **3 `needs_roll_variant`** — DWHQ-335008 / 335013 / 335023 are **sample-only** (`has_product_variant=false`,
`variant_count=1`): no roll variant exists to reprice. Hold until a roll variant is created.
- **2 `excluded`** — DWHQ-335002 (Cranes Marine: collision + cost-gap) and DWHQ-335024
(Demoiselle/Locronan mfr_sku mis-stamp collision).
- `27 + 3 + 2 = 32` ✓ (test-enforced).
## Target retail (verified)
`target_retail = round(net_cost / 0.65 / 0.85, 2)` for all 27 — asserted against the formula by the
plan test. Tiers: $208.14 (cost 115), $228.05 (126), $253.39 (140), $269.68 (149).
## Identifiers & join key (Cody clarity)
- **`dwhq_sku` IS the real Shopify write-target sku** (`shopify_products.sku`). The catalog `dw_sku`
is the disjoint `DWHA-570*` namespace — do NOT key the write on it.
- Join catalog↔shopify on **`shopify_id = 'gid://shopify/Product/' || shopify_product_id`**, NOT `mfr_sku`.
## Steps that are inherently LIVE (cannot be finished read-only)
1. **Variant targeting.** The mirror's `variant_id`/`variant_sku` points at the **Sample** variant for
these products. Execution MUST call the Shopify Products API per product, enumerate variants, and
set the price on the **roll (non-`-Sample`) variant only** — never reprice by the mirror's variant_id,
and never touch the $4.25 Sample.
2. **Current price** is NULL in the mirror — read the live roll-variant price first to build the restore-map.
## Execution shape (for the gated owner)
For each of the 27 `reprice_now` `shopify_product_id`s: read variants live → pick the roll variant →
snapshot current price to a restore-map → set price = `target_retail`. Reversible via the restore-map.
Customer-facing → **Steve-gated**. The 3 sample-only products need a roll variant before they can price.