frmscoe / tms-service

1 stars 3 forks source link

TMS - entity and account database keys #154

Closed Sandy-at-Tazama closed 5 days ago

Sandy-at-Tazama commented 1 month ago

As a Tazama Operator over a switching ecosystem, I want Tazama to be able to uniquely identify entities and accounts across my ecosystem, So that entity and account identifiers that may be the same within different FSP ecosystems are handled as unique across the switching ecosystem

Current entity identifiers:

Context: https://tazama-lf.slack.com/archives/C05SPK7DR39/p1716967084771519

image

Current account identifiers:

Image

Image

Image

Note This change depends on the changes to implement the Othr objects as arrays as defined here: https://github.com/frmscoe/tms-service/issues/177

Acceptance Criteria

  1. When a debtor or creditor entity identifier is created in data preparation from an incoming pain.001, pain.013, pacs002 or pacs.008 message, the entity identifier that will be used inside the database to uniquely identify the entity must be a combination (concatenation) of the identification scheme as well as the identifier itself, i.e. Othr[0].id + Othr[0].SchmeNm.Prtry (in reverse logical order to maximise sequential uniqueness for indexing purposes)
  2. The concatenated key must be used in the DataCache to uniquely identify the entities out of the rule processors.
  3. The concatenated key must be used as the _id when the entity is posted to the ArangoDB graph database pseudonyms.entities node collection.
  4. When a debtor or creditor account identifier is created in data preparation from an incoming pain.001, pain.013, pacs002 or pacs.008 message, the account identifier that will be used inside the database to uniquely identify the entity must be a combination (concatenation) of the FSP identifier, the identification scheme as well as the identifier itself, i.e. Othr[0].id + Othr[0].SchmeNm.Prtry + DbtrAgt.FinInstnId.ClrSysMmbId.MmbId (in reverse logical order to maximise sequential uniqueness for indexing purposes)
  5. The concatenated key must be used in the DataCache to uniquely identify the accounts out of the rule processors.
  6. The concatenated key must be used as the _id when the account is posted to the ArangoDB graph database pseudonyms.accounts node collection.
  7. Regression testing