add active mieters request
This commit is contained in:
parent
4f4b959e9e
commit
ab44de341d
23
Mieter.py
23
Mieter.py
@ -21,6 +21,29 @@ SELECT m.id as id,
|
||||
w.id = m.wohnung
|
||||
""", [], "Mieter")
|
||||
|
||||
def get_mieters_active():
|
||||
return getMany("""
|
||||
SELECT m.id as id,
|
||||
o.id as objekt,
|
||||
w.id as wohnung,
|
||||
w.shortname as wohnung_shortname,
|
||||
o.shortname as objekt_shortname,
|
||||
COALESCE(m.anrede, '-') as anrede,
|
||||
COALESCE(m.vorname, '-') as vorname,
|
||||
m.nachname as nachname,
|
||||
COALESCE(m.strasse, '-') as strasse,
|
||||
COALESCE(m.plz, '-') as plz,
|
||||
COALESCE(m.ort, '-') as ort,
|
||||
COALESCE(m.telefon, '-') as telefon,
|
||||
m.einzug as einzug,
|
||||
COALESCE(m.auszug, '-') as auszug
|
||||
FROM wohnung w, objekt o, mieter m
|
||||
WHERE o.id = w.objekt AND
|
||||
w.id = m.wohnung AND
|
||||
m.einzug <= curdate() and
|
||||
(m.auszug is null or m.auszug > curdate())
|
||||
""", [], "Mieter")
|
||||
|
||||
def get_mieter(id=None):
|
||||
return getOne("""
|
||||
SELECT m.id as id,
|
||||
|
2
build.sh
2
build.sh
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
IMAGE_NAME="registry.hottis.de/hv/hv-service"
|
||||
VERSION=0.0.3
|
||||
VERSION=0.0.4
|
||||
|
||||
docker build -t ${IMAGE_NAME}:${VERSION} .
|
||||
docker push ${IMAGE_NAME}:${VERSION}
|
||||
|
18
swagger.yaml
18
swagger.yaml
@ -126,6 +126,24 @@ paths:
|
||||
description: No Mieter available
|
||||
500:
|
||||
description: Some server error
|
||||
/hv/mieters/active:
|
||||
get:
|
||||
tags: [ "Mieter" ]
|
||||
operationId: Mieter.get_mieters_active
|
||||
summary: Returns all currently active Mieters
|
||||
responses:
|
||||
200:
|
||||
description: Successful response.
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Mieter'
|
||||
404:
|
||||
description: No Mieter available
|
||||
500:
|
||||
description: Some server error
|
||||
/hv/mieter/{id}:
|
||||
get:
|
||||
tags: [ "Mieter" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user