Commit Graph
125 Commits
Author SHA1 Message Date
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 31a4e4f61f feat: Improve installation manual fetching by enforcing URL requirement and enhancing user feedback in MaterialDialog 2025-11-07 12:41:16 +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 0ebca585d7 feat: Implement auto-save functionality for geometry and smart packages, enhance roof type options, and update frontend status report 2025-11-05 09:42:43 +00:00
alexpolo1 210ad7a2a4 fix: Improve calendar view error handling and empty state messages
Task 22: Fix Kalendervisning/planlægning

Changes:
- Added comprehensive empty state messages for calendar view
- Better data validation before rendering calendar grid
- Helpful messages when no calendar data is available
- Separate message when no employees are found
- Empty week message when no tasks are scheduled
- User-friendly tips for troubleshooting calendar issues
- Improved UX with clear explanations of what might be wrong
- All messages in Danish matching application language

Messages include:
- 'Ingen kalenderdata tilgængelig' with sync tips
- 'Ingen medarbejdere fundet' with Ordrestyring reference
- 'Ingen planlagte opgaver denne uge' with navigation help
2025-11-05 08:55:46 +00:00
alexpolo1 3a67e106a2 feat: Add corner house (vinkelhus) calculation support
Task 21: Vinkelhus calculation support

Changes:
- Added 'Vinkelhus' checkbox to enable L-shaped building mode
- Added fields for second wing dimensions (wing2Width, wing2Length)
- Visual UI section for second wing with green highlighting
- Real-time total area calculation showing both wings combined
- Backend calculates area for both wings separately and combines:
  * Flat roof: wing1_area + wing2_area
  * Pitched roof: calculates each wing surface area independently
- Database migration adds is_corner_house, wing2_width, wing2_length columns
- Form labels update dynamically (Vinge 1/Vinge 2) when corner house mode active
- Proper data persistence and loading for corner house configurations
2025-11-05 08:50:36 +00:00
alexpolo1 c8b28e250c feat: Implement bidirectional auto-calculation for roof geometry
Task 2: Geometri - Auto-beregning højde kip/stern

Changes:
- Added 'Tagbeklædning' (roof covering area) field to geometry form
- Implemented bidirectional calculation:
  * When user enters stern-kip height → auto-calculates tagbeklædning
  * When user enters tagbeklædning → auto-calculates stern-kip height
- Added helper functions for mathematical calculations:
  * calculateRoofCoveringFromHeight() - uses Pythagorean theorem
  * calculateRidgeHeightFromCovering() - inverse calculation
- Backend saves roof_covering_area to database
- Database migration adds roof_covering_area column
- Real-time updates as user types in either field
- Uses accurate geometry formulas for pitched roofs
2025-11-05 08:44:38 +00:00
alexpolo1 02b6bb9440 feat: Add kvist details fields for 'Tag med kviste'
Task 5: Tag med kviste - Add kvist details

Changes:
- Added kvist_size (m²) and number_of_kviste fields to geometry form
- Fields only appear when 'Tag med kviste' is selected
- Total kvist area is calculated and displayed (size × number)
- Backend saves kvist data to roof_geometry table
- Area calculation includes kvist area when applicable
- Database migration adds kvist_size and number_of_kviste columns
- Visual feedback with highlighted kvist section in form
2025-11-05 08:39:57 +00:00
alexpolo1 ce7312a4da fix: Improve kategori dropdown to show all tag-related items
Task 9 completed:
- Added smart category matching for 'Tag' category
- 'Tag' category now shows ALL tag-related packages automatically
- Includes: Tag, Tagrenovering, Tagudskiftning, Tagmaterialer, Tagrende
- Prevents duplicate tag subcategories in dropdown menu

Backend changes:
- smartPackageManagementService.js: Smart category filtering
- When category='Tag', uses LIKE matching for all tag-related items
- Supports both 'Tag' and 'tag' case variations
- Specific subcategories (Tagrenovering, etc.) still work as before

Frontend changes:
- SmartPackages.js: Added 'Tag (alle tag-relaterede)' option
- Filters out tag subcategories from dropdown to avoid duplication
- Clean dropdown with main 'Tag' category + other categories

Technical improvements:
- Case-insensitive category matching
- LIKE pattern matching for flexibility
- Maintains backward compatibility with existing categories

Customer feedback: Task 9 - Fix kategori dropdown to show all tag-related items
2025-11-05 08:27:27 +00:00
alexpolo1 2d768774ae feat: Add search and auto-save to Smart Package form
Tasks 6-7 completed:
- Added search functionality for materials and tasks
- Implemented auto-save (saves 2 seconds after last change)
- Removed manual 'Gem pakke' button in edit mode
- Added auto-save status indicator showing last save time

Search features:
- Material search box filters materials in real-time
- Task search box filters tasks in real-time
- Search is case-insensitive and searches by name
- Compact UI with search + add button in same row

Auto-save features:
- Automatic save 2 seconds after any change (edit mode only)
- Silent background saves - no user notification for success
- Last saved timestamp displayed at bottom
- Manual save button still available when creating new package
- Prevents data loss from accidental page closure

Technical improvements:
- Added materialSearchTerm and taskSearchTerm state
- Added autoSaveTimeout and lastSaved state
- useEffect hook triggers auto-save on packageData changes
- Filter functions on materials/tasks arrays
- Conditional rendering of save button vs auto-save indicator

Customer feedback: Tasks 6-7 - Search function + Auto-save for smartboks
2025-11-05 08:22:36 +00:00
alexpolo1 f7917d83bf fix: Add customer address to quote text generation
- Added customer_address field to static quote template
- Updated AI quote template to include [KUNDE_ADRESSE] placeholder
- Added instruction to AI to replace address placeholder with actual customer address
- Both static and AI-generated quotes now show complete customer information

Technical changes:
- buildCompleteStaticQuote: Added conditional customer_address display
- buildStaticQuoteTemplate: Added [KUNDE_ADRESSE] placeholder
- buildOptimizedPrompt: Added instruction #3 to replace address placeholder

Customer feedback: Task 17 - Fix tilbudstekst address not working
2025-11-05 08:18:07 +00:00
alexpolo1 86ad8064c0 fix: Fix PDF button functionality in Final Review
- Changed 'Vis PDF' link to 'Åben PDF' button with proper onClick handler
- Fixed blob URL management - now properly cleans up old URLs
- Added useEffect cleanup to revoke blob URLs on component unmount
- Improved error handling with user-friendly alerts
- Added success message after PDF generation
- Fixed button styling - converted link to button for consistency
- Added tooltips to explain button functionality

Technical improvements:
- handleOpenPDF: Opens PDF in new window using window.open()
- Memory leak fix: Revokes old blob URLs before creating new ones
- Better UX: Clear feedback for success/error states

Customer feedback: Tasks 15-16 - Fix 'Åben PDF' and 'Vis PDF' buttons
2025-11-05 08:15:22 +00:00
alexpolo1 1d25c4a3aa feat: Remove redundant Guide tab from Smart Package form
- Removed 'Guide' tab with stepper wizard (3 steps)
- Kept only 'Materialer og opgaver' and 'Alle detaljer' tabs
- Simplified package creation workflow
- Removed unused stepper components and handlers
- Tab indices automatically adjusted after removal

The Guide tab was redundant as 'Alle detaljer' shows all fields
in a single view, providing better overview for users.

Customer feedback: Task 11 - Remove Guide tab if not needed
2025-11-05 08:08:45 +00:00
alexpolo1 cd253e9b99 feat: Remove sværhedsgrader (difficulty levels) from Smart Packages
- Removed difficulty level filter from SmartPackages component
- Removed difficulty stars display from package cards
- Removed difficulty level field from SmartPackageForm (both instances)
- Removed difficulty level field from TaskDialog
- Removed difficulty level display from PackageDetailsDialog
- Simplified UI without unnecessary complexity indicators

Customer feedback: Task 10 - Remove Sværhedsgrader from interface
2025-11-05 08:05:46 +00:00
alexpolo1 54d0e44930 style: Change yellow material source badge to white
- Changed .source-badge.static background from yellow (#fff3cd) to white
- Updated text color from #856404 to neutral #6c757d
- Changed border from yellow (#ffeaa7) to neutral gray (#dee2e6)
- Improves readability and consistency with other badges

Customer feedback: Task 12 - Change yellow material box to white
2025-11-05 08:02:21 +00:00
alexpolo1 47cb55b8f9 feat: Simplify quote text - Remove ARBEJDE DER UDFØRES details, add customer text
- Replaced complex 'ARBEJDE DER UDFØRES' section with simple format
- Now only shows: work hours and total area (m²)
- Added customer's preferred text: 'Med mange års erfaring...'
- Removed detailed breakdowns (tag type, antal tømrere, timepris)
- Simplified price section to only show: price excl. VAT, VAT, total
- Updated AI instructions to generate simpler, focused quotes
- Removed company values, guarantees, and service descriptions from template

Customer feedback: Tasks 18, 19, 20 from customer email
2025-11-05 07:58:18 +00:00
alexpolo1 ae47e4a8d9 feat: Add scroll to top on page navigation
- Added automatic scroll to top when navigating to:
  - EnhancedGeometry component
  - FinalReview component
  - CalculationView component
  - InlineSmartPackage component
- Uses smooth scrolling behavior for better UX
- Prevents users from landing at bottom of page after navigation

Customer feedback addressed:
- Navigation now scrolls to top on page change
2025-11-05 07:51:00 +00:00
alexpolo1 c66ff67956 feat: Make prices and hours editable in Final Review + add profit margin
- All material prices and quantities now editable
- All labor hours and rates now editable
- Added profit margin percentage input (moved from smartboks)
- Prices recalculate automatically when values change
- Added editable input styling with focus states
- Profit margin shows in highlighted yellow section

Customer feedback addressed:
- Unlock timer/priser boxes for editing
- Move fortjeneste procent to Final Review (from smartboks)
- Allow last-minute price adjustments before sending quote
2025-11-05 07:46:45 +00:00
alexpolo1 e86aef7107 fix: Update tag types and remove komplekst tag option
- Replaced 'Komplekst tag' with proper tag types: Sadeltag/Skråttag, Valmtag, Københavnertag, Fladtag, Pulttag, Tag med kviste, Mansardtag
- Removed parentheses from tag type names for cleaner UI
- Removed 'Komplekse detaljer' checkbox (karnapper, kviste)
- Removed manual 'Gem Geometri' button - geometry now auto-saves after calculation
- Updated backend complexity calculations to support new tag types
- Updated getRoofTypeDisplayName to include all new tag types

Customer feedback addressed:
- Tag type cleanup and proper Danish names
- Removed komplekst tag option
- Removed manual save button
2025-11-05 07:43:02 +00:00
alexpolo1 a3badedb2c docs: Add comprehensive integration documentation 2025-10-31 21:20:48 +00:00
alexpolo1andAI Assistant 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 <[email protected]>
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 2186362e3c Implement Bygma PDF Scraper, Custom Task Creation, Customer Search, and Manual Retrieval Features
- 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.
2025-10-30 18:04:41 +00:00
alexpolo1 8a44b44770 feat: Add Ordrestyring report integration and profit margin analysis documentation 2025-10-26 08:59:27 +00:00
alexpolo1 d4d3eb3d00 feat: Implement Bygma Prisbog import script to handle CSV import of 54,558 products
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
2025-10-26 08:15:46 +00:00
alexpolo1 dc4a470a58 feat: Implementere erfaringsbaserede SmartPackages med varenumre og geometri-beregning
- 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.
2025-10-25 04:52:26 +00:00
alexpolo1 9f7ff8456b Refactor Smart Package Management Service and Frontend Components
- 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.
2025-10-24 07:45:19 +00:00
alexpolo1 a632107999 feat: Migrate planning calendar endpoint to GraphQL and remove deprecated services
- 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.
2025-10-23 22:21:37 +00:00
alexpolo1 1d96d69a58 feat(graphql): Implement comprehensive GraphQL queries for hours, hour types, and business hours
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
2025-10-23 22:01:33 +00:00
alexpolo1 a0c5beb738 feat: new bygma webpage crawler, and graphql api full feature set to replace api v2 2025-10-23 13:22:30 +00:00
alexpolo1 0a44cb0ab3 feat: Add API endpoints for fetching tasks and package categories, enhance routing and logging in SmartPackages 2025-10-22 21:25:56 +00:00
alexpolo1 2d7218d67e feat: Implement TaskDialog component for managing tasks in smart packages
- 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.
2025-10-22 19:29:21 +00:00
alexpolo1 2c121882bc feat: Enhance CalendarGrid with status filters and improved event handling 2025-10-21 15:21:02 +00:00
alexpolo1 d4fb536198 feat: Filter calendar to show only employees with events
- 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
2025-10-21 08:47:23 +00:00
alexpolo1 598c0b073c feat: Show customer names in calendar instead of task descriptions
- 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'
2025-10-21 08:00:04 +00:00
alexpolo1 2df6ee1e7c feat: Calendar shows task titles and integrates directly with Ordrestyring API
- 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
2025-10-21 07:51:32 +00:00
alexpolo1 f9648991c0 feat: Update CalendarGrid status color mapping and improve database query for calendar events 2025-10-21 07:23:41 +00:00
alexpolo1 f89506ca28 feat: Add new CalendarGrid component matching screenshot design 1-to-1
✨ New Features:
- CalendarGrid component with employee rows and day columns
- Full status color mapping (Åben, Lukket, Afsluttet, Murer/Tømrer statuser)
- Settings panel with filter options (Planlagt tid, Arbejdstid, etc.)
- Responsive grid layout matching exact screenshot design
- Time range display (07:00-15:30 format)
- Status indicators with proper colors:
  * Åben (green #22c55e)
  * Lukket (orange #f97316)
  * Afsluttet (red #dc2626)
  * Murer igangværende (blue #3b82f6)
  * Murer kommende (cyan #06b6d4)
  * Tømrer igangværende (dark green #059669)
  * Tømrer kommende (light green #10b981)
  * Bogført (gray #6b7280)
  * Ferie/Syg/Fri statuses

📋 Components Added:
- frontend/src/components/CalendarGrid.js
- frontend/src/components/CalendarGrid.css

🔧 Integration:
- Updated PlanningDashboard to use CalendarGrid instead of CalendarView
- Removed unused transformCalendarData function
- Clean import structure
2025-10-21 06:41:22 +00:00
alexpolo1 4a018d7862 fix: Complete codebase audit - 100% API test coverage with all errors fixed
✅ 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
2025-10-21 06:33:28 +00:00
alexpolo1 9cdc4c27b0 test: Add installation manual API tests to build script
- 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
2025-10-20 10:43:14 +00:00
alexpolo1 adfbef5e3a ui: Improve installation manual button visibility and clean up Smart Packages page
- 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
2025-10-20 10:40:27 +00:00
alexpolo1 2a640821a5 test: Add installation manual API test script 2025-10-20 10:35:59 +00:00