Changed Citycom order flow to new estmk activation workflow
This commit is contained in:
@@ -254,8 +254,12 @@ class CitycomImporter {
|
||||
$ctag = \PreorderCtag::getFirstActive(["preorder_id" => $preorder->id, "stag" => $stag, "service_type" => $stypes[$service->service_type]]);
|
||||
//echo "====\n";
|
||||
//echo $preorder->id." - ".$service->service_number." - ".$service->location->sublocation->id." - ".$service->service_type." - $stag\n";
|
||||
if($ctag && $ctag->ext_id != $service->service_number) {
|
||||
$ctag->ext_id = $service->service_number;
|
||||
if($ctag && $ctag->ext_id != $service->id) {
|
||||
$ctag->ext_id = $service->id;
|
||||
$ctag->save();
|
||||
}
|
||||
if($ctag && $ctag->ext_name != $service->service_number) {
|
||||
$ctag->ext_name = $service->service_number;
|
||||
$ctag->save();
|
||||
}
|
||||
if($ctag && $ctag->ext_status != $service->state) {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/*
|
||||
* Looks for new Citycom OAN Orders and orders all services with ctags
|
||||
* from Citycom OAN API
|
||||
*/
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../../../config/config.php");
|
||||
@@ -37,23 +41,36 @@ foreach(PreordercampaignModel::search(["fulfillment" => "citycom_oan"]) as $camp
|
||||
}
|
||||
}
|
||||
|
||||
if($has_inet_service || $has_mgmt_service) continue;
|
||||
if($has_inet_service) continue;
|
||||
|
||||
$sublocation_id = \Citycom_OanApiHelper::hausnummerExtrefToCitycomId($preorder->adb_wohneinheit->extref);
|
||||
$data = [
|
||||
"down" => 100,
|
||||
"up" => 100,
|
||||
"product_name" => "Estmk Greenstream OAN Mgmt",
|
||||
"product_name" => "Estmk Greenstream OAN Default",
|
||||
"execution_date" => false,
|
||||
"services" => CITYCOM_OAN_API_SERVICES_FOR_RESERVATION,
|
||||
|
||||
];
|
||||
|
||||
$log->info(__METHOD__.": Ordering mgmt service for preorder ".$preorder->id);
|
||||
$services_to_order = array_merge(CITYCOM_OAN_API_SERVICES_FOR_RESERVATION, CITYCOM_OAN_API_SERVICES_FOR_ORDER);
|
||||
if($has_mgmt_service) {
|
||||
$services_to_order = CITYCOM_OAN_API_SERVICES_FOR_ORDER;
|
||||
}
|
||||
$data["services"] = $services_to_order;
|
||||
|
||||
$existing_ctag = \PreorderCtag::getFirstActive(["preorder_id" => $preorder->id]);
|
||||
if($existing_ctag) {
|
||||
$data["ctag_range_search"] = $existing_ctag->ctag;
|
||||
}
|
||||
|
||||
//echo "{$preorder->id}\n";
|
||||
//var_dump($data);exit;
|
||||
|
||||
$log->info(__FILE__.": Ordering Citycom services for preorder ".$preorder->id);
|
||||
if(!$cc_helper->orderServices($preorder, $sublocation_id, $data)) {
|
||||
$log->error(__METHOD__.": Error ordering mgmt service for preorder ".$preorder->id);
|
||||
$log->error(__FILE__.": Error ordering Citycom services for preorder ".$preorder->id);
|
||||
continue;
|
||||
}
|
||||
//continue;
|
||||
|
||||
// TODO check for new service @ citycom -> 230
|
||||
$cc_services = $cc->getServices();
|
||||
|
||||
Reference in New Issue
Block a user