Files
product_inventory/src/global.ts
Ben Miller 85cdfe1443 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.
2025-12-24 23:55:28 -07:00

52 lines
2.3 KiB
TypeScript

/// <reference types="@types/google-apps-script" />
import { onOpen } from "./onOpen"
import { matchProductToShopifyOnEditHandler } from "./OnEditHandler"
import { getShopifyProducts } from "./shopifyApi"
import { runShopifyOrders } from "./shopifyApi"
import {
initMenu,
matchProductToShopifyHandler,
updateShopifyProductHandler,
reauthorizeScript,
} from "./initMenu"
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
import { reinstallTriggers } from "./triggers"
import { newSkuHandler } from "./newSku"
import { columnOnEditHandler, onEditHandler } from "./OnEditHandler"
import {
onEditQueue,
processBatchedEdits
} from "./onEditQueue"
import { fillProductFromTemplate } from "./fillProductFromTemplate"
import { showSidebar, getQueueStatus, setQueueEnabled, deleteEdit, pushEdit } from "./sidebar"
import { checkRecentSales, reconcileSalesHandler } from "./salesSync"
import { installSalesSyncTrigger } from "./triggers"
// prettier-ignore
;(global as any).onOpen = onOpen
;(global as any).initMenu = initMenu
;(global as any).getShopifyProducts = getShopifyProducts
;(global as any).runShopifyOrders = runShopifyOrders
;(global as any).matchProductToShopifyHandler = matchProductToShopifyHandler
;(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
;(global as any).reinstallTriggers = reinstallTriggers
;(global as any).newSkuHandler = newSkuHandler
;(global as any).fillProductFromTemplate = fillProductFromTemplate
;(global as any).createMissingPhotoFolders = createMissingPhotoFolders
;(global as any).showSidebar = showSidebar
;(global as any).getQueueStatus = getQueueStatus
;(global as any).setQueueEnabled = setQueueEnabled
;(global as any).deleteEdit = deleteEdit
;(global as any).pushEdit = pushEdit
;(global as any).checkRecentSales = checkRecentSales
;(global as any).reconcileSalesHandler = reconcileSalesHandler
;(global as any).installSalesSyncTrigger = installSalesSyncTrigger