39 lines
838 B
PHP
39 lines
838 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\ApiResource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Get;
|
|
use App\State\WorkHourDayContextProvider;
|
|
|
|
#[ApiResource(
|
|
operations: [
|
|
new Get(
|
|
uriTemplate: '/work-hours/day-context',
|
|
security: "is_granted('ROLE_USER')",
|
|
provider: WorkHourDayContextProvider::class
|
|
),
|
|
],
|
|
paginationEnabled: false
|
|
)]
|
|
final class WorkHourDayContext
|
|
{
|
|
public string $workDate = '';
|
|
|
|
/**
|
|
* @var list<array{
|
|
* employeeId:int,
|
|
* absenceLabel:?string,
|
|
* absenceColor:?string,
|
|
* absenceHalf:?string,
|
|
* absentMorning:bool,
|
|
* absentAfternoon:bool,
|
|
* creditedMinutes:int,
|
|
* creditedPresenceUnits:float
|
|
* }>
|
|
*/
|
|
public array $rows = [];
|
|
}
|