From 43caf0e3440161bb1e900fe0e6f01f0962557184 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 13 Dec 2022 21:02:43 +0100 Subject: [PATCH] rename unit_id to unit_string --- application/Api/v1/PreorderApicontroller.php | 6 +++--- application/Preorder/Preorder.php | 6 ++++++ public/docs/preorder-api.yaml | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index c9f25ce30..d1674ce3e 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -240,7 +240,7 @@ class PreorderApicontroller extends mfBaseApicontroller { } $unit_search = []; - foreach(['block','stiege','stock','tuer','unit_id'] as $key) { + foreach(['block','stiege','stock','tuer','unit_string'] as $key) { if(property_exists($this->post['address'], $key) && trim($this->post['address']->$key)) { $unit_search[$key] = trim($this->post['address']->$key); } @@ -295,8 +295,8 @@ class PreorderApicontroller extends mfBaseApicontroller { $unit = false; if(count($unit_search)) { //var_dump($unit_search);exit; - if(array_key_exists("unit_id", $unit_search)) { - $where .= " AND bezeichner LIKE '".$unit_search['unit_id']."'"; + if(array_key_exists("unit_string", $unit_search)) { + $where .= " AND bezeichner LIKE '".$unit_search['unit_string']."'"; } else { foreach($unit_search as $field => $value) { if($field == "stock") continue; // only check for block, stiege and tuer diff --git a/application/Preorder/Preorder.php b/application/Preorder/Preorder.php index 6ff03d006..5bb4fb2a6 100644 --- a/application/Preorder/Preorder.php +++ b/application/Preorder/Preorder.php @@ -49,6 +49,9 @@ class Preorder extends mfBaseModel { $a['status'] = $this->getProperty("status")->getApiArray(); $a['connectionType'] = $this->connection_type; $a['connectionCount'] = ($this->connection_count) ? (int)$this->connection_count : 1; + $a['isAdditionalOrder'] = ($this->is_additional_order) ? true : false; + $a['technology'] = ($this->technology) ? $this->technology : null; + $a['patchposition'] = ($this->patchposition) ? $this->patchposition : null; $a['preorderType'] = $this->type; $a['acceptMarketing'] = ($this->accept_marketing) ? true : false; $a['acceptAgb'] = ($this->accept_agb) ? true : false; @@ -66,6 +69,8 @@ class Preorder extends mfBaseModel { $address['stock'] = ($wohneinheit->stock) ? $wohneinheit->stock : null; $address['stiege'] = ($wohneinheit->stiege) ? $wohneinheit->stiege : null; $address['tuer'] = ($wohneinheit->tuer) ? $wohneinheit->tuer : null; + $address['unit_string'] = ($wohneinheit->bezeichner) ? $wohneinheit->bezeichner : null; + $address['is_shipping'] = ($this->shipping_address == "address") ? true : false; $customer = []; $customer['company'] = ($this->company) ? $this->company : null; @@ -80,6 +85,7 @@ class Preorder extends mfBaseModel { $customer['stock'] = ($this->stock) ? $this->stock : null; $customer['stiege'] = ($this->stiege) ? $this->stiege : null; $customer['tuer'] = ($this->tuer) ? $this->tuer : null; + $customer['unit_string'] = ($this->unit_string) ? $this->unit_string : null; $customer['phone'] = ($this->phone) ? $this->phone : null; $customer['email'] = ($this->email) ? $this->email : null; diff --git a/public/docs/preorder-api.yaml b/public/docs/preorder-api.yaml index 7b9d69cc6..d3d4aa604 100644 --- a/public/docs/preorder-api.yaml +++ b/public/docs/preorder-api.yaml @@ -364,7 +364,7 @@ paths: Soll Starterkit an Anschlussadresse gesendet werden, muss `address.is_shipping` auf true gestellt werden, bei false wird das Starterkit an Vertragsinhaber (`customer`) gesendet. - Wohneinheitsidentifikation (Block, Stiege, Stock, Tür) kann strukturiert mit jeweils einem eigenen Feld übergeben werden oder alle Wohneinheitsdaten in einem einzigen String (`unit_id`). + Wohneinheitsidentifikation (Block, Stiege, Stock, Tür) kann strukturiert mit jeweils einem eigenen Feld übergeben werden oder alle Wohneinheitsdaten in einem einzigen String (`unit_string`). --- @@ -923,7 +923,7 @@ components: type: string description: Tür der Anschlussadresse example: 1337 - unit_id: + unit_string: type: string description: Zusatzangaben zur Identifizierung der Wohneinheit in einem String. Kann statt den Einzelfeldern (Block, Stiege, Stock, Tür) angegeben werden example: Stg. 2 Stock 3 Tür 7