Files
thetool/public/docs/preorder-api.yaml
2022-10-13 17:39:50 +02:00

654 lines
19 KiB
YAML

openapi: 3.0.1
info:
title: thetool Preorder API
description: API Dokumentation für thetool Vorbestellung
license:
name: Apache 2.0 License
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- url: https://thetool-test.xinon.at/api/v1
- url: https://thetool.xinon.at/api/v1
tags:
- name: addressdb
description: Abfrage von GWR-Daten
- name: preorder
description: Informationen zum Netzgebiet und Speichern von Vorbestellungen
paths:
/addressdb/findAddress:
get:
tags:
- addressdb
summary: Adressen suchen
description: Sucht nach Adressen. Retourniert Adressen mit Wohneinheiten
operationId: findAddresses
parameters:
- name: street
description: Straße Suchbegriff
in: query
schema:
type: string
- name: zip
description: Postleitzahl Suchbegriff
in: query
schema:
type: string
- name: city
description: Stadt Suchbegriff
in: query
schema:
type: string
- name: housenumber
description: Hausnummer Suchbegriff
in: query
schema:
type: string
responses:
'200':
description: |
Successful operation
Der Rückgabewert `preorderType` gibt an, welche Vorbestelltypen an dieser Adresse erlaubt sind:
| preorderType | description |
|--------------|-------------|
| interest | Interessensbekundung |
| provision | Vorsorgeanschluss |
| order | Vollanschluss |
| reorder | Nachbestellung (nach Bauabschluss) |
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
type: object
properties:
addresses:
$ref: '#/components/schemas/Addresses'
'400':
description: |
Bad Request
Parameter missing or malformed
'401':
description: Unauthorized
/addressdb/findStreet:
get:
tags:
- addressdb
summary: Straßen suchen
description: Sucht nach Straßen
operationId: findStreets
parameters:
- name: street
description: Straße Suchbegriff
in: query
schema:
type: string
- name: zip
description: Postleitzahl Suchbegriff
in: query
schema:
type: string
- name: city
description: Stadt Suchbegriff
in: query
schema:
type: string
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
type: object
properties:
streets:
$ref: '#/components/schemas/Streets'
'400':
description: |
Bad Request
Parameter missing or malformed
'401':
description: Unauthorized
/addressdb/findZip:
get:
tags:
- addressdb
summary: Postleitzahlen suchen
description: Sucht nach Postleitzahlen
operationId: findZips
parameters:
- name: zip
description: Postleitzahl Suchbegriff
in: query
schema:
type: string
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
type: object
properties:
zips:
$ref: '#/components/schemas/Zips'
'400':
description: |
Bad Request
Parameter missing or malformed
'401':
description: Unauthorized
/addressdb/findCity:
get:
tags:
- addressdb
summary: Gemeinden suchen
description: Sucht nach Gemeinden
operationId: findCity
parameters:
- name: zip
description: Postleitzahl Suchbegriff
in: query
schema:
type: string
- name: city
description: Stadt Suchbegriff
in: query
schema:
type: string
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
type: object
properties:
cities:
$ref: '#/components/schemas/Cities'
'400':
description: |
Bad Request
Parameter missing or malformed
'401':
description: Unauthorized
/preorder:
post:
tags:
- preorder
summary: Vorbestellung registrieren
description: |
Registriert eine Vorbestellung.
---
Parameter `address`: Anschlussadresse
Parameter `address_info`: Zusätzliche Informationen zur Adresse
Parameter `customer`: Vertragsinhaber
---
Parameter `preorderType` bestimmt Vorbestelltyp:
| preorderType | Description |
|--------------|-------------|
| interest | Interessensbekundung|
| provision | Vorsorgeanschluss|
| order | Vollanschluss|
| reorder | Nachbestellung (nach Bauabschluss) |
---
Parameter `connectionCount`: Anzahl Anschlüsse für Rabatt bei mehreren Anschlüssen in Mehrfamilienhaus
---
Parameter `connectionType` bestimmt den Anschlusstyp:
|connectionType | description |
|---------------|-------------|
| single-dwelling | Einfamilienhaus
| multi-dwelling | Mehrfamilienhaus (bis 3 Wohneinheiten)
| apartment-building | Mehrparteienhaus (ab 4 Wohneinheiten)
| apartment | Wohneinheit in Mehrparteienhaus
| business | Gewerbebetrieb |
operationId: submitPreorder
requestBody:
description: PreorderRequest object
required: true
content:
'application/json':
schema:
$ref: '#/components/schemas/preorderRequest'
'application/x-www-form-urlencoded':
schema:
$ref: '#/components/schemas/preorderRequest'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: Status string
example: OK
result:
type: object
properties:
code:
type: string
description: Code für Statusabfrage
'400':
description: |
Bad Request
Parameter missing or malformed
'401':
description: Unauthorized
'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
components:
schemas:
Zips:
type: array
items:
type: string
Cities:
type: array
items:
type: string
Streets:
type: array
items:
type: string
Addresses:
type: array
items:
$ref: '#/components/schemas/Address'
Address:
type: object
properties:
street:
type: string
description: Strasse
example: Beispielstraße
housenumber:
type: string
description: Hausnummer
example: 13
zip:
type: string
description: PLZ
example: 9999
city:
type: string
description: Ort
example: Beispielhausen
block:
type: string
description: Block
example: ""
stock:
type: string
description: Stock
example: 42
stiege:
type: string
description: Stiege
example: ""
tuer:
type: string
description: Tür
example: 1337
gps_lat:
typee: float
description: Breitengrad der GPS-Koordinate (Dezimal)
example: 48.517560
gps_long:
typee: float
description: Längengrad der GPS-Koordinate (Dezimal)
example: 13.950665
rollout_year:
type: integer
description: Jahr des geplanten Ausbaus
example: 2024
preorderTypes:
type: array
example: ["interest", "provision", "order", "reorder"]
description: |
Erlaubte Vorbestelltypen:
| preorderType | description |
|--------------|-------------|
| interest | Interessensbekundung |
| provision | Vorsorgeanschluss |
| order | Vollanschluss |
| reorder | Nachbestellung (nach Bauabschluss) |
items:
type: string
required:
- street
addressResponse:
type: object
properties:
street:
type: string
description: Strasse der Anschlussadresse
housenumber:
type: string
description: Hausnummer der Anschlussadresse
zip:
type: string
description: PLZ der Anschlussadresse
city:
type: string
description: Ort der Anschlussadresse
block:
type: string
description: Block der Anschlussadresse
stock:
type: string
description: Stock der Anschlussadresse
stiege:
type: string
description: Stiege der Anschlussadresse
tuer:
type: string
description: Tür der Anschlussadresse
customerResponse:
type: object
properties:
company:
type: string
description: Firmenname Kunde
uid:
type: string
description: UID (wenn Firmenkunde)
firstname:
type: string
description: Vorname Kunde
lastname:
type: string
description: Nachname Kunde
street:
type: string
description: Straße Kunde
zip:
type: string
description: PLZ Kunde
city:
type: string
description: Ort Kunde
phone:
type: string
description: Telefonnummer Kunde
email:
type: string
description: Emailadresse Kunde
preorderRequest:
type: object
properties:
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:
type: object
description: Anschlussadresse
properties:
street:
type: string
description: Strasse der Anschlussadresse
example: Beispielstraße
housenumber:
type: string
description: Hausnummer der Anschlussadresse
example: 13
zip:
type: string
description: PLZ der Anschlussadresse
example: 9999
city:
type: string
description: Ort der Anschlussadresse
example: Beispielhausen
block:
type: string
description: Block der Anschlussadresse
example: ""
stock:
type: string
description: Stock der Anschlussadresse
example: 42
stiege:
type: string
description: Stiege der Anschlussadresse
example: ""
tuer:
type: string
description: Tür der Anschlussadresse
example: 1337
required:
- street
- housenumber
- zip
- city
address_info:
type: string
description: Zusätzliche Info zur Adresse
example: im Carport
customer:
type: object
description: Vertragsinhaber
properties:
type:
type: string
enum: ["owner","tenant"]
description: |
Ist diese Adresse Besitzer oder Bewohner der Wohneinheit. Optional, aber kann je nach Kampagne ein Pflichtfeld sein.
| type | Description |
|--------|-------------|
| owner | Ist Besitzer |
| tenant | Ist Bewohner|
company:
type: string
description: Firmenname Kunde
example:
uid:
type: string
description: UID (wenn Firmenkunde)
example:
firstname:
type: string
description: Vorname Kunde
example: Vor
lastname:
type: string
description: Nachname Kunde
example: Nachname
street:
type: string
description: Straße und Hausnummer Kunde
example: "Beispielstraße 42"
zip:
type: string
description: PLZ Kunde
example: 9999
city:
type: string
description: Ort Kunde
example: Beispielhausen
phone:
type: string
description: Telefonnummer Kunde
example: "01 1234 567 89"
email:
type: string
description: Emailadresse Kunde
example: this.email@does-not.exist
required:
- firstname
- lastname
- street
- zip
- city
required:
- connectionType
- preorderType
- acceptMarketing
- acceptAgb
- acceptDsgvo
- acceptWithdrawal
- address
- customer
preorderStatusDetail:
type: object
properties:
address:
$ref: '#/components/schemas/addressResponse'
customer:
$ref: '#/components/schemas/customerResponse'
status:
type: object
properties:
id:
type: integer
description: status ID
example: 220
text:
type: string
description: Statustext
example: Tiefbau abgeschlossen, Leitungsbau ausständig
securitySchemes:
api_key_header:
type: apiKey
name: X-Api-Key
in: header
api_key_query:
type: apiKey
name: apikey
in: query
security:
- api_key_header: []
- api_key_query: []