Project

General

Profile

Customer Database » History » Version 5

Ryan Supawarapong, 04/01/2026 01:21 AM

1 1 Ryan Supawarapong
# Customer Database
2
3 4 Ryan Supawarapong
4 1 Ryan Supawarapong
```
5 5 Ryan Supawarapong
// 4 top layer 1
6
// Onboarding
7
// Customer
8
// Transaction: combine of customer and asset
9
// Digital Asset: asset_id
10 1 Ryan Supawarapong
11 5 Ryan Supawarapong
// Layer 2
12
// Fullname
13
// Customer info: link to transaction, onboarding
14
// customer suite test answer: answer
15
// suite test id: question and answer
16
17
// Layer 3
18
// suite test question and answer
19
// Knowledge test
20
21
22
// Layer 1
23
// ----------------------
24
// Onboarding
25
Table onboarding {
26 1 Ryan Supawarapong
  id int
27 5 Ryan Supawarapong
  register_id uuid
28
  customer_info_id int [ref: - customer_info.id]
29
  idcard_id int [ref: - idcard.id]
30
  occupation_id int [ref: - occupation.id]
31
  register_address_id int [ref : - address.id]
32
  current_address_id int [ref : - address.id]
33
  work_address_id int [ref : - address.id]
34
  customer_suite_id int [ref: - customer_suite_submission.id]
35
  cdd_id int [ref: - cdd.id]
36
  bank_id int [ref: - bank.id]
37
  secondary_bank_id int [ref: - bank.id]
38
  source_of_fund_id int [ref: - source_of_fund.id]
39
  thaid_id int [ref: - thaid.id]
40
  ndid_id int [ref: - ndid.id]
41
  approval_id int [ref: - approval.id]
42
  appman_id int [ref: - appman.id]
43
  risk_score_id int [ref: - risk_score.id]
44
  has_done_knowledge_test bool
45
  steps int
46 1 Ryan Supawarapong
}
47
48 5 Ryan Supawarapong
// Customer
49
Table customer {
50 1 Ryan Supawarapong
  id int
51 5 Ryan Supawarapong
  customer_info_id int [ref: - customer_info.id]
52
  risk_score_id int [ref: - risk_score.id]
53
  idcard_id int [ref: - idcard.id]
54
  occupation_id int [ref: - occupation.id]
55
  register_address_id int [ref : - address.id]
56
  current_address_id int [ref : - address.id]
57
  work_address_id int [ref : - address.id]
58
  customer_suite_id int [ref: - customer_suite_submission.id]
59
  bank_id int [ref: - bank.id]
60
  secondary_bank_id int [ref: - bank.id]
61
  source_of_fund_id int [ref: - source_of_fund.id]
62
63 1 Ryan Supawarapong
}
64
65 5 Ryan Supawarapong
// Transaction
66
Table transaction {
67
  id uuid
68
  seller_info_id int [ref: - customer_info.id]
69
}
70 1 Ryan Supawarapong
71 5 Ryan Supawarapong
// Digital Asset
72
Table digital_asset {
73 2 Ryan Supawarapong
  id uuid
74 5 Ryan Supawarapong
  customer_info_id int [ref: - customer_info.id]
75
  asset_detail_id int [ref: - asset_detail.id]
76
77 2 Ryan Supawarapong
}
78
79 5 Ryan Supawarapong
// ----------------------
80
// Layer 2
81
// ----------------------
82
Table customer_info {
83 2 Ryan Supawarapong
  id int
84 5 Ryan Supawarapong
  mobile string
85
  email string
86
  title_id int [ref: - title.id]
87
  first_name_th string
88
  middle_name_th string
89
  last_name_th string
90
  first_name_en string
91
  middle_name_en string
92
  last_name_en string
93
  customer_type enum
94
  ip_id int [ref: - ip_detail.id]
95 1 Ryan Supawarapong
}
96
97
Table address {
98
  id int
99
  house_number string
100
  floor string
101 2 Ryan Supawarapong
  village_building string
102
  sub_street strign
103 1 Ryan Supawarapong
  street strign
104
  country_code string
105
  location_id  int
106
}
107
108 5 Ryan Supawarapong
Table idcard {
109
  id int
110
  citizen_id  string
111
  laser_code string
112
  date_of_birth timestamp
113
  expire_date timestamp
114
  issue_date timestamp
115
}
116 1 Ryan Supawarapong
117 5 Ryan Supawarapong
Table occupation {
118 1 Ryan Supawarapong
  id int
119 5 Ryan Supawarapong
  code string
120
  position_name string
121
  source_of_investment string
122
  workplace_name string
123
  education_id string [ref: - education.id]
124
  occupation_id int [ref: - occupation.id]
125
  business_type_id int [ref: - business_type.id]
126
  income_range_id int [ref: - income_range.id]
127
  
128 1 Ryan Supawarapong
}
129
130 5 Ryan Supawarapong
Table customer_suite_answer {
131
  id int
132
  submission_id int [ref: > customer_suite_submission.id]
133
  question_id int [ref: > suitability_question.id]
134
  choice_id int [ref: > suitability_choice.id]
135
}
136 2 Ryan Supawarapong
137 5 Ryan Supawarapong
Table customer_suite_submission {
138
  id int
139
  customer_info_id int [ref: > customer_info.id]
140
  total_score int
141
  risk_level string
142
}
143 1 Ryan Supawarapong
144 2 Ryan Supawarapong
145 5 Ryan Supawarapong
Table cdd {
146 1 Ryan Supawarapong
  id int
147 5 Ryan Supawarapong
  mule string
148
  freeze_04 string
149
  freeze_05 string
150
  pep bool
151
  pep_message string
152
  dopa bool
153 1 Ryan Supawarapong
}
154
155 5 Ryan Supawarapong
Table appman {
156 2 Ryan Supawarapong
  id int
157 5 Ryan Supawarapong
  verification_id string
158
  idcard_id int [ref: - appman_id_card.id]
159
  liveness_id int [ref: - appman_liveness.id]
160
  liveness_attribute_id int [ref: - appman_liveness_attributes.id]
161
  recognition int [ref: - appman_recognition.id]
162 1 Ryan Supawarapong
}
163
164 5 Ryan Supawarapong
Table bank { //
165 1 Ryan Supawarapong
  id int
166 5 Ryan Supawarapong
  name string
167
  branch string
168
  account_no string
169 1 Ryan Supawarapong
}
170
171 5 Ryan Supawarapong
Table source_of_fund { //
172
  id int
173
  source_of_fund string
174
  country_of_income string
175
  purpose_of_investment string
176
}
177 1 Ryan Supawarapong
178 5 Ryan Supawarapong
Table thaid {
179 1 Ryan Supawarapong
  id int
180 5 Ryan Supawarapong
  url string
181
  state string
182
  thaid_detail_id int [ref: - thaid_detail.id]
183 1 Ryan Supawarapong
}
184
185 5 Ryan Supawarapong
Table ndid {
186 1 Ryan Supawarapong
  id int
187 5 Ryan Supawarapong
  ndid_detail_id int [ref: - ndid_detail.id]
188 1 Ryan Supawarapong
}
189
190 5 Ryan Supawarapong
Table approval {
191 1 Ryan Supawarapong
  id int
192 5 Ryan Supawarapong
  by string
193
  name string
194
  level int
195
  message string
196
  is_approve bool
197 1 Ryan Supawarapong
}
198
199 5 Ryan Supawarapong
Table risk_score {
200 1 Ryan Supawarapong
  id int
201 5 Ryan Supawarapong
  score int
202
  risk_level int
203
}
204
205
Table asset_detail {
206
  id int
207 2 Ryan Supawarapong
  name string
208 5 Ryan Supawarapong
  price float
209 2 Ryan Supawarapong
}
210
211
// ----------------------
212 5 Ryan Supawarapong
// Layer 3
213
// ----------------------
214 2 Ryan Supawarapong
215 5 Ryan Supawarapong
Table suitability_question {
216
  id int
217
  question string
218 2 Ryan Supawarapong
}
219
220 5 Ryan Supawarapong
Table suitability_choice {
221
  id int 
222
  question_id int [ref: > suitability_question.id]
223
  answer string
224
  score int
225
}
226
227
Table appman_id_card {
228 2 Ryan Supawarapong
  id int
229
}
230
231 5 Ryan Supawarapong
Table appman_liveness {
232 2 Ryan Supawarapong
  id int
233
}
234
235 5 Ryan Supawarapong
Table appman_liveness_attributes {
236 2 Ryan Supawarapong
  id int
237
}
238
239 5 Ryan Supawarapong
Table appman_recognition {
240
  id int
241
}
242
243
Table education {
244
  id int
245
  code string
246
  name string
247
}
248
249
Table business_type {
250
  id int
251
  name string
252
  risk_score int
253
}
254
255
Table income_range {
256
  id int
257
  range string
258
}
259
260
Table thaid_detail {
261
  id int
262
}
263
264
Table ndid_detail {
265
  id int
266
}
267
268
Table ip_detail {
269
  id int
270
  ip_address string
271
  country string
272
}
273
274
Table title {
275
  id int
276
  name_en string
277
  name_th string
278
}
279
280
// ----------------------
281
282
283
284 1 Ryan Supawarapong
285
```