mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 16:22:16 +01:00
31 lines
864 B
PHP
31 lines
864 B
PHP
<?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';
|
|
case Description = 'description';
|
|
|
|
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
|
|
};
|
|
}
|
|
}
|