1
0
Fork 0
mirror of https://github.com/dancojocaru2000/foxbank.git synced 2025-02-22 17:09:35 +02:00

Added documentation for accounts endpoints

This commit is contained in:
Kenneth Bruen 2021-12-29 20:23:28 +02:00
parent 31511f6004
commit 17d1cb2400
Signed by: kbruen
GPG key ID: C1980A470C3EE5B1

View file

@ -24,12 +24,14 @@ class MetaAccountTypesSchema(Schema):
@bp.get('/meta/currencies')
@bp.response(200, MetaCurrenciesSchema)
def get_valid_currencies():
"""Get valid account currencies"""
return returns.success(currencies=VALID_CURRENCIES)
@bp.get('/meta/account_types')
@bp.response(200, MetaAccountTypesSchema)
def get_valid_account_types():
"""Get valid account types"""
return returns.success(account_types=ACCOUNT_TYPES)
@ -38,6 +40,7 @@ def get_valid_account_types():
@bp.response(401, returns.ErrorSchema, description='Login failure')
@bp.doc(security=[{'Token': []}])
def get_account_id(account_id: int):
"""Get account by id"""
account = db_utils.get_account(account_id=account_id)
if account is None:
return returns.abort(returns.NOT_FOUND)
@ -52,6 +55,7 @@ def get_account_id(account_id: int):
@bp.response(401, returns.ErrorSchema, description='Login failure')
@bp.doc(security=[{'Token': []}])
def get_account_iban(iban: str):
"""Get account by IBAN"""
account = db_utils.get_account(iban=iban)
if account is None:
return returns.abort(returns.NOT_FOUND)