- 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 `scrape_fixed_v2.py` for scraping installation manuals from Bygma using Playwright.
- Created `test-custom-task.js` to test custom task creation in the smart packages API.
- Developed `test-customer-search.html` for testing customer search functionality with auto-fill capabilities.
- Implemented `test-manuals.html` for testing the retrieval and display of installation manuals.
- Added SQL script `test_project_21_materials.sql` to insert test materials for project 21 and check for manual availability.
feat: Create Python script to scrape 10 installation manuals from Bygma, focusing on construction materials
feat: Develop script to scrape installation manual from Bygma by VareNr, including AI analysis and database storage
feat: Add script to scrape Swedoor Snap-In Karmsat installation manual using product name from URL
chore: Create start script for PM2 to manage services with correct node path
test: Add comprehensive test script for quote generation and PDF endpoints
test: Implement CSV parser tests to verify product presence and data integrity
test: Create readline test script to efficiently read and search for product in CSV
- Oprettet create-packages-simple.js til at generere SmartPackages med detaljerede materialelister og installationstider.
- Oprettet create-packages-v3.js som en minimal version til oprettelse af basis erfaringspakker.
- Tilføjet test-markup-sliders.js for at teste markup sliders for materialer og final review.
- Implementeret test-package-calculation.js til at teste geometri-beregninger for SmartPackages.
- Oprettet test-stern-til-kip-formula.js for at validere brugen af stern_til_kip variabel i formler.
- Tilføjet test-stern-to-ridge-height.js for at sikre korrekt gemning af højde stern til kip i databasen.
- Removed `package_type` from the Smart Package creation process in the backend.
- Updated SQL queries and data handling in `smartPackageManagementService.js` to reflect the removal of `package_type`.
- Simplified the Smart Package form component by removing unnecessary navigation hooks and parameters.
- Adjusted the Smart Packages main component to handle editing and creating packages without direct navigation.
- Enhanced the Smart Packages menu to use callback functions for section changes instead of routing.
- Implemented a new script to create Smart Packages from Ordrestyring cases, including detailed logging and error handling.
- Added a test script to explore cases from Ordrestyring, providing insights into available cases and their details.
- Updated last_sync_status.json with new sync data.
- Updated `/api/planning/calendar` to use GraphQL for fetching hours data.
- Removed deprecated calendar sync service files.
- Adjusted employee fetching logic to utilize GraphQL for active employees.
- Cleaned up and refactored related code for better maintainability.
- Added comprehensive tests for migration and cleanup, ensuring all endpoints function correctly.
- Documented migration status and test results in KALENDER_CLEANUP_COMPLETE.md.
feat(graphql): Create a GraphQL client for improved API interaction and error handling
chore(deprecated): Disable deprecated REST endpoints and notify users of changes
feat(mapping): Develop a script to map Bygma products to categories based on varegrp codes
chore(lock): Update lock file for ordrestyring comprehensive sync
test(graphql): Add tests for new GraphQL endpoints and identify unused code
test(migration): Complete migration tests for GraphQL endpoints and cleanup
test(calendar): Implement tests for calendar and hours GraphQL integration
test(offer): Create tests for GraphQL offer creation endpoint
test(work-breakdown): Add tests for work breakdown and case details endpoints
- Added TaskDialog component with functionality to create and edit tasks.
- Integrated form validation and error handling for task inputs.
- Implemented step management within tasks, including adding and deleting steps.
- Styled TaskDialog with CSS for improved user experience.
feat: Create SmartPackagesRoutes for navigation and routing
- Established routing for smart packages, including create and edit functionalities.
- Added loading state management for better user feedback during data fetching.
- Integrated SmartPackagesMenu for navigation within the smart packages section.
feat: Add utility functions for formatting data
- Implemented formatting utilities for currency, time, date, and percentages.
- Ensured consistent formatting across the application for better readability.
chore: Update database schema for smart packages
- Extended material_packages table with new fields for estimated hours, hourly rate, and difficulty level.
- Created smart_package_tasks and smart_package_steps tables for task management.
- Added foreign key relationships and indexes for improved database performance.
test: Add API tests for smart packages functionality
- Created test suite for validating smart packages API endpoints.
- Included tests for CRUD operations on smart packages and retrieval of categories and types.
- CalendarGrid now only displays employees who have calendar entries
- Filters by current week - if employee has no events in displayed week, they are hidden
- Reduces clutter and matches user preference to see only active employees
- Dynamic filtering updates when navigating between weeks
- Employee count in footer shows only visible employees with data
- Calendar now displays customer name as event title (highest priority)
- Fetches customer_number from cases table
- Looks up customer_name from debtors table
- Title priority: 1) customer name, 2) event text/header, 3) case description, 4) type.title
- Added customer_number and customer_name fields to calendar response
- Example: Shows 'Lars Koch Magnussen' and 'Rasmus Gamrath' instead of 'Opgave 2603'
- Calendar endpoint now calls Ordrestyring /calendar API directly instead of local database
- Title priority: 1) event text/header, 2) case description from DB, 3) type.title
- Fetches case descriptions from both cases and ordrestyring_cases tables
- Uses local user cache for performance (avoid N+1 queries)
- Maps calendar_type (hours/personal/planned) from API
- Shows proper event colors from type.color field
- Frontend rebuilt with updated calendar display
✅ Fixes implemented:
- Fixed all 6 failing API endpoints (Bygma imports, prices, stats, orders, status-summary, analytics/materials)
- Disabled non-functional sync services (CalendarSync, Materials sync from Ordrestyring API)
- Removed duplicate PUT/DELETE /api/pricing/materials/:id endpoints
- Updated scrape_and_analyze_bygma.py to use service user from .env file
- Fixed analytics/materials query to use project_materials table with denormalized schema
📊 Test results:
- Created comprehensive-api-test.js testing 46 critical endpoints
- Success rate: 100% (46/46 passing)
- All Bygma endpoints working with direct SQL queries
- Orders endpoints protected with API key guards
- No more CalendarSync/Materials sync errors in logs
🗃️ Database schema discoveries:
- project_materials uses material_name (TEXT) not material_id (FK)
- material_prices has is_active not is_current
- bygma_import_log uses import_batch_id not batch_id
- All queries updated to match actual schema
- Added test for installation manual search endpoint
- Tests both found and not-found scenarios
- Validates JSON response structure
- Shows step count and tools count in test output
- Updated feature list to include installation manual feature
- Changed manual button from icon-only to 'Montagevejledning' text
- Made button larger and more prominent with better styling
- Removed long calculation info box from Smart Packages page
- Cleaned up UI to give more space for actual package selection
- Updated button styling with better padding and hover effects
- Added API endpoint /api/customer/installation-manual/search
- Added installation manual button to each material in the list
- Created modal to display installation steps, tools, safety requirements
- Added CSS styling for modal with gradient header and step-by-step view
- Integrated with existing Bygma scraper data in database
- Shows time estimates, weather conditions, and key points
- Mobile-responsive design with smooth animations
- Added TaskCategorizationService to categorize tasks based on keywords in descriptions.
- Implemented fuzzy matching using Levenshtein distance for better keyword matching.
- Introduced caching for categories and keywords to optimize database queries.
- Added methods for categorizing individual tasks and batch processing for project tasks.
- Created SQL migration scripts for task_categories and category_keywords tables.
- Included default categories and keywords for initial setup.
- Enhanced project_tasks table with new columns for categorization data.
- Added statistics export functionality for category performance analysis.
- Added ProjectExperienceService to calculate similar projects and scale hours based on area.
- Created API endpoint for fetching similar project experiences.
- Developed frontend components for automatic data fetching and displaying intelligent task estimates.
- Updated build and test scripts to include new features and ensure functionality.
- Added tests for the Experience API to validate responses and data integrity.
- Updated ProjectCreation component to include a button for direct navigation to SmartPakke.
- Improved ProjectFlow component to handle SmartPakke navigation and project selection logic.
- Added CSS styles for new buttons and layout adjustments in ProjectFlow.
- Introduced a calculation info box in SmartPackagesEnhanced to display detailed pricing and time estimates based on real project data.
- Implemented functionality to load similar projects based on keywords from selected packages.
- Added API endpoint to fetch similar projects based on project descriptions and names.
- 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.
- Implemented InlineSmartPackage component for managing smart packages.
- Added CSS styles for layout, sections, and interactive elements.
- Integrated automatic material and labor calculations based on geometry data.
- Included profit margin settings and total price calculations.
- Enabled selection of predefined packages and dynamic updates of materials and tasks.
- Added functionality to add, update, and remove materials.
- Implemented task selection with detailed calculations for labor costs.
style: Add form help text styling in ProjectFlow.css
fix: Update SmartPackagesEnhanced to use strict equality checks for isCustom
refactor: Modify unified-server.js to use material_name instead of sku and implement new project_packages table for package management
chore: Create new MCP server configuration files for deployment
chore: Add SQL script to introduce wall_height column in roof_geometry table
build: Implement build and test script for local development
docs: Provide instructions for updating proxy server configuration
chore: Add quick deploy script for streamlined deployment process
test: Create comprehensive test, build, and deploy script for Tilbudgivern
- Created package.json for the test suite "tilbudgivern-tests"
- Added scripts for running tests, watching tests, and generating coverage reports
- Included Jest and Supertest as development dependencies
- Configured Jest with a test environment, test match pattern, and coverage collection settings
- Specified coverage output directory
- Added MaterialPackageService for handling CRUD operations on material packages.
- Introduced new API endpoints for creating, retrieving, updating, and deleting material packages.
- Developed frontend components for managing material packages, including forms for creating and listing packages.
- Implemented styling for the Material Packages interface.
- Created SQL setup script for material packages and related tables, including category mapping for Bygma standards.
- Added SmartPackages component for selecting roof types and packages based on area and search criteria.
- Integrated API calls to fetch packages based on selected roof type and area.
- Implemented package selection logic and summary display for selected packages.
- Enhanced database schema with new tables for custom packages, advanced geometry calculations, and time calculations.
- Added foreign key relationships and indexes for improved performance.
- Created default packages for various roof types and implemented a view for easy package selection.
- Developed a function to calculate total project costs including selected packages and labor costs.
- Added triggers to keep project total updated on package and time calculation changes.
- Deleted the outdated PDF file `updated_real_project_quote.pdf`.
- Created a new SQL view `v_enhanced_quotes` to enhance quote data extraction with improved project and customer name handling, price extraction, labor cost calculation, material cost estimation, and project type icon mapping.
- Updated the existing SQL view `enhanced_quotes_view` to align with the new enhancements.
- Added comprehensive integration tests for the new system, including tests for project review status, reject functionality, and overall quote accessibility.