From 0d819badc2a4b2a5390314dedb657d0ebc85447c Mon Sep 17 00:00:00 2001 From: lorentz Date: Fri, 10 Jul 2026 19:38:24 -0400 Subject: [PATCH] feat(11-01): extend PAX8 types with cost fields and sync-result shapes - Pax8Subscription: price, partnerCost, currencyCode, productName, endDate, updatedDate - Pax8Product: vendorName, shortDescription - New Pax8EntitySyncResult / Pax8SyncResult mirroring AppgateSyncResult shape - Note pre-existing unrelated tsc errors in sync-scheduler.ts (missing untracked appgate-factory/appgate-sync-service files in this worktree) in deferred-items.md --- .../deferred-items.md | 16 ++++++++++ lib/types/pax8.ts | 32 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .planning/phases/11-company-catalog-subscription-sync/deferred-items.md diff --git a/.planning/phases/11-company-catalog-subscription-sync/deferred-items.md b/.planning/phases/11-company-catalog-subscription-sync/deferred-items.md new file mode 100644 index 0000000..df8ae9e --- /dev/null +++ b/.planning/phases/11-company-catalog-subscription-sync/deferred-items.md @@ -0,0 +1,16 @@ +# Deferred Items — Phase 11 + +Items discovered during execution that are out of scope for the current +plan/task and are not auto-fixed per the executor's scope boundary rule. + +## Plan 01 + +- **Pre-existing `tsc` errors unrelated to this plan**: `lib/services/sync-scheduler.ts:446,450` + reference `@/lib/services/appgate-factory` and `@/lib/services/appgate-sync-service`, + which are untracked files present in the main repo checkout (`git status` shows them + as `??`) but were never committed — so they do not exist in this git worktree's + history. This is a worktree/commit-state artifact, not something introduced by + Plan 01's changes (migration 092, `lib/types/pax8.ts` extensions). Confirmed via + `npx tsc --noEmit --pretty` before and after this plan's edits — same 2 errors, + same file, unrelated to `lib/types/pax8.ts`. No action taken; will resolve itself + once the AppGate work is committed to the main branch/worktree base. diff --git a/lib/types/pax8.ts b/lib/types/pax8.ts index c62e6d8..ca6c9de 100644 --- a/lib/types/pax8.ts +++ b/lib/types/pax8.ts @@ -41,6 +41,12 @@ export interface Pax8Subscription { billingTerm: string | null; status: string | null; startDate: string | null; + price: number | null; // customer/list price (D-03) + partnerCost: number | null; // partner/reseller cost (D-03) + currencyCode: string | null; + productName: string | null; + endDate: string | null; + updatedDate: string | null; [key: string]: unknown; // escape hatch for fields not yet modeled } @@ -50,6 +56,8 @@ export interface Pax8Product { vendorSku: string | null; name: string; category: string | null; + vendorName: string | null; + shortDescription: string | null; [key: string]: unknown; // escape hatch for fields not yet modeled // NOTE: the deprecated alternate-vendor-SKU field per PAX8's own schema is intentionally omitted. } @@ -78,3 +86,27 @@ export interface Pax8OrderItem { currencyCode: string | null; [key: string]: unknown; // escape hatch for fields not yet modeled } + +// ─── Sync result shapes ─────────────────────────────────────────────────── +// Mirrors lib/types/appgate.ts's AppgateSyncResult/AppgateEntity shape — +// the sync service (Plan 02) reports one Pax8EntitySyncResult per entity +// type (companies/products/subscriptions), rolled up into a Pax8SyncResult. + +export interface Pax8EntitySyncResult { + entity: string; + success: boolean; + upserted: number; + tombstoned: number; + durationMs: number; + error?: string; +} + +export interface Pax8SyncResult { + syncId: string; + status: 'completed' | 'failed'; + startedAt: Date; + completedAt: Date | null; + durationMs: number; + entities: Pax8EntitySyncResult[]; + errors: string[]; +}