Commit Graph
145 Commits
Author SHA1 Message Date
f37adae2cb feat: deliver auditable Smart Pakke quote flow and free site geometry (#31)
CI - Test & Build / Lint & Type Check (push) Canceled after 0s
CI - Test & Build / Backend Unit Tests (push) Canceled after 0s
CI - Test & Build / Frontend Build (push) Canceled after 0s
CI - Test & Build / Security Scan (push) Canceled after 0s
CI - Test & Build / E2E Tests (Playwright) (push) Canceled after 0s
CI - Test & Build / CI Summary (push) Canceled after 0s
* feat: move login credentials to a DB-backed users table with an admin management page

Replaces the hardcoded AUTH_USERNAME/AUTH_PASSWORD login check with a new
auth_accounts table (bcrypt-hashed passwords, admin/user roles). Adds
admin-only /api/users CRUD routes and a "Brugere" admin page in the
frontend for managing logins without redeploying. Removes the unused,
unmounted duplicate login route in src/routes/auth.js.

* docs: add architecture codemaps with diagrams for the whole system

Adds codemaps/architecture.md, backend.md, frontend.md, and data.md —
Mermaid-diagrammed design documentation verified against the live
codebase and database rather than assumed from CLAUDE.md. Covers the
unified-server.js request flow (mounted routers + ~183 inline routes),
68 backend services grouped by domain, the frontend's state-driven
view-switch (no React Router in practice despite BrowserRouter being
present), and the full 122-table DB schema with the auth_accounts vs
unrelated users table naming trap flagged explicitly. Links added from
the root README.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: ship canonical roof quote workflow

* fix: keep migration dry-run idempotent

* [verified] feat: complete Smart Pakker management

* [verified] fix: ignore blank task dependencies

* [verified] fix: align package duplication with schema

* [verified] fix: enforce Discord status limits

* [verified] fix: link Smart Pakke materials safely

* [verified] fix: harden material link review

* [verified] feat: improve material matching

* fix: scope pitch validation to roof packages

* fix: support canonical snapshots on production schema

* [verified] fix: hide internal package metadata from PDF

* [verified] feat: deliver sales-ready customer PDF

* [verified] feat: ship sales-ready PDF with AI overview

* [verified] fix: authenticate project list requests

* [verified] fix: refresh project-list authentication

* [verified] fix: open existing project details

* [verified] fix: keep roof components searchable in builder

* [verified] fix: expose all Smart Package categories

* [verified] fix: authenticate project creation

* [verified] feat: make Smart Pakker the universal project flow

* [verified] feat: preview Smart Package contents

* [verified] test: keep generic release isolated from downpipe work

* feat: add first-class Smart Pakke rentals

* [verified] feat: add gutter and downpipe smart packages

* [verified] fix: prepare six-house gutter quote flow

* [verified] fix: open generic quotes without roof geometry

* [verified] fix: review generic quotes with authenticated APIs

* [verified] fix: calculate generic Smart Package quotes

* [verified] fix: return generic calculation breakdown

* feat: checkpoint generic signed snapshot validation with red-green tests

* feat: complete fail-closed generic quote approval and customer PDF flow

* feat: use generic signed snapshot in final review

* feat: redesign generic quote final review

* fix: harden generic review summaries

* feat: add auditable six-house package basis

* [verified] feat: finish auditable Smart Pakke UI

* [verified] fix: bind auditable quantity and price bases

* [verified] fix: keep six-house basis across package versions

* [verified] fix: complete smart package discovery management

* [verified] fix: simplify composition and generic scope

* [verified] test: keep explicit roof contracts fail closed

* [verified] fix: harden generic quote snapshots

* fix: make generic quote delivery customer safe

* [verified] fix: secure package catalog reads

* [verified] fix: close workspace provenance blockers

* fix: harden customer document language boundary

* [verified] fix: secure smart package internal reads

* fix: version package child mutations atomically

* feat: add generic customer quote text flow

* [verified] fix: allow manual customer numbers

* [verified] fix: expose optional roof geometry

* [verified] fix: rebase hydrated packages after geometry edits

* [verified] feat: add free editable site area map

* [verified] fix: harden map recovery and geocoding gate

* fix: bind map quantities to authoritative geometry

* fix: release geocoder lock before dispatch

* fix: separate roof and site geometry provenance

* fix: revoke stale admin authorization

* fix: migrate task geometry basis

* fix: make backend CI dependency-complete

* ci: seed isolated e2e login account

* fix: allow clean database bootstrap

* fix: skip indexes for optional tables

* test: use canonical mansard geometry in e2e

* [verified] fix(auth): enforce live operator boundary

* fix: fail close Ordrestyring offer transport

* fix(frontend): authenticate customer project requests

* fix: align canonical roof type contract

* [verified] fix: reconcile legacy package labor safely

* [verified] fix: audit site geometry deletion

* docs: add PR 31 reviewer guide

* docs: synchronize Obsidian vault

* docs: sync integrated reviewer guide to Obsidian

* ci: seed isolated auth account explicitly

* fix: close offer bootstrap and service readiness gaps

* fix: authenticate protected package callers

* fix: provision initial admin and disable generic send

* [verified] fix: close final quote release blockers

* [verified] fix: seed gutter packages before deployment

---------

Co-authored-by: alexpolo1 <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
2026-09-26 22:39:18 +02:00
Alexandalexpolo1 8b16d35287 fix: keep Smart Packages compatible with roof material (#30)
CI - Test & Build / Lint & Type Check (push) Canceled after 0s
CI - Test & Build / Backend Unit Tests (push) Canceled after 0s
CI - Test & Build / Frontend Build (push) Canceled after 0s
CI - Test & Build / Security Scan (push) Canceled after 0s
CI - Test & Build / E2E Tests (Playwright) (push) Canceled after 0s
CI - Test & Build / CI Summary (push) Canceled after 0s
Co-authored-by: alexpolo1 <[email protected]>
2026-09-02 07:19:39 +02:00
Alexandalexpolo1 adb7e8a17a fix: enforce complete scope keyword matches (#29)
Co-authored-by: alexpolo1 <[email protected]>
2026-08-30 18:14:57 +02:00
Alexandalexpolo1 1a00fdadfe fix: classify roof support reference services (#28)
Co-authored-by: alexpolo1 <[email protected]>
2026-08-30 17:58:10 +02:00
Alexandalexpolo1 4f0ba89cbe fix: make material name matches safe and automatic (#27)
Co-authored-by: alexpolo1 <[email protected]>
2026-08-29 20:56:18 +02:00
Alexandalexpolo1 c0e2010075 feat: add fail-closed quote realism checks (#26)
Co-authored-by: alexpolo1 <[email protected]>
2026-08-29 20:29:49 +02:00
alexpolo1 1c44a514b4 [verified] fix: use system Chrome for PDF generation 2026-08-27 12:21:09 +02:00
alexpolo1 823e072702 [verified] fix: preserve rental pricing in projects 2026-08-26 19:11:35 +02:00
alexpolo1 81b6e1ea21 fix: make Jannick price import usable and safe 2026-08-24 08:31:55 +02:00
alexpolo1andClaude Sonnet 5 a56a911bee feat: import reference task prices from haandvaerkpriser.dk
Support ticket #396994 (Jannick): pull prices from
haandvaerkpriser.dk for tasks we don't already price, as a starting
reference. robots.txt allows crawling /alle-priser/ and no terms of
use restrict reuse (checked before building this).

Each imported task becomes a verified 'component' Smart Package with
a single task carrying the price, filtered to only the 8 trades
Jannick asked for (Maler, Gulv, VVS & Blikkenslager, Tømrer &
Snedker, Murer, Tagrenovering, Isolering & Energi, Nedrivning &
Affald - the site has 16 categories total). This lands in the same
place as today's earlier smart-package fix, so these are immediately
selectable via the "Enkelte opgaver" picker and visible in the admin
Smart Packages list, unlike the existing price_database table which
is dead code (0 rows, its only consumer queries a column that no
longer exists, and its route isn't mounted).

Re-running the import is idempotent: a task already imported from
this source gets its price averaged with the new pull instead of
duplicating, per Jannick's request ("har vi en pris i forvejen kan
den lave et gennemsnit"). Cross-source matching against Jannick's own
manually-curated components is intentionally out of scope - automating
that risks merging unrelated tasks.

New endpoints (admin-only): GET /api/smart-packages/haandvaerkpriser-preview
(dry run, no writes) and POST /api/smart-packages/haandvaerkpriser-import.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-20 14:56:29 +02:00
alexpolo1andClaude Sonnet 5 9b7df90385 feat: add carpenter walkthrough release gate (hydration, readiness, material link review)
Implements the plan from the carpenter walkthrough audit: make the
project flow -> final review -> PDF path measurable and safe to gate
CI on.

- projectHydrationService loads a project's geometry/labor/materials/
  rentals/packages/calculation in parallel and reports per-resource
  timing plus the slowest resource, so hydration SLA breaches are
  visible instead of silent
- projectReadiness centralizes the blocking checks final review must
  pass before a quote can be sent (name, customer, description,
  materials/labor present, zero-price lines)
- pdfSourceSignature detects when a generated PDF is stale relative to
  the current project data, so a carpenter doesn't send an outdated
  quote
- MaterialLinkReview + new customer-projects match-preview/link
  endpoints let a user review and confirm suggested master-material
  matches instead of silently auto-linking
- ProjectFlow refactored around the new hydration/readiness utilities;
  FinalReview surfaces readiness checks and unlinked material counts
- CI: the carpenter smoke test (full-roof-quote-flow.spec.js) is now
  a blocking gate on main, with the rest of the Playwright suite
  running best-effort alongside it
- docs/qa/CARPENTER_WALKTHROUGH_RELEASE_GATE.md documents the gate and
  the monthly production audit procedure

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-20 13:20:33 +02:00
alexpolo1andClaude Sonnet 5 db34ee96ed fix: make all verified smart packages selectable, not just 5
Root cause (from support tickets #333382 and #775903): a one-off
integrity migration archived 40 Excel-imported carpenter task packages
(is_active=0, blocked) because their material lines couldn't be
auto-linked to the material database, and even a verified component
package had nowhere to appear since the quote flow only fetched
packageType=complete_offer.

- verifyPackage now reactivates a package (is_active=1) once its
  materials/tasks pass integrity checks
- getPackageDetails/updatePackage can reach blocked-but-inactive
  packages so admins can repair them, without exposing genuinely
  deleted packages; fixes a latent bug where updatePackage's final
  UPDATE still hardcoded is_active=1 and would have silently no-op'd
- new GET /api/smart-packages/review-queue + SmartPackageReviewQueue
  admin panel to relink materials (with fuzzy-match suggestions) and
  verify archived packages in one step
- InlineSmartPackage gains an "Enkelte opgaver" à la carte picker
  (search-by-word, additive multi-select) for verified component
  packages, alongside the existing single complete-offer picker;
  geometry-based quantity/hours math extracted into
  utils/smartPackageGeometryCalculations.js so both flows share it

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-20 13:00:08 +02:00
alexpolo1 c3e3255aff [verified] fix: harden material and smart package errors 2026-08-18 12:50:24 +02:00
alexpolo1 8d2db6281c feat: send daily repository status to Discord 2026-08-18 10:07:59 +02:00
alexpolo1 77cddbf704 fix: harden mobile offer review flow 2026-08-18 00:49:25 +02:00
alexpolo1 6dc90a92aa security: move remaining credentials to environment 2026-08-17 09:25:03 +02:00
alexpolo1 edb73df2d6 docs: archive legacy guides and add Obsidian vault 2026-08-17 09:12:03 +02:00
alexpolo1 a2a99e1595 chore: stop tracking generated artifacts 2026-08-17 09:11:12 +02:00
alexpolo1 f9c0b7bc57 feat: harden smart package field workflow 2026-08-15 00:34:28 +02:00
alexpolo1 3ab5e8cf5e fix: resolve open smart package issues 2026-08-13 23:58:36 +02:00
alexpolo1 c6ca27dd22 feat: persist support tickets for Codex worklist 2026-08-13 14:29:15 +02:00
alexpolo1 340d15bf78 fix: align support tickets with osTicket API 2026-08-13 13:37:10 +02:00
alexpolo1 9c00074327 feat: add image attachments to support feedback 2026-08-13 13:28:29 +02:00
alexpolo1 ddc52ddc91 fix: cap quote PDFs and add compact recovery 2026-08-13 13:02:16 +02:00
Alex d5f65f74d4 feat: mobil tømrerflow og Codex CLI-generering (#8)
Flyt brugerrettet indholdsgenerering til Codex CLI, forbedr mobilflowet og ret CI-miljøets afhængigheder og testkonfiguration.
2026-08-13 11:47:14 +02:00
alexpolo1 11ad6b7f0b feat: enforce verified smart package catalog 2026-08-10 12:38:52 +02:00
alexpolo1 46c0025e49 feat: add AI usage and quote output polish 2026-07-07 21:30:34 +02:00
alexpolo1 a6a643fd46 feat: add mobile order field workflow 2026-07-07 21:30:28 +02:00
alexpolo1 ca4ce44bef feat: improve roof quote readiness 2026-07-07 21:30:23 +02:00
alexpolo1 01ad8f4a49 feat: consolidate ordrestyring quote workflow 2026-07-05 08:10:59 +00:00
alexpolo1 002e05bfc7 fix(ordrestyring): close hours-without-case gap and harden local-first sync 2026-04-08 05:56:01 +00:00
alexpolo1 d081763d20 fix: stabilize ordrestyring sync parsing and simulation hours 2026-04-06 07:44:09 +00:00
alexpolo1 4695e28088 feat: add ordrestyring simulation runner 2026-04-05 20:05:07 +00:00
alexpolo1 7395d4d290 fix: stabilize ordrestyring sync layers 2026-04-05 19:47:47 +00:00
alexpolo1 10d94c7ff1 feat: persist carpenter workflow status and price freshness 2026-03-29 12:27:06 +00:00
alexpolo1 3b7772c697 chore: ignore test data and checkpoint current changes 2026-03-04 10:08:49 +00:00
alexpolo1 bbb75ccce2 feat: Add Advanced Dashboard and perform repo cleanup
This commit introduces a new Advanced Dashboard feature, which provides enhanced analytics and system health monitoring.

Additionally, this commit includes a general repository cleanup, which consists of:

- Removal of a duplicate  file from the root directory.
- Addition of temporary report and documentation files to .
- Relocation of several test files from the root to the  directory.
- Staging of various other modified files that were previously uncommitted.

The new Advanced Dashboard feature includes:
-  and  for the UI.
-  for the backend API.
-  for API documentation.

New tests for smart packages and autosave functionality have also been added.
2026-02-28 17:38:23 +00:00
Alex 9469a896d3 Merge pull request #1 from alexpolo1/copilot/identify-slow-code-improvements
Optimize database operations and async workflows for 5-20x performance gains
2026-01-25 12:01:05 +01:00
Alex 03071eb7b0 Merge pull request #2 from alexpolo1/copilot/secure-secret-handling
Security: Remove hardcoded JWT secrets and client-side refresh token storage
2026-01-25 11:57:25 +01:00
Claude 1ed77551a0 feat: Add comprehensive CI/CD pipelines and fix lint errors
CI/CD Pipelines:
- ci.yml: Enhanced with lint, unit tests, E2E tests, security scan
- deploy-test.yml: Test environment deployment workflow
- deploy-prod.yml: Production deployment with backup, rollback, smoke tests

Test Fixes:
- supportTickets.test.js: Fix field names (topic_id, priority_id)

Lint Fixes:
- CalendarGrid.js: Mark unused employeeTypeFilter
- CustomerSearch.js: Mark unused setTaskType
- EnhancedGeometry.js: Mark unused variables
- InlineSmartPackage.js: Add eslint-disable for unused handlers
- ProjectFlow.js: Remove unused imports and handlers
- WhosFreeWidget.js: Add eslint-disable for useEffect
- BackupImport.js: Remove unused TextField import
2026-01-25 10:47:16 +00:00
alexpolo1 a03b6df348 feat: Crew scheduling system (Phase 1-3) - 8.5/10 rating
Phase 1: Quick Wins
- Calendar default tab, simplified 3-option filters
- Show all employees including free ones

Phase 2: Core Functionality
- POST /api/calendar/allocate endpoint
- AllocationModal component with validation
- Integration with Ordrestyring GraphQL API

Phase 2.5: UX Polish
- Prominent employee names with type badges
- NotificationToast system for success/error feedback
- Auto-refresh after allocation
- Removed confusing employee-type filter

Phase 3: Enhanced UX
- WhosFreeWidget with tabs (I dag | I morgen | Denne uge)
- Job names displayed on busy employees
- Quick-allocate with employee pre-selection
- Fixed undefined name sorting bugs

Lars validation: 8.5/10 - 'Replaces whiteboard for 90% of planning'
Real impact: 97% faster than manual process (5s vs 2-3 min)
2026-01-22 21:59:34 +00:00
alexpolo1 b096ff55c3 fix: add automatic port cleanup before server start to prevent EADDRINUSE errors 2026-01-21 07:56:56 +00:00
alexpolo1 9937e60ed6 fix: correct syntax error in support tickets route and improve error handling 2026-01-21 07:52:13 +00:00
alexpolo1 f60a0dfd48 feat: add support ticket system with osTicket integration
- Add SupportDialog React component for user support requests
- Add backend /api/support/tickets endpoint with osTicket API integration
- Add comprehensive test suite for support tickets (Jest)
- Add system_settings table migration for dynamic osTicket config
- Fix OpenAI costs API query parameter bug
- Clean up ESLint warnings across frontend components
- Add Claude AI project configuration (.claude/ directory)
- Add comprehensive code quality rules and patterns
- Add security review and TDD workflow skills
- Add analysis report documenting project state

Technical details:
- Support dialog with form validation and rate limiting
- Database and env var fallback for osTicket credentials
- Input sanitization and XSS protection
- IP forwarding for ticket context
- Full test coverage (backend unit tests: 69/69 passing)
2026-01-21 07:29:20 +00:00
alexpolo1andClaude Opus 4.5 e736645432 feat: Add task saving to database in Smart Packages + cleanup
Smart Package improvements:
- InlineSmartPackage.js: Add saveTaskToDatabase() to persist tasks
- smartPackagesRoutes.js: Add timeUnit and timePerUnit fields

Fixes:
- package.json: Fix playwright path to use local node_modules

Cleanup:
- .gitignore: Add test-results and playwright-report to ignore
- Remove old backup files from tracking (already in .gitignore)
- Remove test result artifacts from tracking

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-20 11:04:50 +00:00
copilot-swe-agent[bot]andalexpolo1 7f42aa7d89 Add prominent warnings about incomplete refresh token implementation
Co-authored-by: alexpolo1 <[email protected]>
2026-01-06 07:29:29 +00:00
copilot-swe-agent[bot]andalexpolo1 8d0e7c159d Address code review: remove JWT secret exports and clarify incomplete refresh implementation
Co-authored-by: alexpolo1 <[email protected]>
2026-01-06 07:27:17 +00:00
copilot-swe-agent[bot]andalexpolo1 bf2288c1a0 Update unified-server.js to use separate JWT secrets and fail-fast
Co-authored-by: alexpolo1 <[email protected]>
2026-01-06 07:25:09 +00:00
copilot-swe-agent[bot]andalexpolo1 f7d75e18d9 Add jsonwebtoken and bcryptjs dependencies for authentication
Co-authored-by: alexpolo1 <[email protected]>
2026-01-06 07:23:03 +00:00
copilot-swe-agent[bot]andalexpolo1 be642f5c1d Implement security improvements: enforce JWT secrets, remove client-side refresh token storage
Co-authored-by: alexpolo1 <[email protected]>
2026-01-06 07:20:24 +00:00