From 823f1a1b17212b26c9062d185b8516fe906aeaae Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 3 Jul 2020 00:21:18 +0530 Subject: notes on amount handling --- libeufin/iso20022.rst | 77 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) (limited to 'libeufin') diff --git a/libeufin/iso20022.rst b/libeufin/iso20022.rst index aa6df201..d87098a3 100644 --- a/libeufin/iso20022.rst +++ b/libeufin/iso20022.rst @@ -32,15 +32,84 @@ on a customer's bank account. We also flatten the hierarchy a bit and only have entries ("money movement in one go") and transactions. +Types of amounts in camt messages +--------------------------------- + +* Entry amount + + * ISO 20022: Mandatory, with debit/credit indicator. Indicates money + moving in/out of the account in the account's currency. + * LibEuFin: Same. + +* Entry transaction amount + + * ISO 20022: Optional, direction-less. Amount of money + moving between the debtor and creditor bank, may not be + in the account's currency (but the "native" currency between + the two banks). + * LibEuFin: Same. + +* Entry instructed amount + + * ISO 20022: Optional, direction-less. Amount of money specified in the + payment initiation message. Usually only specified when the amount is in a + different currency than the account currency. + * LibEuFin: Same. + +* Entry counter value amount + + * ISO 20022: Optional, direction-less. Amount in the account's + currency before charges. + * LibEuFin: Same. + +* Entry announced posting amount + + * (not used by LibEuFin) + +* EntryDetails amount + + * ISO 20022: Optional, with debit-credit indicator. Same as "Entry amount" + but for EntryDetails (= logical transactions). + * LibEuFin: Always present. In Swiss camt messages, the element is always + present. In German/Swedish/... camt, we take the "Entry amount" for + non-batch entries, whereas in batch entries we use the "EntryDetails + transaction amount" with the same debit credit indicator as the whole + entry, which by local rules is always in the bank account currency. + +* EntryDetails (transaction / instructed / counter value) amount + + * ISO 20022: Optional, direction-less. Same as "Entry ... amount" + but for EntryDetails (= logical transactions). + * Same. + +* EntryDetails announced posting amount + + * (not used by LibEuFin) + + +LibEuFin schema for account history +----------------------------------- + +FIXME: This is not complete yet. + .. code-block:: typescript - interface AccountTransactionItem { - // LibEuFin-internal identifier for the transaction - nexusTransactionId: string; + interface NexusTransactionsReponse { + entries: NexusAccountEntryItem[]; + } - // Link to the entry that contains the transaction + interface NexusAccountEntryItem { nexusEntryId: string; + // Serial number that will increase with each update + // to the entry. + nexusStatusSequenceId: number; + + entry: AccountEntryItem; + } + + interface AccountEntryItem { + // At least one of entryId or accountServicerRef // must be non-null entryId?: string; -- cgit v1.2.3