Merge branch 'fronkdev' into 'master'

Citycom: updateing CC service with billing_date when finishing orders

See merge request fronk/thetool!2093
This commit is contained in:
Frank Schubert
2026-02-11 14:33:46 +00:00

View File

@@ -81,6 +81,9 @@ class SnoppCitycom extends Modules\ApiControllerModule
return \mfResponse::BadRequest(["message" => "id missing"]);
}
$cc_api_client = new \Citycom_OanApiClient(CITYCOM_OAN_API_USER, CITYCOM_OAN_API_PASS);
$cc_api = new \Citycom_OanApiHelper($cc_api_client);
$bb_up = $this->post["bb_up"];
$bb_down = $this->post["bb_down"];
$execution_date = false;
@@ -126,6 +129,8 @@ class SnoppCitycom extends Modules\ApiControllerModule
if($preorder->status->code < 500) {
$preorder->setNewStatusCode(500);
$preorder->save();
// update billing_date if nessecary
$cc_api->updateService($ctag->ext_id, ["billing_date" => (new \DateTime("now"))->format("Y-m-d")]);
}
return \mfResponse::Ok(["message" => "Service active already", "activation_status" => "active"]);
}
@@ -180,8 +185,7 @@ class SnoppCitycom extends Modules\ApiControllerModule
$data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up";
}
$cc_api_client = new \Citycom_OanApiClient(CITYCOM_OAN_API_USER, CITYCOM_OAN_API_PASS);
$cc_api = new \Citycom_OanApiHelper($cc_api_client);
// try to update product with bandwidth provided by snopp.
// updateService() only updates if values are changed.
@@ -196,6 +200,9 @@ class SnoppCitycom extends Modules\ApiControllerModule
if($preorder->status->code < 500) {
$preorder->setNewStatusCode(500);
$preorder->save();
// update billing date in citycom service
$cc_api->updateService($ctag->ext_id, ["billing_date" => (new \DateTime("now"))->format("Y-m-d")]);
}
return \mfResponse::Ok(["message" => "Service active already", "activation_status" => "active"]);
}