preorder api docs updated

This commit is contained in:
Frank Schubert
2022-12-07 18:34:22 +01:00
parent e66645aa5e
commit 78251feb7e
2 changed files with 184 additions and 65 deletions

View File

@@ -44,7 +44,7 @@ class Preorder extends mfBaseModel {
$wohneinheit = $this->getProperty("adb_wohneinheit");
$a = [];
$a['ucode'] = strtoupper($this->ucode);
$a['code'] = strtoupper($this->ucode);
$a['oaid'] = $this->oaid;
$a['status'] = $this->getProperty("status")->getApiArray();
$a['connectionType'] = $this->connection_type;
@@ -62,7 +62,7 @@ class Preorder extends mfBaseModel {
$address['zip'] = $hausnummer->plz->plz;
$address['city'] = $hausnummer->strasse->gemeinde->name;
$address['district'] = $hausnummer->ortschaft->name;
$address['bock'] = ($wohneinheit->block) ? $wohneinheit->block : null;
$address['block'] = ($wohneinheit->block) ? $wohneinheit->block : null;
$address['stock'] = ($wohneinheit->stock) ? $wohneinheit->stock : null;
$address['stiege'] = ($wohneinheit->stiege) ? $wohneinheit->stiege : null;
$address['tuer'] = ($wohneinheit->tuer) ? $wohneinheit->tuer : null;
@@ -74,9 +74,9 @@ class Preorder extends mfBaseModel {
$customer['lastname'] = ($this->lastname) ? $this->lastname : null;
$customer['street'] = ($this->street) ? $this->street : null;
$customer['housenumber'] = ($this->hausnummer) ? $this->housenumber : null;
$customer['zip'] = ($this->plz) ? $this->plz : null;
$customer['zip'] = ($this->zip) ? $this->zip : null;
$customer['city'] = ($this->city) ? $this->city : null;
$customer['bock'] = ($this->block) ? $this->block : null;
$customer['block'] = ($this->block) ? $this->block : null;
$customer['stock'] = ($this->stock) ? $this->stock : null;
$customer['stiege'] = ($this->stiege) ? $this->stiege : null;
$customer['tuer'] = ($this->tuer) ? $this->tuer : null;

View File

@@ -278,7 +278,7 @@ paths:
Registriert eine Vorbestellung.
---
Parameter `address`: Anschlussadresse
Parameter `address`: Anschlussadresse. Soll Starterkit an Anschlussadresse gesendet werden, muss `address.is_shipping` auf true gestellt werden, bei false wird das Starterkit an Vertragsinhaber (`customer`) gesendet.
Parameter `address_info`: **(Optional)** Zusätzliche Informationen zur Adresse
@@ -327,7 +327,6 @@ paths:
---
Parameter `additionalData`: **(Optional)** Object für zusätzliche individuelle Daten, die in der Vorbestellung gespeichert werden. Wird in `GET /preorder` retourniert.
operationId: submitPreorder
@@ -383,54 +382,58 @@ paths:
description: Vorbestellung für diese Wohneinheit bereits vorhanden
'404':
description: Adresse oder Wohneinheit nicht gefunden
# /preorder/{code}:
# get:
# tags:
# - preorder
# summary: Details zur Vorbestellung (noch nicht Final)
# description: Gibt Details zum Status der Vorbestellung/Bestellung zurück **(noch nicht Final)**
# operationId: getPreorderStatus
# parameters:
# - name: code
# in: path
# description: code der Vorbestellung
# required: true
# schema:
# type: string
# responses:
# '200':
# description: |
# Successful operation
#
# Mögliche Werte für Rückgabewert `status`
#
# | id | text | description |
# |------|------|-------------|
# | 100 | Aufgenommen | Interessensbekundung/Vorbestellung aufgenommen |
# | 110 | Tiefbau in Planung | |
# | 120 | Tiefbau in Arbeit | |
# | 200 | Tiefbau abgeschlossen | |
# | 210 | Leitungsbau in planung | |
# | 220 | Leitungsbau in Arbeit | |
# | 230 | Leitungsbau abgeschlossen | |
# | 300 | Leitungskonfiguration in Planung | |
# | 310 | Leitungskonfiguration in Arbeit | |
# | 320 | Leitung hergestellt | Produkt bestellbar |
# content:
# application/json:
# schema:
# type: object
# properties:
# status:
# type: string
# description: Status string
# example: OK
# result:
# $ref: '#/components/schemas/preorderStatusDetail'
# '401':
# description: Unauthorized
# '404':
# description: Vorbestellung nicht gefunden
/preorder/{code}:
get:
tags:
- preorder
summary: Details und Status zur Vorbestellung
description: Gibt Details zum Status der Vorbestellung/Bestellung zurück
operationId: getPreorderStatus
parameters:
- name: code
in: path
description: code der Vorbestellung oder OAID der Wohneinheit
required: true
schema:
type: string
responses:
'200':
description: |
Successful operation
Mögliche Werte für Rückgabewert `status`:
| code | text | description |
|------|------|-------------|
| 10 | new | Neu |
| 110 | Underground construction planning | Tiefbau in Planung |
| 120 | Underground construction planning finished | Tiefbau Planung abgeschlossen |
| 130 | Underground construction work assigned | Bauauftrag zugeteilt |
| 140 | Conduit at property border | Rohr an Grundstücksgrenze |
| 200 | Conduit in building | Rohr im Gebäude |
| 210 | Fiber planning | Leitungsplan in Arbeit |
| 220 | Fiber planning finished | Leitungsplan abgeschlossen |
| 230 | Fiber installation work assigned | Bauauftrag zugeteilt |
| 240 | Fiber in building | Faser im Gebäude |
| 250 | ONT ready | ONT vorbereitet |
| 260 | ONT picked up or shipped | ONT abgeholt oder versandt |
| 300 | ONT installed | ONT in Betrieb |
| 500 | Finished | Fertiggestellt |
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
$ref: '#/components/schemas/preorderStatusDetail'
'401':
description: Unauthorized
'404':
description: Vorbestellung nicht gefunden
components:
schemas:
Zips:
@@ -515,7 +518,7 @@ components:
rollout_info:
type: string
description: Infotext begzl. Bauplanung
example: Bauplan 2024
example: null
preorderTypes:
type: array
example: ["interest", "provision", "order", "reorder"]
@@ -711,6 +714,22 @@ components:
city:
type: string
description: Ort Kunde
block:
type: string
description: Adresszusatz
example: null
stiege:
type: string
description: Adresszusatz
example: null
stock:
type: string
description: Adresszusatz
example: null
tuer:
type: string
description: Adresszusatz
example: null
phone:
type: string
description: Telefonnummer Kunde
@@ -796,6 +815,10 @@ components:
type: string
description: Tür der Anschlussadresse
example: 1337
is_shipping:
type: boolean
description: Soll Starterkit an Anschlussadresse gesendet werden. Bei false wird das Starterkit an Vertrasinhaber (`customer`) gesendet.
example: true
required:
- street
- housenumber
@@ -937,21 +960,117 @@ components:
preorderStatusDetail:
type: object
properties:
code:
type: string
description: Eindeutiger Code der Vorbestellung
example: A1B2C3D4
oaid:
type: string
description: Open Access ID der Wohneinheit
example: AT-9999-abcdef01.001
status:
type: object
properties:
code:
type: integer
description: status ID
example: 230
text:
type: string
description: Statustext
example: Fiber installation work assigned
connectionType:
type: string
enum: [single-dwelling, multi-dwelling, apartment-building, apartment, business]
description: |
|connectionType | description |
|---------------|-------------|
| single-dwelling | Einfamilienhaus
| multi-dwelling | Mehrfamilienhaus (bis 3 Wohneinheiten)
| apartment-building | Mehrparteienhaus (ab 4 Wohneinheiten)
| apartment | Wohneinheit in Mehrparteienhaus
| business | Gewerbebetrieb |
connectionCount:
type: integer
default: 1
description: Anzahl Anschlüsse für Rabatt bei mehreren Anschlüssen in Mehrfamilienhaus
nullable: true
preorderType:
type: string
enum: [interest, provision, order]
description: |
Vorbestelltyp
| preorderType | Description |
|--------------|-------------|
| interest | Interessensbekundung |
| provision | Vorsorgeanschluss |
| order | Vollanschluss |
| reorder | Nachbestellung (nach Bauabschluss) |
acceptMarketing:
type: boolean
description: Zustimmung Datenspeicherung/-weitergabe
acceptAgb:
type: boolean
description: Zustimmung AGB
acceptDsgvo:
type: boolean
description: Zustimmung DSGVO
acceptWithdrawal:
type: boolean
description: Informationen zu Rücktrittsrecht akzeptiert
address_info:
type: string
description: Zusätzliche Info zur Adresse
example: im Carport
address:
$ref: '#/components/schemas/addressResponse'
customer:
$ref: '#/components/schemas/customerResponse'
status:
addonServices:
type: array
description: |
Zusätzlich gebuchte Services
Services müssen nicht vordefiniert sein, es können benutzerdefinierte Services übergeben werden
items:
type: object
properties:
service:
type: string
description: Name des gebuchten Service
example: installation_inhouse
ordered:
type: boolean
description: Wurde dieses Service dazu gebucht
example: true
data:
type: array
items:
type: object
description: Zusätzlich benötigte Felder für Service
properties:
name:
type: string
description: Name für zusätzliches Feld
example: accept_data_forwarding
value:
type: string
description: Wert für zusätzliches Feld
example: true
additionalData:
type: object
properties:
id:
type: integer
description: status ID
example: 220
text:
type: string
description: Statustext
example: Tiefbau abgeschlossen, Leitungsbau ausständig
description: Benutzerdefiniertes Objekt. Wird unverändert gespeichert und in `GET /preorder` wieder ausgegeben
example:
myData: Hallo
moreData: Welt
lotsMoreData:
- key: name
value: test
- key: another Key
value: more value
securitySchemes:
api_key_header:
type: apiKey