Refactor InvoicingPeriodRoute and vehiclesRoute: streamline invoicing period data retrieval, enhance transaction handling across customer types, introduce new methods for efficient object construction, and add improved type validation in object_property.
This commit is contained in:
@@ -278,6 +278,8 @@ class vehiclesRoute
|
||||
$vehicle->type->set(
|
||||
(int)$type
|
||||
);
|
||||
// TODO: Make the potential vehicleTypeId reflect the correct type.
|
||||
// It's currently possible to set the vehicleTypeId to a type that is not allowed for the vehicle.
|
||||
}
|
||||
}
|
||||
if (self::isParametersSet(['reg'])) {
|
||||
@@ -314,6 +316,7 @@ class vehiclesRoute
|
||||
$vehicle->reference->set($reference);
|
||||
}
|
||||
}
|
||||
$vehicle->objectChanged();
|
||||
// Return the vehicle
|
||||
$response->success(
|
||||
$vehicle->asArray()
|
||||
|
||||
Reference in New Issue
Block a user