commit fd7c9f791bedfbf79961f2cbd2aa4cb50e2aaee3
parent b17d803571ea185b032d43af0d2a25aa3d208397
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date: Sat, 25 May 2024 15:22:59 +0200
update donau api 3
Diffstat:
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/core/api-donau.rst b/core/api-donau.rst
@@ -340,7 +340,6 @@ corresponding charity_id by the Donau.
**Request:** `IssueReceiptsRequest`
**Response:**
-
:http:statuscode:`200 OK`:
The request was successful, and the response is a `BSDonationReceipts`.
:http:statuscode:`403 Forbidden`:
@@ -464,12 +463,14 @@ corresponding charity_id by the Donau.
.. _donau_submit:
----------------
-Submit receipts
----------------
+------------------
+Donation statement
+------------------
Inspired by the Taler exchange :ref:`Deposit<deposit-par>`.
+Donation statement operations are requested by a donor.
+
.. http:POST:: /submit
Send in donation receipts for the current or one of the past fiscal years.
@@ -480,8 +481,8 @@ Inspired by the Taler exchange :ref:`Deposit<deposit-par>`.
**Response:**
- :http:statuscode:`200 OK`:
- The request was successful, and the response is a `SubmitResponse`.
+ :http:statuscode:`201 CREATED`:
+ The request was successful, and the created `DonationStatement` is stored.
:http:statuscode:`403 Forbidden`:
One of the signatures is invalid. This response comes with a standard `ErrorDetail` response.
:http:statuscode:`404 Not found`:
@@ -533,27 +534,31 @@ Inspired by the Taler exchange :ref:`Deposit<deposit-par>`.
cs_signature_s: Cs25519Scalar:
}
+.. http:GET:: /donation-statement/$YEAR/$HASH_DONOR_ID
+
+ Get the donation statement for a specific year and donor.
+
+ **Request:**
+ **Response:**
- .. ts:def:: SubmitResponse
+ :http:statuscode:`200 OK`:
+ The request was successful, and the response is a `DonationStatement`.
+ :http:statuscode:`403 Forbidden`:
+ One of the signatures is invalid. This response comes with a standard `ErrorDetail` response.
+ :http:statuscode:`404 Not found`:
+ Either the donor or the year or the corresponding donation statement was not found.
+ This response comes with a standard `ErrorDetail` response.
+
+ **Details:**
+ .. ts:def:: DonationStatement
- interface SubmitResponse{
- // *accepted* total
+ interface DonationStatement {
total: Amount;
// signature over h_donor_tax_id, total, donation_year
signature: EddsaSignature;
}
-
-
- .. ts:def:: DonationUnitExpiredMessage
-
- interface DonationUnitExpiredMessage{
- h_donation_unit_pub: HashCode;
- donau_pub: EddsaPublicKey;
- donau_sig: EddsaSignature;
- }
-
-
+
.. _donau_charity:
---------------------------------------------