Commit Graph

194 Commits

Author SHA1 Message Date
HoloPanio 4fa13a1d28 fix(migrate): fix set -e swallowing prisma output on failure
POSIX sh exits a script on the assignment line when command substitution
exits non-zero under set -e -- before the subsequent echo ever runs.

  DEPLOY_OUTPUT=$(cmd 2>&1)   # <- script exits here if cmd fails
  EXIT_CODE=$?
  echo "$DEPLOY_OUTPUT"       # <- never reached

Fix: use the || idiom, which puts the LHS in a compound-command context
where set -e does not apply, and still captures the real exit code:

  EXIT_CODE=0
  DEPLOY_OUTPUT=$(cmd 2>&1) || EXIT_CODE=$?
  echo "$DEPLOY_OUTPUT"       # <- always runs

Applied the same fix to the resolve call.
v0.1.25
2026-04-08 14:31:22 +00:00
HoloPanio 6b90bab30c fix(api): add catch-up migration to sync db-push schema drift
All schema changes that were applied via 'prisma db push' over the past
several months were never captured in migration files.  When the postgres
pod restarted just before the migration job ran, the database was rebuilt
from the 15 existing migrations -- creating an old schema that was missing
~20 tables and significant structural changes to User, Opportunity,
CatalogItem, and Company.

This migration bridges the gap idempotently:
- New enums: PhoneType, FaxType, BillingMethod, BillingType, GenderType,
  USState, Country, OpportunityInterest
- User: add firstName/lastName/title/active/hidden/cwMemberId/updatedBy;
  drop emailVerified/name; make userId nullable
- CatalogItem: TEXT id → INTEGER id + TEXT uid PK; restructure FK columns
- Company: TEXT id → INTEGER id + TEXT uid PK; drop old CW columns; add
  dateDeleted/deleteFlag/phone/taxExempt/taxId/website/enteredById
- Opportunity: TEXT id → INTEGER id + TEXT uid PK; drop ~25 flat CW
  columns; add typeId/statusId/contactId/siteId/locationId/departmentId/
  closedById/primarySalesRepId/secondarySalesRepId/eneteredBy/updatedBy/
  oppNarrative/taxCodeId/interest; drop cwDateEntered
- UnifiSite: companyId TEXT → INTEGER
- 20+ new tables: CorporateLocation, InternalDepartment, CompanyAddress,
  Contact, CatalogItemType, CatalogCategory, CatalogSubcategory,
  CatalogManufacturer, Warehouse, WarehouseBin, ProductInventory,
  MinimumStockByWarehouse, ProductData, ServiceTicket, ServiceTicketNote,
  ServiceTicketType, ServiceTicketBoard, ServiceTicketLocation,
  ServiceTicketSource, ServiceTicketImpact, ServiceTicketPriority,
  ServiceTicketServerity, ServiceTicketFinalData, OpportunityType,
  OpportunityStatus, ScheduleStatus, ScheduleType, ScheduleSpan,
  Schedule, TaxCode

Verified: all 16 migrations apply cleanly on a fresh DB and produce zero
schema drift (prisma migrate diff outputs '-- This is an empty migration.')

Fixes P2022 ColumnNotFound errors on login and all model queries.
2026-04-08 13:40:29 +00:00
HoloPanio 7914c025a1 chore(migrate): add local migration test harness script 2026-04-08 05:36:41 +00:00
HoloPanio 8c32b0c5e0 fix(migrate): rewrite entrypoint to resolve P3009 from deploy error output v0.1.0-b1 2026-04-08 05:25:37 +00:00
HoloPanio f34178978e fix(ci): fix migration pod log retrieval 2026-04-08 05:13:14 +00:00
HoloPanio 9a1a641e97 fix(ci): don't hang forever waiting for migration job to complete 2026-04-08 05:05:40 +00:00
HoloPanio 557e729ca9 fix(ci): fix UI server build context, macOS/Windows desktop build steps 2026-04-08 04:56:17 +00:00
HoloPanio f3a8a7e25a ci: attempt to fix Deployment 2026-04-08 04:41:53 +00:00
HoloPanio b9c2ddb38b fix: add missing patches COPY + workspace COPY to Dockerfiles; fix UI workdir; add @prisma/client-runtime-utils explicitly to api and dalpuri 2026-04-08 04:18:17 +00:00
HoloPanio ee0434fa08 fix: add missing workspace package.json COPYs to Dockerfiles for bun workspace resolution 2026-04-08 03:51:19 +00:00
HoloPanio 7cbc0c9178 fix: pin bun to 1.3.11 in Dockerfiles, fix husky CI crash, fix workspace:* npm compat 2026-04-08 03:43:52 +00:00
HoloPanio 92318608dd fix(tests): mock workert module in setup to prevent PgBoss crash on missing DATABASE_URL 2026-04-08 03:22:57 +00:00
HoloPanio 8e5c0801ef fix: add missing socket.io-client dependency to api package 2026-04-08 03:18:40 +00:00
HoloPanio 0844fd0577 fix: remove dotenv/config import from prisma configs (not installed, Bun loads .env natively) 2026-04-08 03:11:44 +00:00
HoloPanio 1d48a2fe7b ci(global): fix failing tests 2026-04-08 03:09:27 +00:00
HoloPanio 43a3968788 fix: remove duplicate typescript and stale next dep from root package.json 2026-04-08 03:07:53 +00:00
HoloPanio e88d21fa35 ci(global): go through and make sure all related files are working and good to go 2026-04-08 03:04:58 +00:00
HoloPanio 546bf65b8b test(ui): i corrected UI Testing 2026-04-08 01:45:12 +00:00
HoloPanio 5d378ccb56 fix tests 2026-04-08 01:02:45 +00:00
HoloPanio 24f303355b all the haul 2026-04-07 23:56:31 +00:00
HoloPanio 87cce83030 fix(dalpuri): correct UTC timestamp field names in smart sync
Fixed field name mismatches for tables with lastUpdatedUTC (all-caps):
- IV_Product: lastUpdateUtc → lastUpdatedUTC
- Department: lastUpdateUtc → lastUpdatedUTC

These field names must match the Prisma schema exactly (case-sensitive).
Ensures smart sync decision logic can correctly probe for record updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 21:28:22 -05:00
HoloPanio 688a9096c2 refactor(api): started implementing all of the tables needed for full data synchronization
BREAKING CHANGE: refer to body
2026-03-22 20:48:29 -05:00
HoloPanio 6b7eec67b8 fix: remove nested .git folders, re-add as normal directories 2026-03-22 17:50:47 -05:00
HoloPanio f55c7e47c9 chore:update everything 2026-03-22 17:47:03 -05:00
HoloPanio cb71133186 chore: add EVERYTHING 2026-03-22 17:44:44 -05:00
HoloPanio 91fa272fe6 chore: add EVERYTHING 2026-03-22 17:43:55 -05:00
HoloPanio 5ea7bb8f95 chore: import history from ui 2026-03-22 17:43:23 -05:00
HoloPanio 9fed61de68 chore: import history from api 2026-03-22 17:41:40 -05:00
Jackson ec4c8da786 Initial commit 2026-03-22 17:21:08 -05:00
HoloPanio 2f17f24b3b fix: ship sales tax rates with production runtime v0.1.23 2026-03-16 11:25:12 -05:00
HoloPanio 1230dacfa2 build: include logo.png in runtime image v0.1.22 2026-03-15 23:55:46 -05:00
HoloPanio 005e939a54 Swap Quick Add and Add to Cart button order in detail pane
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-15 23:53:41 -05:00
HoloPanio 85fa991c30 Sales opportunity enhancements and unsaved changes guard
- Add unsaved changes guard (UnsavedChangesDialog, EditGuard, dirtyState store)
- Add Breadcrumb component
- Add EmailText component
- Update sales opportunity detail with new tabs and workflow
- Add dashboard tab to sales page with metrics
- Update opportunity API URLs to include /opportunity/ path segment
- Add auth token refresh endpoint
- Add credential-types API endpoint
- Add CW members store
- Add sales-utils helpers
- Update layout server to return user info alongside canViewAdmin
- Fix unit tests to match updated API paths and return shapes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-15 23:43:34 -05:00
HoloPanio 1dc3c7ce07 test: align review approval status with ReadyToSend v0.1.21 2026-03-15 23:43:16 -05:00
HoloPanio e764932c39 feat: expand sales opportunity workflow and metrics APIs v0.1.20 2026-03-15 23:38:56 -05:00
HoloPanio e74611cd96 refactor: extract reusable UI components and shared utilities 2026-03-12 22:47:06 -05:00
HoloPanio 33b34d08a7 Add migration for CwMember table
Creates the CwMember table migration that was missing from the migration history
(previously applied locally via db push but never migrated for production).
v0.1.19
2026-03-09 17:59:17 -05:00
HoloPanio 7ffbd98f2e feat: add taxableFlag editing and improve add-products UX
- Make taxableFlag editable in opportunity product detail view
- Normalize salesTaxable → taxableFlag in procurement catalog API
- Add taxableFlag to EditOpportunityProductBody interface
- Add loading spinner and disable button during 'Add Selected Items'
- Prevent double-submit on add-selected-items action
2026-03-09 17:49:28 -05:00
HoloPanio 5afda8cb34 Add taxableFlag to product updates, QUO-Narrative quote fallback, and orphan reconciliation
- Add taxableFlag boolean field to product update schema and forecast patch
- Fall back to QUO-Narrative product customerDescription for quote narrative
- Reconcile orphaned local opportunity records not found in CW during refresh
- Invalidate caches for removed orphaned opportunities
- Add reconciled event and orphanedCount to refresh events
- Update API_ROUTES.md with taxableFlag field documentation
v0.1.18
2026-03-09 17:48:47 -05:00
HoloPanio ee3e0a7377 bypass checkColdStatus — always returns not-cold until feature ready v0.1.17 2026-03-09 03:33:59 -05:00
HoloPanio e294791858 fix: provide real checkColdStatus in wfOpportunity mock, remove stray closing brace 2026-03-09 03:29:00 -05:00
HoloPanio 97ac4a2173 fix: eliminate cross-file mock.module pollution — complete exports for all mocked modules 2026-03-09 03:26:22 -05:00
HoloPanio ad7507d133 fix: use real cache key prefixes in mock and dynamic imports for CI compatibility 2026-03-09 03:08:15 -05:00
HoloPanio 15ef24eb3e fix: resolve CI test failures — explicit cache mock exports, hoisted service mocks, pinned Bun 1.3.6 2026-03-09 03:03:06 -05:00
HoloPanio f53b390e18 feat: add opportunity workflows, delete routes, company sites, algorithms, and expanded test coverage 2026-03-09 02:56:08 -05:00
HoloPanio 02dc4f0305 fix: rename +-prefixed spec files to prevent SvelteKit build errors
SvelteKit rejects files with + prefix in routes/ during vite build.
Renamed all +*.spec.ts files to drop the + prefix (e.g. +page.server.spec.ts → page.server.spec.ts).
This fixes both Docker and Electron Forge builds.
2026-03-09 02:30:10 -05:00
HoloPanio 025e4e8a44 fix: exclude test/spec files from Docker build context 2026-03-09 02:20:23 -05:00
HoloPanio 7073f5aa33 feat: add workflow actions, admin enhancements, and comprehensive test coverage 2026-03-09 02:14:08 -05:00
HoloPanio 5169107a04 feat(sales): enhance opportunity management and add CW integration 2026-03-07 18:16:14 -06:00
HoloPanio c0a4d4f919 feat: add CW members, opportunity create/update, and integrator interceptor v0.1.16 2026-03-07 18:15:17 -06:00