add post method to api
This commit is contained in:
parent
e238b1fb9f
commit
6bb1eec181
13
api/db.py
13
api/db.py
@ -49,8 +49,9 @@ def execDatabaseOperation(func, params):
|
||||
sslmode = 'require')
|
||||
conn.autocommit = False
|
||||
|
||||
with conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor) as cur:
|
||||
return func(cur, params)
|
||||
with conn:
|
||||
with conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor) as cur:
|
||||
return func(cur, params)
|
||||
except psycopg2.Error as err:
|
||||
raise Exception("Error when connecting to database: {}".format(err))
|
||||
finally:
|
||||
@ -101,3 +102,11 @@ def dbGetOne(user, token_info, params):
|
||||
except Exception as e:
|
||||
logger.error(f"Exception: {e}")
|
||||
raise werkzeug.exceptions.InternalServerError
|
||||
|
||||
def dbInsert(user, token_info, params):
|
||||
logger.info("params: {}, token: {}".format(params, json.dumps(token_info)))
|
||||
try:
|
||||
return execDatabaseOperation(_opGetOne, params)
|
||||
except Exception as e:
|
||||
logger.error(f"Exception: {e}")
|
||||
raise werkzeug.exceptions.InternalServerError
|
||||
|
427
api/methods.py
427
api/methods.py
@ -5,7 +5,8 @@
|
||||
# -----------------------------------------
|
||||
|
||||
|
||||
from db import dbGetMany, dbGetOne
|
||||
from db import dbGetMany, dbGetOne, dbInsert
|
||||
from loguru import logger
|
||||
|
||||
def get_accounts(user, token_info):
|
||||
return dbGetMany(user, token_info, {
|
||||
@ -21,6 +22,29 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_account(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO account_t
|
||||
(
|
||||
description
|
||||
) VALUES (
|
||||
%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_account: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_account(user, token_info, accountId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -59,6 +83,73 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_tenant(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_salutation = body["salutation"]
|
||||
v_firstname = body["firstname"]
|
||||
v_lastname = body["lastname"]
|
||||
v_address1 = body["address1"]
|
||||
v_address2 = body["address2"]
|
||||
v_address3 = body["address3"]
|
||||
v_zip = body["zip"]
|
||||
v_city = body["city"]
|
||||
v_phone1 = body["phone1"]
|
||||
v_phone2 = body["phone2"]
|
||||
v_iban = body["iban"]
|
||||
v_account = body["account"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO tenant_t
|
||||
(
|
||||
salutation
|
||||
,firstname
|
||||
,lastname
|
||||
,address1
|
||||
,address2
|
||||
,address3
|
||||
,zip
|
||||
,city
|
||||
,phone1
|
||||
,phone2
|
||||
,iban
|
||||
,account
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_salutation
|
||||
,v_firstname
|
||||
,v_lastname
|
||||
,v_address1
|
||||
,v_address2
|
||||
,v_address3
|
||||
,v_zip
|
||||
,v_city
|
||||
,v_phone1
|
||||
,v_phone2
|
||||
,v_iban
|
||||
,v_account
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_tenant: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_tenant(user, token_info, tenantId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -99,6 +190,41 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_premise(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_street = body["street"]
|
||||
v_zip = body["zip"]
|
||||
v_city = body["city"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO premise_t
|
||||
(
|
||||
description
|
||||
,street
|
||||
,zip
|
||||
,city
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_street
|
||||
,v_zip
|
||||
,v_city
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_premise: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_premise(user, token_info, premiseId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -132,6 +258,41 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_flat(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_premise = body["premise"]
|
||||
v_area = body["area"]
|
||||
v_flat_no = body["flat_no"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO flat_t
|
||||
(
|
||||
description
|
||||
,premise
|
||||
,area
|
||||
,flat_no
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_premise
|
||||
,v_area
|
||||
,v_flat_no
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_flat: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_flat(user, token_info, flatId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -165,6 +326,41 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_overhead_advance(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_amount = body["amount"]
|
||||
v_startdate = body["startdate"]
|
||||
v_enddate = body["enddate"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO overhead_advance_t
|
||||
(
|
||||
description
|
||||
,amount
|
||||
,startdate
|
||||
,enddate
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_amount
|
||||
,v_startdate
|
||||
,v_enddate
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_overhead_advance: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_overhead_advance(user, token_info, overhead_advanceId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -196,6 +392,33 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_overhead_advance_flat_mapping(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_overhead_advance = body["overhead_advance"]
|
||||
v_flat = body["flat"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO overhead_advance_flat_mapping_t
|
||||
(
|
||||
overhead_advance
|
||||
,flat
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_overhead_advance
|
||||
,v_flat
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_overhead_advance_flat_mapping: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_overhead_advance_flat_mapping(user, token_info, overhead_advance_flat_mappingId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -225,6 +448,33 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_parking(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_premise = body["premise"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO parking_t
|
||||
(
|
||||
description
|
||||
,premise
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_premise
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_parking: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_parking(user, token_info, parkingId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -254,6 +504,33 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_commercial_premise(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_premise = body["premise"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO commercial_premise_t
|
||||
(
|
||||
description
|
||||
,premise
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_premise
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_commercial_premise: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_commercial_premise(user, token_info, commercial_premiseId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -288,6 +565,53 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_tenancy(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_tenant = body["tenant"]
|
||||
v_flat = body["flat"]
|
||||
v_parking = body["parking"]
|
||||
v_commercial_premise = body["commercial_premise"]
|
||||
v_startdate = body["startdate"]
|
||||
v_enddate = body["enddate"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO tenancy_t
|
||||
(
|
||||
description
|
||||
,tenant
|
||||
,flat
|
||||
,parking
|
||||
,commercial_premise
|
||||
,startdate
|
||||
,enddate
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_tenant
|
||||
,v_flat
|
||||
,v_parking
|
||||
,v_commercial_premise
|
||||
,v_startdate
|
||||
,v_enddate
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_tenancy: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_tenancy(user, token_info, tenancyId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -325,6 +649,45 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_fee(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_amount = body["amount"]
|
||||
v_fee_type = body["fee_type"]
|
||||
v_startdate = body["startdate"]
|
||||
v_enddate = body["enddate"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO fee_t
|
||||
(
|
||||
description
|
||||
,amount
|
||||
,fee_type
|
||||
,startdate
|
||||
,enddate
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_amount
|
||||
,v_fee_type
|
||||
,v_startdate
|
||||
,v_enddate
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_fee: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_fee(user, token_info, feeId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -354,6 +717,33 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_tenancy_fee_mapping(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_tenancy = body["tenancy"]
|
||||
v_fee = body["fee"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO tenancy_fee_mapping_t
|
||||
(
|
||||
tenancy
|
||||
,fee
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_tenancy
|
||||
,v_fee
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_tenancy_fee_mapping: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_tenancy_fee_mapping(user, token_info, tenancy_fee_mappingId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
@ -382,6 +772,41 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_account_entry(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_account = body["account"]
|
||||
v_created_at = body["created_at"]
|
||||
v_amount = body["amount"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO account_entry_t
|
||||
(
|
||||
description
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_account
|
||||
,v_created_at
|
||||
,v_amount
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_account_entry: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_account_entry(user, token_info, account_entryId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
|
@ -1,6 +1,7 @@
|
||||
$GENERATED_PYTHON_COMMENT
|
||||
|
||||
from db import dbGetMany, dbGetOne
|
||||
from db import dbGetMany, dbGetOne, dbInsert
|
||||
from loguru import logger
|
||||
|
||||
#for $table in $tables
|
||||
def get_${table.name}s(user, token_info):
|
||||
@ -25,6 +26,43 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def insert_${table.name}(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
#for $column in $table.columns
|
||||
v_$column.name = body["$column.name"]
|
||||
#end for
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO ${table.name}_t
|
||||
(
|
||||
#set $sep=""
|
||||
#for $column in $table.columns
|
||||
$sep$column.name
|
||||
#set $sep=","
|
||||
#end for
|
||||
) VALUES (
|
||||
#set $sep=""
|
||||
#for $column in $table.columns
|
||||
$sep%s
|
||||
#set $sep=","
|
||||
#end for
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
#set $sep=""
|
||||
#for $column in $table.columns
|
||||
${sep}v_$column.name
|
||||
#set $sep=","
|
||||
#end for
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_${table.name}: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_${table.name}(user, token_info, ${table.name}Id=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
|
252
api/openapi.yaml
252
api/openapi.yaml
@ -35,6 +35,27 @@ paths:
|
||||
$ref: '#/components/schemas/account'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "account" ]
|
||||
summary: Insert a account
|
||||
operationId: methods.insert_account
|
||||
requestBody:
|
||||
description: account
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/account'
|
||||
responses:
|
||||
'200':
|
||||
description: account successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/account'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/accounts/{accountId}:
|
||||
get:
|
||||
tags: [ "account" ]
|
||||
@ -73,6 +94,27 @@ paths:
|
||||
$ref: '#/components/schemas/tenant'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "tenant" ]
|
||||
summary: Insert a tenant
|
||||
operationId: methods.insert_tenant
|
||||
requestBody:
|
||||
description: tenant
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/tenant'
|
||||
responses:
|
||||
'200':
|
||||
description: tenant successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/tenant'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/tenants/{tenantId}:
|
||||
get:
|
||||
tags: [ "tenant" ]
|
||||
@ -111,6 +153,27 @@ paths:
|
||||
$ref: '#/components/schemas/premise'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "premise" ]
|
||||
summary: Insert a premise
|
||||
operationId: methods.insert_premise
|
||||
requestBody:
|
||||
description: premise
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/premise'
|
||||
responses:
|
||||
'200':
|
||||
description: premise successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/premise'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/premises/{premiseId}:
|
||||
get:
|
||||
tags: [ "premise" ]
|
||||
@ -149,6 +212,27 @@ paths:
|
||||
$ref: '#/components/schemas/flat'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "flat" ]
|
||||
summary: Insert a flat
|
||||
operationId: methods.insert_flat
|
||||
requestBody:
|
||||
description: flat
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/flat'
|
||||
responses:
|
||||
'200':
|
||||
description: flat successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/flat'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/flats/{flatId}:
|
||||
get:
|
||||
tags: [ "flat" ]
|
||||
@ -187,6 +271,27 @@ paths:
|
||||
$ref: '#/components/schemas/overhead_advance'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "overhead_advance" ]
|
||||
summary: Insert a overhead_advance
|
||||
operationId: methods.insert_overhead_advance
|
||||
requestBody:
|
||||
description: overhead_advance
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/overhead_advance'
|
||||
responses:
|
||||
'200':
|
||||
description: overhead_advance successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/overhead_advance'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/overhead_advances/{overhead_advanceId}:
|
||||
get:
|
||||
tags: [ "overhead_advance" ]
|
||||
@ -225,6 +330,27 @@ paths:
|
||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "overhead_advance_flat_mapping" ]
|
||||
summary: Insert a overhead_advance_flat_mapping
|
||||
operationId: methods.insert_overhead_advance_flat_mapping
|
||||
requestBody:
|
||||
description: overhead_advance_flat_mapping
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||
responses:
|
||||
'200':
|
||||
description: overhead_advance_flat_mapping successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/overhead_advance_flat_mappings/{overhead_advance_flat_mappingId}:
|
||||
get:
|
||||
tags: [ "overhead_advance_flat_mapping" ]
|
||||
@ -263,6 +389,27 @@ paths:
|
||||
$ref: '#/components/schemas/parking'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "parking" ]
|
||||
summary: Insert a parking
|
||||
operationId: methods.insert_parking
|
||||
requestBody:
|
||||
description: parking
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/parking'
|
||||
responses:
|
||||
'200':
|
||||
description: parking successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/parking'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/parkings/{parkingId}:
|
||||
get:
|
||||
tags: [ "parking" ]
|
||||
@ -301,6 +448,27 @@ paths:
|
||||
$ref: '#/components/schemas/commercial_premise'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "commercial_premise" ]
|
||||
summary: Insert a commercial_premise
|
||||
operationId: methods.insert_commercial_premise
|
||||
requestBody:
|
||||
description: commercial_premise
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/commercial_premise'
|
||||
responses:
|
||||
'200':
|
||||
description: commercial_premise successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/commercial_premise'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/commercial_premises/{commercial_premiseId}:
|
||||
get:
|
||||
tags: [ "commercial_premise" ]
|
||||
@ -339,6 +507,27 @@ paths:
|
||||
$ref: '#/components/schemas/tenancy'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "tenancy" ]
|
||||
summary: Insert a tenancy
|
||||
operationId: methods.insert_tenancy
|
||||
requestBody:
|
||||
description: tenancy
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/tenancy'
|
||||
responses:
|
||||
'200':
|
||||
description: tenancy successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/tenancy'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/tenancys/{tenancyId}:
|
||||
get:
|
||||
tags: [ "tenancy" ]
|
||||
@ -377,6 +566,27 @@ paths:
|
||||
$ref: '#/components/schemas/fee'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "fee" ]
|
||||
summary: Insert a fee
|
||||
operationId: methods.insert_fee
|
||||
requestBody:
|
||||
description: fee
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/fee'
|
||||
responses:
|
||||
'200':
|
||||
description: fee successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/fee'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/fees/{feeId}:
|
||||
get:
|
||||
tags: [ "fee" ]
|
||||
@ -415,6 +625,27 @@ paths:
|
||||
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "tenancy_fee_mapping" ]
|
||||
summary: Insert a tenancy_fee_mapping
|
||||
operationId: methods.insert_tenancy_fee_mapping
|
||||
requestBody:
|
||||
description: tenancy_fee_mapping
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||
responses:
|
||||
'200':
|
||||
description: tenancy_fee_mapping successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/tenancy_fee_mappings/{tenancy_fee_mappingId}:
|
||||
get:
|
||||
tags: [ "tenancy_fee_mapping" ]
|
||||
@ -453,6 +684,27 @@ paths:
|
||||
$ref: '#/components/schemas/account_entry'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "account_entry" ]
|
||||
summary: Insert a account_entry
|
||||
operationId: methods.insert_account_entry
|
||||
requestBody:
|
||||
description: account_entry
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/account_entry'
|
||||
responses:
|
||||
'200':
|
||||
description: account_entry successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/account_entry'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/account_entrys/{account_entryId}:
|
||||
get:
|
||||
tags: [ "account_entry" ]
|
||||
|
@ -31,6 +31,27 @@ paths:
|
||||
\$ref: '#/components/schemas/$table.name'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
post:
|
||||
tags: [ "$table.name" ]
|
||||
summary: Insert a ${table.name}
|
||||
operationId: methods.insert_${table.name}
|
||||
requestBody:
|
||||
description: $table.name
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
\$ref: '#/components/schemas/$table.name'
|
||||
responses:
|
||||
'200':
|
||||
description: ${table.name} successfully inserted
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
\$ref: '#/components/schemas/$table.name'
|
||||
security:
|
||||
- jwt: ['secret']
|
||||
/v1/${table.name}s/{${table.name}Id}:
|
||||
get:
|
||||
tags: [ "$table.name" ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user