155 Commits

Author SHA1 Message Date
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
HoloPanio 0ce1eda606 fix: add missing GeneratedQuotes columns migration v0.1.15 2026-03-07 00:14:26 -06:00
HoloPanio 6c310ed753 fix: add missing probability column migration for Opportunity v0.1.14 2026-03-07 00:07:10 -06:00
HoloPanio b735981b6b feat(sales): add quotes tab, PDF viewer, and opportunity sidebar enhancements 2026-03-06 23:49:27 -06:00
HoloPanio 1907bb433b feat: restructure sales, add PDF quote generation and WebSocket support v0.1.13 2026-03-06 23:25:37 -06:00
HoloPanio 762edd8eb7 feat(sales): update opportunity product and overview flows 2026-03-04 18:44:29 -06:00
HoloPanio 4efca6cc53 Add sales item labor/product route updates and permission docs 2026-03-04 18:43:54 -06:00
HoloPanio d5c22c8eff Add special-order product flow for sales opportunities v0.1.12 2026-03-04 00:11:40 -06:00
HoloPanio e04a1ad746 Add special-order product flow and improve opportunity product sequencing 2026-03-04 00:11:36 -06:00
HoloPanio a048e1e824 feat: add CW callback route and optimize cache refresh workflows v0.1.11 2026-03-03 19:46:48 -06:00
HoloPanio c628a78b27 feat: enhance opportunity detail and sales flow 2026-03-03 19:46:12 -06:00
HoloPanio 6d935e7180 feat: Redis opportunity cache, CW API retry/logging, adaptive TTLs
- Add Redis-backed opportunity cache with background refresh (30s interval)
- Fix concurrency bug: use lazy thunks instead of eager promises for batching
- Add withCwRetry utility with exponential backoff for transient CW errors
- Add adaptive TTL algorithms (primary, sub-resource, products) based on opportunity activity
- Add include query param on GET /sales/opportunities/:id (notes,contacts,products)
- Add opt-in CW API logger (LOG_CW_API env var) with timestamped files in cw-api-logs/
- Add debug-scripts/analyze-cw-calls.py for API call analysis
- Add computeSubResourceCacheTTL and computeProductsCacheTTL algorithms with tests
- Increase CW API timeout from 15s to 30s
- Unblock cache refresh from startup chain (remove await)
- Prioritize recently updated opportunities in refresh cycle
- Add CACHING.md documentation
- Update API_ROUTES.md with caching details and include param
- Update copilot instructions to require CACHING.md sync
- Add dev:log script for CW API call logging during development
v0.1.10
2026-03-02 23:23:24 -06:00
HoloPanio fe71248e88 perf: cache-only strategy for list views, cache-then-cw for single fetch
- Add data-source hierarchy to opportunity manager (cache-only, cache-then-cw, cw-first)
- fetchPages/search/fetchByCompany use cache-only: Redis → DB (no CW calls)
- fetchItem uses cache-then-cw by default, cw-first when fresh=true
- Add idleTimeout: 255 to Bun.serve to prevent request timeouts
- Map CW status 57 (04. Confirmed Quote) to Active equivalency
- Add computeCacheTTL algorithm and opportunityCache module
v0.1.9
2026-03-02 21:12:44 -06:00
HoloPanio 7411310083 fix: add migration for missing columns (cwIdentifier, catalog categories, productSequence) v0.1.8 2026-03-01 18:28:05 -06:00
HoloPanio 9145ea5ba4 feat(sales): cancellation awareness in forecast summary, productSequence ordering
- Show fully/partially cancelled products in forecast summary table
- Add cancellation KPI card with full/partial breakdown
- Fully cancelled rows: strikethrough + reduced opacity + red badge
- Partially cancelled rows: amber border + badge + effective/total qty
- Add productSequence prop to ProductsTab for custom ordering
- Fall back to CW sequenceNumber when no productSequence set
- Add productSequence field to SalesOpportunity interface
2026-03-01 18:02:46 -06:00
HoloPanio 30b408e0db feat: add product to opportunity route, local product sequencing
- Add POST /v1/sales/opportunities/:identifier/products with field-level permission gating
- Add CWForecastItemCreate type for forecast item creation
- Store product display order locally (productSequence Int[] on Opportunity)
- Rewrite resequenceProducts to be local-only (no CW PUT, stable IDs)
- Remove reorderProducts CW util (PUT regenerated IDs & broke procurement)
- Update fetchProducts to apply local ordering with CW sequenceNumber fallback
- Add productSequence to OpportunityController.toJson()
- Update API_ROUTES.md, PERMISSIONS.md, PermissionNodes.ts
v0.1.7
2026-03-01 18:01:02 -06:00
HoloPanio d7b374f8ab feat: sales activities, forecast products, catalog categories, member cache, procurement filters, and comprehensive tests
New features:
- ActivityController and manager for CW sales activities (CRUD)
- ForecastProductController for opportunity forecast/product lines
- CW member cache with dual-layer (in-memory + Redis) resolution
- Catalog category/subcategory/ecosystem taxonomy module
- Quote statuses type definitions with CW mapping
- User-defined fields (UDF) module with cache and event refresh
- Company sites CW module with serialization
- Procurement manager filters (category, ecosystem, manufacturer, price, stock)
- Opportunity notes CRUD and product line management via CW API
- Opportunity type definitions endpoint

Updates:
- OpportunityController: CW refresh, company hydration, activities, custom fields
- UserController: cwIdentifier field for CW member linking
- CatalogItemController: category/subcategory fields from CW
- PermissionNodes: sales note/product CRUD nodes, subCategories, collectPermissions
- API routes: procurement categories/filters, sales notes/products, opportunity types
- Global events: UDF and member refresh intervals on startup

Tests (414 passing):
- ActivityController, ForecastProductController, OpportunityController unit tests
- UserController cwIdentifier tests
- catalogCategories, companySites, memberCache, procurement module tests
- activityTypes, opportunityTypes, quoteStatuses type tests
- permissionNodes subCategories and getAllPermissionNodes tests
- Updated test setup with redis mock, API method mocks, and builder helpers
2026-03-01 13:19:00 -06:00
HoloPanio 4bec198db6 feat: sales opportunity detail, procurement filters, permission resilience
- Add sales opportunity detail page with tabs (overview, notes, contacts, products, forecasts, activity)
- Add sales note CRUD endpoints (create, update, delete) with server routes
- Add opportunity types, contacts, product sequencing, and refresh API methods
- Add AddProductModal component for catalog browsing
- Update procurement.fetchMany to accept CatalogItemFilters object
- Add procurement.fetchCategories and procurement.fetchFilters endpoints
- Add resilient permission check (no-token returns all-true with __checkFailed)
- Parallelize company detail data fetches for performance
- Remove stale console.log statements across modules
- Add comprehensive unit tests for all new API methods and permission edge cases
2026-03-01 13:08:58 -06:00
HoloPanio 27755d4a00 fix: default permissions to true on API failure to prevent UI hiding
- When the permission check API call fails (timeout, network error, etc.),
  permissions now default to true instead of false
- This prevents UI elements like the WiFi tab from disappearing when the
  permission check has a transient failure
- The API still enforces access server-side, so no security impact
- Added __checkFailed flag to PermissionMap for observability
2026-02-27 18:12:14 -06:00
HoloPanio 0e634c84ff fix: keep login spinner visible until auth callback completes
- Spinner was disappearing when the OAuth popup closed, but the server
  was still waiting for the socket callback (awaitAuthCallback)
- Now the spinner stays until BOTH the popup closes AND the form action
  finishes
- Handle popup-blocked case by resetting loading state immediately
2026-02-27 18:08:27 -06:00
HoloPanio 3b43393e5d fix: add /healthz endpoint to prevent K8s crash loop
- Added dedicated /healthz route returning 200 OK
- Skip API health check in hooks.server.ts for /healthz path
- Updated K8s liveness/readiness probes to use /healthz instead of /login
- The /login probe was returning 503 when the API was unreachable, causing
  Kubernetes to kill and restart the pod in a loop
2026-02-27 18:07:26 -06:00
HoloPanio 883b648d5e fix: add identifier column migration and fix entrypoint resolve logic
- Add explicit migration for CatalogItem.identifier column
- Fix entrypoint script: resolve only migrations on 'Failed' lines (not all)
- Remove auto-diff generation (use committed migration files instead)
- Remove 2>/dev/null that swallowed migration errors
2026-02-27 17:44:08 -06:00
HoloPanio b787120461 fix: start HTTP server before background init to prevent bad gateway v0.1.6-4 2026-02-27 17:06:36 -06:00
HoloPanio 1326725995 fix: resolve failed migrations before deploying v0.1.6-2 v0.1.6-3 2026-02-27 16:26:31 -06:00
HoloPanio 508fa39835 fix: crash loop recovery, auto-migrations, CI test pipeline
- Wrap startup syncs in safeStartup() to prevent crash on external service failure
- Add migrate-entrypoint.sh for auto-generating migrations from schema diff
- Update Dockerfile migration stage to use entrypoint script
- Add test job to build-and-publish workflow (runs before build)
- Add tests.yaml workflow to run tests on every push
- Fix test setup to use real RSA key pair instead of plain strings
- Add test script to package.json
v0.1.6-1
2026-02-27 16:11:28 -06:00
HoloPanio cb8c6b3958 fix: restore permissions export compatibility and add regressions 2026-02-27 14:54:26 -06:00
HoloPanio 5a6970a4c5 feat: add procurement and sales sections 2026-02-27 14:42:19 -06:00
HoloPanio b1f6462ac3 Fix UserController permission serialization and include current updates v0.1.6 2026-02-27 14:38:22 -06:00
HoloPanio 7486bcf939 perf: bundle server with bun build to eliminate node_modules in production 2026-02-26 14:35:46 -06:00
HoloPanio 4814e67b19 fix: install production dependencies in Docker image 2026-02-26 14:23:53 -06:00
HoloPanio 5be32e0dcf fix: use npm instead of bun for Windows desktop build
Bun on Windows fails to install native modules like @electron/node-gyp
v0.1.0
2026-02-26 14:02:50 -06:00
HoloPanio 68000c8272 fix: add npm rebuild for native modules in desktop CI builds 2026-02-26 13:53:15 -06:00
HoloPanio bd5a54031e fix: add PUBLIC_API_URL env var to all build steps 2026-02-26 13:45:32 -06:00
HoloPanio f86ab35b32 chore: replace pnpm with bun across the project 2026-02-26 13:41:13 -06:00
Jackson e9e3451c2d Merge pull request #1 from Project-Optima/Proper-UI
Proper UI
2026-02-26 13:29:47 -06:00
HoloPanio ae5ac35058 feat: add server deployment, desktop builds, and CI/CD pipeline
- Add Dockerfile with adapter-node for server deployment
- Add Kubernetes deployment and ingress manifests
- Add GitHub Actions workflow (server build, desktop builds, K8s deploy)
- Electron now loads hosted URL (https://optima.osdci.net) in production
- Add macOS DMG maker and make:macos script
- Switch to static imports in lib/index.ts
- Add .dockerignore
2026-02-26 12:58:24 -06:00
HoloPanio 51eb36f4a6 fix: resolve type errors across test suite 2026-02-26 12:49:04 -06:00
HoloPanio 827b018f25 auto-create admin role on startup, use API_BASE_URL for auth redirects v0.1.5 2026-02-25 23:00:51 -06:00
HoloPanio 5852bd7819 remove migration drift check v0.1.4 2026-02-25 22:34:16 -06:00
HoloPanio 4c21245044 add shadow db service for migration drift check 2026-02-25 22:32:40 -06:00