This commit enforces proper SKU validation, uses the SKU as the Shopify handle, and implements ID-based product updates to allow renaming. It also extracts the IShop interface for TDD.
1.7 KiB
1.7 KiB
Project Memory
Project Context
This project (product_inventory) integrates Google Sheets with Shopify. It serves as a master inventory management tool where users edit product data in a Google Sheet, and scripts automatically sync those changes to Shopify.
Critical Components:
- Google Apps Script: Runs the logic.
- "vars" Sheet: Holds all configuration and API keys. NEVER hardcode credentials.
- Shopify Admin API: Used for syncing. REST for Orders, GraphQL for Products.
Work Patterns & Agreements
- Documentation First: Before implementing complex features, we update the plan and often the documentation (README/ARCHITECTURE).
- Safety First: We use
SafeToAutoRun: falsefor commands that deploy or modify external state until verified. - Strict Typing: We use TypeScript. No
anyunless absolutely necessary (and even then, we try to avoid it). - TDD: We follow Test Driven Development (Red/Green/Refactor). Write failing tests before implementing features.
- Artifact Usage: We use
task.md,implementation_plan.md, andwalkthrough.mdto track state.
Key Technical Decisions
- Queue System: We implemented
onEditQueue.tsto batch edits. This prevents hitting Shopify API rate limits and Google Apps Script execution limits during rapid manual edits. - Hybrid API: We use REST for retrieving Orders (legacy/easier for flat data) and GraphQL for Products (more efficient/flexible).
- Global Exports: Functions in
src/global.tsare explicitly exposed to be callable by Apps Script triggers.
User Preferences
- OS: Windows.
- Shell: PowerShell.
- Node Manager:
fnm.