update methods and immutable attribute added
This commit is contained in:
parent
0afef9f3cd
commit
6470aa5358
@ -112,3 +112,11 @@ def dbInsert(user, token_info, params):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Exception: {e}")
|
logger.error(f"Exception: {e}")
|
||||||
raise werkzeug.exceptions.InternalServerError
|
raise werkzeug.exceptions.InternalServerError
|
||||||
|
|
||||||
|
def dbUpdate(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
|
||||||
|
270
api/methods.py
270
api/methods.py
@ -5,8 +5,9 @@
|
|||||||
# -----------------------------------------
|
# -----------------------------------------
|
||||||
|
|
||||||
|
|
||||||
from db import dbGetMany, dbGetOne, dbInsert
|
from db import dbGetMany, dbGetOne, dbInsert, dbUpdate
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
import werkzeug
|
||||||
|
|
||||||
def get_accounts(user, token_info):
|
def get_accounts(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
@ -57,6 +58,28 @@ SELECT
|
|||||||
"params": (accountId, )
|
"params": (accountId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_account(user, token_info, accountId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE account_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
accountId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_account: 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": """
|
||||||
@ -173,6 +196,58 @@ SELECT
|
|||||||
"params": (tenantId, )
|
"params": (tenantId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_tenant(user, token_info, tenantId=None, **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"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE tenant_t
|
||||||
|
SET
|
||||||
|
salutation = %s
|
||||||
|
,firstname = %s
|
||||||
|
,lastname = %s
|
||||||
|
,address1 = %s
|
||||||
|
,address2 = %s
|
||||||
|
,address3 = %s
|
||||||
|
,zip = %s
|
||||||
|
,city = %s
|
||||||
|
,phone1 = %s
|
||||||
|
,phone2 = %s
|
||||||
|
,iban = %s
|
||||||
|
WHERE id = %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,
|
||||||
|
tenantId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_tenant: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
def get_premises(user, token_info):
|
def get_premises(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -240,6 +315,37 @@ SELECT
|
|||||||
"params": (premiseId, )
|
"params": (premiseId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_premise(user, token_info, premiseId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_street = body["street"]
|
||||||
|
v_zip = body["zip"]
|
||||||
|
v_city = body["city"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE premise_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,street = %s
|
||||||
|
,zip = %s
|
||||||
|
,city = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_street,
|
||||||
|
v_zip,
|
||||||
|
v_city,
|
||||||
|
premiseId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_premise: 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": """
|
||||||
@ -308,6 +414,37 @@ SELECT
|
|||||||
"params": (flatId, )
|
"params": (flatId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_flat(user, token_info, flatId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_premise = body["premise"]
|
||||||
|
v_area = body["area"]
|
||||||
|
v_flat_no = body["flat_no"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE flat_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,premise = %s
|
||||||
|
,area = %s
|
||||||
|
,flat_no = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_premise,
|
||||||
|
v_area,
|
||||||
|
v_flat_no,
|
||||||
|
flatId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_flat: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
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": """
|
||||||
@ -376,6 +513,31 @@ SELECT
|
|||||||
"params": (overhead_advanceId, )
|
"params": (overhead_advanceId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_overhead_advance(user, token_info, overhead_advanceId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_enddate = body["enddate"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE overhead_advance_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,enddate = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_enddate,
|
||||||
|
overhead_advanceId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_overhead_advance: 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": """
|
||||||
@ -432,6 +594,8 @@ SELECT
|
|||||||
"params": (overhead_advance_flat_mappingId, )
|
"params": (overhead_advance_flat_mappingId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_parkings(user, token_info):
|
def get_parkings(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -488,6 +652,31 @@ SELECT
|
|||||||
"params": (parkingId, )
|
"params": (parkingId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_parking(user, token_info, parkingId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_premise = body["premise"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE parking_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,premise = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_premise,
|
||||||
|
parkingId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_parking: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
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": """
|
||||||
@ -544,6 +733,31 @@ SELECT
|
|||||||
"params": (commercial_premiseId, )
|
"params": (commercial_premiseId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_commercial_premise(user, token_info, commercial_premiseId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_premise = body["premise"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE commercial_premise_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,premise = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_premise,
|
||||||
|
commercial_premiseId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_commercial_premise: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
def get_tenancys(user, token_info):
|
def get_tenancys(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -630,6 +844,31 @@ SELECT
|
|||||||
"params": (tenancyId, )
|
"params": (tenancyId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_tenancy(user, token_info, tenancyId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_enddate = body["enddate"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE tenancy_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,enddate = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_enddate,
|
||||||
|
tenancyId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_tenancy: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
|
||||||
def get_fees(user, token_info):
|
def get_fees(user, token_info):
|
||||||
return dbGetMany(user, token_info, {
|
return dbGetMany(user, token_info, {
|
||||||
"statement": """
|
"statement": """
|
||||||
@ -704,6 +943,31 @@ SELECT
|
|||||||
"params": (feeId, )
|
"params": (feeId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def update_fee(user, token_info, feeId=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
v_description = body["description"]
|
||||||
|
v_enddate = body["enddate"]
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE fee_t
|
||||||
|
SET
|
||||||
|
description = %s
|
||||||
|
,enddate = %s
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
v_description,
|
||||||
|
v_enddate,
|
||||||
|
feeId
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_fee: 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": """
|
||||||
@ -757,6 +1021,8 @@ SELECT
|
|||||||
"params": (tenancy_fee_mappingId, )
|
"params": (tenancy_fee_mappingId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
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": """
|
||||||
@ -822,3 +1088,5 @@ SELECT
|
|||||||
"params": (account_entryId, )
|
"params": (account_entryId, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
$GENERATED_PYTHON_COMMENT
|
$GENERATED_PYTHON_COMMENT
|
||||||
|
|
||||||
from db import dbGetMany, dbGetOne, dbInsert
|
from db import dbGetMany, dbGetOne, dbInsert, dbUpdate
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
import werkzeug
|
||||||
|
|
||||||
#for $table in $tables
|
#for $table in $tables
|
||||||
def get_${table.name}s(user, token_info):
|
def get_${table.name}s(user, token_info):
|
||||||
@ -77,4 +78,42 @@ SELECT
|
|||||||
"params": (${table.name}Id, )
|
"params": (${table.name}Id, )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#if (('immutable' not in $table) or (not $table.immutable))
|
||||||
|
def update_${table.name}(user, token_info, ${table.name}Id=None, **args):
|
||||||
|
try:
|
||||||
|
body = args["body"]
|
||||||
|
#for $column in $table.columns
|
||||||
|
#if (('immutable' not in $column) or (not $column.immutable))
|
||||||
|
v_$column.name = body["$column.name"]
|
||||||
|
#end if
|
||||||
|
#end for
|
||||||
|
return dbUpdate(user, token_info, {
|
||||||
|
"statement": """
|
||||||
|
UPDATE ${table.name}_t
|
||||||
|
SET
|
||||||
|
#set $sep=""
|
||||||
|
#for $column in $table.columns
|
||||||
|
#if (('immutable' not in $column) or (not $column.immutable))
|
||||||
|
$sep$column.name = %s
|
||||||
|
#end if
|
||||||
|
#set $sep=","
|
||||||
|
#end for
|
||||||
|
WHERE id = %s
|
||||||
|
RETURNING *
|
||||||
|
""",
|
||||||
|
"params": [
|
||||||
|
#for $column in $table.columns
|
||||||
|
#if (('immutable' not in $column) or (not $column.immutable))
|
||||||
|
v_${column.name},
|
||||||
|
#end if
|
||||||
|
#end for
|
||||||
|
${table.name}Id
|
||||||
|
]
|
||||||
|
})
|
||||||
|
except KeyError as e:
|
||||||
|
logger.warning("update_${table.name}: parameter missing: {}".format(e))
|
||||||
|
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||||
|
#end if
|
||||||
|
|
||||||
#end for
|
#end for
|
||||||
|
495
api/openapi.yaml
495
api/openapi.yaml
@ -56,6 +56,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/account'
|
$ref: '#/components/schemas/account'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "account" ]
|
||||||
|
summary: Update a account
|
||||||
|
operationId: methods.update_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}:
|
/v1/accounts/{accountId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "account" ]
|
tags: [ "account" ]
|
||||||
@ -78,6 +99,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/account'
|
$ref: '#/components/schemas/account'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "account" ]
|
||||||
|
summary: Update a account
|
||||||
|
operationId: methods.update_account
|
||||||
|
parameters:
|
||||||
|
- name: accountId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/tenants:
|
/v1/tenants:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenant" ]
|
tags: [ "tenant" ]
|
||||||
@ -115,6 +163,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenant'
|
$ref: '#/components/schemas/tenant'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "tenant" ]
|
||||||
|
summary: Update a tenant
|
||||||
|
operationId: methods.update_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}:
|
/v1/tenants/{tenantId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenant" ]
|
tags: [ "tenant" ]
|
||||||
@ -137,6 +206,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenant'
|
$ref: '#/components/schemas/tenant'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "tenant" ]
|
||||||
|
summary: Update a tenant
|
||||||
|
operationId: methods.update_tenant
|
||||||
|
parameters:
|
||||||
|
- name: tenantId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/premises:
|
/v1/premises:
|
||||||
get:
|
get:
|
||||||
tags: [ "premise" ]
|
tags: [ "premise" ]
|
||||||
@ -174,6 +270,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/premise'
|
$ref: '#/components/schemas/premise'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "premise" ]
|
||||||
|
summary: Update a premise
|
||||||
|
operationId: methods.update_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}:
|
/v1/premises/{premiseId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "premise" ]
|
tags: [ "premise" ]
|
||||||
@ -196,6 +313,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/premise'
|
$ref: '#/components/schemas/premise'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "premise" ]
|
||||||
|
summary: Update a premise
|
||||||
|
operationId: methods.update_premise
|
||||||
|
parameters:
|
||||||
|
- name: premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/flats:
|
/v1/flats:
|
||||||
get:
|
get:
|
||||||
tags: [ "flat" ]
|
tags: [ "flat" ]
|
||||||
@ -233,6 +377,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/flat'
|
$ref: '#/components/schemas/flat'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "flat" ]
|
||||||
|
summary: Update a flat
|
||||||
|
operationId: methods.update_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}:
|
/v1/flats/{flatId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "flat" ]
|
tags: [ "flat" ]
|
||||||
@ -255,6 +420,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/flat'
|
$ref: '#/components/schemas/flat'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "flat" ]
|
||||||
|
summary: Update a flat
|
||||||
|
operationId: methods.update_flat
|
||||||
|
parameters:
|
||||||
|
- name: flatId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/overhead_advances:
|
/v1/overhead_advances:
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance" ]
|
tags: [ "overhead_advance" ]
|
||||||
@ -292,6 +484,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/overhead_advance'
|
$ref: '#/components/schemas/overhead_advance'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "overhead_advance" ]
|
||||||
|
summary: Update a overhead_advance
|
||||||
|
operationId: methods.update_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}:
|
/v1/overhead_advances/{overhead_advanceId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance" ]
|
tags: [ "overhead_advance" ]
|
||||||
@ -314,6 +527,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/overhead_advance'
|
$ref: '#/components/schemas/overhead_advance'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "overhead_advance" ]
|
||||||
|
summary: Update a overhead_advance
|
||||||
|
operationId: methods.update_overhead_advance
|
||||||
|
parameters:
|
||||||
|
- name: overhead_advanceId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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_advance_flat_mappings:
|
/v1/overhead_advance_flat_mappings:
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance_flat_mapping" ]
|
tags: [ "overhead_advance_flat_mapping" ]
|
||||||
@ -351,6 +591,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
$ref: '#/components/schemas/overhead_advance_flat_mapping'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "overhead_advance_flat_mapping" ]
|
||||||
|
summary: Update a overhead_advance_flat_mapping
|
||||||
|
operationId: methods.update_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}:
|
/v1/overhead_advance_flat_mappings/{overhead_advance_flat_mappingId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "overhead_advance_flat_mapping" ]
|
tags: [ "overhead_advance_flat_mapping" ]
|
||||||
@ -410,6 +671,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/parking'
|
$ref: '#/components/schemas/parking'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "parking" ]
|
||||||
|
summary: Update a parking
|
||||||
|
operationId: methods.update_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}:
|
/v1/parkings/{parkingId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "parking" ]
|
tags: [ "parking" ]
|
||||||
@ -432,6 +714,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/parking'
|
$ref: '#/components/schemas/parking'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "parking" ]
|
||||||
|
summary: Update a parking
|
||||||
|
operationId: methods.update_parking
|
||||||
|
parameters:
|
||||||
|
- name: parkingId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/commercial_premises:
|
/v1/commercial_premises:
|
||||||
get:
|
get:
|
||||||
tags: [ "commercial_premise" ]
|
tags: [ "commercial_premise" ]
|
||||||
@ -469,6 +778,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/commercial_premise'
|
$ref: '#/components/schemas/commercial_premise'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "commercial_premise" ]
|
||||||
|
summary: Update a commercial_premise
|
||||||
|
operationId: methods.update_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}:
|
/v1/commercial_premises/{commercial_premiseId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "commercial_premise" ]
|
tags: [ "commercial_premise" ]
|
||||||
@ -491,6 +821,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/commercial_premise'
|
$ref: '#/components/schemas/commercial_premise'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "commercial_premise" ]
|
||||||
|
summary: Update a commercial_premise
|
||||||
|
operationId: methods.update_commercial_premise
|
||||||
|
parameters:
|
||||||
|
- name: commercial_premiseId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/tenancys:
|
/v1/tenancys:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenancy" ]
|
tags: [ "tenancy" ]
|
||||||
@ -528,6 +885,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenancy'
|
$ref: '#/components/schemas/tenancy'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "tenancy" ]
|
||||||
|
summary: Update a tenancy
|
||||||
|
operationId: methods.update_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}:
|
/v1/tenancys/{tenancyId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenancy" ]
|
tags: [ "tenancy" ]
|
||||||
@ -550,6 +928,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenancy'
|
$ref: '#/components/schemas/tenancy'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "tenancy" ]
|
||||||
|
summary: Update a tenancy
|
||||||
|
operationId: methods.update_tenancy
|
||||||
|
parameters:
|
||||||
|
- name: tenancyId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/fees:
|
/v1/fees:
|
||||||
get:
|
get:
|
||||||
tags: [ "fee" ]
|
tags: [ "fee" ]
|
||||||
@ -587,6 +992,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/fee'
|
$ref: '#/components/schemas/fee'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "fee" ]
|
||||||
|
summary: Update a fee
|
||||||
|
operationId: methods.update_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}:
|
/v1/fees/{feeId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "fee" ]
|
tags: [ "fee" ]
|
||||||
@ -609,6 +1035,33 @@ paths:
|
|||||||
$ref: '#/components/schemas/fee'
|
$ref: '#/components/schemas/fee'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "fee" ]
|
||||||
|
summary: Update a fee
|
||||||
|
operationId: methods.update_fee
|
||||||
|
parameters:
|
||||||
|
- name: feeId
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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/tenancy_fee_mappings:
|
/v1/tenancy_fee_mappings:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenancy_fee_mapping" ]
|
tags: [ "tenancy_fee_mapping" ]
|
||||||
@ -646,6 +1099,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/tenancy_fee_mapping'
|
$ref: '#/components/schemas/tenancy_fee_mapping'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "tenancy_fee_mapping" ]
|
||||||
|
summary: Update a tenancy_fee_mapping
|
||||||
|
operationId: methods.update_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}:
|
/v1/tenancy_fee_mappings/{tenancy_fee_mappingId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "tenancy_fee_mapping" ]
|
tags: [ "tenancy_fee_mapping" ]
|
||||||
@ -705,6 +1179,27 @@ paths:
|
|||||||
$ref: '#/components/schemas/account_entry'
|
$ref: '#/components/schemas/account_entry'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "account_entry" ]
|
||||||
|
summary: Update a account_entry
|
||||||
|
operationId: methods.update_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}:
|
/v1/account_entrys/{account_entryId}:
|
||||||
get:
|
get:
|
||||||
tags: [ "account_entry" ]
|
tags: [ "account_entry" ]
|
||||||
|
@ -52,6 +52,27 @@ paths:
|
|||||||
\$ref: '#/components/schemas/$table.name'
|
\$ref: '#/components/schemas/$table.name'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
put:
|
||||||
|
tags: [ "$table.name" ]
|
||||||
|
summary: Update a ${table.name}
|
||||||
|
operationId: methods.update_${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}:
|
/v1/${table.name}s/{${table.name}Id}:
|
||||||
get:
|
get:
|
||||||
tags: [ "$table.name" ]
|
tags: [ "$table.name" ]
|
||||||
@ -74,6 +95,35 @@ paths:
|
|||||||
\$ref: '#/components/schemas/$table.name'
|
\$ref: '#/components/schemas/$table.name'
|
||||||
security:
|
security:
|
||||||
- jwt: ['secret']
|
- jwt: ['secret']
|
||||||
|
#if (('immutable' not in $table) or (not $table.immutable))
|
||||||
|
put:
|
||||||
|
tags: [ "$table.name" ]
|
||||||
|
summary: Update a ${table.name}
|
||||||
|
operationId: methods.update_${table.name}
|
||||||
|
parameters:
|
||||||
|
- name: ${table.name}Id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
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']
|
||||||
|
#end if
|
||||||
#end for
|
#end for
|
||||||
|
|
||||||
components:
|
components:
|
||||||
|
25
schema.json
25
schema.json
@ -20,7 +20,7 @@
|
|||||||
{ "name": "phone1", "sqltype": "varchar(64)" },
|
{ "name": "phone1", "sqltype": "varchar(64)" },
|
||||||
{ "name": "phone2", "sqltype": "varchar(64)" },
|
{ "name": "phone2", "sqltype": "varchar(64)" },
|
||||||
{ "name": "iban", "sqltype": "varchar(64)" },
|
{ "name": "iban", "sqltype": "varchar(64)" },
|
||||||
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true }
|
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true, "immutable": true }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -45,13 +45,14 @@
|
|||||||
"name": "overhead_advance",
|
"name": "overhead_advance",
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
||||||
{ "name": "amount", "sqltype": "numeric(10,4)", "notnull": true },
|
{ "name": "amount", "sqltype": "numeric(10,4)", "notnull": true, "immutable": true },
|
||||||
{ "name": "startdate", "sqltype": "date", "selector": 1 },
|
{ "name": "startdate", "sqltype": "date", "selector": 1, "immutable": true },
|
||||||
{ "name": "enddate", "sqltype": "date" }
|
{ "name": "enddate", "sqltype": "date" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "overhead_advance_flat_mapping",
|
"name": "overhead_advance_flat_mapping",
|
||||||
|
"immutable": true,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "overhead_advance", "sqltype": "integer", "notnull": true, "foreignkey": true, "selector": 0 },
|
{ "name": "overhead_advance", "sqltype": "integer", "notnull": true, "foreignkey": true, "selector": 0 },
|
||||||
{ "name": "flat", "sqltype": "integer", "notnull": true, "foreignkey": true, "selector": 1 }
|
{ "name": "flat", "sqltype": "integer", "notnull": true, "foreignkey": true, "selector": 1 }
|
||||||
@ -75,11 +76,11 @@
|
|||||||
"name": "tenancy",
|
"name": "tenancy",
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
||||||
{ "name": "tenant", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
{ "name": "tenant", "sqltype": "integer", "notnull": true, "foreignkey": true, "immutable": true },
|
||||||
{ "name": "flat", "sqltype": "integer", "notnull": false, "foreignkey": true },
|
{ "name": "flat", "sqltype": "integer", "notnull": false, "foreignkey": true, "immutable": true },
|
||||||
{ "name": "parking", "sqltype": "integer", "notnull": false, "foreignkey": true },
|
{ "name": "parking", "sqltype": "integer", "notnull": false, "foreignkey": true, "immutable": true },
|
||||||
{ "name": "commercial_premise", "sqltype": "integer", "notnull": false, "foreignkey": true },
|
{ "name": "commercial_premise", "sqltype": "integer", "notnull": false, "foreignkey": true, "immutable": true },
|
||||||
{ "name": "startdate", "sqltype": "date", "notnull": true, "selector": 1 },
|
{ "name": "startdate", "sqltype": "date", "notnull": true, "selector": 1, "immutable": true },
|
||||||
{ "name": "enddate", "sqltype": "date", "notnull": false }
|
{ "name": "enddate", "sqltype": "date", "notnull": false }
|
||||||
],
|
],
|
||||||
"tableConstraints": [
|
"tableConstraints": [
|
||||||
@ -90,9 +91,9 @@
|
|||||||
"name": "fee",
|
"name": "fee",
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
{ "name": "description", "sqltype": "varchar(128)", "selector": 0 },
|
||||||
{ "name": "amount", "sqltype": "numeric(10,2)", "notnull": true },
|
{ "name": "amount", "sqltype": "numeric(10,2)", "notnull": true, "immutable": true },
|
||||||
{ "name": "fee_type", "sqltype": "varchar(10)", "notnull": true },
|
{ "name": "fee_type", "sqltype": "varchar(10)", "notnull": true, "immutable": true },
|
||||||
{ "name": "startdate", "sqltype": "date", "selector": 1 },
|
{ "name": "startdate", "sqltype": "date", "selector": 1, "immutable": true },
|
||||||
{ "name": "enddate", "sqltype": "date" }
|
{ "name": "enddate", "sqltype": "date" }
|
||||||
],
|
],
|
||||||
"tableConstraints": [
|
"tableConstraints": [
|
||||||
@ -101,6 +102,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tenancy_fee_mapping",
|
"name": "tenancy_fee_mapping",
|
||||||
|
"immutable": true,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "tenancy", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
{ "name": "tenancy", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
||||||
{ "name": "fee", "sqltype": "integer", "notnull": true, "foreignkey": true }
|
{ "name": "fee", "sqltype": "integer", "notnull": true, "foreignkey": true }
|
||||||
@ -108,6 +110,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "account_entry",
|
"name": "account_entry",
|
||||||
|
"immutable": true,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "name": "description", "sqltype": "varchar(128)", "notnull": true },
|
{ "name": "description", "sqltype": "varchar(128)", "notnull": true },
|
||||||
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
{ "name": "account", "sqltype": "integer", "notnull": true, "foreignkey": true },
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
// export const serviceBaseUrl = "http://172.16.10.38:5000";
|
// export const serviceBaseUrl = "http://172.16.10.38:5000";
|
||||||
export const serviceBaseUrl = "http://localhost:8080"
|
export const serviceBaseUrl = "http://localhost:8080"
|
||||||
export const authserviceBaseUrl = "https://authservice.hottis.de"
|
export const authserviceBaseUrl = "https://authservice.hottis.de"
|
||||||
|
export const applicationId = "hv2"
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable, of } from 'rxjs';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
||||||
|
|
||||||
import { MessageService } from './message.service';
|
import { MessageService } from './message.service';
|
||||||
import { serviceBaseUrl } from './config';
|
import { serviceBaseUrl } from './config';
|
||||||
@ -54,6 +53,13 @@ export class AccountService {
|
|||||||
return this.http.post<Account>(`${serviceBaseUrl}/v1/accounts`, item).toPromise()
|
return this.http.post<Account>(`${serviceBaseUrl}/v1/accounts`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putAccount(item: Account): Promise<Account> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`AccountService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Account>(`${serviceBaseUrl}/v1/accounts/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -76,6 +82,13 @@ export class TenantService {
|
|||||||
return this.http.post<Tenant>(`${serviceBaseUrl}/v1/tenants`, item).toPromise()
|
return this.http.post<Tenant>(`${serviceBaseUrl}/v1/tenants`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putTenant(item: Tenant): Promise<Tenant> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`TenantService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Tenant>(`${serviceBaseUrl}/v1/tenants/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -98,6 +111,13 @@ export class PremiseService {
|
|||||||
return this.http.post<Premise>(`${serviceBaseUrl}/v1/premises`, item).toPromise()
|
return this.http.post<Premise>(`${serviceBaseUrl}/v1/premises`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putPremise(item: Premise): Promise<Premise> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`PremiseService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Premise>(`${serviceBaseUrl}/v1/premises/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -120,6 +140,13 @@ export class FlatService {
|
|||||||
return this.http.post<Flat>(`${serviceBaseUrl}/v1/flats`, item).toPromise()
|
return this.http.post<Flat>(`${serviceBaseUrl}/v1/flats`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putFlat(item: Flat): Promise<Flat> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`FlatService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Flat>(`${serviceBaseUrl}/v1/flats/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -142,6 +169,13 @@ export class OverheadAdvanceService {
|
|||||||
return this.http.post<OverheadAdvance>(`${serviceBaseUrl}/v1/overhead_advances`, item).toPromise()
|
return this.http.post<OverheadAdvance>(`${serviceBaseUrl}/v1/overhead_advances`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putOverheadAdvance(item: OverheadAdvance): Promise<OverheadAdvance> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`OverheadAdvanceService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<OverheadAdvance>(`${serviceBaseUrl}/v1/overhead_advances/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -164,6 +198,7 @@ export class OverheadAdvanceFlatMappingService {
|
|||||||
return this.http.post<OverheadAdvanceFlatMapping>(`${serviceBaseUrl}/v1/overhead_advance_flat_mappings`, item).toPromise()
|
return this.http.post<OverheadAdvanceFlatMapping>(`${serviceBaseUrl}/v1/overhead_advance_flat_mappings`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -186,6 +221,13 @@ export class ParkingService {
|
|||||||
return this.http.post<Parking>(`${serviceBaseUrl}/v1/parkings`, item).toPromise()
|
return this.http.post<Parking>(`${serviceBaseUrl}/v1/parkings`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putParking(item: Parking): Promise<Parking> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`ParkingService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Parking>(`${serviceBaseUrl}/v1/parkings/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -208,6 +250,13 @@ export class CommercialPremiseService {
|
|||||||
return this.http.post<CommercialPremise>(`${serviceBaseUrl}/v1/commercial_premises`, item).toPromise()
|
return this.http.post<CommercialPremise>(`${serviceBaseUrl}/v1/commercial_premises`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putCommercialPremise(item: CommercialPremise): Promise<CommercialPremise> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`CommercialPremiseService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<CommercialPremise>(`${serviceBaseUrl}/v1/commercial_premises/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -230,6 +279,13 @@ export class TenancyService {
|
|||||||
return this.http.post<Tenancy>(`${serviceBaseUrl}/v1/tenancys`, item).toPromise()
|
return this.http.post<Tenancy>(`${serviceBaseUrl}/v1/tenancys`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putTenancy(item: Tenancy): Promise<Tenancy> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`TenancyService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Tenancy>(`${serviceBaseUrl}/v1/tenancys/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -252,6 +308,13 @@ export class FeeService {
|
|||||||
return this.http.post<Fee>(`${serviceBaseUrl}/v1/fees`, item).toPromise()
|
return this.http.post<Fee>(`${serviceBaseUrl}/v1/fees`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async putFee(item: Fee): Promise<Fee> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`FeeService: put data for ${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<Fee>(`${serviceBaseUrl}/v1/fees/${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -274,6 +337,7 @@ export class TenancyFeeMappingService {
|
|||||||
return this.http.post<TenancyFeeMapping>(`${serviceBaseUrl}/v1/tenancy_fee_mappings`, item).toPromise()
|
return this.http.post<TenancyFeeMapping>(`${serviceBaseUrl}/v1/tenancy_fee_mappings`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@ -296,6 +360,7 @@ export class AccountEntryService {
|
|||||||
return this.http.post<AccountEntry>(`${serviceBaseUrl}/v1/account_entrys`, item).toPromise()
|
return this.http.post<AccountEntry>(`${serviceBaseUrl}/v1/account_entrys`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@ $GENERATED_TS_COMMENT
|
|||||||
|
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable, of } from 'rxjs';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
||||||
|
|
||||||
import { MessageService } from './message.service';
|
import { MessageService } from './message.service';
|
||||||
import { serviceBaseUrl } from './config';
|
import { serviceBaseUrl } from './config';
|
||||||
@ -42,6 +41,15 @@ export class ${JsNameConverter($table.name)}Service {
|
|||||||
return this.http.post<${JsNameConverter($table.name)}>(`\${serviceBaseUrl}/v1/${table.name}s`, item).toPromise()
|
return this.http.post<${JsNameConverter($table.name)}>(`\${serviceBaseUrl}/v1/${table.name}s`, item).toPromise()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (('immutable' not in $table) or (not $table.immutable))
|
||||||
|
async put${JsNameConverter($table.name)}(item: ${JsNameConverter($table.name)}): Promise<${JsNameConverter($table.name)}> {
|
||||||
|
let itemStr: string = JSON.stringify(item, undefined, 4)
|
||||||
|
this.messageService.add(`${JsNameConverter($table.name)}Service: put data for \${itemStr}`)
|
||||||
|
let id: number = item["id"]
|
||||||
|
return this.http.put<${JsNameConverter($table.name)}>(`\${serviceBaseUrl}/v1/${table.name}s/\${id}`, item).toPromise()
|
||||||
|
}
|
||||||
|
#end if
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#end for
|
#end for
|
||||||
|
@ -5,7 +5,7 @@ import { UserCreds } from './userCreds'
|
|||||||
import jwt_decode from 'jwt-decode'
|
import jwt_decode from 'jwt-decode'
|
||||||
import { Observable, interval, Subject, Subscription } from 'rxjs'
|
import { Observable, interval, Subject, Subscription } from 'rxjs'
|
||||||
import { map, takeWhile } from 'rxjs/operators'
|
import { map, takeWhile } from 'rxjs/operators'
|
||||||
import { authserviceBaseUrl } from './config'
|
import { authserviceBaseUrl, applicationId } from './config'
|
||||||
|
|
||||||
|
|
||||||
interface TokenTuple {
|
interface TokenTuple {
|
||||||
@ -66,7 +66,7 @@ export class TokenService {
|
|||||||
async login(login: string, password: string) : Promise<void> {
|
async login(login: string, password: string) : Promise<void> {
|
||||||
this.messageService.add(`TokenService: trying to login and obtain token`)
|
this.messageService.add(`TokenService: trying to login and obtain token`)
|
||||||
const userCreds : UserCreds = {
|
const userCreds : UserCreds = {
|
||||||
"application": "hv2",
|
"application": applicationId,
|
||||||
"login": login,
|
"login": login,
|
||||||
"password": password
|
"password": password
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user