46 Commits

Author SHA1 Message Date
alexpolo1
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 <noreply@anthropic.com>
2026-08-20 13:20:33 +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
c6ca27dd22 feat: persist support tickets for Codex worklist 2026-08-13 14:29:15 +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
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
10d94c7ff1 feat: persist carpenter workflow status and price freshness 2026-03-29 12:27:06 +00:00
alexpolo1
653e364b1e chore: reorganize docs - move md files to correct locations
- Move root-level status/feature/summary MDs into docs/ subdirs
- Convert .txt documentation files to .md format
- Tests-related MD moved to tests/
- Root now only contains README.md, CLAUDE.md, GEMINI.md
2026-02-28 18:37:46 +00:00
alexpolo1
888e833de6 chore(docs): move top-level .md files to docs/ for better organization 2026-02-28 18:01:12 +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
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
Claude
ceaa6039fa docs: Update README with current architecture and tech stack
- Update tech stack from PostgreSQL to MariaDB/MySQL
- Update port from 3000/3001 to unified server port 4032
- Add Smart Packages system (15 carpenter packages)
- Add 7 roof types documentation
- Add Ordrestyring GraphQL integration info
- Update project structure to reflect current state
- Add comprehensive API endpoints documentation
- Update docs/README.md with documentation index and architecture diagram
2026-01-25 08:46:36 +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
fe93881c3b docs: add port management guide for permanent startup fixes 2026-01-21 07:57:10 +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
copilot-swe-agent[bot]
3329ddef7f Address code review feedback: deterministic cache cleanup and migration approach
Co-authored-by: alexpolo1 <14327609+alexpolo1@users.noreply.github.com>
2025-12-27 08:39:49 +00:00
copilot-swe-agent[bot]
fb78cdcdcc Add caching layer and comprehensive performance documentation
Co-authored-by: alexpolo1 <14327609+alexpolo1@users.noreply.github.com>
2025-12-27 08:37:06 +00:00
alexpolo1
aa69197a2e Add initial test results for carpenter Lars Nielsen's project quote 2025-12-23 02:09:41 +00:00
alexpolo1
78595bbf6f feat: Complete SVG validation and enhancements for all roof types
- Added comprehensive SVG validation and fixes in EnhancedGeometry.js
- Created SVG_VALIDATION_COMPLETE.md to document validation results and improvements
- Developed a quick test guide for all 7 roof types in TEST_ROOF_TYPES_QUICK.md
- Summarized test results in TEST_SUMMARY.md, highlighting core functionality and API status
- Implemented Playwright tests for roof types API and UI interactions, ensuring all roof types are selectable and functional
- Enhanced error handling and accessibility features across the application
- Verified successful integration of SVG rendering with React components
2025-12-23 01:37:04 +00:00
alexpolo1
3e6f3f58a9 feat: Implement root-only encrypted environment system
Add comprehensive encrypted environment variable system with AES-256 encryption.

Security Features:
- AES-256-CBC encryption with PBKDF2 (100k iterations)
- Root-only encryption key (/root/.tilbudgivern-secure/)
- Encrypted .env.enc files safe to commit to git
- Plaintext .env files only exist at runtime
- Auto-cleanup on shutdown

Components:
- setup-encrypted-env.sh: Encrypt .env → .env.enc
- decrypt-env.sh: Decrypt .env.enc → .env
- start-secure.sh: Decrypt + start application
- test-encryption.sh: Test encryption/decryption
- tilbudgivern-secure.service: Systemd service

Documentation:
- ENCRYPTED_ENV_README.md: Overview and quick start
- ENCRYPTED_ENV_QUICKSTART.md: Quick reference guide
- docs/ENCRYPTED_ENV_SECURITY.md: Complete security guide

Threat Model:
 User account compromise: Credentials safe
 Git repository leak: Only encrypted files exposed
 File system read: Encrypted files useless
 Root compromise: Defense in depth

This ensures attackers need root access to decrypt credentials.
2025-12-20 13:36:30 +00:00
alexpolo1
9d1b1917a7 Add comprehensive database backup setup and scripts
- Created DATABASE_BACKUP_SETUP.md for detailed backup instructions
- Implemented backup-databases.sh for automated database backups
- Added logrotate configuration for managing backup logs
- Developed setup scripts for user-specific backup configurations
- Included error handling and logging in backup processes
- Established cron job setup for automated backups
- Provided examples and troubleshooting tips in documentation
2025-11-16 21:12:29 +00:00
alexpolo1
7489234f74 Implement OpenAI Costs API integration with backend and frontend updates
- Integrated OpenAI Costs API into the backend service with new methods for fetching costs and detailed breakdowns.
- Added new API endpoints for retrieving costs, budget status, and detailed cost breakdown.
- Updated frontend to display OpenAI costs and budget status, including new UI components and states.
- Enhanced styling for budget status and cost breakdown sections.
- Configured environment variables for OpenAI API access.
- Created comprehensive documentation for setup, API endpoints, and user flow.
- Added test script for validating API endpoints.
- Fixed production issues by ensuring new endpoints are loaded correctly.
2025-11-16 21:00:04 +00:00
alexpolo1
8773d96e94 feat: Add AI-Powered Visual Testing Suite using Selenium and OpenAI Vision API
- Implemented VisualAITester class for automated UI/UX testing
- Configured environment variables for API keys and paths
- Developed methods for browser setup, login, screenshot capture, and image encoding
- Integrated OpenAI Vision API for visual quality analysis with detailed feedback
- Created tests for various application pages including homepage, project flow, geometry form, and more
- Generated comprehensive HTML report summarizing test results and AI analysis
- Added functionality to copy AI prompts for automated issue resolution
2025-11-14 20:27:19 +00:00
alexpolo1
bdb9e524db Implement manual and automated tests for auto-save countdown feature
- Added a comprehensive manual testing guide for the countdown functionality in `test_countdown_manual.md`.
- Developed a detailed Selenium test suite in `test_countdown_selenium.py` to verify countdown behavior, including server accessibility, login, countdown progression, and UI elements.
- Created a minimal Selenium test version in `test_countdown_selenium_minimal.py` for quick checks without complex setup.
- Introduced a verification script in `test_countdown_verification.py` to analyze code correctness, including server checks, build file existence, and countdown logic.
2025-11-14 11:28:58 +00:00
alexpolo1
12263aef2e feat: Enhance material pricing integration by adding JOINs in API and updating SmartPackageForm to auto-add tasks from installation manuals 2025-11-07 12:01:07 +00:00
alexpolo1
0c186eb06f feat: Implement price calculation and drag-and-drop functionality in SmartPackageForm 2025-11-07 09:58:08 +00:00
alexpolo1
b82f9e758b feat: Add Backup & Import functionality for SmartPackages
- Implemented BackupImport component for exporting and importing SmartPackages.
- Added API calls for exporting JSON backups and importing packages.
- Included file validation for JSON format during import.
- Enhanced user interface with MUI components for better user experience.

feat: Create Components Library for reusable components

- Developed ComponentsLibrary component to manage reusable components for SmartPackages.
- Integrated CRUD operations for components with API endpoints.
- Added filtering functionality by component category.
- Included dummy data for initial testing and development.

feat: Implement Statistics View for SmartPackages

- Created StatisticsView component to display package statistics.
- Added API call to fetch statistics and display key metrics.
- Included visual representation of categories and most used materials.

chore: Create migration for smart_package_components table

- Added SQL migration script to create smart_package_components table.
- Inserted sample data for testing and development purposes.
- Included verification query to check data integrity after insertion.
2025-11-07 09:45:19 +00:00
alexpolo1
537d55c106 feat: Consolidate tag categories into a single "Tag" category and update related scripts and documentation 2025-11-07 09:13:12 +00:00
alexpolo1
faaf9500f5 feat: Add API test HTML page and update server check documentation
- Created a new HTML page for testing the Tømmer Opgaver API with buttons for various endpoints.
- Added a LICENSE file for React and related libraries in the frontend build.
- Documented a complete server check report, detailing fixes, test results, and server status.
- Added sample test data for quotes, including project details, geometry, labor, materials, and calculations.
2025-11-07 08:44:35 +00:00
alexpolo1
99a31cb3cb fix: Downgrade dependencies for Node.js compatibility and add engines field 2025-11-07 08:08:24 +00:00
alexpolo1
26d3452d59 Add comprehensive tests for API verification, frontend integration, and PDF generation
- Implemented a new test suite for production API verification using curl, ensuring all critical endpoints respond correctly and return valid JSON.
- Added frontend integration tests to check for critical errors in the UI and verify key UI elements are present and functional.
- Created test data for quotes and project calculations to facilitate testing.
- Developed a script to check offers in the Ordrestyring system, including detailed task descriptions.
- Added tests for generating PDFs from quote data, ensuring the output is valid and contains expected information.
- Implemented a test script for the Røsevangen project, integrating with the Ordrestyring API and verifying database entries.
2025-11-07 08:02:07 +00:00
alexpolo1
a3badedb2c docs: Add comprehensive integration documentation 2025-10-31 21:20:48 +00:00
alexpolo1
80632c996b feat: Complete Ordrestyring GraphQL integration with automatic offer creation
FEATURES IMPLEMENTED:
 Full GraphQL integration with Ordrestyring API
 Automatic offer creation from Tilbudsgiveren quotes
 Customer management (find existing or create new)
 Task/Opgave management with full quote description
 Material lines (tilbudslinjer) with pricing
 Internal notes in bemærkninger field
 Department assignment (Tømrer = ID 2)
 Status management (Tilbudsgiver Oprettet Tilbud)

KEY COMPONENTS:

1. OrdrestyringQuoteService (backend/src/services/ordrestyringQuoteService.js)
   - generateDetailedQuoteDescription(): Creates formatted quote text
   - findOrCreateCustomer(): Handles customer, contact, delivery address
   - createOfferLines(): Updates default task & adds material lines
   - sendQuoteToOrdrestyring(): Main orchestration method
   - getOfferWithTasks(): Query offers with task details

2. Smart Task Management:
   - Finds and updates existing default 'Opgave 1' task
   - Renames to 'Tilbudsgivertekst' for clarity
   - Adds full 2000+ character quote description
   - Creates material lines under the task
   - Fallback: Creates new task if none exists

3. GraphQL Mutations & Queries:
   - createOffer: Creates offer with customer, status, department
   - updateOfferTask: Updates existing task with description
   - createOfferTask: Fallback for new task creation
   - createOfferLine: Adds material lines with pricing
   - Proper error handling and logging throughout

4. Database Integration:
   - Migration: add_ordrestyring_columns.sql
   - Tracks ordrestyring_offer_id, ordrestyring_offer_number
   - Status synchronization with ordrestyring_status
   - Timestamp tracking with ordrestyring_sent_at

5. Route Updates (backend/routes/ordrestyring.js):
   - POST /api/ordrestyring/send-quote-graphql
   - Optional customerId parameter (uses existing or creates new)
   - Validation for projectId and calculationId
   - Returns complete offer details

TECHNICAL HIGHLIGHTS:

• GraphQL Client: graphql-request v7.3.1
• API Endpoint: https://graphql.ordrestyring.dk/graphql
• Authentication: Bearer token in headers
• Error Handling: Graceful fallbacks, detailed logging
• Field Discovery: Used introspection to find correct types
  - UpdateOfferTaskInput (not OfferTaskInput)
  - Task fields: header & text (not name & description)
  - productNumber required for offer lines

TESTING:

• Test scripts: test_roesevangen_ordrestyring.py
• Verification: test_check_offer.js
• Live testing with Project 22 (Røsevangen 44)
• Confirmed: Single task with full description
• Confirmed: 10 material lines with correct pricing
• Confirmed: Department, status, and internal notes working

RESULT:
Complete end-to-end integration from Tilbudsgiveren → Ordrestyring
- Creates professional offers with all data
- Single 'Tilbudsgivertekst' task (not duplicate Opgave 1)
- Full quote description visible in task
- Material lines with quantities and prices
- Ready for production use

Co-authored-by: AI Assistant <copilot@github.com>
2025-10-31 21:19:00 +00:00
alexpolo1
4dbaf3e950 Add final version of TØMRER SMART PACKAGES and cleanup for v2
- Created a comprehensive SQL migration script for TØMRER SMART PACKAGES, including detailed material packages, tasks, and calculations for various roofing tasks.
- Implemented a cleanup process to remove existing test packages related to 'Tagrende' and 'Nedløb' before inserting new data.
- Structured the material packages to include specific materials, quantities, and pricing, ensuring accurate calculations for installation tasks.
- Added detailed task descriptions and estimated hours for each package to enhance clarity and usability for users.
- Included completion checks to verify the successful creation of packages, tasks, and materials.
2025-10-30 19:23:15 +00:00
alexpolo1
f9484eff3a feat: Enhance project quote generation with hierarchical structure and detailed prompts
- Updated AI prompt in projectQuoteGenerationService.js to include a hierarchical task description format for professional quotes.
- Added critical rules for AI to follow, emphasizing action words and specific material descriptions.
- Created comprehensive documentation for the updated quote system, including examples and guidelines for AI prompts.
- Developed a new layout template for quotes to improve readability and professionalism.
- Established a detailed guide on professional quote structure based on Mikael Holck's standards.
2025-10-30 18:58:22 +00:00
alexpolo1
4a372d2e28 clean up 2025-10-30 18:28:58 +00:00
alexpolo1
f8512149b5 feat: Add automated Bygma installation manual scraper with AI analysis
Features:
- Automated login and PDF download from Bygma
- GPT-4o AI analysis of installation manuals
- Extracts: steps, time estimates, tools, safety, materials, skill level
- Direct database storage (installation_manuals table)
- Auto-cleanup: deletes PDFs after analysis to save space
- Node.js integration for quote generation

New files:
- scrape_and_analyze_bygma.py - Main automated scraper
- scrape_bygma_with_login.py - Simple download script
- analyze_manual_pdfs.py - Standalone PDF analyzer
- get_installation_tasks.js - Node.js quote integration
- demo_tilbud_opgave.js - Working demo
- BYGMA_AUTOMATION_README.md - Complete documentation

Database:
- installation_manuals table with JSON fields
- Sample data: 1 manual analyzed (Cembrit Bølgeplader)

Integration:
- getInstallationTask(productName, quantity) function
- Returns formatted task descriptions for quotes
- Time calculations: 2.5 hours/m² example

Cleanup:
- Removed old test scripts and debug files
- Removed downloaded PDFs (saved to database)
- Organized documentation files
2025-10-20 10:19:54 +00:00
alexpolo1
ea5394b0b6 feat: calender impprovements , carptender database 2025-10-15 09:57:16 +00:00
alexpolo1
1d79f4710d feat: Implement comprehensive analytics population and data synchronization
- Added SimpleAnalyticsPopulator class for populating project, employee, customer analytics, and daily metrics.
- Integrated MySQL database connections for tilbudgivern and ordrestyring_local databases.
- Developed sync_ordrestyring_data_old.sh script for comprehensive data synchronization from Ordrestyring API.
- Created test scripts for analytics API and services to validate functionality and data integrity.
- Introduced FixedHistoricalQuoteCalculator and HistoricalQuoteCalculator for generating quotes based on historical data.
- Implemented vary-profit-margins.js to introduce variability in profit margins based on project size and customer type.
2025-10-14 13:06:02 +00:00