generate endpoint for all foreign key relationships
This commit is contained in:
parent
1335f0f059
commit
bb2aaa1e84
@ -3,27 +3,3 @@
|
|||||||
# Use plain openapi/yaml syntax, no Cheetah
|
# Use plain openapi/yaml syntax, no Cheetah
|
||||||
# escaping
|
# escaping
|
||||||
# -------------------------------------------------------------------
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
/v1/overhead_advance_flat_mappings/flat/{flatId}:
|
|
||||||
get:
|
|
||||||
tags: [ "overhead_advance_flat_mapping", "flat" ]
|
|
||||||
summary: Returns all overhead advance mappings for a given flat
|
|
||||||
operationId: additional_methods.get_overhead_advance_flat_mapping_by_flat
|
|
||||||
parameters:
|
|
||||||
- name: flatId
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: integer
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: $table.name response
|
|
||||||
content:
|
|
||||||
'application/json':
|
|
||||||
schema:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
|
||||||
security:
|
|
||||||
- jwt: ['secret']
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
from db import dbGetMany, dbGetOne, dbInsert, dbUpdate
|
|
||||||
from loguru import logger
|
|
||||||
import werkzeug
|
|
||||||
|
|
||||||
|
|
||||||
def get_overhead_advance_flat_mapping_by_flat(user, token_info, flatId=None):
|
|
||||||
return dbGetOne(user, token_info, {
|
|
||||||
"statement": """
|
|
||||||
SELECT
|
|
||||||
id
|
|
||||||
,overhead_advance
|
|
||||||
,flat
|
|
||||||
FROM overhead_advance_flat_mapping_t
|
|
||||||
WHERE flat = %s
|
|
||||||
""",
|
|
||||||
"params": (flatId, )
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
228
api/methods.py
228
api/methods.py
@ -80,6 +80,7 @@ UPDATE account_t
|
|||||||
logger.warning("update_account: parameter missing: {}".format(e))
|
logger.warning("update_account: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
def get_tenants(user, token_info):
|
def get_tenants(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -248,6 +249,31 @@ UPDATE tenant_t
|
|||||||
logger.warning("update_tenant: parameter missing: {}".format(e))
|
logger.warning("update_tenant: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
|
def get_tenant_by_account(user, token_info, accountId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,salutation
|
||||||
|
,firstname
|
||||||
|
,lastname
|
||||||
|
,address1
|
||||||
|
,address2
|
||||||
|
,address3
|
||||||
|
,zip
|
||||||
|
,city
|
||||||
|
,phone1
|
||||||
|
,phone2
|
||||||
|
,iban
|
||||||
|
,account
|
||||||
|
FROM tenant_t
|
||||||
|
WHERE account = %s
|
||||||
|
""",
|
||||||
|
"params": (accountId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_premises(user, token_info):
|
def get_premises(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -346,6 +372,7 @@ UPDATE premise_t
|
|||||||
logger.warning("update_premise: parameter missing: {}".format(e))
|
logger.warning("update_premise: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
def get_flats(user, token_info):
|
def get_flats(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -445,6 +472,23 @@ UPDATE flat_t
|
|||||||
logger.warning("update_flat: parameter missing: {}".format(e))
|
logger.warning("update_flat: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
|
def get_flat_by_premise(user, token_info, premiseId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,premise
|
||||||
|
,area
|
||||||
|
,flat_no
|
||||||
|
FROM flat_t
|
||||||
|
WHERE premise = %s
|
||||||
|
""",
|
||||||
|
"params": (premiseId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_overhead_advances(user, token_info):
|
def get_overhead_advances(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -538,6 +582,7 @@ UPDATE overhead_advance_t
|
|||||||
logger.warning("update_overhead_advance: parameter missing: {}".format(e))
|
logger.warning("update_overhead_advance: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
def get_overhead_advance_flat_mappings(user, token_info):
|
def get_overhead_advance_flat_mappings(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -596,6 +641,35 @@ SELECT
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_overhead_advance_flat_mapping_by_overhead_advance(user, token_info, overhead_advanceId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,overhead_advance
|
||||||
|
,flat
|
||||||
|
FROM overhead_advance_flat_mapping_t
|
||||||
|
WHERE overhead_advance = %s
|
||||||
|
""",
|
||||||
|
"params": (overhead_advanceId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_overhead_advance_flat_mapping_by_flat(user, token_info, flatId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,overhead_advance
|
||||||
|
,flat
|
||||||
|
FROM overhead_advance_flat_mapping_t
|
||||||
|
WHERE flat = %s
|
||||||
|
""",
|
||||||
|
"params": (flatId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_parkings(user, token_info):
|
def get_parkings(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -677,6 +751,21 @@ UPDATE parking_t
|
|||||||
logger.warning("update_parking: parameter missing: {}".format(e))
|
logger.warning("update_parking: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
|
def get_parking_by_premise(user, token_info, premiseId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,premise
|
||||||
|
FROM parking_t
|
||||||
|
WHERE premise = %s
|
||||||
|
""",
|
||||||
|
"params": (premiseId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_commercial_premises(user, token_info):
|
def get_commercial_premises(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -758,6 +847,21 @@ UPDATE commercial_premise_t
|
|||||||
logger.warning("update_commercial_premise: parameter missing: {}".format(e))
|
logger.warning("update_commercial_premise: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
|
def get_commercial_premise_by_premise(user, token_info, premiseId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,premise
|
||||||
|
FROM commercial_premise_t
|
||||||
|
WHERE premise = %s
|
||||||
|
""",
|
||||||
|
"params": (premiseId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_tenancys(user, token_info):
|
def get_tenancys(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -869,6 +973,83 @@ UPDATE tenancy_t
|
|||||||
logger.warning("update_tenancy: parameter missing: {}".format(e))
|
logger.warning("update_tenancy: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
|
def get_tenancy_by_tenant(user, token_info, tenantId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,tenant
|
||||||
|
,flat
|
||||||
|
,parking
|
||||||
|
,commercial_premise
|
||||||
|
,startdate
|
||||||
|
,enddate
|
||||||
|
FROM tenancy_t
|
||||||
|
WHERE tenant = %s
|
||||||
|
""",
|
||||||
|
"params": (tenantId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_tenancy_by_flat(user, token_info, flatId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,tenant
|
||||||
|
,flat
|
||||||
|
,parking
|
||||||
|
,commercial_premise
|
||||||
|
,startdate
|
||||||
|
,enddate
|
||||||
|
FROM tenancy_t
|
||||||
|
WHERE flat = %s
|
||||||
|
""",
|
||||||
|
"params": (flatId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_tenancy_by_parking(user, token_info, parkingId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,tenant
|
||||||
|
,flat
|
||||||
|
,parking
|
||||||
|
,commercial_premise
|
||||||
|
,startdate
|
||||||
|
,enddate
|
||||||
|
FROM tenancy_t
|
||||||
|
WHERE parking = %s
|
||||||
|
""",
|
||||||
|
"params": (parkingId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_tenancy_by_commercial_premise(user, token_info, commercial_premiseId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,tenant
|
||||||
|
,flat
|
||||||
|
,parking
|
||||||
|
,commercial_premise
|
||||||
|
,startdate
|
||||||
|
,enddate
|
||||||
|
FROM tenancy_t
|
||||||
|
WHERE commercial_premise = %s
|
||||||
|
""",
|
||||||
|
"params": (commercial_premiseId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_fees(user, token_info):
|
def get_fees(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -968,6 +1149,7 @@ UPDATE fee_t
|
|||||||
logger.warning("update_fee: parameter missing: {}".format(e))
|
logger.warning("update_fee: parameter missing: {}".format(e))
|
||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
def get_tenancy_fee_mappings(user, token_info):
|
def get_tenancy_fee_mappings(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -1023,6 +1205,35 @@ SELECT
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_tenancy_fee_mapping_by_tenancy(user, token_info, tenancyId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,tenancy
|
||||||
|
,fee
|
||||||
|
FROM tenancy_fee_mapping_t
|
||||||
|
WHERE tenancy = %s
|
||||||
|
""",
|
||||||
|
"params": (tenancyId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def get_tenancy_fee_mapping_by_fee(user, token_info, feeId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,tenancy
|
||||||
|
,fee
|
||||||
|
FROM tenancy_fee_mapping_t
|
||||||
|
WHERE fee = %s
|
||||||
|
""",
|
||||||
|
"params": (feeId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
def get_account_entrys(user, token_info):
|
def get_account_entrys(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -1090,3 +1301,20 @@ SELECT
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_account_entry_by_account(user, token_info, accountId=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
,description
|
||||||
|
,account
|
||||||
|
,created_at
|
||||||
|
,amount
|
||||||
|
FROM account_entry_t
|
||||||
|
WHERE account = %s
|
||||||
|
""",
|
||||||
|
"params": (accountId, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
@ -116,4 +116,24 @@ UPDATE ${table.name}_t
|
|||||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
#end if
|
#end if
|
||||||
|
|
||||||
|
#for $column in $table.columns
|
||||||
|
#if (('foreignkey' in $column) and $column.foreignkey)
|
||||||
|
|
||||||
|
def get_${table.name}_by_${column.name}(user, token_info, ${column.name}Id=None):
|
||||||
|
return dbGetOne(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
#for $innerColumn in $table.columns
|
||||||
|
,$innerColumn.name
|
||||||
|
#end for
|
||||||
|
FROM ${table.name}_t
|
||||||
|
WHERE ${column.name} = %s
|
||||||
|
""",
|
||||||
|
"params": (${column.name}Id, )
|
||||||
|
}
|
||||||
|
)
|
||||||
|
#end if
|
||||||
|
#end for
|
||||||
|
|
||||||
#end for
|
#end for
|
||||||
|
292
api/openapi.yaml
292
api/openapi.yaml
@ -191,6 +191,28 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenant'
|
$ref: '#/components/schemas/tenant'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/tenants/account/{accountId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenant", "account" ]
|
||||||
|
summary: Return tenant by $account
|
||||||
|
operationId: methods.get_tenant_by_account
|
||||||
|
parameters:
|
||||||
|
- name: accountId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenant response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenant'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/premises:
|
/v1/premises:
|
||||||
get:
|
get:
|
||||||
tags: [ "premise" ]
|
tags: [ "premise" ]
|
||||||
@ -363,6 +385,28 @@ paths:
|
|||||||
$ref: '#/components/schemas/flat'
|
$ref: '#/components/schemas/flat'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/flats/premise/{premiseId}:
|
||||||
|
get:
|
||||||
|
tags: [ "flat", "premise" ]
|
||||||
|
summary: Return flat by $premise
|
||||||
|
operationId: methods.get_flat_by_premise
|
||||||
|
parameters:
|
||||||
|
- name: premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: flat response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/flat'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/overhead_advances:
|
/v1/overhead_advances:
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance" ]
|
tags: [ "overhead_advance" ]
|
||||||
@ -508,6 +552,50 @@ paths:
|
|||||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/overhead_advance_flat_mappings/overhead_advance/{overhead_advanceId}:
|
||||||
|
get:
|
||||||
|
tags: [ "overhead_advance_flat_mapping", "overhead_advance" ]
|
||||||
|
summary: Return overhead_advance_flat_mapping by $overhead_advance
|
||||||
|
operationId: methods.get_overhead_advance_flat_mapping_by_overhead_advance
|
||||||
|
parameters:
|
||||||
|
- name: overhead_advanceId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: overhead_advance_flat_mapping response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
/v1/overhead_advance_flat_mappings/flat/{flatId}:
|
||||||
|
get:
|
||||||
|
tags: [ "overhead_advance_flat_mapping", "flat" ]
|
||||||
|
summary: Return overhead_advance_flat_mapping by $flat
|
||||||
|
operationId: methods.get_overhead_advance_flat_mapping_by_flat
|
||||||
|
parameters:
|
||||||
|
- name: flatId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: overhead_advance_flat_mapping response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/parkings:
|
/v1/parkings:
|
||||||
get:
|
get:
|
||||||
tags: [ "parking" ]
|
tags: [ "parking" ]
|
||||||
@ -594,6 +682,28 @@ paths:
|
|||||||
$ref: '#/components/schemas/parking'
|
$ref: '#/components/schemas/parking'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/parkings/premise/{premiseId}:
|
||||||
|
get:
|
||||||
|
tags: [ "parking", "premise" ]
|
||||||
|
summary: Return parking by $premise
|
||||||
|
operationId: methods.get_parking_by_premise
|
||||||
|
parameters:
|
||||||
|
- name: premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: parking response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/parking'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/commercial_premises:
|
/v1/commercial_premises:
|
||||||
get:
|
get:
|
||||||
tags: [ "commercial_premise" ]
|
tags: [ "commercial_premise" ]
|
||||||
@ -680,6 +790,28 @@ paths:
|
|||||||
$ref: '#/components/schemas/commercial_premise'
|
$ref: '#/components/schemas/commercial_premise'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/commercial_premises/premise/{premiseId}:
|
||||||
|
get:
|
||||||
|
tags: [ "commercial_premise", "premise" ]
|
||||||
|
summary: Return commercial_premise by $premise
|
||||||
|
operationId: methods.get_commercial_premise_by_premise
|
||||||
|
parameters:
|
||||||
|
- name: premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: commercial_premise response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/commercial_premise'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/tenancys:
|
/v1/tenancys:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenancy" ]
|
tags: [ "tenancy" ]
|
||||||
@ -766,6 +898,94 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenancy'
|
$ref: '#/components/schemas/tenancy'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/tenancys/tenant/{tenantId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy", "tenant" ]
|
||||||
|
summary: Return tenancy by $tenant
|
||||||
|
operationId: methods.get_tenancy_by_tenant
|
||||||
|
parameters:
|
||||||
|
- name: tenantId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
/v1/tenancys/flat/{flatId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy", "flat" ]
|
||||||
|
summary: Return tenancy by $flat
|
||||||
|
operationId: methods.get_tenancy_by_flat
|
||||||
|
parameters:
|
||||||
|
- name: flatId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
/v1/tenancys/parking/{parkingId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy", "parking" ]
|
||||||
|
summary: Return tenancy by $parking
|
||||||
|
operationId: methods.get_tenancy_by_parking
|
||||||
|
parameters:
|
||||||
|
- name: parkingId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
/v1/tenancys/commercial_premise/{commercial_premiseId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy", "commercial_premise" ]
|
||||||
|
summary: Return tenancy by $commercial_premise
|
||||||
|
operationId: methods.get_tenancy_by_commercial_premise
|
||||||
|
parameters:
|
||||||
|
- name: commercial_premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/fees:
|
/v1/fees:
|
||||||
get:
|
get:
|
||||||
tags: [ "fee" ]
|
tags: [ "fee" ]
|
||||||
@ -911,6 +1131,50 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenancy_fee_mapping'
|
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/tenancy_fee_mappings/tenancy/{tenancyId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy_fee_mapping", "tenancy" ]
|
||||||
|
summary: Return tenancy_fee_mapping by $tenancy
|
||||||
|
operationId: methods.get_tenancy_fee_mapping_by_tenancy
|
||||||
|
parameters:
|
||||||
|
- name: tenancyId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy_fee_mapping response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
/v1/tenancy_fee_mappings/fee/{feeId}:
|
||||||
|
get:
|
||||||
|
tags: [ "tenancy_fee_mapping", "fee" ]
|
||||||
|
summary: Return tenancy_fee_mapping by $fee
|
||||||
|
operationId: methods.get_tenancy_fee_mapping_by_fee
|
||||||
|
parameters:
|
||||||
|
- name: feeId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: tenancy_fee_mapping response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
/v1/account_entrys:
|
/v1/account_entrys:
|
||||||
get:
|
get:
|
||||||
tags: [ "account_entry" ]
|
tags: [ "account_entry" ]
|
||||||
@ -970,37 +1234,35 @@ paths:
|
|||||||
$ref: '#/components/schemas/account_entry'
|
$ref: '#/components/schemas/account_entry'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
/v1/account_entrys/account/{accountId}:
|
||||||
# -------------------------------------------------------------------
|
|
||||||
# ATTENTION: This file will not be parsed by Cheetah
|
|
||||||
# Use plain openapi/yaml syntax, no Cheetah
|
|
||||||
# escaping
|
|
||||||
# -------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
/v1/overhead_advance_flat_mappings/flat/{flatId}:
|
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance_flat_mapping", "flat" ]
|
tags: [ "account_entry", "account" ]
|
||||||
summary: Returns all overhead advance mappings for a given flat
|
summary: Return account_entry by $account
|
||||||
operationId: additional_methods.get_overhead_advance_flat_mapping_by_flat
|
operationId: methods.get_account_entry_by_account
|
||||||
parameters:
|
parameters:
|
||||||
- name: flatId
|
- name: accountId
|
||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: $table.name response
|
description: account_entry response
|
||||||
content:
|
content:
|
||||||
'application/json':
|
'application/json':
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
$ref: '#/components/schemas/account_entry'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# ATTENTION: This file will not be parsed by Cheetah
|
||||||
|
# Use plain openapi/yaml syntax, no Cheetah
|
||||||
|
# escaping
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
jwt:
|
jwt:
|
||||||
|
@ -103,6 +103,32 @@ paths:
|
|||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
#end if
|
#end if
|
||||||
|
#for $column in $table.columns
|
||||||
|
#if (('foreignkey' in $column) and $column.foreignkey)
|
||||||
|
/v1/${table.name}s/${column.name}/{${column.name}Id}:
|
||||||
|
get:
|
||||||
|
tags: [ "$table.name", "$column.name" ]
|
||||||
|
summary: Return $table.name by $$column.name
|
||||||
|
operationId: methods.get_${table.name}_by_${column.name}
|
||||||
|
parameters:
|
||||||
|
- name: ${column.name}Id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: $table.name response
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
\$ref: '#/components/schemas/$table.name'
|
||||||
|
security:
|
||||||
|
- jwt: ['secret']
|
||||||
|
#end if
|
||||||
|
#end for
|
||||||
#end for
|
#end for
|
||||||
|
|
||||||
#include raw "./api/additional_endpoints.yaml"
|
#include raw "./api/additional_endpoints.yaml"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user