feat(ticketing): resolve validity in tenant timezone

This commit is contained in:
2026-09-21 15:19:09 -03:00
parent f4de2ff5b2
commit 3e3b3bfac0
17 changed files with 354 additions and 45 deletions

View File

@@ -10,6 +10,11 @@ use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin ValidityTime */
class ValidityTimeResource extends JsonResource
{
public function __construct($resource, private readonly string $timezone = 'UTC')
{
parent::__construct($resource);
}
/** @return array<string, mixed> */
public function toArray(Request $request): array
{
@@ -27,7 +32,7 @@ class ValidityTimeResource extends JsonResource
return [
'id' => $this->id,
'type' => $this->type->value,
'is_valid' => $this->isValid(),
'is_valid' => $this->isValid(timezone: $this->timezone),
...array_filter($fields, fn (mixed $value): bool => $value !== null),
];
}