Skip to content

Add ShopifySovereignBridge class for biometric fit metadata injection#122

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/sync-robert-to-shopify-again
Draft

Add ShopifySovereignBridge class for biometric fit metadata injection#122
Copilot wants to merge 2 commits intomainfrom
copilot/sync-robert-to-shopify-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Implements ShopifySovereignBridge — a class that injects Robert biometric fit metrics into Shopify draft orders to reduce returns, and syncs inventory changes from the Armario Solidario.

Changes

api/shopify_bridge.py

  • ShopifySovereignBridge.__init__(api_key, shop_url) — constructs api_base and auth headers; API version via SHOPIFY_ADMIN_API_VERSION env var, defaults to 2026-04
  • sync_robert_to_shopify(look_id, engine_metrics) — POSTs a draft order to Shopify Admin API with Robert_Fit_Score and Biometric_Validation line item properties; returns invoice URL on success, graceful fallback string on failure
  • update_inventory_physics(fabric_key, stock_change) — logs stock sync for Armario Solidario removals

Uses urllib.request (consistent with existing module) rather than requests.

tests/test_shopify_bridge.py

15 new unittest cases covering init, payload structure, network error handling, missing fields, and inventory sync.

bridge = ShopifySovereignBridge(api_key, "mystore.myshopify.com")

# Injects fit score into draft order line item properties
result = bridge.sync_robert_to_shopify(look_id=42, engine_metrics={"fitScore": 87})
# → Shopify invoice URL, or "Checkout de Shopify listo para Look 42" on failure

# Sync stock removal
bridge.update_inventory_physics("linen_coat_v3", -1)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryonyou-pilot Error Error Apr 7, 2026 1:54pm

Request Review

Copilot AI changed the title [WIP] Add sync process for Robert metrics to Shopify Add ShopifySovereignBridge class for biometric fit metadata injection Apr 7, 2026
Copilot AI requested a review from LVT-ENG April 7, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants