Resolve recommended-profile Critical and High findings, retain narrow analyzer exceptions, and update the edge-broker WebSocket dependency to a non-vulnerable release.
- 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.
- Added support for `today`, `week`, and `month` progress tracking in `GoalsCriteria`.
- Introduced `setTimeframeByName` method to manage time-based progress criteria.
- Enhanced `calculateProgressFromArray` and `calculateProgressDetailsFromArray` to include customizable timeframes.
- Updated departmental progress calculations with detailed breakdowns for multiple time periods.
- Replaced obsolete single-value progress tracking with comprehensive progress details.
- Refactored department daily targets logic for optimization and better maintainability.
- Ensured department-specific targets are validated, sanitized, and consistently applied in updates.
- Improved database interaction safety by preventing unnecessary updates for unchanged object properties.
- Adjusted route and API behavior for criteria and department updates to handle validations comprehensively.
- 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.
- Simplify multi-period department progress calculations by restructuring logic to render by period first.
- Add support for daily target calculations and timeframe-based target adjustments in `goals_criteria`.
- Introduce `countOperatingDaysInTimeframe` and related helper methods for improved alert scheduling and progress tracking.
- Add cloning logic in `withDepartmentFilter` to avoid mutating original `goals_criteria` objects.
- Rename method parameter in `render` and refactor `renderDanishPeriodSummary` for enhanced readability and flexibility.
- Introduce helper methods for date range and criteria window adjustments to streamline department progress calculations.
- Replace `send_webhook_message` with `send_message` for improved Slack notification rendering using `goals_progress_alert_renderer`.
- Add methods for calculating and retrieving departmental progress and distribution in `goals_criteria`.
- Update `renderDanishPeriodSummary` and Slack cron logic to support departmental-specific summaries.
- Include departmental progress in serialized goal objects for better reporting.
- 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.
- Implement `goals_progress_alert_renderer` service to compose and render progress alert messages based on destination, progress type, and style.
- Add format classes (`sms_progress_alert_format`, `email_progress_alert_format`, `slack_progress_alert_format`) with length constraints.
- Extend `goals_criteria` to include alert customization properties (`progress_alert_destination`, `progress_alert_progress_type`, `progress_alert_style`, `progress_alert_format`) with parsing and validation logic.
- Update `toArray` and `fromJson` methods to support new fields.
- Add `validateAndSanitize` method to `goals_criteria` for input validation and defaulting incorrect values.
- Ensure JSON encoding in `response` and database interactions respects Unicode (`JSON_UNESCAPED_UNICODE`).
- Sanitize and validate input for `department_goals_o::add` and criteria usage.
- Fix header character encoding in response (`Content-Type: application/json; charset=utf-8`).
- Update criteria `label` sanitization with trimming, length limits, and safe character handling.
- Introduce `goals_criteria_progress_alert_frequency` property in `goals_criteria` class to handle alert frequencies.
- Extend `fromJson` to parse `progress_alert_frequency` with support for camelCase input.
- Update `toArray` to include `progress_alert_frequency` in serialized output.
- Add robust validation for JSON input, including error handling for malformed or invalid data.
- Sanitize and validate all fields (`type`, `target`, `label`, `start`, `end`) with additional constraints like trimming, length limits, and proper date handling.
- Implement deduplication for `users`, `departments`, and `products` to ensure unique and valid entries.
- Ensure `end` date does not precede `start` by swapping when necessary.
- Introduce `VISITS` as a new goal criteria type in `goals_criteria_type` enum.
- Extend `goals_criteria` with `countVisits` method to compute unique visit counts based on criteria filters.
- Update result computation logic in `goals_criteria` to support `VISITS`.
- Introduce `REVENUE` as a new goal criteria type in `goals_criteria_type` enum.
- Add `goals_label_t` trait for handling label properties in goal criteria.
- Extend `goals_criteria` to support labels, including serialization and input validation.
- 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.
- Introduce `department_goals_o` for managing department-specific goals with criteria.
- Enhance `goals_criteria` with `toArray` and `toJson` methods for canonical JSON export.
- Update `goals` to delegate JSON export to `goals_criteria`.
- Add parsing logic for users, departments, and products, supporting array inputs with IDs or objects.
- Filter out invalid entries and update relevant criteria properties.
- Implement `exportToJson` and `importFromJson` methods in `goals` for serialization and deserialization.
- Add `fromJson` method in `goals_criteria` to parse criteria from JSON input.
- Extend `exampleRoute` for debugging with sample JSON-based goal creation.
- Update `index.php` to autoload new `goals` module classes and dependencies.
- Add `goals` class for managing goal metrics and calculations.
- Extend `goals_criteria` with timeframe initialization and validation.
- Implement `getListByCriteria` in `order_items_o.php` for product-based goal evaluation.
- Add unit tests for `goals` to validate
- Add `goals_criteria` base class implementing customizable goal criteria.
- Introduce interfaces and traits for modular handling of users, departments, and products in goal criteria.
- Include enumeration for goal types (`goals_criteria_type`).
- Implement timeframe and target management through traits.
- Provide initial configuration for enabling the goals module.