From be1a7cc0f83dc221d8fca3bf803a09d79f79069a Mon Sep 17 00:00:00 2001 From: cmorenov1402 Date: Fri, 25 Apr 2025 09:13:38 +0200 Subject: [PATCH] Increase hour interval range --- src/ApiResource/Accounting/AccountingBalancePoint.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ApiResource/Accounting/AccountingBalancePoint.php b/src/ApiResource/Accounting/AccountingBalancePoint.php index bb73529..e0fb0eb 100644 --- a/src/ApiResource/Accounting/AccountingBalancePoint.php +++ b/src/ApiResource/Accounting/AccountingBalancePoint.php @@ -28,7 +28,10 @@ use Symfony\Component\Validator\Constraints as Assert; ), 'interval' => new QueryParameter( schema: ['type' => 'string', 'default' => '24h'], - constraints: [new Assert\Choice(['24h'])], + constraints: [new Assert\Regex([ + 'pattern' => '/^\d+h$/', + 'message' => 'Interval must be a number followed by "h" (e.g. 24h)', + ])], ), 'end' => new QueryParameter( schema: ['type' => 'string', 'format' => 'date-time', 'default' => 'now'],