|
|
@@ -19,7 +19,7 @@ class CprPreregistrationController
|
|
|
$email = isset($body['email']) ? trim((string)$body['email']) : '';
|
|
|
$productType = isset($body['product_type']) ? trim((string)$body['product_type']) : '';
|
|
|
$internalControlNumber = isset($body['internal_control_number']) ? trim((string)$body['internal_control_number']) : '';
|
|
|
- $productQuantityRaw = $body['product_quantity'] ?? null;
|
|
|
+ $productQuantityRaw = isset($body['product_quantity']) ? trim((string)$body['product_quantity']) : '';
|
|
|
$propertyName = isset($body['property_name']) ? trim((string)$body['property_name']) : '';
|
|
|
$propertyLocation = isset($body['property_location']) ? trim((string)$body['property_location']) : '';
|
|
|
|
|
|
@@ -32,7 +32,7 @@ class CprPreregistrationController
|
|
|
'product_type' => v::stringType()->notEmpty()->alnum(" -_/.,")->length(1, 100),
|
|
|
'internal_control_number' => v::stringType()->notEmpty()->alnum("-_/.")->length(1, 100),
|
|
|
// Accept numeric strings convertible to int
|
|
|
- 'product_quantity' => v::stringType()->notEmpty()->alnum("-_/.")->length(1, 100),
|
|
|
+ 'product_quantity' => v::stringType()->notEmpty()->alnum(" -_/.,")->length(1, 200),
|
|
|
'property_name' => v::stringType()->notEmpty()->alnum(" -_/.,")->length(1, 150),
|
|
|
'property_location' => v::stringType()->notEmpty()->alnum(" -_/.,")->length(1, 200),
|
|
|
];
|
|
|
@@ -61,8 +61,8 @@ class CprPreregistrationController
|
|
|
return ResponseLib::sendFail("Validation failed", ['errors' => $errors], "E_VALIDATE")->withStatus(400);
|
|
|
}
|
|
|
|
|
|
- // Safe casting after validation
|
|
|
- $productQuantity = (int)$productQuantityRaw;
|
|
|
+ // Keep as free text after validation
|
|
|
+ $productQuantity = $productQuantityRaw;
|
|
|
|
|
|
try {
|
|
|
$model = new CprPreregistrationModel();
|