mirror of
https://github.com/dancojocaru2000/foxbank.git
synced 2025-02-22 23:39:36 +02:00
Added documentation for accounts endpoints
This commit is contained in:
parent
31511f6004
commit
17d1cb2400
1 changed files with 4 additions and 0 deletions
|
@ -24,12 +24,14 @@ class MetaAccountTypesSchema(Schema):
|
||||||
@bp.get('/meta/currencies')
|
@bp.get('/meta/currencies')
|
||||||
@bp.response(200, MetaCurrenciesSchema)
|
@bp.response(200, MetaCurrenciesSchema)
|
||||||
def get_valid_currencies():
|
def get_valid_currencies():
|
||||||
|
"""Get valid account currencies"""
|
||||||
return returns.success(currencies=VALID_CURRENCIES)
|
return returns.success(currencies=VALID_CURRENCIES)
|
||||||
|
|
||||||
|
|
||||||
@bp.get('/meta/account_types')
|
@bp.get('/meta/account_types')
|
||||||
@bp.response(200, MetaAccountTypesSchema)
|
@bp.response(200, MetaAccountTypesSchema)
|
||||||
def get_valid_account_types():
|
def get_valid_account_types():
|
||||||
|
"""Get valid account types"""
|
||||||
return returns.success(account_types=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.response(401, returns.ErrorSchema, description='Login failure')
|
||||||
@bp.doc(security=[{'Token': []}])
|
@bp.doc(security=[{'Token': []}])
|
||||||
def get_account_id(account_id: int):
|
def get_account_id(account_id: int):
|
||||||
|
"""Get account by id"""
|
||||||
account = db_utils.get_account(account_id=account_id)
|
account = db_utils.get_account(account_id=account_id)
|
||||||
if account is None:
|
if account is None:
|
||||||
return returns.abort(returns.NOT_FOUND)
|
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.response(401, returns.ErrorSchema, description='Login failure')
|
||||||
@bp.doc(security=[{'Token': []}])
|
@bp.doc(security=[{'Token': []}])
|
||||||
def get_account_iban(iban: str):
|
def get_account_iban(iban: str):
|
||||||
|
"""Get account by IBAN"""
|
||||||
account = db_utils.get_account(iban=iban)
|
account = db_utils.get_account(iban=iban)
|
||||||
if account is None:
|
if account is None:
|
||||||
return returns.abort(returns.NOT_FOUND)
|
return returns.abort(returns.NOT_FOUND)
|
||||||
|
|
Loading…
Add table
Reference in a new issue