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>
- 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
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.
- 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
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)
- 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)
- 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
- 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
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
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>
- 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.
- 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.
- 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.