← back to Mdc Onboard
__pycache__/import-drafts.cpython-314.pyc
121 lines
+
�jjK+ � �� � R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI t Rt
R]
R2t]! R ]
! R4 4 4 t] P P! ] P P# ] P P% ]4 4 R4 t] P* ! ]RR 7 R
]P, 9 tR]P, 9 d: ]! ]P, ]P, P3 R4 ^, , 4 MRt]P6 ! R]P8 4 t]P6 ! R
]P8 4 tR tR t R t!R t"R t#. ROt$R t%R t&]'R8X d
]&! 4 R# R# )u�
MDC → Phillipe Romano (Type II contract vinyl) DRAFT onboard.
Creates Shopify DRAFT products for dw_unified.mdc_catalog rows not yet on Shopify,
following the proven vahallan-onboard (quote-only) + knoll-onboard (private-label)
pattern. PRIVATE LABEL — "MDC" / mdcwall.com / the real book & designer names are
NEVER customer-facing; the only real datum pushed to Shopify is the opaque mfr SKU
code, stored in hidden custom+dwc manufacturer_sku metafields (per task spec).
Per product (task contract):
* title = dw_catalog.dw_title (already title-cased "... | Phillipe Romano",
guaranteed to contain no "Wallpaper"/"Unknown" — re-guarded here)
* status = draft (activation DRAFT->ACTIVE is a SEPARATE Steve-gated step
through settlement + the 5-field gate + publish-ex-Google)
* Sample var = {DW_SKU}-Sample @ $4.25, inventory_management=null (no inventory)
* quote-only => tags 'quotes' + 'contact-for-price' (no sellable/priced variant)
* metafields = custom.manufacturer_sku, dwc.manufacturer_sku (both = mfr_sku),
global.Brand=Phillipe Romano, global.width (when known),
global.unit_of_measure, custom.color/real_color_name
* >=1 image = image_url (every row has one; re-guarded)
BUDGET_CAT=backlog: this is a STANDALONE importer. It does NOT touch the shared
upload/variant-create budget (budget.cjs) and does NOT auto-activate — the drafts
land as backlog, to be drip-activated later under the activation-lane cap. Nothing
here consumes the "upload" pool.
PostgreSQL-first write-back: the moment a product is created, its shopify_product_id
+ on_shopify=true is written back to mdc_catalog (the local dw_unified mirror,
host=/tmp) BEFORE moving on — so the run is fully resumable and never double-creates.
Cost: $0 (local) — plain urllib POSTs to the Shopify Admin API (unmetered) + local
PG. No browser, no Gemini, no Claude API.
Usage:
python3 import-drafts.py # DRY-RUN: print first 3 payloads, create nothing
python3 import-drafts.py --limit 3 --commit # create 3 real drafts (test batch)
python3 import-drafts.py --commit # create ALL remaining (~45 min)
Nz)designer-laboratory-sandbox.myshopify.comzhttps://z/admin/api/2024-10c # � "