Remove outdated edge gateway object classes, add new agent implementation

Transitioned from obsolete gateway object classes (`edge_gateway_shell_action_jobs_o`, `edge_gateway_shell_events_o`, `edge_gateway_shell_sessions_o`, `edge_gateway_update_jobs_o`) to the new agent implementation (`edge-gateway-agent/agent.php`).
This commit is contained in:
Jeppe Bundgaard
2026-04-21 14:13:17 +02:00
parent d30a006457
commit 7d450e285e
90 changed files with 11811 additions and 2760 deletions
@@ -217,8 +217,8 @@ it('builds the overview payload from batched repository data with deterministic
(object)[
'departmentID' => 'dep_1',
'start' => '2026-03-23T09:00:00+00:00',
'end' => '2026-03-23T17:00:00+00:00',
'approval' => (object)['originalEnd' => '2026-03-23T17:30:00+00:00'],
'end' => '2026-03-23T17:30:00+00:00',
'approval' => (object)['originalEnd' => '2026-03-23T17:00:00+00:00'],
],
(object)[
'departmentID' => 'dep_2',
@@ -299,13 +299,44 @@ it('limits overtime counting to the selected reporting range', function (): void
$hours = department_daily_reports_route_invoke_private($route, 'calculateShiftOvertimeHoursInRange', [[
'start' => '2026-03-22T20:00:00+00:00',
'end' => '2026-03-22T23:45:00+00:00',
'approval' => (object)['originalEnd' => '2026-03-23T00:30:00+00:00'],
'end' => '2026-03-23T00:30:00+00:00',
'approval' => (object)['originalEnd' => '2026-03-22T23:45:00+00:00'],
], new \DateTime('2026-03-23T00:00:00+00:00'), new \DateTime('2026-03-24T00:00:00+00:00')]);
expect($hours)->toBe(0.5);
});
it('does not count negative approved overtime when a saved end shortens the shift', function (): void {
$route = new DepartmentDailyReportsOverviewRouteDouble();
$route->repository = new FakeDailyReportRepository();
$route->complaints_repository = new FakeDailyReportComplaintsRepository();
$route->outside_hours_service = new FakeOutsideHoursStatisticsService();
$hours = department_daily_reports_route_invoke_private($route, 'calculateShiftOvertimeHoursInRange', [[
'start' => '2026-03-23T10:00:00+00:00',
'end' => '2026-03-23T17:00:00+00:00',
'approval' => (object)['originalEnd' => '2026-03-23T18:00:00+00:00'],
], new \DateTime('2026-03-23T00:00:00+00:00'), new \DateTime('2026-03-24T00:00:00+00:00')]);
expect($hours)->toBe(0.0);
});
it('ignores late unapproved administrative edits when calculating overtime', function (): void {
$route = new DepartmentDailyReportsOverviewRouteDouble();
$route->repository = new FakeDailyReportRepository();
$route->complaints_repository = new FakeDailyReportComplaintsRepository();
$route->outside_hours_service = new FakeOutsideHoursStatisticsService();
$hours = department_daily_reports_route_invoke_private($route, 'calculateShiftOvertimeHoursInRange', [[
'start' => '2026-03-23T09:00:00+00:00',
'end' => '2026-03-23T17:00:00+00:00',
'approval' => null,
'updateTime' => '2026-03-24T02:30:00+00:00',
], new \DateTime('2026-03-23T00:00:00+00:00'), new \DateTime('2026-03-24T00:00:00+00:00')]);
expect($hours)->toBe(0.0);
});
it('wires the overview route to batched repository methods and overview path', function (): void {
$routeContent = (string)file_get_contents(app_path('routes/departmentDailyReportsRoute.php'));
$objectContent = (string)file_get_contents(app_path('objects/department_daily_reports_o.php'));