finamaze_schema 1.54.0 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,449 @@
1
+ {
2
+ "entities": {
3
+ "Session": {
4
+ "table": "sessions",
5
+ "description": "Tracks user sessions after ATM/IVR login. Each session represents a user's onboarding journey.",
6
+ "fields": {
7
+ "id": {
8
+ "type": "uuid",
9
+ "primary": true,
10
+ "autoGenerated": true,
11
+ "description": "Database primary key - auto-generated UUID for tracking individual onboarding sessions"
12
+ },
13
+ "sessionId": {
14
+ "type": "varchar(255)",
15
+ "unique": true,
16
+ "description": "Session identifier generated during user login with the IVR or ATM. This is the actual session ID used for authentication and tracking, separate from the database primary key"
17
+ },
18
+ "created_at": {
19
+ "type": "timestamp",
20
+ "autoGenerated": true,
21
+ "description": "When the session was created - automatically set when session is initialized"
22
+ },
23
+ "expires_at": {
24
+ "type": "timestamp",
25
+ "description": "When the session should expire - used for session timeout and cleanup"
26
+ },
27
+ "status": {
28
+ "type": "enum",
29
+ "values": ["active", "expired", "completed"],
30
+ "default": "active",
31
+ "description": "Session lifecycle status - active: Session is currently in use, expired: Session has timed out, completed: User has finished onboarding"
32
+ },
33
+ "onboardingVersion": {
34
+ "type": "int",
35
+ "default": 1,
36
+ "description": "Onboarding flow version for this session. Links the user to the specific version of onboarding they are following. Used to ensure users see consistent onboarding flow throughout their journey"
37
+ },
38
+ "updated_at": {
39
+ "type": "timestamp",
40
+ "autoGenerated": true,
41
+ "description": "Automatically updated when session is modified"
42
+ }
43
+ },
44
+ "relationships": {
45
+ "substep_progress": {
46
+ "type": "OneToMany",
47
+ "target": "UserSubstepProgress",
48
+ "description": "Relationship to track progress for this session"
49
+ },
50
+ "answers": {
51
+ "type": "OneToMany",
52
+ "target": "UserAnswer",
53
+ "description": "Relationship to track answers for this session"
54
+ }
55
+ }
56
+ },
57
+ "UserAnswer": {
58
+ "table": "user_answers",
59
+ "description": "Stores answers per question for each session. Records user responses to individual questions.",
60
+ "fields": {
61
+ "id": {
62
+ "type": "uuid",
63
+ "primary": true,
64
+ "autoGenerated": true,
65
+ "description": "Unique answer ID - auto-generated UUID for unique answer identification"
66
+ },
67
+ "session": {
68
+ "type": "ManyToOne",
69
+ "target": "Session",
70
+ "foreignKey": "session_id",
71
+ "description": "Session context - references the session this answer belongs to"
72
+ },
73
+ "question": {
74
+ "type": "ManyToOne",
75
+ "target": "Question",
76
+ "foreignKey": "question_id",
77
+ "description": "Question being answered - references the specific question this answer relates to"
78
+ },
79
+ "answer": {
80
+ "type": "jsonb",
81
+ "description": "Answer content - JSON object containing the actual answer data: text, number, array, string, boolean, or object for file metadata"
82
+ },
83
+ "answered_at": {
84
+ "type": "timestamp",
85
+ "description": "Time of submission - when the user submitted this answer"
86
+ },
87
+ "created_at": {
88
+ "type": "timestamp",
89
+ "autoGenerated": true,
90
+ "description": "Automatically set when answer record is created"
91
+ },
92
+ "updated_at": {
93
+ "type": "timestamp",
94
+ "autoGenerated": true,
95
+ "description": "Automatically updated when answer record is modified"
96
+ }
97
+ }
98
+ },
99
+ "UserSubstepProgress": {
100
+ "table": "user_substep_progress",
101
+ "description": "Tracks substep completion per session. Records which substeps have been completed by users.",
102
+ "fields": {
103
+ "id": {
104
+ "type": "uuid",
105
+ "primary": true,
106
+ "autoGenerated": true,
107
+ "description": "Unique tracking ID - auto-generated UUID for unique progress tracking"
108
+ },
109
+ "session": {
110
+ "type": "ManyToOne",
111
+ "target": "Session",
112
+ "foreignKey": "session_id",
113
+ "description": "Linked session - references the session this progress belongs to"
114
+ },
115
+ "substep": {
116
+ "type": "ManyToOne",
117
+ "target": "Substep",
118
+ "foreignKey": "substep_id",
119
+ "description": "The substep being tracked - references the specific substep this progress relates to"
120
+ },
121
+ "status": {
122
+ "type": "enum",
123
+ "values": ["incomplete", "complete"],
124
+ "description": "Completion status - incomplete: Substep has not been completed yet, complete: Substep has been successfully completed"
125
+ },
126
+ "completed_at": {
127
+ "type": "timestamp",
128
+ "nullable": true,
129
+ "description": "Time when marked as complete - null if substep is still incomplete"
130
+ },
131
+ "created_at": {
132
+ "type": "timestamp",
133
+ "autoGenerated": true,
134
+ "description": "Automatically set when progress record is created"
135
+ },
136
+ "updated_at": {
137
+ "type": "timestamp",
138
+ "autoGenerated": true,
139
+ "description": "Automatically updated when progress record is modified"
140
+ }
141
+ }
142
+ },
143
+ "OnboardingSchema": {
144
+ "table": "onboarding_schemas",
145
+ "description": "Represents the complete onboarding flow configuration. This is the master schema that defines the entire onboarding structure.",
146
+ "indexes": [
147
+ ["version", "status"],
148
+ ["name", "version"]
149
+ ],
150
+ "fields": {
151
+ "id": {
152
+ "type": "uuid",
153
+ "primary": true,
154
+ "autoGenerated": true,
155
+ "description": "Unique schema identifier - auto-generated UUID for unique schema identification"
156
+ },
157
+ "name": {
158
+ "type": "varchar(255)",
159
+ "description": "Schema name for easy identification - e.g., 'SNB_Standard_Onboarding', 'SNB_Premium_Onboarding'"
160
+ },
161
+ "version": {
162
+ "type": "varchar(20)",
163
+ "description": "Schema version number - used for versioning and A/B testing. Major.Minor.Patch format (e.g., 1.0.0)"
164
+ },
165
+ "status": {
166
+ "type": "enum",
167
+ "values": ["draft", "active", "deprecated", "archived"],
168
+ "default": "draft",
169
+ "description": "Schema status - draft: Schema is being developed, active: Schema is currently in use, deprecated: Schema is no longer used but kept for reference, archived: Schema is archived and cannot be used"
170
+ },
171
+ "description": {
172
+ "type": "text",
173
+ "nullable": true,
174
+ "description": "Schema description - detailed description of what this onboarding flow covers"
175
+ },
176
+ "total_steps": {
177
+ "type": "int",
178
+ "default": 0,
179
+ "description": "Total number of steps in this schema"
180
+ },
181
+ "created_at": {
182
+ "type": "timestamp",
183
+ "autoGenerated": true,
184
+ "description": "Automatically set when schema is created"
185
+ },
186
+ "updated_at": {
187
+ "type": "timestamp",
188
+ "autoGenerated": true,
189
+ "description": "Automatically updated when schema is modified"
190
+ }
191
+ },
192
+ "relationships": {
193
+ "steps": {
194
+ "type": "OneToMany",
195
+ "target": "Step",
196
+ "description": "Relationship to steps within this schema"
197
+ }
198
+ }
199
+ },
200
+ "Step": {
201
+ "table": "steps",
202
+ "description": "Represents the high-level onboarding phases. Each step contains multiple substeps that users must complete.",
203
+ "fields": {
204
+ "id": {
205
+ "type": "varchar",
206
+ "primary": true,
207
+ "description": "Step identifier - auto-generated UUID for unique step identification"
208
+ },
209
+ "order": {
210
+ "type": "int",
211
+ "description": "Order in which step appears - determines the sequence of steps in the onboarding flow"
212
+ },
213
+ "title_en": {
214
+ "type": "string",
215
+ "description": "Step title in English - display text for English-speaking users"
216
+ },
217
+ "title_ar": {
218
+ "type": "string",
219
+ "description": "Step title in Arabic - display text for Arabic-speaking users"
220
+ },
221
+ "step_description_en": {
222
+ "type": "text",
223
+ "nullable": true,
224
+ "description": "Step description in English - display text for English-speaking users"
225
+ },
226
+ "step_description_ar": {
227
+ "type": "text",
228
+ "nullable": true,
229
+ "description": "Step description in Arabic - display text for Arabic-speaking users"
230
+ },
231
+ "version": {
232
+ "type": "int",
233
+ "default": 1,
234
+ "description": "Onboarding flow version - tracks which version of the onboarding flow this step belongs to. Used for A/B testing, legal compliance, and preventing breaking changes"
235
+ },
236
+ "created_at": {
237
+ "type": "timestamp",
238
+ "autoGenerated": true,
239
+ "description": "Automatically set when step is created"
240
+ },
241
+ "updated_at": {
242
+ "type": "timestamp",
243
+ "autoGenerated": true,
244
+ "description": "Automatically updated when step is modified"
245
+ },
246
+ "onboarding_schema": {
247
+ "type": "ManyToOne",
248
+ "target": "OnboardingSchema",
249
+ "foreignKey": "onboarding_schema_id",
250
+ "description": "Reference to parent onboarding schema - links this step to its containing onboarding schema"
251
+ }
252
+ },
253
+ "relationships": {
254
+ "substeps": {
255
+ "type": "OneToMany",
256
+ "target": "Substep",
257
+ "description": "Relationship to substeps within this step"
258
+ }
259
+ }
260
+ },
261
+ "Substep": {
262
+ "table": "substeps",
263
+ "description": "Each step is broken into substeps. Substeps represent individual components within a step.",
264
+ "fields": {
265
+ "id": {
266
+ "type": "varchar",
267
+ "primary": true,
268
+ "description": "Substep identifier - auto-generated UUID for unique substep identification"
269
+ },
270
+ "step": {
271
+ "type": "ManyToOne",
272
+ "target": "Step",
273
+ "foreignKey": "step_id",
274
+ "description": "Reference to parent step - links this substep to its containing step"
275
+ },
276
+ "order": {
277
+ "type": "int",
278
+ "description": "Order within the step - determines the sequence of substeps within a step"
279
+ },
280
+ "title_en": {
281
+ "type": "string",
282
+ "description": "Title in English - display text for English-speaking users"
283
+ },
284
+ "title_ar": {
285
+ "type": "string",
286
+ "description": "Title in Arabic - display text for Arabic-speaking users"
287
+ },
288
+ "created_at": {
289
+ "type": "timestamp",
290
+ "autoGenerated": true,
291
+ "description": "Automatically set when substep is created"
292
+ },
293
+ "updated_at": {
294
+ "type": "timestamp",
295
+ "autoGenerated": true,
296
+ "description": "Automatically updated when substep is modified"
297
+ }
298
+ },
299
+ "relationships": {
300
+ "groups": {
301
+ "type": "OneToMany",
302
+ "target": "Group",
303
+ "description": "Relationship to question groups within this substep"
304
+ },
305
+ "progress": {
306
+ "type": "OneToMany",
307
+ "target": "UserSubstepProgress",
308
+ "description": "Relationship to track progress for this substep"
309
+ }
310
+ }
311
+ },
312
+ "Group": {
313
+ "table": "groups",
314
+ "description": "Organizes questions into visual groups within a substep. This is a UI-driven feature to improve user experience.",
315
+ "fields": {
316
+ "id": {
317
+ "type": "varchar",
318
+ "primary": true,
319
+ "description": "Group identifier - string-based ID from onboarding structure"
320
+ },
321
+ "title_en": {
322
+ "type": "varchar(255)",
323
+ "description": "Title in English - display text for English-speaking users"
324
+ },
325
+ "title_ar": {
326
+ "type": "varchar(255)",
327
+ "nullable": true,
328
+ "description": "Title in Arabic - display text for Arabic-speaking users"
329
+ },
330
+ "order": {
331
+ "type": "int",
332
+ "description": "Order within the substep - determines the display sequence of groups"
333
+ },
334
+ "type": {
335
+ "type": "enum",
336
+ "values": ["group", "readonly_info", "question"],
337
+ "default": "group",
338
+ "description": "Type of group"
339
+ },
340
+ "required": {
341
+ "type": "boolean",
342
+ "default": false,
343
+ "description": "Is this group required?"
344
+ },
345
+ "metadata": {
346
+ "type": "jsonb",
347
+ "nullable": true,
348
+ "description": "Optional metadata for group configuration"
349
+ },
350
+ "substep": {
351
+ "type": "ManyToOne",
352
+ "target": "Substep",
353
+ "foreignKey": "substep_id",
354
+ "description": "Reference to the parent substep - links this group to its containing substep"
355
+ },
356
+ "created_at": {
357
+ "type": "timestamp",
358
+ "autoGenerated": true,
359
+ "description": "Automatically set when group is created"
360
+ },
361
+ "updated_at": {
362
+ "type": "timestamp",
363
+ "autoGenerated": true,
364
+ "description": "Automatically updated when group is modified"
365
+ }
366
+ },
367
+ "relationships": {
368
+ "questions": {
369
+ "type": "OneToMany",
370
+ "target": "Question",
371
+ "description": "Questions within this group - one group can contain multiple questions"
372
+ }
373
+ }
374
+ },
375
+ "Question": {
376
+ "table": "questions",
377
+ "description": "Stores the actual questions per substep. Each question can have different input types and validation rules.",
378
+ "fields": {
379
+ "id": {
380
+ "type": "varchar",
381
+ "primary": true,
382
+ "description": "Unique question ID - string-based ID from onboarding structure"
383
+ },
384
+ "group": {
385
+ "type": "ManyToOne",
386
+ "target": "Group",
387
+ "foreignKey": "group_id",
388
+ "description": "Reference to parent question group - links this question to a visual group within the substep"
389
+ },
390
+ "label_en": {
391
+ "type": "string",
392
+ "description": "Question text in English - the actual question displayed to English-speaking users"
393
+ },
394
+ "label_ar": {
395
+ "type": "string",
396
+ "description": "Question text in Arabic - the actual question displayed to Arabic-speaking users"
397
+ },
398
+ "type": {
399
+ "type": "enum",
400
+ "values": ["text", "number", "single_choice", "multiple_choice", "date", "time", "datetime", "phone", "email", "url", "address", "yes_no", "multi_choice", "checkbox", "object"],
401
+ "description": "Question input type - determines the UI component and validation rules"
402
+ },
403
+ "metadata": {
404
+ "type": "jsonb",
405
+ "nullable": true,
406
+ "description": "Optional metadata for question configuration - includes options, prefilled, source, editable, readonlyReason, placeholder, productTypes, riskSplit, includeAmount"
407
+ },
408
+ "required": {
409
+ "type": "boolean",
410
+ "default": false,
411
+ "description": "Is answering mandatory? - if true, user must provide an answer to continue"
412
+ },
413
+ "created_at": {
414
+ "type": "timestamp",
415
+ "autoGenerated": true,
416
+ "description": "Automatically set when question is created"
417
+ },
418
+ "updated_at": {
419
+ "type": "timestamp",
420
+ "autoGenerated": true,
421
+ "description": "Automatically updated when question is modified"
422
+ }
423
+ },
424
+ "relationships": {
425
+ "answers": {
426
+ "type": "OneToMany",
427
+ "target": "UserAnswer",
428
+ "description": "Relationship to track answers for this question"
429
+ }
430
+ }
431
+ }
432
+ },
433
+ "relationships": {
434
+ "Session -> UserSubstepProgress": "One-to-Many",
435
+ "Session -> UserAnswer": "One-to-Many",
436
+ "OnboardingSchema -> Step": "One-to-Many",
437
+ "Step -> Substep": "One-to-Many",
438
+ "Substep -> Group": "One-to-Many",
439
+ "Group -> Question": "One-to-Many",
440
+ "Substep -> UserSubstepProgress": "One-to-Many",
441
+ "Question -> UserAnswer": "One-to-Many"
442
+ },
443
+ "metadata": {
444
+ "totalEntities": 8,
445
+ "description": "Complete database schema for onboarding system with session management, progress tracking, and multi-language support",
446
+ "version": "1.0.0",
447
+ "created": "2024-01-01"
448
+ }
449
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finamaze_schema",
3
- "version": "1.54.0",
3
+ "version": "1.58.0",
4
4
  "description": "A package to connect two APIs with a single SQL database using TypeORM",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",