diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index afa0f4aa0..468068f6a 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -1039,12 +1039,13 @@ class PreorderApicontroller extends mfBaseApicontroller { } $return['status'] = $preorder->status->getApiArray(); foreach($preorder->statusflags as $sflag) { - $return['status']['flags'][$sflag->code] = [ + $return['status']['flags'][] = [ "code" => (int)$sflag->code, "text" => $sflag->name, "value" => ($sflag->value->value == 1) ]; } + //var_dump($return['status']);exit; if($addon_data) { $return["additionalData"] = $addon_data; } diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 6cc7ec723..2439cd9c9 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -608,13 +608,13 @@ class Preorder extends mfBaseModel { $status = $this->getProperty("status")->getApiArray(); foreach($this->getProperty("statusflags") as $sflag) { - $status["flags"][$sflag->code] = [ + $status["flags"][] = [ "code" => (int)$sflag->code, "text" => $sflag->name, "value" => ($sflag->value->value == 1) ]; } - + //var_dump($status);exit; $a = []; $a['code'] = strtoupper($this->ucode); diff --git a/public/docs/preorder-api.yaml b/public/docs/preorder-api.yaml index 12ce71e4f..90364a4da 100644 --- a/public/docs/preorder-api.yaml +++ b/public/docs/preorder-api.yaml @@ -5,7 +5,7 @@ info: license: name: Apache 2.0 License url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 1.2.0 + version: 1.2.1 servers: - url: https://thetool-test.xinon.at/api/v1 - url: https://thetool.xinon.at/api/v1 @@ -545,6 +545,20 @@ paths: type: string description: Statustext example: Fiber installation work assigned + flags: + type: array + items: + type: object + properties: + code: + type: string + example: "141" + text: + type: string + example: "Conduit on property border and FCP prepaired" + value: + type: boolean + example: true additionalData: type: object description: Benutzerdefiniertes Objekt. Wird unverändert gespeichert und in `GET /preorder` wieder ausgegeben @@ -1511,6 +1525,21 @@ components: type: string description: Statustext example: Fiber installation work assigned + flags: + type: array + items: + type: object + properties: + code: + type: string + example: "141" + text: + type: string + example: "Conduit on property border and FCP prepaired" + value: + type: boolean + example: true + ciftoken: type: string description: Customer Installation Feedback Token @@ -1629,6 +1658,8 @@ components: type: string description: Wert für zusätzliches Feld example: true + + additionalData: type: object description: Benutzerdefiniertes Objekt. Wird unverändert gespeichert und in `GET /preorder` wieder ausgegeben @@ -1662,6 +1693,9 @@ components: type: object properties: ciftoken: + type: string + description: Cif Token + example: AbcdEFG123 code: type: string description: Eindeutiger Code der Vorbestellung