45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\ApiResource;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Post;
|
|
use App\State\WorkHourBulkUpsertProcessor;
|
|
|
|
#[ApiResource(
|
|
operations: [
|
|
new Post(
|
|
uriTemplate: '/work-hours/bulk-upsert',
|
|
security: "is_granted('ROLE_USER')",
|
|
output: WorkHourBulkUpsertResult::class,
|
|
processor: WorkHourBulkUpsertProcessor::class
|
|
),
|
|
]
|
|
)]
|
|
final class WorkHourBulkUpsert
|
|
{
|
|
public string $workDate = '';
|
|
|
|
/**
|
|
* @var list<array{
|
|
* employeeId:int,
|
|
* morningFrom?:?string,
|
|
* morningTo?:?string,
|
|
* afternoonFrom?:?string,
|
|
* afternoonTo?:?string,
|
|
* eveningFrom?:?string,
|
|
* eveningTo?:?string,
|
|
* isPresentMorning?:bool,
|
|
* isPresentAfternoon?:bool,
|
|
* dayHoursMinutes?:?int,
|
|
* nightHoursMinutes?:?int,
|
|
* hasBreakfast?:bool,
|
|
* hasLunch?:bool,
|
|
* hasOvernight?:bool
|
|
* }>
|
|
*/
|
|
public array $entries = [];
|
|
}
|