Commit Graph
72 Commits
Author SHA1 Message Date
Jeppe Bundgaard 36c9472a40 Integrate historical data into weather forecast, sort timeline entries, and update local development server URL in OpenAPI configuration. 2026-03-11 14:31:39 +01:00
Jeppe B 527e6a9ec4 Document WeatherAPI and department weather endpoints in OpenAPI 2026-03-11 13:56:29 +01:00
Jeppe Bundgaard 96629cba0d Add sayMessage method to Bird API client, extend birdVoiceWebhooksRoute with TTS capability for inbound calls, introduce /bird/voice/calls/{id}/say route, and update OpenAPI spec accordingly. 2026-03-04 12:47:44 +01:00
Jeppe Bundgaard 3d2e8396cc Replace inline schemas with reusable BirdVoiceCallListResponse, BirdVoiceCallSingleResponse, and BirdTestOutboundCallResponse components in OpenAPI spec, define new BirdVoiceCall schema, and require permissions for Bird voice call listing 2026-03-04 10:50:10 +01:00
Jeppe Bundgaard cbac9181f6 Refactor Bird API routes to support fallback workspace and channel configuration, centralize helper methods, and update OpenAPI spec to reflect optional parameters. 2026-03-04 10:42:33 +01:00
Jeppe Bundgaard 98203282ba Replace inline schemas with reusable BirdNumberListResponse and BirdNumberSingleResponse components in OpenAPI spec, and define new BirdNumber and BirdNumberCapability schemas. 2026-03-04 10:31:32 +01:00
Jeppe Bundgaard 70b7f5de87 Add workspace support to Bird numbers API and update routes, methods, and tests accordingly 2026-03-04 10:28:36 +01:00
Jeppe Bundgaard 7a43fbf383 Add department_relay_config and department_gate_config classes and refactor gate/relay handling logic to use strongly-typed configuration models 2026-03-03 12:24:01 +01:00
Jeppe B acc913c9b5 Implement department gates and relays objects and routes 2026-03-03 12:01:02 +01:00
Jeppe Bundgaard 80701117f4 Add include_lanes query parameter to guest departments endpoint and define DepartmentGuest and DepartmentLaneGuest schemas in OpenAPI documentation 2026-03-02 13:18:02 +01:00
Jeppe Bundgaard cc77066617 Reapply "Update Bird module to use AccessKey authorization header instead of Bearer, improve error handling, and add support for workspace/channel configuration."
This reverts commit 1087ffb413.
2026-02-27 03:15:38 +01:00
Jeppe Bundgaard 1087ffb413 Revert "Update Bird module to use AccessKey authorization header instead of Bearer, improve error handling, and add support for workspace/channel configuration."
This reverts commit 2ad9bcfd37.
2026-02-27 03:09:48 +01:00
Jeppe Bundgaard 2ad9bcfd37 Update Bird module to use AccessKey authorization header instead of Bearer, improve error handling, and add support for workspace/channel configuration. 2026-02-27 03:08:28 +01:00
Jeppe Bundgaard 52b467fe59 Update configuration response schemas in OpenAPI documentation to include detailed data structures 2026-02-27 01:55:22 +01:00
Jeppe Bundgaard abd33ed6d9 Add Bird configuration endpoints (GET/POST) and update OpenAPI documentation 2026-02-27 01:38:45 +01:00
Jeppe Bundgaard 32f017778f Add voice call management endpoints and enhance logging for HTTP requests 2026-02-27 01:29:32 +01:00
Jeppe Bundgaard f74210bca8 Add date range fields to goal criteria and update OpenAPI documentation 2026-02-27 00:46:30 +01:00
Jeppe Bundgaard ddc35fd21a Enhance goal progress schema by adding year and to-date calculations, and improve descriptions for clarity 2026-02-27 00:41:31 +01:00
Jeppe Bundgaard 88f4f34c34 Update department daily targets to support floats
- Refactored `department_daily_targets` logic to accept and process float values instead of integers.
- Adjusted relevant type declarations, validations, and calculations in `GoalsCriteria`.
- Updated OpenAPI schema to align with new data type for per-department daily targets.
2026-02-25 14:40:26 +01:00
Jeppe Bundgaard 90959c6b41 Expand criteria type enums and add goal progress tracking schema updates
- Added new enum values (`REVENUE`, `VISITS`, `NONE`) for `Criteria type` in `GoalsCriteria`.
- Introduced `GoalProgressDetails` schema for tracking progress metrics (count, target).
- Extended `DepartmentGoal` to include time-based progress tracking (`today`, `week`, `month`) and departmental distribution of progress.
2026-02-25 14:29:56 +01:00
Jeppe Bundgaard ffc5d6bc21 Add support for per-department custom daily targets
- Introduced `department_daily_targets` field in criteria, renderer, and API to define daily target overrides for departments.
- Enhanced daily target logic to honor per-department overrides while maintaining backward compatibility.
- Updated SMS, email, and Slack renderers for consistent enforcement of text length limits with fallback to non-mbstring functions.
- Refactored order item update logic to improve database interaction safety by using setters.
2026-02-25 13:03:04 +01:00
Jeppe Bundgaard b291e959e0 Add WebAuthn integration, reCAPTCHA support, and new tests
- Integrate WebAuthn library for passkey authentication workflows, including assertion verification and improved error handling.
- Add support for reCAPTCHA token validation across multiple endpoints for enhanced security.
- Extend OpenAPI schema to document new fields and restructured payloads.
- Add unit tests for WebAuthn flows, permission initialization, and route validation to ensure robustness and accuracy.
2026-02-24 09:27:51 +01:00
Jeppe Bundgaard 356e59bd10 Improve dynamic URL generation and add localhost support for passkey challenges
- Refactor direct download URL generation to dynamically use `HTTP_HOST` and protocol.
- Add support for localhost `rpId` during WebAuthn passkey challenges.
- Extend test cases to validate `localhost` and `truckwash.io` scenarios.
- Update OpenAPI specifications to reflect new `rpId` logic and additional server configurations.
2026-02-23 23:37:15 +01:00
Jeppe Bundgaard 61db62212c Add WebAuthn passkey challenge and verification endpoints
- Introduced endpoints for WebAuthn-based authentication flow (`/auth/passkey/challenge` and `/auth/passkey/verify`).
- Added support for generating and verifying WebAuthn PublicKeyCredentialRequestOptions and challenge tokens.
- Extended routing logic to expose matched route templates for improved parameter handling.
- Updated OpenAPI specifications to document passkey challenge and verification workflows.
- Included unit tests for validating both existing and non-existing user scenarios during passkey challenges.
2026-02-23 23:03:28 +01:00
Jeppe Bundgaard eb0f4ca38b Enhance 2FA handling and subuser session management
- Add `two_factor_enabled` property for subuser responses in routes and OpenAPI specs.
- Improve subuser session resolution by checking token `id` for validity.
- Adjust authentication flow to prevent operations on nonexistent users in 2FA logic.
- Update OpenAPI request/response schema to better represent token/session objects.
2026-02-23 21:44:11 +01:00
Jeppe Bundgaard f6b526f4ef Add two-factor authentication support for users and subusers
- Extend `users_o` and `subusers_o` with `two_factor_enabled` and `two_factor_secret` properties.
- Implement methods for managing 2FA (`isTwoFactorEnabled`, `setTwoFactorSecret`, `verify_2fa_code`) in authentication logic.
- Add 2FA handling in login flows for both users and subusers, including token generation and validation.
- Introduce `totp` class for TOTP-based authentication, including QR code generation and code verification.
- Add test cases for 2FA functionality (`TwoFactorAuthTest.php`) and coverage for login scenarios with 2FA.
- Update OpenAPI specifications to include 2FA flows (`auth/2fa/setup`, `auth/2fa/enable`, `auth/2fa/verify`, `auth/2fa/disable`).
2026-02-23 17:00:18 +01:00
Jeppe Bundgaard 5a59562e35 Add Bird API integration with voice call and flash call support
- Implement Bird API client (`bird.php`) for handling HTTP requests to Bird services.
- Add routes for voice and flash call management (`birdVoiceFlashCallsRoute.php`, `birdNumbersRoute.php`).
- Introduce test cases for voice calls, flash calls, and numbers (`VoiceCallsApiTest.php`, `NumbersAndFlashCallsApiTest.php`).
- Include configuration management classes and APIs for enabling the Bird module and managing API keys (`bird_c.php`).
- Provide OpenAPI specifications for flash call endpoints (`bird-flash-calls.md`).
2026-02-19 12:19:36 +01:00
Jeppe Bundgaard 4bdbe40329 Add superuser endpoints for forced MACHINE relay control
- Implement emergency operations to forcibly enable or disable MACHINE relays (`forceTurnOnMachineRelay`).
- Add OpenAPI specifications for `/modules/self-serve/lane/force/machine/enable` and `/modules/self-serve/lane/force/machine/disable`.
- Update route definitions and introduce validation for input parameters.
2026-02-19 10:39:43 +01:00
Jeppe Bundgaard 54160659fc Add dynamic image generation for department lanes
- Implement `/department/lanes/dynamic-image` endpoint for machine UI dynamic image rendering.
- Add OpenAPI specification for the new endpoint with query parameters for buttons, current step, and vehicle type.
- Include `DepartmentLanesImageTest` for lightweight testing of image behavior and input normalization.
- Update `departmentLanesRoute.php` with logic for parameter handling and image composition based on lane configuration.
2026-02-18 16:44:18 +01:00
Jeppe Bundgaard 73ac77a2f5 Add support for dynamic image buttons and vehicle type selection in self-serve tasks
- Extend `department_selfserve_tasks_o` with `buttons` and `dynamic_images_vehicle_type` properties.
- Add normalization/validation methods for `buttons` and `dynamic_images_vehicle_type` parameters.
- Update `departmentSelfserveTasksRoute` to handle new fields in task creation and update.
- Add OpenAPI specifications for `buttons` and `dynamic_images_vehicle_type`.
- Include comprehensive tests for button normalization and vehicle type selection.
2026-02-18 16:34:58 +01:00
Jeppe Bundgaard 51014bf774 Add development guidelines, testing rules, and secure routes documentation
- Add `.junie/guidelines.md` with comprehensive development instructions.
- Include `.aiassistant/rules/Creating and maintaining tests.md` and `.aiassistant/rules/Creating and securing routes.md`.
- Introduce `CACHE_SELFSERVE_LANE_KEY_ALLOWED_SERVICES` for lane service validation.
- Update `selfserve_lane_relay_controller_t` to enforce service-specific permissions for machine relay.
2026-02-18 14:13:05 +01:00
Jeppe Bundgaard 05a4943162 Add /subusers/me route for public registration and extend OpenAPI schema
- Add `/subusers/me` as a public registration endpoint, including CVR validation, phone lookup, and optional SMS setup link generation.
- Extend OpenAPI specification with `SubuserSelf` and `SubuserGrantSummary` schemas for returning authenticated subuser profiles and grants.
2026-02-12 16:58:41 +01:00
Jeppe Bundgaard 4f9f2a2d71 Enhance API documentation and extend customer context handling for subuser permissions
- Add `X-Customer-Number` header for subuser-specific customer targeting across endpoints.
- Update vehicle-related endpoints (`listVehicles`, `addVehicle`, `editVehicle`, etc.) to include subuser permission checks and customer context handling.
- Refactor request and response schemas for vehicle operations to reflect new requirements and improve clarity.
- Include detailed permission scoping and descriptions for subuser and broader access handling.
- Extend OpenAPI specification with enriched schema properties and additional responses for edge cases.
2026-02-12 16:01:30 +01:00
Jeppe Bundgaard e9e0b3e19e Add include_non_enabled parameter to /subusers endpoint
- Allow listing subusers with only non-enabled grants by introducing an optional `include_non_enabled` query parameter.
- Update SQL query logic to conditionally include non-enabled subuser grants.
- Extend OpenAPI documentation to reflect the new parameter with its description and schema.
2026-02-11 17:58:55 +01:00
Jeppe Bundgaard 34ea4937e0 Add /subusers and /subusers/{id} endpoints for subuser management with permission-based visibility
- Implement routes to list and retrieve subusers based on grant visibility tied to the authenticated user's customer number.
- Extend OpenAPI documentation with detailed descriptions, parameters, and response schemas for the new endpoints.
2026-02-11 17:56:59 +01:00
Jeppe Bundgaard 89b8587dfc Update OpenAPI documentation with new API structure and subuser registration flow
- Add detailed API info, authentication methods, and permission requirements.
- Introduce comprehensive tags for endpoints covering key modules such as Users, Orders, Bookings, Payments, and more.
- Define `/subusers` endpoint for creating subuser registrations with CVR validation and SMS setup flow.
- Update schemas for user and subuser properties, including notifications and timestamps.
2026-02-11 17:39:36 +01:00
Jeppe Bundgaard 354ad86de3 Add CRUD operations for subuser grants and list permission nodes
- Implement routes for managing subuser grants: listing, creating, updating, and deleting.
- Add endpoint to fetch available permission nodes grouped by type.
- Extend `subuser_grants_o` with new utility methods, including `asArray`.
- Update OpenAPI documentation to include new endpoints and schemas.
2026-02-11 17:25:53 +01:00
Jeppe Bundgaard 6ad28a26eb Add passkeysRoute for managing user passkeys and extend OpenAPI documentation
- Introduce `passkeysRoute` with operations to list, create, rename, and delete passkeys for authenticated users.
- Update OpenAPI with endpoints and request/response schemas for passkey management.
2026-02-11 15:59:10 +01:00
Jeppe Bundgaard 54de81269b Add /subusers/auth/password endpoint for subuser authentication using password and identifier types 2026-02-11 14:57:46 +01:00
Jeppe Bundgaard 2206a3dc46 Extend OpenAPI with subuser registration and setup endpoints
- Add `/subusers` route for subuser creation using CVR and phone validation.
- Introduce `/subusers/setup` with token validation and subuser setup completion.
- Define detailed request/response schemas for both endpoints.
2026-02-10 16:21:55 +01:00
Jeppe Bundgaard 8a5a7294ab Refactor invoice comparison logic and deprecate temporary route
- Enhance `/collected-invoices/economic/compare` with improved HTTP status determination and response structure.
- Add handling for `draft_total` and `booked_total` comparisons against internal totals.
- Deprecate `/tmp-customer-list-overcharged` route with error response.
- Update OpenAPI documentation for `compareCollectedInvoiceEconomic` endpoint.
- Introduce `CollectedInvoiceEconomicCompareResponse` schema for consistent API responses.
- Comment out unused return data and debug code for clarity.
2026-02-03 15:08:21 +01:00
Jeppe Bundgaard 7fd4ac888a Add POST endpoint /goals/department/progress-alert/test to send test progress alerts
- Define alert destinations (Slack, Email, SMS) with customizable parameters.
- Implement OpenAPI specification and validate permissions, goal existence, and configuration.
2026-01-27 09:11:17 +01:00
Jeppe Bundgaard 043382c6f4 Add support for weekday-specific and time-of-day progress alerts in goals_criteria
- Introduce `progress_alert_weekdays` and `progress_alert_time_of_day` fields with parsing, validation, and sanitization logic.
- Add `goals_criteria_progress_alert_weekday` enum for supported weekdays.
- Update `toArray` and OpenAPI specification to support new fields and maintain backward compatibility.
2026-01-27 08:52:12 +01:00
Jeppe Bundgaard 4eacd04c2a Update OpenAPI spec: Add progress alert customization fields to goals_criteria schema
- Introduce `progress_alert_destination`, `progress_alert_progress_type`, `progress_alert_style`, and `progress_alert_format` fields with descriptions, examples, and enum values.
- Ensure backward compatibility with support for camelCase inputs.
2026-01-27 08:46:14 +01:00
Jeppe Bundgaard 32b5816a36 Update OpenAPI spec: Add label field to goals_criteria schema 2026-01-26 19:47:15 +01:00
Jeppe Bundgaard 8009e4029c Update OpenAPI spec: Add progress_alert_frequency to goals_criteria schema 2026-01-26 19:46:18 +01:00
Jeppe Bundgaard c1b7f5bad6 Add progress calculation and enhance department goal management
- Introduce progress-related functionality in `goals_criteria` and enumeration for alert frequencies.
- Add `calculateProgressFromArray` for progress evaluation based on criteria arrays.
- Extend `department_goals_o` with `name` property and optional inclusion of progress in goal exports.
- Update OpenAPI spec with endpoints and schemas for department goal management.
2026-01-26 18:51:31 +01:00
Jeppe Bundgaard ca4432374c Add department access check and self-serve enabled status routes in departments API 2026-01-21 10:49:45 +01:00
Jeppe Bundgaard da9ee98fb5 Add password reset request endpoint to authentication routes; update OpenAPI spec and improve user email handling in users_o 2026-01-19 11:17:35 +01:00
Jeppe Bundgaard 09b5c618ed Add fine-grained permission checks for viewing department self-serve tasks and implement password reset endpoints (validate and set) in authentication routes; update OpenAPI spec accordingly. 2026-01-19 10:57:09 +01:00