citycom oan: Always trying to update cc service when snopp sends order

This commit is contained in:
Frank Schubert
2026-02-12 14:56:53 +01:00
parent ec30f47816
commit d34a1e1b15

View File

@@ -125,6 +125,7 @@ class SnoppCitycom extends Modules\ApiControllerModule
return \mfResponse::NotFound(["message" => "Home not found"]); return \mfResponse::NotFound(["message" => "Home not found"]);
} }
/*
if($ctag->ext_id && $ctag->ext_status == "finished") { if($ctag->ext_id && $ctag->ext_status == "finished") {
if($preorder->status->code < 500) { if($preorder->status->code < 500) {
$preorder->setNewStatusCode(500); $preorder->setNewStatusCode(500);
@@ -136,44 +137,8 @@ class SnoppCitycom extends Modules\ApiControllerModule
$cc_api->updateService($ctag->ext_id, ["billing_date" => (new \DateTime("now"))->format("Y-m-d")]); $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"]); return \mfResponse::Ok(["message" => "Service active already", "activation_status" => "active"]);
} }
*/
// Home must have Status 300, else return deferred
/*if($wohneinheit->status->code < 300) {
return \mfResponse::Ok(["message" => "ONT not yet installed. Deferred", "activation_status" => "deferred"]);
}*/
/*
$cc_home_id = \Citycom_OanApiHelper::hausnummerExtrefToCitycomId($wohneinheit->extref);
$data["up"] = $bb_up;
$data["down"] = $bb_down;
$data["product_name"] = false;
$data["execution_date"] = ($execution_date) ? $execution_date->format("Y-m-d") : false;
$data["services"] = CITYCOM_OAN_API_SERVICES_FOR_ORDER;
// check if mgmt ctag is set
// so we use the same ctag set for the real services
$mgmt_ctag = \PreorderCtag::getFirstActive(["preorder_id" => $preorder->id, "service_type" => "mgmt"]);
if($mgmt_ctag) {
$data["ctag_range_search"] = $mgmt_ctag->ctag;
}
if($preorder->campaign->fulfillment == "citycom_oan") {
$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);
// order Service at Citycom and set Preorder to 500 Finished
if(!$cc_api->orderServices($preorder, $cc_home_id, $data)) {
return \mfResponse::InternalServerError(["message" => "Error activating service"]);
}*/
// update product at citycom
//$cc_home_id = \Citycom_OanApiHelper::hausnummerExtrefToCitycomId($wohneinheit->extref);
$data["up"] = $bb_up; $data["up"] = $bb_up;
$data["down"] = $bb_down; $data["down"] = $bb_down;
$data["product_name"] = false; $data["product_name"] = false;
@@ -187,8 +152,6 @@ class SnoppCitycom extends Modules\ApiControllerModule
$data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up"; $data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up";
} }
// try to update product with bandwidth provided by snopp. // try to update product with bandwidth provided by snopp.
// updateService() only updates if values are changed. // updateService() only updates if values are changed.
if(!$cc_api->updateService($ctag->ext_id, $data)) { if(!$cc_api->updateService($ctag->ext_id, $data)) {