Customer Database » History » Version 9
Ryan Supawarapong, 04/01/2026 03:59 AM
| 1 | 1 | Ryan Supawarapong | # Customer Database |
|---|---|---|---|
| 2 | |||
| 3 | 4 | Ryan Supawarapong | |
| 4 | 1 | Ryan Supawarapong | ``` |
| 5 | 9 | Ryan Supawarapong | // Customer database |
| 6 | // Layer 1 |
||
| 7 | 1 | Ryan Supawarapong | // Onboarding |
| 8 | // Customer |
||
| 9 | |||
| 10 | 9 | Ryan Supawarapong | // Separate transaction database |
| 11 | // Transaction: use customer_code from customer_info and asset_id per trade |
||
| 12 | |||
| 13 | 5 | Ryan Supawarapong | // Layer 2 |
| 14 | // Fullname |
||
| 15 | 9 | Ryan Supawarapong | // Customer info: link to onboarding and expose customer_code for transaction database |
| 16 | 5 | Ryan Supawarapong | // customer suite test answer: answer |
| 17 | // suite test id: question and answer |
||
| 18 | |||
| 19 | // Layer 3 |
||
| 20 | // suite test question and answer |
||
| 21 | // Knowledge test |
||
| 22 | |||
| 23 | 1 | Ryan Supawarapong | |
| 24 | // Layer 1 |
||
| 25 | // ---------------------- |
||
| 26 | 5 | Ryan Supawarapong | // Onboarding |
| 27 | 1 | Ryan Supawarapong | Table onboarding { |
| 28 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 29 | onboarding_id string |
||
| 30 | 1 | Ryan Supawarapong | register_id uuid |
| 31 | 9 | Ryan Supawarapong | customer_info_id string [ref: - customer_info.customer_info_id] |
| 32 | idcard_id string [ref: - idcard.idcard_id] |
||
| 33 | occupation_id string [ref: - occupation.occupation_id] |
||
| 34 | register_address_id string [ref : - address.address_id] |
||
| 35 | current_address_id string [ref : - address.address_id] |
||
| 36 | work_address_id string [ref : - address.address_id] |
||
| 37 | customer_suite_id string [ref: - customer_suite_submission.customer_suite_submission_id] |
||
| 38 | cdd_id string [ref: - cdd.cdd_id] |
||
| 39 | bank_id string [ref: - bank.bank_id] |
||
| 40 | secondary_bank_id string [ref: - bank.bank_id] |
||
| 41 | source_of_fund_id string [ref: - source_of_fund.source_of_fund_id] |
||
| 42 | thaid_id string [ref: - thaid.thaid_id] |
||
| 43 | ndid_id string [ref: - ndid.ndid_id] |
||
| 44 | approval_id string [ref: - approval.approval_id] |
||
| 45 | appman_id string [ref: - appman.appman_id] |
||
| 46 | risk_score_id string [ref: - risk_score.risk_score_id] |
||
| 47 | 5 | Ryan Supawarapong | has_done_knowledge_test bool |
| 48 | steps int |
||
| 49 | } |
||
| 50 | |||
| 51 | 1 | Ryan Supawarapong | // Customer |
| 52 | Table customer { |
||
| 53 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 54 | customer_id string |
||
| 55 | customer_info_id string [ref: - customer_info.customer_info_id] |
||
| 56 | risk_score_id string [ref: - risk_score.risk_score_id] |
||
| 57 | idcard_id string [ref: - idcard.idcard_id] |
||
| 58 | occupation_id string [ref: - occupation.occupation_id] |
||
| 59 | register_address_id string [ref : - address.address_id] |
||
| 60 | current_address_id string [ref : - address.address_id] |
||
| 61 | work_address_id string [ref : - address.address_id] |
||
| 62 | customer_suite_id string [ref: - customer_suite_submission.customer_suite_submission_id] |
||
| 63 | bank_id string [ref: - bank.bank_id] |
||
| 64 | secondary_bank_id string [ref: - bank.bank_id] |
||
| 65 | source_of_fund_id string [ref: - source_of_fund.source_of_fund_id] |
||
| 66 | 1 | Ryan Supawarapong | |
| 67 | } |
||
| 68 | |||
| 69 | 5 | Ryan Supawarapong | // Layer 2 |
| 70 | 2 | Ryan Supawarapong | // ---------------------- |
| 71 | 1 | Ryan Supawarapong | Table customer_info { |
| 72 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 73 | customer_info_id string |
||
| 74 | customer_code int |
||
| 75 | 5 | Ryan Supawarapong | mobile string |
| 76 | email string |
||
| 77 | 9 | Ryan Supawarapong | title_id string [ref: - title.title_id] |
| 78 | 5 | Ryan Supawarapong | first_name_th string |
| 79 | 2 | Ryan Supawarapong | middle_name_th string |
| 80 | 5 | Ryan Supawarapong | last_name_th string |
| 81 | first_name_en string |
||
| 82 | middle_name_en string |
||
| 83 | last_name_en string |
||
| 84 | 1 | Ryan Supawarapong | customer_type enum |
| 85 | 9 | Ryan Supawarapong | ip_id string [ref: - ip_detail.ip_detail_id] |
| 86 | 5 | Ryan Supawarapong | } |
| 87 | 1 | Ryan Supawarapong | |
| 88 | Table address { |
||
| 89 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 90 | address_id string |
||
| 91 | 1 | Ryan Supawarapong | house_number string |
| 92 | 5 | Ryan Supawarapong | floor string |
| 93 | 1 | Ryan Supawarapong | village_building string |
| 94 | sub_street strign |
||
| 95 | 5 | Ryan Supawarapong | street strign |
| 96 | 1 | Ryan Supawarapong | country_code string |
| 97 | location_id int |
||
| 98 | } |
||
| 99 | |||
| 100 | Table idcard { |
||
| 101 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 102 | idcard_id string |
||
| 103 | 2 | Ryan Supawarapong | citizen_id string |
| 104 | laser_code string |
||
| 105 | 1 | Ryan Supawarapong | date_of_birth timestamp |
| 106 | expire_date timestamp |
||
| 107 | issue_date timestamp |
||
| 108 | } |
||
| 109 | |||
| 110 | Table occupation { |
||
| 111 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 112 | occupation_id string |
||
| 113 | 1 | Ryan Supawarapong | code string |
| 114 | 5 | Ryan Supawarapong | position_name string |
| 115 | source_of_investment string |
||
| 116 | 1 | Ryan Supawarapong | workplace_name string |
| 117 | 9 | Ryan Supawarapong | education_id string [ref: - education.education_id] |
| 118 | parent_occupation_id string [ref: - occupation.occupation_id] |
||
| 119 | business_type_id string [ref: - business_type.business_type_id] |
||
| 120 | income_range_id string [ref: - income_range.income_range_id] |
||
| 121 | 1 | Ryan Supawarapong | |
| 122 | 5 | Ryan Supawarapong | } |
| 123 | |||
| 124 | Table customer_suite_answer { |
||
| 125 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 126 | customer_suite_answer_id string |
||
| 127 | submission_id string [ref: > customer_suite_submission.customer_suite_submission_id] |
||
| 128 | question_id string [ref: > suitability_question.suitability_question_id] |
||
| 129 | choice_id string [ref: > suitability_choice.suitability_choice_id] |
||
| 130 | 1 | Ryan Supawarapong | } |
| 131 | |||
| 132 | 5 | Ryan Supawarapong | Table customer_suite_submission { |
| 133 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 134 | customer_suite_submission_id string |
||
| 135 | customer_info_id string [ref: > customer_info.customer_info_id] |
||
| 136 | 5 | Ryan Supawarapong | total_score int |
| 137 | risk_level string |
||
| 138 | 2 | Ryan Supawarapong | } |
| 139 | 5 | Ryan Supawarapong | |
| 140 | |||
| 141 | 1 | Ryan Supawarapong | Table cdd { |
| 142 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 143 | cdd_id string |
||
| 144 | 5 | Ryan Supawarapong | mule string |
| 145 | freeze_04 string |
||
| 146 | 1 | Ryan Supawarapong | freeze_05 string |
| 147 | 2 | Ryan Supawarapong | pep bool |
| 148 | 5 | Ryan Supawarapong | pep_message string |
| 149 | 1 | Ryan Supawarapong | dopa bool |
| 150 | 5 | Ryan Supawarapong | } |
| 151 | |||
| 152 | Table appman { |
||
| 153 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 154 | appman_id string |
||
| 155 | 5 | Ryan Supawarapong | verification_id string |
| 156 | 9 | Ryan Supawarapong | is_verified bool |
| 157 | status string [enum] |
||
| 158 | verified_at timestamp |
||
| 159 | expire_at timestamp |
||
| 160 | idcard_id string [ref: - appman_id_card.appman_id_card_id] |
||
| 161 | liveness_id string [ref: - appman_liveness.appman_liveness_id] |
||
| 162 | liveness_attribute_id string [ref: - appman_liveness_attributes.appman_liveness_attributes_id] |
||
| 163 | recognition string [ref: - appman_recognition.appman_recognition_id] |
||
| 164 | 5 | Ryan Supawarapong | } |
| 165 | |||
| 166 | 1 | Ryan Supawarapong | Table bank { // |
| 167 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 168 | bank_id string |
||
| 169 | 1 | Ryan Supawarapong | name string |
| 170 | 5 | Ryan Supawarapong | branch string |
| 171 | account_no string |
||
| 172 | 1 | Ryan Supawarapong | } |
| 173 | |||
| 174 | Table source_of_fund { // |
||
| 175 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 176 | source_of_fund_id string |
||
| 177 | 5 | Ryan Supawarapong | source_of_fund string |
| 178 | country_of_income string |
||
| 179 | purpose_of_investment string |
||
| 180 | } |
||
| 181 | |||
| 182 | 1 | Ryan Supawarapong | Table thaid { |
| 183 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 184 | thaid_id string |
||
| 185 | 5 | Ryan Supawarapong | url string |
| 186 | state string |
||
| 187 | 9 | Ryan Supawarapong | thaid_detail_id string [ref: - thaid_detail.thaid_detail_id] |
| 188 | 1 | Ryan Supawarapong | } |
| 189 | |||
| 190 | 5 | Ryan Supawarapong | Table ndid { |
| 191 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 192 | ndid_id string |
||
| 193 | ndid_detail_id string [ref: - ndid_detail.ndid_detail_id] |
||
| 194 | 1 | Ryan Supawarapong | } |
| 195 | 5 | Ryan Supawarapong | |
| 196 | 1 | Ryan Supawarapong | Table approval { |
| 197 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 198 | approval_id string |
||
| 199 | 5 | Ryan Supawarapong | by string |
| 200 | name string |
||
| 201 | 1 | Ryan Supawarapong | level int |
| 202 | message string |
||
| 203 | is_approve bool |
||
| 204 | } |
||
| 205 | 5 | Ryan Supawarapong | |
| 206 | 1 | Ryan Supawarapong | Table risk_score { |
| 207 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 208 | risk_score_id string |
||
| 209 | 5 | Ryan Supawarapong | score int |
| 210 | risk_level int |
||
| 211 | } |
||
| 212 | |||
| 213 | 2 | Ryan Supawarapong | // ---------------------- |
| 214 | 5 | Ryan Supawarapong | // Layer 3 |
| 215 | 2 | Ryan Supawarapong | // ---------------------- |
| 216 | |||
| 217 | Table suitability_question { |
||
| 218 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 219 | suitability_question_id string |
||
| 220 | 2 | Ryan Supawarapong | question string |
| 221 | 5 | Ryan Supawarapong | } |
| 222 | |||
| 223 | Table suitability_choice { |
||
| 224 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 225 | suitability_choice_id string |
||
| 226 | question_id string [ref: > suitability_question.suitability_question_id] |
||
| 227 | 5 | Ryan Supawarapong | answer string |
| 228 | 1 | Ryan Supawarapong | score int |
| 229 | } |
||
| 230 | 5 | Ryan Supawarapong | |
| 231 | Table appman_id_card { |
||
| 232 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 233 | appman_id_card_id string |
||
| 234 | 1 | Ryan Supawarapong | register_id string |
| 235 | verification_id string |
||
| 236 | 7 | Ryan Supawarapong | id_number string |
| 237 | address_th string |
||
| 238 | full_name_th string |
||
| 239 | full_name_en string |
||
| 240 | 1 | Ryan Supawarapong | serial_number string |
| 241 | date_birth_en string |
||
| 242 | 7 | Ryan Supawarapong | date_birth_th string |
| 243 | date_issue_en string |
||
| 244 | date_issue_th string |
||
| 245 | 1 | Ryan Supawarapong | date_expire_en string |
| 246 | date_expire_th string |
||
| 247 | 7 | Ryan Supawarapong | laser_code string |
| 248 | updated_at timestamp |
||
| 249 | 1 | Ryan Supawarapong | } |
| 250 | |||
| 251 | 7 | Ryan Supawarapong | Table appman_liveness { |
| 252 | id int [pk, increment] |
||
| 253 | 9 | Ryan Supawarapong | appman_liveness_id string |
| 254 | 1 | Ryan Supawarapong | register_id string |
| 255 | 5 | Ryan Supawarapong | verification_id string |
| 256 | 2 | Ryan Supawarapong | verified bool |
| 257 | 1 | Ryan Supawarapong | valid bool |
| 258 | 7 | Ryan Supawarapong | completed bool |
| 259 | 1 | Ryan Supawarapong | success bool |
| 260 | was_processed bool |
||
| 261 | scan_result_blob text |
||
| 262 | updated_at timestamp |
||
| 263 | } |
||
| 264 | |||
| 265 | Table appman_liveness_attributes { |
||
| 266 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 267 | appman_liveness_attributes_id string |
||
| 268 | 1 | Ryan Supawarapong | register_id string |
| 269 | verification_id string |
||
| 270 | yaw float |
||
| 271 | roll float |
||
| 272 | pitch float |
||
| 273 | is_beard bool |
||
| 274 | beard_confidence float |
||
| 275 | is_smile bool |
||
| 276 | smile_confidence float |
||
| 277 | gender string |
||
| 278 | gender_confidence float |
||
| 279 | sharpness float |
||
| 280 | brightness float |
||
| 281 | age_low int |
||
| 282 | age_high int |
||
| 283 | is_eyes_open bool |
||
| 284 | eyes_open_confidence float |
||
| 285 | is_mustache bool |
||
| 286 | mustache_confidence float |
||
| 287 | is_mouth_open bool |
||
| 288 | mouth_open_confidence float |
||
| 289 | confidence float |
||
| 290 | is_eyeglasses bool |
||
| 291 | eyeglasses_confidence float |
||
| 292 | is_sunglasses bool |
||
| 293 | sunglasses_confidence float |
||
| 294 | } |
||
| 295 | |||
| 296 | Table appman_recognition { |
||
| 297 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 298 | appman_recognition_id string |
||
| 299 | 1 | Ryan Supawarapong | register_id string |
| 300 | verification_id string |
||
| 301 | yaw float |
||
| 302 | roll float |
||
| 303 | pitch float |
||
| 304 | sharpness float |
||
| 305 | brightness float |
||
| 306 | top float |
||
| 307 | left float |
||
| 308 | width float |
||
| 309 | height float |
||
| 310 | similarity float |
||
| 311 | pass_similarity bool |
||
| 312 | confidence float |
||
| 313 | verified bool |
||
| 314 | valid bool |
||
| 315 | completed bool |
||
| 316 | source_key string |
||
| 317 | target_key string |
||
| 318 | source_url string |
||
| 319 | target_url string |
||
| 320 | updated_at timestamp |
||
| 321 | } |
||
| 322 | Table education { |
||
| 323 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 324 | education_id string |
||
| 325 | 1 | Ryan Supawarapong | code string |
| 326 | name string |
||
| 327 | } |
||
| 328 | |||
| 329 | Table business_type { |
||
| 330 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 331 | business_type_id string |
||
| 332 | 1 | Ryan Supawarapong | name string |
| 333 | risk_score int |
||
| 334 | } |
||
| 335 | |||
| 336 | Table income_range { |
||
| 337 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 338 | income_range_id string |
||
| 339 | 1 | Ryan Supawarapong | range string |
| 340 | 5 | Ryan Supawarapong | } |
| 341 | |||
| 342 | 1 | Ryan Supawarapong | Table thaid_detail { |
| 343 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 344 | thaid_detail_id string |
||
| 345 | 7 | Ryan Supawarapong | } |
| 346 | |||
| 347 | Table ndid_detail { |
||
| 348 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 349 | ndid_detail_id string |
||
| 350 | 7 | Ryan Supawarapong | } |
| 351 | |||
| 352 | Table ip_detail { |
||
| 353 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 354 | ip_detail_id string |
||
| 355 | 7 | Ryan Supawarapong | ip_address string |
| 356 | country string |
||
| 357 | } |
||
| 358 | |||
| 359 | Table title { |
||
| 360 | 9 | Ryan Supawarapong | id int [pk, increment] |
| 361 | title_id string |
||
| 362 | 7 | Ryan Supawarapong | name_en string |
| 363 | name_th string |
||
| 364 | } |
||
| 365 | 5 | Ryan Supawarapong | |
| 366 | 9 | Ryan Supawarapong | // ---------------------- |
| 367 | 5 | Ryan Supawarapong | |
| 368 | 9 | Ryan Supawarapong | // Transaction database |
| 369 | // ---------------------- |
||
| 370 | // Current asset holding = sum(buy unit) - sum(sell unit) |
||
| 371 | // grouped by customer_code and asset_id from completed transactions |
||
| 372 | // If old rows are moved to transaction_history, calculate from |
||
| 373 | // UNION ALL(transaction, transaction_history) or maintain a rebuildable balance projection |
||
| 374 | Table transaction { |
||
| 375 | id int [pk, increment] |
||
| 376 | transaction_id string |
||
| 377 | asset_id string [ref: - digital_asset.asset_id] |
||
| 378 | seller_customer_code int |
||
| 379 | buyer_customer_code int |
||
| 380 | status enum |
||
| 381 | price float |
||
| 382 | amount_per_unit float |
||
| 383 | unit float |
||
| 384 | } |
||
| 385 | |||
| 386 | // Transaction Layer 2 |
||
| 387 | // ---------------------- |
||
| 388 | Table digital_asset { |
||
| 389 | id int [pk, increment] |
||
| 390 | asset_id string |
||
| 391 | name string |
||
| 392 | by string |
||
| 393 | total_unit float |
||
| 394 | } |
||
| 395 | |||
| 396 | 5 | Ryan Supawarapong | ``` |
| 397 | |||
| 398 | |||
| 399 | Tree layer version: |
||
| 400 | ``` |
||
| 401 | 9 | Ryan Supawarapong | Customer |
| 402 | │ --- layer-1 --- |
||
| 403 | │ ├── onboarding |
||
| 404 | │ │ ├── id: int [pk, increment] |
||
| 405 | │ │ ├── onboarding_id: string |
||
| 406 | │ │ ├── register_id: uuid |
||
| 407 | │ │ ├── customer_info_id: string [ref: - customer_info.customer_info_id] |
||
| 408 | │ │ ├── idcard_id: string [ref: - idcard.idcard_id] |
||
| 409 | │ │ ├── occupation_id: string [ref: - occupation.occupation_id] |
||
| 410 | │ │ ├── register_address_id: string [ref: - address.address_id] |
||
| 411 | │ │ ├── current_address_id: string [ref: - address.address_id] |
||
| 412 | │ │ ├── work_address_id: string [ref: - address.address_id] |
||
| 413 | │ │ ├── customer_suite_id: string [ref: - customer_suite_submission.customer_suite_submission_id] |
||
| 414 | │ │ ├── cdd_id: string [ref: - cdd.cdd_id] |
||
| 415 | │ │ ├── bank_id: string [ref: - bank.bank_id] |
||
| 416 | │ │ ├── secondary_bank_id: string [ref: - bank.bank_id] |
||
| 417 | │ │ ├── source_of_fund_id: string [ref: - source_of_fund.source_of_fund_id] |
||
| 418 | │ │ ├── thaid_id: string [ref: - thaid.thaid_id] |
||
| 419 | │ │ ├── ndid_id: string [ref: - ndid.ndid_id] |
||
| 420 | │ │ ├── approval_id: string [ref: - approval.approval_id] |
||
| 421 | │ │ ├── appman_id: string [ref: - appman.appman_id] |
||
| 422 | │ │ ├── risk_score_id: string [ref: - risk_score.risk_score_id] |
||
| 423 | │ │ ├── has_done_knowledge_test: bool |
||
| 424 | │ │ └── steps: int |
||
| 425 | │ └── customer |
||
| 426 | │ ├── id: int [pk, increment] |
||
| 427 | │ ├── customer_id: string |
||
| 428 | │ ├── customer_info_id: string [ref: - customer_info.customer_info_id] |
||
| 429 | │ ├── risk_score_id: string [ref: - risk_score.risk_score_id] |
||
| 430 | │ ├── idcard_id: string [ref: - idcard.idcard_id] |
||
| 431 | │ ├── occupation_id: string [ref: - occupation.occupation_id] |
||
| 432 | │ ├── register_address_id: string [ref: - address.address_id] |
||
| 433 | │ ├── current_address_id: string [ref: - address.address_id] |
||
| 434 | │ ├── work_address_id: string [ref: - address.address_id] |
||
| 435 | │ ├── customer_suite_id: string [ref: - customer_suite_submission.customer_suite_submission_id] |
||
| 436 | │ ├── bank_id: string [ref: - bank.bank_id] |
||
| 437 | │ ├── secondary_bank_id: string [ref: - bank.bank_id] |
||
| 438 | │ └── source_of_fund_id: string [ref: - source_of_fund.source_of_fund_id] |
||
| 439 | │ --- layer-2 --- |
||
| 440 | │ ├── customer_info |
||
| 441 | │ │ ├── id: int [pk, increment] |
||
| 442 | │ │ ├── customer_info_id: string |
||
| 443 | │ │ ├── customer_code: int |
||
| 444 | │ │ ├── mobile: string |
||
| 445 | │ │ ├── email: string |
||
| 446 | │ │ ├── title_id: string [ref: - title.title_id] |
||
| 447 | │ │ ├── first_name_th: string |
||
| 448 | │ │ ├── middle_name_th: string |
||
| 449 | │ │ ├── last_name_th: string |
||
| 450 | │ │ ├── first_name_en: string |
||
| 451 | │ │ ├── middle_name_en: string |
||
| 452 | │ │ ├── last_name_en: string |
||
| 453 | │ │ ├── customer_type: enum |
||
| 454 | │ │ └── ip_id: string [ref: - ip_detail.ip_detail_id] |
||
| 455 | │ ├── address |
||
| 456 | │ │ ├── id: int [pk, increment] |
||
| 457 | │ │ ├── address_id: string |
||
| 458 | │ │ ├── house_number: string |
||
| 459 | │ │ ├── floor: string |
||
| 460 | │ │ ├── village_building: string |
||
| 461 | │ │ ├── sub_street: strign |
||
| 462 | │ │ ├── street: strign |
||
| 463 | │ │ ├── country_code: string |
||
| 464 | │ │ └── location_id: int |
||
| 465 | │ ├── idcard |
||
| 466 | │ │ ├── id: int [pk, increment] |
||
| 467 | │ │ ├── idcard_id: string |
||
| 468 | │ │ ├── citizen_id: string |
||
| 469 | │ │ ├── laser_code: string |
||
| 470 | │ │ ├── date_of_birth: timestamp |
||
| 471 | │ │ ├── expire_date: timestamp |
||
| 472 | │ │ └── issue_date: timestamp |
||
| 473 | │ ├── occupation |
||
| 474 | │ │ ├── id: int [pk, increment] |
||
| 475 | │ │ ├── occupation_id: string |
||
| 476 | │ │ ├── code: string |
||
| 477 | │ │ ├── position_name: string |
||
| 478 | │ │ ├── source_of_investment: string |
||
| 479 | │ │ ├── workplace_name: string |
||
| 480 | │ │ ├── education_id: string [ref: - education.education_id] |
||
| 481 | │ │ ├── parent_occupation_id: string [ref: - occupation.occupation_id] |
||
| 482 | │ │ ├── business_type_id: string [ref: - business_type.business_type_id] |
||
| 483 | │ │ └── income_range_id: string [ref: - income_range.income_range_id] |
||
| 484 | │ ├── customer_suite_answer |
||
| 485 | │ │ ├── id: int [pk, increment] |
||
| 486 | │ │ ├── customer_suite_answer_id: string |
||
| 487 | │ │ ├── submission_id: string [ref: > customer_suite_submission.customer_suite_submission_id] |
||
| 488 | │ │ ├── question_id: string [ref: > suitability_question.suitability_question_id] |
||
| 489 | │ │ └── choice_id: string [ref: > suitability_choice.suitability_choice_id] |
||
| 490 | │ ├── customer_suite_submission |
||
| 491 | │ │ ├── id: int [pk, increment] |
||
| 492 | │ │ ├── customer_suite_submission_id: string |
||
| 493 | │ │ ├── customer_info_id: string [ref: > customer_info.customer_info_id] |
||
| 494 | │ │ ├── total_score: int |
||
| 495 | │ │ └── risk_level: string |
||
| 496 | │ ├── cdd |
||
| 497 | │ │ ├── id: int [pk, increment] |
||
| 498 | │ │ ├── cdd_id: string |
||
| 499 | │ │ ├── mule: string |
||
| 500 | │ │ ├── freeze_04: string |
||
| 501 | │ │ ├── freeze_05: string |
||
| 502 | │ │ ├── pep: bool |
||
| 503 | │ │ ├── pep_message: string |
||
| 504 | │ │ └── dopa: bool |
||
| 505 | │ ├── appman |
||
| 506 | │ │ ├── id: int [pk, increment] |
||
| 507 | │ │ ├── appman_id: string |
||
| 508 | │ │ ├── verification_id: string |
||
| 509 | │ │ ├── is_verified: bool |
||
| 510 | │ │ ├── status: string [enum] |
||
| 511 | │ │ ├── verified_at: timestamp |
||
| 512 | │ │ ├── expire_at: timestamp |
||
| 513 | │ │ ├── idcard_id: string [ref: - appman_id_card.appman_id_card_id] |
||
| 514 | │ │ ├── liveness_id: string [ref: - appman_liveness.appman_liveness_id] |
||
| 515 | │ │ ├── liveness_attribute_id: string [ref: - appman_liveness_attributes.appman_liveness_attributes_id] |
||
| 516 | │ │ └── recognition: string [ref: - appman_recognition.appman_recognition_id] |
||
| 517 | │ ├── bank |
||
| 518 | │ │ ├── id: int [pk, increment] |
||
| 519 | │ │ ├── bank_id: string |
||
| 520 | │ │ ├── name: string |
||
| 521 | │ │ ├── branch: string |
||
| 522 | │ │ └── account_no: string |
||
| 523 | │ ├── source_of_fund |
||
| 524 | │ │ ├── id: int [pk, increment] |
||
| 525 | │ │ ├── source_of_fund_id: string |
||
| 526 | │ │ ├── source_of_fund: string |
||
| 527 | │ │ ├── country_of_income: string |
||
| 528 | │ │ └── purpose_of_investment: string |
||
| 529 | │ ├── thaid |
||
| 530 | │ │ ├── id: int [pk, increment] |
||
| 531 | │ │ ├── thaid_id: string |
||
| 532 | │ │ ├── url: string |
||
| 533 | │ │ ├── state: string |
||
| 534 | │ │ └── thaid_detail_id: string [ref: - thaid_detail.thaid_detail_id] |
||
| 535 | │ ├── ndid |
||
| 536 | │ │ ├── id: int [pk, increment] |
||
| 537 | │ │ ├── ndid_id: string |
||
| 538 | │ │ └── ndid_detail_id: string [ref: - ndid_detail.ndid_detail_id] |
||
| 539 | │ ├── approval |
||
| 540 | │ │ ├── id: int [pk, increment] |
||
| 541 | │ │ ├── approval_id: string |
||
| 542 | │ │ ├── by: string |
||
| 543 | │ │ ├── name: string |
||
| 544 | │ │ ├── level: int |
||
| 545 | │ │ ├── message: string |
||
| 546 | │ │ └── is_approve: bool |
||
| 547 | │ └── risk_score |
||
| 548 | │ ├── id: int [pk, increment] |
||
| 549 | │ ├── risk_score_id: string |
||
| 550 | │ ├── score: int |
||
| 551 | │ └── risk_level: int |
||
| 552 | │ --- layer-3 --- |
||
| 553 | │ ├── suitability_question |
||
| 554 | │ │ ├── id: int [pk, increment] |
||
| 555 | │ │ ├── suitability_question_id: string |
||
| 556 | │ │ └── question: string |
||
| 557 | │ ├── suitability_choice |
||
| 558 | │ │ ├── id: int [pk, increment] |
||
| 559 | │ │ ├── suitability_choice_id: string |
||
| 560 | │ │ ├── question_id: string [ref: > suitability_question.suitability_question_id] |
||
| 561 | │ │ ├── answer: string |
||
| 562 | │ │ └── score: int |
||
| 563 | │ ├── appman_id_card |
||
| 564 | │ │ ├── id: int [pk, increment] |
||
| 565 | │ │ ├── appman_id_card_id: string |
||
| 566 | │ │ ├── register_id: string |
||
| 567 | │ │ ├── verification_id: string |
||
| 568 | │ │ ├── id_number: string |
||
| 569 | │ │ ├── address_th: string |
||
| 570 | │ │ ├── full_name_th: string |
||
| 571 | │ │ ├── full_name_en: string |
||
| 572 | │ │ ├── serial_number: string |
||
| 573 | │ │ ├── date_birth_en: string |
||
| 574 | │ │ ├── date_birth_th: string |
||
| 575 | │ │ ├── date_issue_en: string |
||
| 576 | │ │ ├── date_issue_th: string |
||
| 577 | │ │ ├── date_expire_en: string |
||
| 578 | │ │ ├── date_expire_th: string |
||
| 579 | │ │ ├── laser_code: string |
||
| 580 | │ │ └── updated_at: timestamp |
||
| 581 | │ ├── appman_liveness |
||
| 582 | │ │ ├── id: int [pk, increment] |
||
| 583 | │ │ ├── appman_liveness_id: string |
||
| 584 | │ │ ├── register_id: string |
||
| 585 | │ │ ├── verification_id: string |
||
| 586 | │ │ ├── verified: bool |
||
| 587 | │ │ ├── valid: bool |
||
| 588 | │ │ ├── completed: bool |
||
| 589 | │ │ ├── success: bool |
||
| 590 | │ │ ├── was_processed: bool |
||
| 591 | │ │ ├── scan_result_blob: text |
||
| 592 | │ │ └── updated_at: timestamp |
||
| 593 | │ ├── appman_liveness_attributes |
||
| 594 | │ │ ├── id: int [pk, increment] |
||
| 595 | │ │ ├── appman_liveness_attributes_id: string |
||
| 596 | │ │ ├── register_id: string |
||
| 597 | │ │ ├── verification_id: string |
||
| 598 | │ │ ├── yaw: float |
||
| 599 | │ │ ├── roll: float |
||
| 600 | │ │ ├── pitch: float |
||
| 601 | │ │ ├── is_beard: bool |
||
| 602 | │ │ ├── beard_confidence: float |
||
| 603 | │ │ ├── is_smile: bool |
||
| 604 | │ │ ├── smile_confidence: float |
||
| 605 | │ │ ├── gender: string |
||
| 606 | │ │ ├── gender_confidence: float |
||
| 607 | │ │ ├── sharpness: float |
||
| 608 | │ │ ├── brightness: float |
||
| 609 | │ │ ├── age_low: int |
||
| 610 | │ │ ├── age_high: int |
||
| 611 | │ │ ├── is_eyes_open: bool |
||
| 612 | │ │ ├── eyes_open_confidence: float |
||
| 613 | │ │ ├── is_mustache: bool |
||
| 614 | │ │ ├── mustache_confidence: float |
||
| 615 | │ │ ├── is_mouth_open: bool |
||
| 616 | │ │ ├── mouth_open_confidence: float |
||
| 617 | │ │ ├── confidence: float |
||
| 618 | │ │ ├── is_eyeglasses: bool |
||
| 619 | │ │ ├── eyeglasses_confidence: float |
||
| 620 | │ │ ├── is_sunglasses: bool |
||
| 621 | │ │ └── sunglasses_confidence: float |
||
| 622 | │ ├── appman_recognition |
||
| 623 | │ │ ├── id: int [pk, increment] |
||
| 624 | │ │ ├── appman_recognition_id: string |
||
| 625 | │ │ ├── register_id: string |
||
| 626 | │ │ ├── verification_id: string |
||
| 627 | │ │ ├── yaw: float |
||
| 628 | │ │ ├── roll: float |
||
| 629 | │ │ ├── pitch: float |
||
| 630 | │ │ ├── sharpness: float |
||
| 631 | │ │ ├── brightness: float |
||
| 632 | │ │ ├── top: float |
||
| 633 | │ │ ├── left: float |
||
| 634 | │ │ ├── width: float |
||
| 635 | │ │ ├── height: float |
||
| 636 | │ │ ├── similarity: float |
||
| 637 | │ │ ├── pass_similarity: bool |
||
| 638 | │ │ ├── confidence: float |
||
| 639 | │ │ ├── verified: bool |
||
| 640 | │ │ ├── valid: bool |
||
| 641 | │ │ ├── completed: bool |
||
| 642 | │ │ ├── source_key: string |
||
| 643 | │ │ ├── target_key: string |
||
| 644 | │ │ ├── source_url: string |
||
| 645 | │ │ ├── target_url: string |
||
| 646 | │ │ └── updated_at: timestamp |
||
| 647 | │ ├── education |
||
| 648 | │ │ ├── id: int [pk, increment] |
||
| 649 | │ │ ├── education_id: string |
||
| 650 | │ │ ├── code: string |
||
| 651 | │ │ └── name: string |
||
| 652 | │ ├── business_type |
||
| 653 | │ │ ├── id: int [pk, increment] |
||
| 654 | │ │ ├── business_type_id: string |
||
| 655 | │ │ ├── name: string |
||
| 656 | │ │ └── risk_score: int |
||
| 657 | │ ├── income_range |
||
| 658 | │ │ ├── id: int [pk, increment] |
||
| 659 | │ │ ├── income_range_id: string |
||
| 660 | │ │ └── range: string |
||
| 661 | │ ├── thaid_detail |
||
| 662 | │ │ ├── id: int [pk, increment] |
||
| 663 | │ │ └── thaid_detail_id: string |
||
| 664 | │ ├── ndid_detail |
||
| 665 | │ │ ├── id: int [pk, increment] |
||
| 666 | │ │ └── ndid_detail_id: string |
||
| 667 | │ ├── ip_detail |
||
| 668 | │ │ ├── id: int [pk, increment] |
||
| 669 | │ │ ├── ip_detail_id: string |
||
| 670 | │ │ ├── ip_address: string |
||
| 671 | │ │ └── country: string |
||
| 672 | └─└── title |
||
| 673 | ├── id: int [pk, increment] |
||
| 674 | ├── title_id: string |
||
| 675 | ├── name_en: string |
||
| 676 | └── name_th: string |
||
| 677 | |||
| 678 | Transaction |
||
| 679 | │ --- layer-1 --- |
||
| 680 | │ └── transaction |
||
| 681 | │ ├── id: int [pk, increment] |
||
| 682 | │ ├── transaction_id: string |
||
| 683 | │ ├── asset_id: string [ref: - digital_asset.asset_id] |
||
| 684 | │ ├── seller_customer_code: int |
||
| 685 | │ ├── buyer_customer_code: int |
||
| 686 | │ ├── status: enum |
||
| 687 | │ ├── price: float |
||
| 688 | │ ├── amount_per_unit: float |
||
| 689 | │ └── unit: float |
||
| 690 | │ --- layer-2 --- |
||
| 691 | ├── digital_asset |
||
| 692 | │ ├── id: int [pk, increment] |
||
| 693 | │ ├── asset_id: string |
||
| 694 | │ ├── name: string |
||
| 695 | │ ├── by: string |
||
| 696 | │ └── total_unit: float |
||
| 697 | |||
| 698 | 1 | Ryan Supawarapong | ``` |