Skip to content

Instantly share code, notes, and snippets.

@phspires
Last active February 9, 2023 11:26
Show Gist options
  • Save phspires/6f86b59a0b11c78a93266464685dcd8b to your computer and use it in GitHub Desktop.
Save phspires/6f86b59a0b11c78a93266464685dcd8b to your computer and use it in GitHub Desktop.
Tiko Conceptual Data Model
{
"id": "378fd2af-99dc-4597-b193-b1493e5a350f",
"name": "Rafiki",
"sources": [
{
"id": "0cccd803-36f7-459b-b2e7-0b8b1eeb4abb",
"name": "default",
"kind": {
"kind": "AmlEditor"
},
"content": [
"#",
"# Empty",
"#"
],
"tables": [],
"relations": [],
"createdAt": 1675436096673,
"updatedAt": 1675783901935
},
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"name": "Rafiki",
"kind": {
"kind": "AmlEditor"
},
"content": [
"#",
"# Rafiki",
"#",
"",
"rafiki",
" id uuid pk",
" flg_contact_consent boolean",
" flg_data_privacy boolean",
" flg_merged_contact bool",
" flg_enrolled bool",
" preferred_language(language1,language2) text ",
" user_awareness_method(Friend,TikoPro,Facebook,etc) text",
" flg_has_voice bool,",
" last_service_at time",
" status(Active,Inactive,Blocked,Terminated) text",
" created_at timestamp=now()",
"",
"rafiki_pii",
" id fk rafiki.id",
" phone_number text unique",
" full_name text",
" first_name text",
" last_name text",
" gender(Male,Female,TransFemale,TransMale) text",
" year_of_birth int4",
" month_of_birth int2",
" sexual_orientation(hetero,LGBTIQA+) text",
" voice_url text",
" location_id fk location.id",
" created_at timestamp=now()",
"",
"tiko_card",
" id uuid pk",
" tiko_card_number text",
" tiko_card_design_id fk tiko_card_design.id",
" flg_terminated bool",
" created_at timestamp=now()",
"",
"tiko_card_membership",
" id uuid",
" tiko_card_id fk tiko_card.id",
" rafiki_id fk rafiki_pii.id",
" assigned_at",
" flg_terminat bool",
" created_at timestamp=now()",
"",
"#",
"# Enrolments",
"#",
"",
"mobiliser_enrolment",
" id uuid pk",
" trigger_value text",
" rafiki_id fk rafiki.id",
" connector_id fk connector.id",
" enrolment_location_id fk location.id",
" enrolment_path(TikoCard,App) text",
" flg_enrolled_without_voice bool",
" flg_blocklisted bool",
" created_at timestamp=now()",
"",
"peer_enrolment",
" id uuid pk",
" rafiki_id fk rafiki.id",
" peer_rafiki_id fk rafiki.id",
" enrolment_location_id fk location.id",
" flg_blocklisted bool",
" created_at timestamp=now()",
"",
"self_enrolment",
" id uuid pk",
" rafiki_id fk rafiki.id",
" trigger_value text",
" enrolment_path(SMS,Facebook,Telegram,Messenger) text",
" enrolment_location_id fk location.id",
" flg_blocklisted bool",
" created_at timestamp=now()",
"",
"group_enrolment",
" id uuid pk",
" rafiki_id fk rafiki.id",
" connector_id fk connector.id",
" enrolment_location_id fk location.id",
" group_enrolment_code text",
" flg_blocklisted bool",
" created_at timestamp=now()",
""
],
"tables": [
{
"schema": "",
"table": "group_enrolment",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "connector_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_location_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "group_enrolment_code",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_blocklisted",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "mobiliser_enrolment",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "trigger_value",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "connector_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_location_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_path(TikoCard,App)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_enrolled_without_voice",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_blocklisted",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "peer_enrolment",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "peer_rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_location_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_blocklisted",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "rafiki",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_contact_consent",
"type": "boolean",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_data_privacy",
"type": "boolean",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_merged_contact",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_enrolled",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "preferred_language(language1,language2)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "user_awareness_method(Friend,TikoPro,Facebook,etc)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_has_voice",
"type": "bool,",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "last_service_at",
"type": "time",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "status(Active,Inactive,Blocked,Terminated)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "rafiki_pii",
"columns": [
{
"name": "id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "phone_number",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "full_name",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "first_name",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "last_name",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "gender(Male,Female,TransFemale,TransMale)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "year_of_birth",
"type": "int4",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "month_of_birth",
"type": "int2",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "sexual_orientation(hetero,LGBTIQA+)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "voice_url",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "location_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"uniques": [
{
"name": "rafiki_pii_phone_number_unique_az",
"columns": [
"phone_number"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "self_enrolment",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "trigger_value",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_path(SMS,Facebook,Telegram,Messenger)",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "enrolment_location_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_blocklisted",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "tiko_card",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_number",
"type": "text",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_design_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_terminated",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"schema": "",
"table": "tiko_card_membership",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "assigned_at",
"type": "unknown",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "flg_terminat",
"type": "bool",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"relations": [
{
"name": "rafiki_pii_location_id_fk_az",
"src": {
"table": ".rafiki_pii",
"column": "location_id"
},
"ref": {
"table": ".location",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "rafiki_pii_id_fk_az",
"src": {
"table": ".rafiki_pii",
"column": "id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_tiko_card_design_id_fk_az",
"src": {
"table": ".tiko_card",
"column": "tiko_card_design_id"
},
"ref": {
"table": ".tiko_card_design",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_membership_rafiki_id_fk_az",
"src": {
"table": ".tiko_card_membership",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki_pii",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "tiko_card_membership_tiko_card_id_fk_az",
"src": {
"table": ".tiko_card_membership",
"column": "tiko_card_id"
},
"ref": {
"table": ".tiko_card",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "mobiliser_enrolment_enrolment_location_id_fk_az",
"src": {
"table": ".mobiliser_enrolment",
"column": "enrolment_location_id"
},
"ref": {
"table": ".location",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "mobiliser_enrolment_connector_id_fk_az",
"src": {
"table": ".mobiliser_enrolment",
"column": "connector_id"
},
"ref": {
"table": ".connector",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "mobiliser_enrolment_rafiki_id_fk_az",
"src": {
"table": ".mobiliser_enrolment",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "peer_enrolment_enrolment_location_id_fk_az",
"src": {
"table": ".peer_enrolment",
"column": "enrolment_location_id"
},
"ref": {
"table": ".location",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "peer_enrolment_peer_rafiki_id_fk_az",
"src": {
"table": ".peer_enrolment",
"column": "peer_rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "peer_enrolment_rafiki_id_fk_az",
"src": {
"table": ".peer_enrolment",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "self_enrolment_enrolment_location_id_fk_az",
"src": {
"table": ".self_enrolment",
"column": "enrolment_location_id"
},
"ref": {
"table": ".location",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "self_enrolment_rafiki_id_fk_az",
"src": {
"table": ".self_enrolment",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "group_enrolment_enrolment_location_id_fk_az",
"src": {
"table": ".group_enrolment",
"column": "enrolment_location_id"
},
"ref": {
"table": ".location",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "group_enrolment_connector_id_fk_az",
"src": {
"table": ".group_enrolment",
"column": "connector_id"
},
"ref": {
"table": ".connector",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
},
{
"name": "group_enrolment_rafiki_id_fk_az",
"src": {
"table": ".group_enrolment",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "89019f64-f02e-4b80-a9d6-3a47523feafa",
"lines": []
}
]
}
],
"createdAt": 1675783981940,
"updatedAt": 1675941452116
},
{
"id": "fea3e6ba-dff8-41cf-8077-31215cb58832",
"name": "Connect",
"kind": {
"kind": "AmlEditor"
},
"content": [],
"tables": [],
"relations": [],
"createdAt": 1675941532118,
"updatedAt": 1675941532118
},
{
"id": "0f8b04be-853a-4c94-827c-c2c955eaf457",
"name": "Opportunity Implementation",
"kind": {
"kind": "AmlEditor"
},
"content": [],
"tables": [],
"relations": [],
"createdAt": 1675941582131,
"updatedAt": 1675941582131
},
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"name": "Offer Validation",
"kind": {
"kind": "AmlEditor"
},
"content": [
"#",
"#Offers ",
"#",
"",
"offer",
" rafiki_id fk rafiki.id",
" tiko_connect_id fk tiko_connect.id",
" product_id fk product.id",
" created_at timestamp=now()",
" validation_code text",
" transport_id fk transport.id",
" program_id fk program.id",
" flg_blocklisted bool"
],
"tables": [
{
"schema": "",
"table": "offer",
"columns": [
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "tiko_connect_id",
"type": "unknown",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "product_id",
"type": "unknown",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "validation_code",
"type": "text",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "transport_id",
"type": "unknown",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "program_id",
"type": "unknown",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "flg_blocklisted",
"type": "bool",
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
}
],
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
}
],
"relations": [
{
"name": "offer_program_id_fk_az",
"src": {
"table": ".offer",
"column": "program_id"
},
"ref": {
"table": ".program",
"column": "id"
},
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "offer_transport_id_fk_az",
"src": {
"table": ".offer",
"column": "transport_id"
},
"ref": {
"table": ".transport",
"column": "id"
},
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "offer_product_id_fk_az",
"src": {
"table": ".offer",
"column": "product_id"
},
"ref": {
"table": ".product",
"column": "id"
},
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "offer_tiko_connect_id_fk_az",
"src": {
"table": ".offer",
"column": "tiko_connect_id"
},
"ref": {
"table": ".tiko_connect",
"column": "id"
},
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
},
{
"name": "offer_rafiki_id_fk_az",
"src": {
"table": ".offer",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "8f723a7d-b6d9-4a5b-b78f-b39e6c6f6ca1",
"lines": []
}
]
}
],
"createdAt": 1675941592119,
"updatedAt": 1675941592119
},
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"name": "Location",
"kind": {
"kind": "AmlEditor"
},
"content": [
"#",
"# Location",
"#",
"",
"location ",
" id uuid pk",
" location_point geopoint",
" country text",
" postal_code text",
" address_line_1 text",
" address_line_2 text",
" street_number",
" unit_number",
" location_level_1_id fk location_levels.id",
" location_level_2_id fk location_levels.id",
" location_level_n_id fk location_levels.id",
" created_at timestamp=now()",
"",
"location_levels",
" id uuid pk",
" name text",
" description text",
" parent_location_id fk location_levels.id"
],
"tables": [
{
"schema": "",
"table": "location",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_point",
"type": "geopoint",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "country",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "postal_code",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "address_line_1",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "address_line_2",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "street_number",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "unit_number",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_level_1_id",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_level_2_id",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_level_n_id",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"schema": "",
"table": "location_levels",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "name",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "description",
"type": "text",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "parent_location_id",
"type": "unknown",
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
}
],
"relations": [
{
"name": "location_location_level_n_id_fk_az",
"src": {
"table": ".location",
"column": "location_level_n_id"
},
"ref": {
"table": ".location_levels",
"column": "id"
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_location_level_2_id_fk_az",
"src": {
"table": ".location",
"column": "location_level_2_id"
},
"ref": {
"table": ".location_levels",
"column": "id"
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_location_level_1_id_fk_az",
"src": {
"table": ".location",
"column": "location_level_1_id"
},
"ref": {
"table": ".location_levels",
"column": "id"
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
},
{
"name": "location_levels_parent_location_id_fk_az",
"src": {
"table": ".location_levels",
"column": "parent_location_id"
},
"ref": {
"table": ".location_levels",
"column": "id"
},
"origins": [
{
"id": "efe77407-4e8e-46fa-98de-f123281a0360",
"lines": []
}
]
}
],
"createdAt": 1675941652119,
"updatedAt": 1675941652119
},
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"name": "Loyalty",
"kind": {
"kind": "AmlEditor"
},
"content": [
"#",
"# Transactions",
"#",
"",
"transactions",
" id uuid pk",
" rafiki_account_id fk rafiki_account.id",
" destination_account_id",
" transaction_description text",
" transaction_type(credit,debit) text",
" amount int",
" balance",
" created_at timestamp=now()",
"",
"rafiki_account",
" id uuid pk",
" rafiki_id fk rafiki.id",
" balance int",
" warning_balance int "
],
"tables": [
{
"schema": "",
"table": "rafiki_account",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "rafiki_id",
"type": "unknown",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "balance",
"type": "int",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "warning_balance",
"type": "int",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"schema": "",
"table": "transactions",
"columns": [
{
"name": "id",
"type": "uuid",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "rafiki_account_id",
"type": "unknown",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "destination_account_id",
"type": "unknown",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "transaction_description",
"type": "text",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "transaction_type(credit,debit)",
"type": "text",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "amount",
"type": "int",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "balance",
"type": "unknown",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "created_at",
"type": "timestamp",
"default": "now()",
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
}
],
"primaryKey": {
"columns": [
"id"
],
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
}
],
"relations": [
{
"name": "transactions_rafiki_account_id_fk_az",
"src": {
"table": ".transactions",
"column": "rafiki_account_id"
},
"ref": {
"table": ".rafiki_account",
"column": "id"
},
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
},
{
"name": "rafiki_account_rafiki_id_fk_az",
"src": {
"table": ".rafiki_account",
"column": "rafiki_id"
},
"ref": {
"table": ".rafiki",
"column": "id"
},
"origins": [
{
"id": "c5e903d7-6ee2-427b-b62e-3598c3745c8d",
"lines": []
}
]
}
],
"createdAt": 1675941682119,
"updatedAt": 1675941682119
}
],
"usedLayout": "initial layout",
"layouts": {
"initial layout": {
"canvas": {
"position": {
"left": 0,
"top": 0
},
"zoom": 0.6254890746726067
},
"tables": [
{
"id": ".rafiki_account",
"position": {
"left": 1060,
"top": 430
},
"size": {
"width": 189.74999170073494,
"height": 141.0000950756198
},
"color": "yellow",
"columns": [
"id",
"rafiki_id",
"balance",
"warning_balance"
]
},
{
"id": ".transactions",
"position": {
"left": 700,
"top": 130
},
"size": {
"width": 292.2968810537344,
"height": 237.0000501250186
},
"color": "teal",
"columns": [
"id",
"rafiki_account_id",
"destination_account_id",
"transaction_description",
"transaction_type(credit,debit)",
"amount",
"balance"
]
},
{
"id": ".location",
"position": {
"left": 2240,
"top": 880
},
"size": {
"width": 253.18748772779122,
"height": 333.0000051744173
},
"color": "rose",
"columns": [
"id",
"location_level_1_id",
"location_level_2_id",
"location_level_n_id",
"location_point",
"country",
"postal_code",
"address_line_1",
"address_line_2",
"street_number",
"unit_number"
]
},
{
"id": ".location_levels",
"position": {
"left": 2860,
"top": 920
},
"size": {
"width": 248.67186344375696,
"height": 141.0000950756198
},
"color": "rose",
"columns": [
"id",
"parent_location_id",
"name",
"description"
]
},
{
"id": ".offer",
"position": {
"left": 1450,
"top": 30
},
"size": {
"width": 228.7499868642878,
"height": 237.0000501250186
},
"color": "yellow",
"columns": [
"rafiki_id",
"tiko_connect_id",
"product_id",
"validation_code",
"transport_id",
"program_id",
"flg_blocklisted"
]
},
{
"id": ".tiko_card_membership",
"position": {
"left": 2500,
"top": 440
},
"size": {
"width": 244.65622997578194,
"height": 189.0000726003192
},
"color": "green",
"columns": [
"id",
"tiko_card_id",
"rafiki_id",
"assigned_at",
"flg_terminat",
"created_at"
]
},
{
"id": ".tiko_card",
"position": {
"left": 2800,
"top": 440
},
"size": {
"width": 259.07804648178444,
"height": 165.00003013903105
},
"color": "green",
"columns": [
"id",
"tiko_card_number",
"tiko_card_design_id",
"flg_terminated",
"created_at"
]
},
{
"id": ".mobiliser_enrolment",
"position": {
"left": 970,
"top": 840
},
"size": {
"width": 300.92187030283657,
"height": 260.99993148949136
},
"color": "indigo",
"columns": [
"id",
"trigger_value",
"rafiki_id",
"connector_id",
"enrolment_location_id",
"enrolment_path(TikoCard,App)",
"flg_enrolled_without_voice",
"flg_blocklisted",
"created_at"
]
},
{
"id": ".self_enrolment",
"position": {
"left": 800,
"top": 1130
},
"size": {
"width": 465.2031401504969,
"height": 212.99995396479196
},
"color": "green",
"columns": [
"id",
"rafiki_id",
"trigger_value",
"enrolment_path(SMS,Facebook,Telegram,Messenger)",
"enrolment_location_id",
"flg_blocklisted",
"created_at"
]
},
{
"id": ".group_enrolment",
"position": {
"left": 990,
"top": 1380
},
"size": {
"width": 275.0468220071225,
"height": 212.99995396479196
},
"color": "emerald",
"columns": [
"id",
"rafiki_id",
"connector_id",
"enrolment_location_id",
"group_enrolment_code",
"flg_blocklisted",
"created_at"
]
},
{
"id": ".peer_enrolment",
"position": {
"left": 990,
"top": 1630
},
"size": {
"width": 275.0468220071225,
"height": 189.0000726003192
},
"color": "teal",
"columns": [
"id",
"rafiki_id",
"peer_rafiki_id",
"enrolment_location_id",
"flg_blocklisted",
"created_at"
]
},
{
"id": ".rafiki_pii",
"position": {
"left": 1990,
"top": 440
},
"size": {
"width": 403.34368140341354,
"height": 333.0000051744173
},
"color": "yellow",
"columns": [
"id",
"phone_number",
"full_name",
"first_name",
"last_name",
"gender(Male,Female,TransFemale,TransMale)",
"year_of_birth",
"month_of_birth",
"sexual_orientation(hetero,LGBTIQA+)",
"voice_url",
"location_id",
"created_at"
]
},
{
"id": ".rafiki",
"position": {
"left": 1440,
"top": 440
},
"size": {
"width": 473.6563196459763,
"height": 309.0000164120676
},
"color": "yellow",
"columns": [
"id",
"flg_contact_consent",
"flg_data_privacy",
"flg_merged_contact",
"flg_enrolled",
"preferred_language(language1,language2)",
"user_awareness_method(Friend,TikoPro,Facebook,etc)",
"flg_has_voice",
"last_service_at",
"status(Active,Inactive,Blocked,Terminated)",
"created_at"
]
}
],
"createdAt": 1675436096673,
"updatedAt": 1675941802122
}
},
"settings": {
"findPath": {
"ignoredColumns": "created_.+, updated_.+"
},
"columnBasicTypes": false
},
"createdAt": 1675783956898,
"updatedAt": 1675941743043,
"version": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment