← back to Dwjs Consolidation 2026 04 23
PROCESS.md
83 lines
# DWJS Consolidation — York/Brewster Private-Label Migration
## Goal
Consolidate scattered legacy SKU prefixes (DWBR, CCA, TRF, GGA, stray DWB*) under the
dominant **DWJS** prefix and split the catalog into **two series**: York and Brewster.
Separate follow-up: DWQW (WallQuest / Malibu) collections.
## Scope (counts as of audit)
| Prefix | Total | Notes |
|---|---|---|
| DWJS- | 3,308 | Canonical target — keep |
| DWBR- | 892 | Brewster private label |
| CCA- | 474 | LA Walls legacy |
| TRF- | 76 | Mixed / transitional (vendor = Jeffrey Stevens) |
| GGA- | 66 | Legacy (needs investigation) |
| other DWB* (excl. DWBR) | ~188 | Investigate |
| **Total to renumber** | **~1,696** | |
## Target state
- Single SKU namespace: `DWJS-#####`
- Every product tagged `Series: York` **or** `Series: Brewster`
- `custom.collection_name` metafield = `York` or `Brewster`
- `custom.manufacturer_sku` preserved unchanged (true source of truth from mfr)
- `global.old_dw_sku` new metafield = previous DW SKU (for reverse lookup)
- Vendor field: unchanged (Jeffrey Stevens) unless later decision overrides
## Phases
### Phase 1 — Audit (no writes)
Pull every candidate product. For each variant collect:
- Shopify product/variant IDs, status, vendor
- Current DW SKU (e.g., DWBR-171608)
- `custom.manufacturer_sku` metafield (the mfr's real SKU)
- Title, tags
- Series classification guess (York / Brewster / Unknown) using:
- vendor = "York" or "York Contract" → York
- tag:Brewster OR prefix DWBR → Brewster
- title + tag heuristics for CCA/TRF/GGA
- Proposed new SKU: `DWJS-{base_counter}` starting at **90000** (safe range)
Output: `mapping_audit.csv` with columns
```
current_sku, new_sku, product_id, variant_id, product_status, vendor, title, mfr_sku, series_guess, tags, flags
```
Flags include: `MISSING_MFR_SKU`, `NO_SAMPLE_VARIANT`, `NO_BOLT_VARIANT`, `DUPLICATE_MFR`, `UNKNOWN_SERIES`.
### Phase 2 — Review & approval (user)
- Spot-check 50 rows across each source prefix
- Correct any `UNKNOWN_SERIES` rows
- Approve starting number, confirm York/Brewster tag format, confirm series metafield namespace/key
### Phase 3 — Execute (writes, reversible)
For each approved row, in order:
1. **Write** `global.old_dw_sku` = current_sku (metafield — audit trail)
2. **Rename** each variant SKU: `{DWBR|CCA|TRF|GGA}-##### → DWJS-#####` (keep Sample/bolt suffix convention)
3. **Add tag** `Series: York` or `Series: Brewster`
4. **Set** `custom.collection_name` = `York` or `Brewster`
5. **Do not touch** `custom.manufacturer_sku`, price, inventory, images
6. Log every change to `execution.ndjson` for rollback
### Phase 4 — DWQW (WallQuest) collections
Separate script: create Shopify manual collections for DWQW products grouped by series
with full SEO (title_tag, description_tag).
## Safety rails
- All writes via `productVariantsBulkUpdate` and `metafieldsSet` — standard GraphQL mutations
- Every mutation result logged; failures retried up to 3× then skipped into `failures.ndjson`
- **Do not delete** any old metafields; leaving `old_dw_sku` in place preserves order-history path
- Before executing Phase 3 on any product: verify no open Shopify orders reference the old SKU
(if open orders exist → flag, skip, resolve manually)
## Known risks
- **Order history** — third-party systems (QuickBooks, 3PL, vendor POs) keyed on old DW SKU
must be updated separately. `global.old_dw_sku` preserves the reverse lookup on Shopify side.
- **Barcode labels** — printed labels with old SKU become stale.
- **Vendor PO matching** — incoming invoices keyed to `custom.manufacturer_sku`, not DW SKU, so
this should remain unaffected. **Critical that manufacturer_sku never gets overwritten.**
## Rollback
`execution.ndjson` logs every write. `global.old_dw_sku` metafield preserves original on each
product. If rollback needed: iterate log, reverse each rename and tag write. Full reverse takes
~same time as forward run.