From 918a6ec7a486427f706a3e7c8fcbd563a28f4c4c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 22 Feb 2021 18:53:24 +0100 Subject: [PATCH] make http://localhost/state-balances/ajaxListTransactions wokring and add it to doc --- community_server | 2 +- docu/community-server.api.md | 54 ++++++++++++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/community_server b/community_server index 0a30e2992..8cbfecc98 160000 --- a/community_server +++ b/community_server @@ -1 +1 @@ -Subproject commit 0a30e29924c1cc4e6f8b696aa562362c88182028 +Subproject commit 8cbfecc988d3b4f815daa496c9bff854a6758d99 diff --git a/docu/community-server.api.md b/docu/community-server.api.md index 4b70fc9c4..1368bf11e 100644 --- a/docu/community-server.api.md +++ b/docu/community-server.api.md @@ -4,11 +4,61 @@ In this examples I assume that you use gradido with or docker-compose build on y ## Konto Overview return current account balance -Ajax: + GET http://localhost/state-balances/ajaxGetBalance/-127182 If session is valid, return: +```json {"state":"success","balance":174500} - +``` - balance: Gradido Cent, 4 Nachkommastellen (2 Reserve), 174500 = 17,45 GDD +## List Transactions +List all transactions from logged in user, currently without paging +Ajax: +GET http://localhost/state-balances/ajaxListTransactions/-127182 + +Antwort: +Wenn alles okay: +```json +{"state":"success", "transactions": + [ + { + "name": "Max Mustermann", + "email": "Maxim Mustermann", + "type": "send", + "transaction_id": 2, + "date": "2021-02-19T13:25:36+00:00", + "balance": 1920000, + "memo": "a piece of cake :)", + "pubkey": "038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7" + + } + ], + "transactionExecutingCount": 0, + "count": 1, + "gdtSum": 0 + "timeUsed": 0.04562687873840332 +} +``` + +- name: name of other involved party or empty if unknown (if other party don't belong to group) + - if type is send, name is name of receiver + - if type is receive, name is name of sender + - if type is creation currently I use a static string ("Gradido Akademie) +- email: optional, only if type is send or receive and other user is known +- pubkey: optional, only if type is send or receive and other user isn't known +- type: type of transaction + - creation: user has get gradidos created + - send: user has send another user gradidos + - receiver: user has received gradidos from another user +- transaction_id: id of transaction in db, in stage2 also the hedera sequence number of transaction +- date: date of ordering transaction (booking date) +- balance: Gradido Cent, 4 Nachkommastellen (2 Reserve), 1920000 = 192,00 GDD +- memo: Details about transaction +- pubkey: optional, if other party isn't known, hexadecimal representation of 32 Byte public key of user [0-9a-f] + +- transactionExecutingCount: how many transaction for this user currently pending and waiting for signing +- count: sum of finished transactions user is involved +- gdtSum: sum of gdt of user in cent with 2 places (Nachkommastellen) +- timeUsed: time used for getting data from db in seconds, only for analyse backend performance \ No newline at end of file