A basic contract to illustrate and model the privacy implications of financial/PSD2 data in a STRM schema.
In this example, we require account names (probably direct PII) to have the highest purpose value.
Event contract
{
"is_public": true,
"key_field": "paidFromAccountNumber",
"metadata": {
"create_time": "2022-03-11T13:17:55Z",
"description": "A basic contract to illustrate and model the privacy implications of financial/PSD2 data in a STRM schema. \n\nIn this example, we require account names (probably direct PII) to have the highest purpose value.",
"icon_uri": "https://cdn-icons.flaticon.com/png/512/781/premium/781831.png?token=exp=1647000827~hmac=4855831be67501bdd8559232021f9bf8",
"industries": [
"fintech",
"finance"
],
"title": "A financial transaction (PSD2) example contract."
},
"pii_fields": {
"paidFromAccountName": 2,
"paidFromAccountNumber": 1,
"paidToAccountName": 2,
"paidToAccountNumber": 1
},
"ref": {
"handle": "strm-demo",
"name": "PSD2-example-contract",
"version": "1.0.0"
},
"schema_ref": {
"handle": "strm-demo",
"name": "PSD2-example-schema",
"version": "1.0.0"
},
"state": "ACTIVE"
}
Serialization schema
{
"type": "record",
"name": "Psd2Example",
"namespace": "StrmDemo.Psd2ExampleSchema.v1_0_0",
"fields": [
{
"name": "strmMeta",
"type": {
"type": "record",
"name": "strmMeta",
"namespace": "StrmDemo.Psd2ExampleSchema.v1_0_0.strmmeta",
"fields": [
{
"name": "eventContractRef",
"type": "string"
},
{
"name": "nonce",
"type": [
"null",
"int"
],
"default": null
},
{
"name": "timestamp",
"type": [
"null",
"long"
],
"default": null
},
{
"name": "keyLink",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "billingId",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "consentLevels",
"type": {
"type": "array",
"items": "int"
}
}
]
}
},
{
"name": "paidFromAccountNumber",
"type": [
"null",
"string"
],
"doc": "the account the transaction originates from",
"default": null
},
{
"name": "paidFromAccountName",
"type": [
"null",
"string"
],
"doc": "the name of the transaction origin account",
"default": null
},
{
"name": "description",
"type": [
"null",
"string"
],
"doc": "the transaction description",
"default": null
},
{
"name": "paidToAccountNumber",
"type": [
"null",
"string"
],
"doc": "the account the transaction was added to",
"default": null
},
{
"name": "paidToAccountName",
"type": [
"null",
"string"
],
"doc": "the name of the account the transaction was added to",
"default": null
},
{
"name": "currency",
"type": [
"null",
"int"
],
"default": null
},
{
"name": "amount",
"type": [
"null",
{
"type": "record",
"name": "amount",
"namespace": "StrmDemo.Psd2ExampleSchema.v1_0_0.amount",
"fields": [
{
"name": "whole",
"type": [
"null",
"int"
],
"default": null
},
{
"name": "decimal",
"type": [
"null",
"int"
],
"default": null
}
]
}
],
"doc": "the transaction amount. To define this as simple schema, we separate the whole and decimal point.",
"default": null
}
]
}