mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-10 01:02:15 +01:00
Added filled gaps to time entry aggregation; Moved aggregation to service
This commit is contained in:
29
app/Enums/TimeEntryAggregationType.php
Normal file
29
app/Enums/TimeEntryAggregationType.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum TimeEntryAggregationType: string
|
||||
{
|
||||
case Day = 'day';
|
||||
case Week = 'week';
|
||||
case Month = 'month';
|
||||
case Year = 'year';
|
||||
case User = 'user';
|
||||
case Project = 'project';
|
||||
case Task = 'task';
|
||||
case Client = 'client';
|
||||
case Billable = 'billable';
|
||||
|
||||
public function toInterval(): ?TimeEntryAggregationTypeInterval
|
||||
{
|
||||
return match ($this) {
|
||||
TimeEntryAggregationType::Day => TimeEntryAggregationTypeInterval::Day,
|
||||
TimeEntryAggregationType::Week => TimeEntryAggregationTypeInterval::Week,
|
||||
TimeEntryAggregationType::Month => TimeEntryAggregationTypeInterval::Month,
|
||||
TimeEntryAggregationType::Year => TimeEntryAggregationTypeInterval::Year,
|
||||
default => null
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user