feat: implement status automation and router pattern

- Implemented modular status automation system (statusHandlers.ts).
- Added handlers for 'Published' (Active/Qty 1), 'Sold' (Active/Qty 0), and 'Drafted'.
- Refactored onEdit triggers into a central Router pattern in OnEditHandler.ts.
- Updated Product.ts to support explicit quantity setting (fixed 0 value bug).
- Updated shopifyApi.ts to implement SetInventoryItemQuantity (using ignoreCompareQuantity).
- Consolidated triggers into single onEditHandler.
- Updated project documentation.
This commit is contained in:
2025-12-24 23:55:28 -07:00
parent 2d43c07546
commit 85cdfe1443
9 changed files with 158 additions and 15 deletions

View File

@ -14,7 +14,7 @@ import {
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
import { reinstallTriggers } from "./triggers"
import { newSkuHandler } from "./newSku"
import { columnOnEditHandler } from "./OnEditHandler"
import { columnOnEditHandler, onEditHandler } from "./OnEditHandler"
import {
onEditQueue,
processBatchedEdits
@ -33,6 +33,7 @@ import { installSalesSyncTrigger } from "./triggers"
;(global as any).matchProductToShopifyOnEditHandler = matchProductToShopifyOnEditHandler
;(global as any).updateShopifyProductHandler = updateShopifyProductHandler
;(global as any).columnOnEditHandler = columnOnEditHandler
;(global as any).onEditHandler = onEditHandler
;(global as any).onEditQueue = onEditQueue
;(global as any).processBatchedEdits = processBatchedEdits
;(global as any).reauthorizeScript = reauthorizeScript