| Numéro du ticket | Titre du ticket | |------------------|-----------------| | #322 | Page horaire | ## Description de la PR [#322] Page horaire ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #4 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #4.
This commit is contained in:
22
src/ApiResource/ScopedEmployee.php
Normal file
22
src/ApiResource/ScopedEmployee.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use App\State\ScopedEmployeeProvider;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new GetCollection(
|
||||
uriTemplate: '/employees/scoped',
|
||||
normalizationContext: ['groups' => ['employee:read', 'site:read']],
|
||||
security: "is_granted('ROLE_USER')",
|
||||
provider: ScopedEmployeeProvider::class,
|
||||
paginationEnabled: false
|
||||
),
|
||||
]
|
||||
)]
|
||||
final class ScopedEmployee {}
|
||||
39
src/ApiResource/WorkHourBulkUpsert.php
Normal file
39
src/ApiResource/WorkHourBulkUpsert.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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
|
||||
* }>
|
||||
*/
|
||||
public array $entries = [];
|
||||
}
|
||||
13
src/ApiResource/WorkHourBulkUpsertResult.php
Normal file
13
src/ApiResource/WorkHourBulkUpsertResult.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
final class WorkHourBulkUpsertResult
|
||||
{
|
||||
public int $processed = 0;
|
||||
public int $created = 0;
|
||||
public int $updated = 0;
|
||||
public int $deleted = 0;
|
||||
}
|
||||
37
src/ApiResource/WorkHourDayContext.php
Normal file
37
src/ApiResource/WorkHourDayContext.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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,
|
||||
* absenceHalf:?string,
|
||||
* absentMorning:bool,
|
||||
* absentAfternoon:bool,
|
||||
* creditedMinutes:int,
|
||||
* creditedPresenceUnits:float
|
||||
* }>
|
||||
*/
|
||||
public array $rows = [];
|
||||
}
|
||||
32
src/ApiResource/WorkHourWeeklySummary.php
Normal file
32
src/ApiResource/WorkHourWeeklySummary.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\ApiResource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\Dto\WorkHours\WeeklySummaryRow;
|
||||
use App\State\WorkHourWeeklySummaryProvider;
|
||||
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Get(
|
||||
uriTemplate: '/work-hours/weekly-summary',
|
||||
security: "is_granted('ROLE_USER')",
|
||||
provider: WorkHourWeeklySummaryProvider::class
|
||||
),
|
||||
],
|
||||
paginationEnabled: false
|
||||
)]
|
||||
final class WorkHourWeeklySummary
|
||||
{
|
||||
public string $weekStart = '';
|
||||
public string $weekEnd = '';
|
||||
|
||||
/** @var list<string> */
|
||||
public array $days = [];
|
||||
|
||||
/** @var list<WeeklySummaryRow> */
|
||||
public array $rows = [];
|
||||
}
|
||||
Reference in New Issue
Block a user