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:
Jepp9350
2025-06-30 14:37:37 +02:00
parent e0f582289f
commit 6b80637208
4 changed files with 224 additions and 128 deletions
@@ -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()