This simple data contract shows how the privacy implications of a basic order event would be modelled in a STRM contract. We apply a validation to the user_id field (by regex: should match a UUID).
Event contract
{
"is_public": true,
"key_field": "user_id",
"metadata": {
"create_time": "2022-03-11T09:53:10Z",
"description": "This simple data contract shows how the privacy implications of a basic order event would be modelled in a STRM contract. We apply a validation to the user_id field (by regex: should match a UUID).",
"domains": [
"analytics"
],
"icon_uri": "https://play-lh.googleusercontent.com/AX4QaQ8NbV3HnSBA7AnZB7F9xj0AsDacwPW09Zp1ZXaxqjzua8wGQIHczgfcFIKsbb4",
"industries": [
"e-commerce",
"online retail"
],
"title": "Online Retail demo contract (orders by Instacart)"
},
"pii_fields": {
"session_id": 1,
"user_id": 2
},
"ref": {
"handle": "strm-demo",
"name": "ecommerce-orders-instacart-contract",
"version": "1.0.0"
},
"schema_ref": {
"handle": "strm-demo",
"name": "ecommerce-orders-instacart",
"version": "1.0.0"
},
"state": "ACTIVE",
"validations": [
{
"field": "user_id",
"type": "regex",
"value": "\\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b"
}
]
}
Serialization schema
{
"type": "record",
"name": "EcommerceOrdersInstacart",
"namespace": "StrmDemo.EcommerceOrdersInstacart.v1_0_0",
"fields": [
{
"name": "strmMeta",
"type": {
"type": "record",
"name": "strmMeta",
"namespace": "StrmDemo.EcommerceOrdersInstacart.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": "session_id",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "order_id",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "user_id",
"type": [
"null",
"string"
],
"default": null
},
{
"name": "product_id",
"type": {
"type": "array",
"items": [
"null",
"int"
]
}
}
]
}