Commit Graph

63 Commits

Author SHA1 Message Date
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 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 1907bb433b feat: restructure sales, add PDF quote generation and WebSocket support v0.1.13 2026-03-06 23:25:37 -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 a048e1e824 feat: add CW callback route and optimize cache refresh workflows v0.1.11 2026-03-03 19:46:48 -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 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 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 b1f6462ac3 Fix UserController permission serialization and include current updates v0.1.6 2026-02-27 14:38:22 -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
HoloPanio ce456257ea fix prisma migrate diff flag 2026-02-25 22:30:28 -06:00
HoloPanio 8949819396 add CatalogItem migration and CI schema drift check 2026-02-25 22:28:07 -06:00
HoloPanio 49faf97c9b switch to PKCS#8 key format for Bun compatibility v0.1.3 2026-02-25 22:14:19 -06:00
HoloPanio 05bab2c90f convert PKCS#1 keys to PKCS#8 at load time v0.1.2 2026-02-25 21:56:09 -06:00
HoloPanio 29b5c986cd convert PKCS#1 keys to PKCS#8 at load time 2026-02-25 21:55:09 -06:00
HoloPanio 3d7db8b132 add ingress to CI deploy v0.1.1 2026-02-25 21:48:47 -06:00
HoloPanio cf16c8af49 pkcs1 err 2026-02-25 21:40:35 -06:00
HoloPanio f8639c9eee node env prod 2026-02-25 21:25:25 -06:00
HoloPanio 3779cdc379 fix tls and key secrets 2026-02-25 21:17:00 -06:00
HoloPanio 97b6c45bc0 we are all doomed 2026-02-25 21:02:33 -06:00
HoloPanio 2f2d95a510 outdated k8s flag 2026-02-25 20:59:06 -06:00
HoloPanio 21abf1a9bd fix env secret reference 2026-02-25 20:53:35 -06:00
HoloPanio 13e7d2e6ae update dockerfile 2026-02-25 20:09:59 -06:00
HoloPanio 075074456b update dockerfile 2026-02-25 20:08:09 -06:00
HoloPanio 9b0ce047a6 update dockerfile 2026-02-25 20:04:59 -06:00
HoloPanio d531e1ca83 dryrun 2026-02-24 18:47:27 -06:00
HoloPanio db9b722929 release workflow 2026-02-24 18:30:45 -06:00
HoloPanio 06e021f8a1 Version 2026-02-24 17:53:43 -06:00
HoloPanio da6e0311d8 update gitignore 2026-02-24 16:22:17 -06:00
HoloPanio 3c89f24189 setup unifi wlans 2026-02-22 19:12:34 -06:00
HoloPanio 70284bc14e a lot of things 2026-02-20 11:46:30 -06:00
HoloPanio 987a1c8a6a roles 2026-02-17 21:53:14 -06:00
HoloPanio 6d951e426d MAKING CREDENTIALS WORKS 2026-02-15 16:38:04 -06:00
HoloPanio cdae4d47a4 CREDENTIAL TYPE MANAGEMENT WORKS 2026-02-14 15:15:49 -06:00
HoloPanio b7637334a6 update gitignore 2026-02-14 13:51:43 -06:00
HoloPanio 3bdf562e44 update gitignore 2026-02-14 13:39:06 -06:00
HoloPanio 3ab443790c Lots of updates and cleaning up. 2026-02-14 12:08:23 -06:00