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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user