Setting preorder status triggers status update on hausnummer and
wohneinhiet
This commit is contained in:
@@ -963,7 +963,38 @@ class PreorderController extends mfBaseController {
|
||||
$preorder->status_id = $status_id;
|
||||
$preorder->save();
|
||||
|
||||
return ["message" => "Status saved successfully", "id" => $preorder_id, "status_id" => $status->id, "status_code" => $status->code, "status_text" => $status->name];
|
||||
|
||||
$update = [
|
||||
"preorder" => [
|
||||
"status" => [
|
||||
"id" => $status->id,
|
||||
"code" => $status->code,
|
||||
"text" => $status->name
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
if($preorder->adb_hausnummer_id) {
|
||||
$update["building"] = [
|
||||
"status" => [
|
||||
"id" => $preorder->adb_hausnummer->status->id,
|
||||
"code" => $preorder->adb_hausnummer->status->code,
|
||||
"text" => $preorder->adb_hausnummer->status->name
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
if($preorder->adb_wohneinheit_id) {
|
||||
$update["unit"] = [
|
||||
"status" => [
|
||||
"id" => $preorder->adb_wohneinheit->status->id,
|
||||
"code" => $preorder->adb_wohneinheit->status->code,
|
||||
"text" => $preorder->adb_wohneinheit->status->name
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return ["message" => "Status saved successfully", "id" => $preorder_id, "update" => $update];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user