Add department daily reports feature and improve product handling

Introduced functionality for managing department daily reports, including endpoints for creating, updating, listing, and viewing product sales data. Enhanced product handling in reports by adding support for water usage, notes, and detailed product sales metrics. These changes improve tracking and reporting accuracy across departments.
This commit is contained in:
Jepp9350
2025-03-04 11:39:38 +01:00
parent 9d005566cc
commit 4d593c2b17
7 changed files with 722 additions and 84 deletions
+9
View File
@@ -39,6 +39,15 @@ trait route_t
return true;
}
public function requireDateFormat(string $date, string $format): void
{
global $response;
$d = \DateTime::createFromFormat($format, $date);
if (!$d || $d->format($format) !== $date) {
$response->error('Invalid date format. Expected: ' . $format . ' Got: ' . $date, 400);
}
}
public function requireMinValue(int $value, int $min): void
{
global $response;