Add routes and objects for managing collected order invoices

Introduced GET and POST endpoints for collected order invoices, enabling listing and creation functionalities for authorized users. Added a new database object to handle invoice-related operations and validations. Included utility functions to enforce parameter requirements and data integrity.
This commit is contained in:
Jepp9350
2025-02-28 12:07:46 +01:00
parent 7497e0c744
commit 9bf0355e47
4 changed files with 289 additions and 0 deletions
+13
View File
@@ -39,11 +39,24 @@ trait route_t
return true;
}
public function requireMinValue(int $value, int $min): void
{
global $response;
if ($value < $min) {
$response->error('Parameter must be at least ' . $min, 400);
}
}
public function type_int(): string
{
return 'integer';
}
public function type_string(): string
{
return 'string';
}
public function requireParameters(array $parameters): void
{
global $response;