summaryrefslogtreecommitdiff
path: root/libeufin/iso20022.rst
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-06-24 18:08:25 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-06-24 18:08:25 +0530
commite248817bfa27291c9104c7acd92e46f13fc6b52b (patch)
treea75cc103a99ff5c3666077a5156693172cccd105 /libeufin/iso20022.rst
parent9f5b5a7ed93a8f9f42260a524f17a02f6f1d8b66 (diff)
downloaddocs-e248817bfa27291c9104c7acd92e46f13fc6b52b.tar.gz
docs-e248817bfa27291c9104c7acd92e46f13fc6b52b.tar.bz2
docs-e248817bfa27291c9104c7acd92e46f13fc6b52b.zip
docs
Diffstat (limited to 'libeufin/iso20022.rst')
-rw-r--r--libeufin/iso20022.rst84
1 files changed, 65 insertions, 19 deletions
diff --git a/libeufin/iso20022.rst b/libeufin/iso20022.rst
index bc9f5901..304bd0d8 100644
--- a/libeufin/iso20022.rst
+++ b/libeufin/iso20022.rst
@@ -7,35 +7,81 @@ validation subset) of the schema.
Documentation for message fields can be viewed at https://www.iso20022.org/standardsrepository
+The primary syntax for ISO 20022 messages is XML. To avoid LibEuFin clients
+having to deal with XML, we define a mapping from ISO 20022 messages into JSON.
+
+The specifics of this mapping are:
+
+ * The JSON should be "idiomatic" and easy to process
+ * When possible, the highly nested structures of ISO 20022 should be flattened
+ * It must be possible round-trip between the LibEuFin JSON and ISO 20022
+ XML messages. The mapping of message types is not 1-to-1, as some ISO 20022 messages are
+ very similar and can be mapped to the same JSON structure.
+ * JSON-mapped messages are not explicitly versioned. Instead, changes
+ are made in a backwards-compatible way, possibly preserving old versions
+ of message elements in the same schema.
+
Cash Management (camt)
======================
-camt.052: Bank to Customer Account Report
------------------------------------------
+LibEuFin combines camt.052, camt.053 and camt.054, as they essentially
+have the same structure and serve the same purpose: Reporting transactions
+on a customer's bank account.
+
+.. code-block:: typescript
+
+ interface CashManagementResponseMessage {
+ // ISO: MessageIdentification
+ messageId: string;
+
+ messageType: "report" | "statement" | "notification";
+
+ // ISO: CreationDateTime
+ creationDateTime: string;
+
+ entries: Entry[];
+
+ }
+
+ interface Entry {
+ transactions: Transaction[];
+ }
+
+ interface Transaction {
+ creditDebitIndicator: "credit" | "debit";
+ amount: string;
+ currency: string;
+
+ bookingDate?: string;
+ valueDate?: string;
-* pending and booked transaction
+ accountServicerRef?: string;
-Schema versions:
+ bankTransactionCode: BankTransactionCode;
-* GLS uses camt.052.001.02
+ details: TransactionDetails[];
+ }
-.. code-block:: none
+ interface TransactionDetails {
+ creditDebitIndicator: "credit" | "debit";
+ amount: string;
+ currency: string;
- + Document/BkToCstmrAcctRpt
- ++ GroupHeader [1..1]
- ++ Report [1..*]
- +++ Account [1..1]
- +++ Balance [1..*]
- +++ Entry [1..*]
- ++++ Amount [1..1]
- ++++ Status [1..1]
- ++++ EntryDetails [1..1]
+ // Referenced message ID
+ messageId: string;
+ endToEndId: string;
+ paymentIdentificationId?: string;
-camt.053: Bank to Customer Statement
-------------------------------------
+ bankTransactionCode: BankTransactionCode;
+ }
-* only booked transactions
-* only for the last day (?)
+ interface BankTransactionCode {
+ domain?: string;
+ family?: string;
+ subfamily?: string;
+ proprietaryIssuer?: string;
+ proprietaryCode?: string;
+ }