Ben Miller 2c01693271 Refine Media Manager Save Logic and UI
- Add failing global function verification test (GlobalFunctions.test.ts) and fix missing exports in global.ts.
- Refactor MediaManager.html UI:
    - Implement 
enderPlanHtml to standardize Plan (Details) and Execution views.
    - Show 'Skipped' state for empty save phases.
    - Visually decouple 'Sheet Update' from 'Reorder' phase.
    - Separate 'Manual Link' operations into their own 'Linking' section in the plan view, distinct from Adoptions.
    - Fix TypeErrors in 
enderPlanHtml (undefined actions) and 
enderMatch (missing DOM elements).
- Update MediaService.test.ts to match new filename constraints on reorder.
- Update mediaHandlers.test.ts to correctly spy on loose MediaService instances.
- Ensure all tests pass.
2026-01-01 08:04:06 -07:00
2024-11-07 21:49:40 -07:00
2024-11-13 23:43:32 -07:00

Product Inventory Management

This project integrates Google Sheets with Shopify to manage product inventory, photos, and metadata. It uses Google Apps Script to synchronize data between a "master" Google Sheet and your Shopify store.

Overview

The system allows you to:

  • Manage product details (SKUs, titles, descriptions) in a Google Sheet.
  • Automatically upload product photos from Google Drive to Shopify.
  • specific triggers (onEdit, onOpen) to sync changes to Shopify in real-time or on-demand.
  • Handle rate limiting and concurrency using a custom queue system.
  • Handle rate limiting and concurrency using a custom queue system.
  • Monitor and troubleshoot background processes via a custom side panel.
  • Automated Sales Sync: Periodically check Shopify for recent sales and mark items as "sold" in the sheet.
  • Manual Reconciliation: Backfill sales data for a specific time range via menu command.
  • Status Workflow Automation: Automatically update Shopify status and inventory based on the sheet's "status" column (e.g., "Sold" -> Active, 0 Qty).
  • Integrated Media Manager: A dedicated sidebar for managing product photos, including Google Drive integration and live Shopify syncing.

Prerequisites

  • Node.js: managed via fnm (Fast Node Manager)
  • Google Clasp: for pushing code to Apps Script
  • Google Cloud Project: tied to the Apps Script container

Quick Start

  1. Install Dependencies

    npm install
    
  2. Build Project

    npm run build
    
  3. Deploy to Apps Script

    npm run deploy
    

Testing

Run unit tests using Jest:

npm test
```bash
npm test

Code Quality Enforcement

This project uses Husky to enforce code quality locally.

  • Pre-commit Hook: Runs tests on changed files before every commit.
  • Coverage Requirement: Modified files must maintain 80% code coverage. Commits will be blocked if this threshold is not met.

Project Structure

  • src/: Source code (TypeScript)
  • src/config.ts: Configuration loading from Sheets
  • src/global.ts: Entry points for Apps Script
  • src/shopifyApi.ts: Shopify Admin API wrapper
  • src/onEditQueue.ts: Concurrency management

For more details, see:

Description
No description provided
Readme 2.7 MiB
Languages
TypeScript 70.8%
HTML 28.8%
JavaScript 0.3%
PowerShell 0.1%