16 Commits

Author SHA1 Message Date
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
01ad8f4a49 feat: consolidate ordrestyring quote workflow 2026-07-05 08:10:59 +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
copilot-swe-agent[bot]
f7d75e18d9 Add jsonwebtoken and bcryptjs dependencies for authentication
Co-authored-by: alexpolo1 <14327609+alexpolo1@users.noreply.github.com>
2026-01-06 07:23:03 +00:00
alexpolo1
ed6b5cd3a5 logging: Add correlation ID middleware and structured logging with request tracing 2025-12-22 22:31:16 +00:00
alexpolo1
fa2a79f8aa sec: Replace eval with safe expression parser (expr-eval) for material formulas 2025-12-22 21:56:51 +00:00
alexpolo1
c5c5a70643 tests1 2025-11-24 23:08:04 +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
99a31cb3cb fix: Downgrade dependencies for Node.js compatibility and add engines field 2025-11-07 08:08:24 +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
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
8ad6c494fb Add mock server and database for Bygma pricing test
- Implemented a mock Express server in `mock-bygma-test.js` to simulate Bygma's web price search API with sample data.
- Created a new SQL file `standard_material_prices.sql` containing standard market prices for various construction materials.
- Added initial files for frontend server and pricing test components.
2025-09-15 00:13:47 +02:00
e0086fa2a2 Add initial setup scripts and OCR testing functionality
- Created setup scripts for advanced database, pricing database, and quote items.
- Added a test script for OCR functionality, including PDF text extraction and price data extraction.
- Included test files for various scenarios: poor categorization, material list, and text with noise.
2025-09-14 17:30:10 +02:00
5f101c61cf feat: Initialize Tilbudgivern project with backend and frontend setup
- Added package.json for project dependencies and scripts
- Created setup_mariadb.sql for database setup and user creation
- Documented project development plan in taskfile.txt
- Implemented test_setup.sh for system requirements and project structure checks
- Configured systemd service files for backend and frontend applications
- Added ubu-deployment-commands.sh for deployment instructions on Ubu server
2025-09-12 00:39:06 +02:00