libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 674852b959cee5e1824932d2ad0359af1af0d1f3
parent c818278e7bdd3265d80568a79b8ac4fceb21bb35
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Wed, 11 Dec 2019 21:25:05 +0100

testing history

Diffstat:
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 5+----
Msandbox/src/main/python/libeufin-cli | 16++++++++++++++--
2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -239,10 +239,7 @@ fun main() { post("/{id}/history") { val req = call.receive<CustomerHistoryRequest>() - val startDate = DateTime.parse(req.start) - val endDate = DateTime.parse(req.end) - - LOGGER.debug("Fetching history from ${startDate.toString()}, to ${endDate.toString()}") + LOGGER.debug("Fetching history from ${req.start}, to ${req.end}") val customer = findCustomer(call.parameters["id"]) val ret = CustomerHistoryResponse() diff --git a/sandbox/src/main/python/libeufin-cli b/sandbox/src/main/python/libeufin-cli @@ -306,12 +306,24 @@ def new(obj, user_id, partner_id, system_id, host_id, ebics_url): required=False, default=1 ) -def history(obj, user_id): +@click.option( + "--start", + help="starting date for history elements (YYYY-MM-DD)" , + required=False, + default=None +) +@click.option( + "--end", + help="ending date for history elements (YYYY-MM-DD)" , + required=False, + default=None +) +def history(obj, user_id, start, end): url = urljoin(obj["bank_base_url"], f"/{user_id}/history") print(url) try: - resp = post(url, json=dict(start="2000-01-01", end="2999-12-31")) + resp = post(url, json=dict(start=start, end=end)) except Exception: print("Could not reach the bank") return