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
@@ -39,6 +39,17 @@ class productsRoute
$user = (new authentication())->get_user();
// Check if the request was successful
if ($user) {
// Check if the id is set in the request
if (self::isParametersSet(['id'])) {
// Log the incident
(new logs_o())->add('products', 'global', 1, $user->id, 'LIST_PRODUCTS', 'Successfully listed product with id ' . $response->getRequestParameter('id'));
// Return the product
$response->success(
parseProduct(
(new products_o())->select((int)self::getParameter('id'))->asArray()
)
);
}
// Check if the category is set in the request
$data = $_GET ?? [];
// Check if the category is set