rename unit_id to unit_string

This commit is contained in:
Frank Schubert
2022-12-13 21:02:43 +01:00
parent 33844bf778
commit 43caf0e344
3 changed files with 11 additions and 5 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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