locale stuff

This commit is contained in:
2021-09-09 18:00:24 +02:00
parent 8276e39a7e
commit 6fcd785be0
16 changed files with 250 additions and 23 deletions

View File

@ -49,3 +49,27 @@
$ref: '#/components/schemas/fee'
security:
- jwt: ['secret']
/v1/account/saldo/{accountId}:
get:
tags: [ "account" ]
summary: Return saldo of the account
operationId: additional_methods.get_account_saldo
parameters:
- name: accountId
in: path
required: true
schema:
type: integer
responses:
'200':
description: get_account_saldo
content:
'application/json':
schema:
type: object
properties:
saldo:
type: number
security:
- jwt: ['secret']

View File

@ -25,3 +25,10 @@ SELECT o.id, o.description, o.amount, o.fee_type, o.startdate, o.enddate
"params": (tenancyId, )
}
)
def get_account_saldo(user, token_info, accountId=None):
return dbGetOne(user, token_info, {
"statement": "SELECT sum(amount) as saldo FROM account_entry_t WHERE account=%s",
"params": (accountId, )
}
)

View File

@ -1244,6 +1244,8 @@ SELECT
,created_at
,amount
FROM account_entry_t
ORDER BY
amount
""",
"params": ()
}

View File

@ -1308,6 +1308,30 @@ paths:
$ref: '#/components/schemas/fee'
security:
- jwt: ['secret']
/v1/account/saldo/{accountId}:
get:
tags: [ "account" ]
summary: Return saldo of the account
operationId: additional_methods.get_account_saldo
parameters:
- name: accountId
in: path
required: true
schema:
type: integer
responses:
'200':
description: get_account_saldo
content:
'application/json':
schema:
type: object
properties:
saldo:
type: number
security:
- jwt: ['secret']
components:
securitySchemes: