@api-client/core 0.18.25 → 0.18.27
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.
- package/build/src/modeling/Semantics.d.ts +193 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +134 -0
- package/build/src/modeling/Semantics.js.map +1 -1
- package/build/src/modeling/helpers/Intelisense.d.ts +7 -7
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +1 -1
- package/build/src/modeling/templates/meta/financial-services-platform.json +1 -1
- package/build/src/modeling/templates/meta/index.d.ts +1 -1
- package/build/src/modeling/templates/meta/index.js +1 -1
- package/build/src/modeling/templates/meta/index.js.map +1 -1
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -1
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +249 -63
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js +17 -9
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -1
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +2 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -1
- package/build/src/modeling/validation/postgresql.d.ts.map +1 -1
- package/build/src/modeling/validation/postgresql.js +0 -1
- package/build/src/modeling/validation/postgresql.js.map +1 -1
- package/build/src/runtime/modeling/Semantics.d.ts +84 -0
- package/build/src/runtime/modeling/Semantics.d.ts.map +1 -0
- package/build/src/runtime/modeling/Semantics.js +124 -0
- package/build/src/runtime/modeling/Semantics.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +14 -14
- package/package.json +1 -1
- package/src/modeling/Semantics.ts +262 -0
- package/src/modeling/helpers/Intelisense.ts +7 -7
- package/src/modeling/templates/meta/blog-publishing-platform.json +1 -1
- package/src/modeling/templates/meta/financial-services-platform.json +1 -1
- package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -1
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +286 -65
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +17 -9
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +2 -0
- package/src/modeling/validation/postgresql.ts +0 -1
- package/src/runtime/modeling/Semantics.ts +196 -0
- package/tests/unit/modeling/client_ip_address_semantic.spec.ts +71 -0
- package/tests/unit/modeling/username_semantic.spec.ts +81 -0
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { DataDomain } from '../../../DataDomain.js'
|
|
27
|
+
import { SemanticType } from '../../../Semantics.js'
|
|
27
28
|
import {
|
|
28
29
|
addIdField,
|
|
29
30
|
addNameField,
|
|
@@ -68,85 +69,220 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
68
69
|
const domain = options.domain ?? createDomain()
|
|
69
70
|
|
|
70
71
|
//
|
|
71
|
-
// 1.
|
|
72
|
+
// 1. USER & AUTHENTICATION NAMESPACE (Unified for customers and employees)
|
|
72
73
|
//
|
|
73
|
-
const
|
|
74
|
+
const userManagement = domain.addNamespace({
|
|
74
75
|
info: {
|
|
75
|
-
name: '
|
|
76
|
-
displayName: '
|
|
77
|
-
description: '
|
|
76
|
+
name: 'User Management',
|
|
77
|
+
displayName: 'User & Authentication Management',
|
|
78
|
+
description: 'Unified user authentication, roles, and profile management for customers and employees',
|
|
78
79
|
},
|
|
79
80
|
})
|
|
80
81
|
|
|
81
|
-
//
|
|
82
|
-
const
|
|
82
|
+
// Authentication Model
|
|
83
|
+
const authModel = userManagement.addModel({
|
|
83
84
|
info: {
|
|
84
|
-
name: '
|
|
85
|
-
displayName: '
|
|
86
|
-
description: '
|
|
85
|
+
name: 'Authentication',
|
|
86
|
+
displayName: 'Authentication & Access Control',
|
|
87
|
+
description: 'User authentication, sessions, and access control',
|
|
87
88
|
},
|
|
88
89
|
})
|
|
89
90
|
|
|
90
|
-
// Customer
|
|
91
|
-
const
|
|
91
|
+
// Unified User Entity (replaces separate Customer and Employee entities)
|
|
92
|
+
const userEntity = authModel.addEntity({
|
|
92
93
|
info: {
|
|
93
|
-
name: '
|
|
94
|
-
displayName: '
|
|
95
|
-
description: '
|
|
94
|
+
name: 'user',
|
|
95
|
+
displayName: 'User',
|
|
96
|
+
description: 'Unified user entity for both customers and employees with role-based access',
|
|
96
97
|
},
|
|
98
|
+
semantics: [{ id: SemanticType.User }], // Mark as a user entity for automatic behaviors
|
|
97
99
|
})
|
|
98
100
|
|
|
99
|
-
addIdField(
|
|
101
|
+
addIdField(userEntity, { displayName: 'User ID', description: 'Unique identifier for the user' })
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
// Authentication fields
|
|
104
|
+
userEntity.addProperty({
|
|
105
|
+
info: { name: 'username', displayName: 'Username', description: 'Unique username for login' },
|
|
106
|
+
type: 'string',
|
|
107
|
+
required: true,
|
|
108
|
+
unique: true,
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
userEntity.addProperty({
|
|
112
|
+
info: { name: 'password', displayName: 'Password', description: 'User password (hashed)' },
|
|
113
|
+
type: 'string',
|
|
114
|
+
required: true,
|
|
115
|
+
writeOnly: true,
|
|
116
|
+
semantics: [{ id: SemanticType.Password }], // Automatic password security behaviors
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const emailProperty = addEmailField(userEntity, { description: 'User email address' })
|
|
120
|
+
emailProperty.required = true
|
|
121
|
+
emailProperty.unique = true
|
|
122
|
+
|
|
123
|
+
// Personal Information
|
|
124
|
+
addFirstNameField(userEntity, { description: 'User first name' })
|
|
125
|
+
addLastNameField(userEntity, { description: 'User last name' })
|
|
126
|
+
addPhoneField(userEntity, { description: 'User phone number' })
|
|
127
|
+
|
|
128
|
+
// User Type & Role (unified approach)
|
|
129
|
+
userEntity.addProperty({
|
|
130
|
+
info: { name: 'user_type', displayName: 'User Type', description: 'Type of user account' },
|
|
131
|
+
type: 'string',
|
|
132
|
+
required: true,
|
|
133
|
+
schema: {
|
|
134
|
+
enum: ['customer', 'employee', 'admin', 'system'],
|
|
135
|
+
},
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
userEntity.addProperty({
|
|
139
|
+
info: { name: 'role', displayName: 'User Role', description: 'User role defining permissions and access level' },
|
|
140
|
+
type: 'string',
|
|
141
|
+
required: true,
|
|
142
|
+
schema: {
|
|
143
|
+
enum: [
|
|
144
|
+
// Customer roles
|
|
145
|
+
'individual_customer',
|
|
146
|
+
'business_customer',
|
|
147
|
+
'premium_customer',
|
|
148
|
+
'private_banking_customer',
|
|
149
|
+
// Employee roles
|
|
150
|
+
'teller',
|
|
151
|
+
'loan_officer',
|
|
152
|
+
'relationship_manager',
|
|
153
|
+
'compliance_officer',
|
|
154
|
+
'branch_manager',
|
|
155
|
+
'investment_advisor',
|
|
156
|
+
'risk_analyst',
|
|
157
|
+
// Admin roles
|
|
158
|
+
'system_admin',
|
|
159
|
+
'security_admin',
|
|
160
|
+
'audit_admin',
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
semantics: [{ id: SemanticType.UserRole }],
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
// Status and verification
|
|
167
|
+
addCustomStatusField(userEntity, ['active', 'inactive', 'suspended', 'pending_verification', 'locked'], {
|
|
168
|
+
displayName: 'User Status',
|
|
169
|
+
description: 'Current status of the user account',
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
userEntity.addProperty({
|
|
173
|
+
info: { name: 'email_verified', displayName: 'Email Verified', description: 'Whether user email is verified' },
|
|
174
|
+
type: 'boolean',
|
|
175
|
+
required: true,
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
userEntity.addProperty({
|
|
179
|
+
info: { name: 'last_login', displayName: 'Last Login', description: 'When user last logged in' },
|
|
180
|
+
type: 'datetime',
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
addCreatedAtField(userEntity, { description: 'When the user account was created' })
|
|
184
|
+
addUpdatedAtField(userEntity, { description: 'When the user account was last updated' })
|
|
185
|
+
|
|
186
|
+
// Session Entity for authentication management
|
|
187
|
+
const sessionEntity = authModel.addEntity({
|
|
188
|
+
info: {
|
|
189
|
+
name: 'user_session',
|
|
190
|
+
displayName: 'User Session',
|
|
191
|
+
description: 'Active user authentication sessions',
|
|
192
|
+
},
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
addIdField(sessionEntity, { displayName: 'Session ID', description: 'Unique session identifier' })
|
|
196
|
+
|
|
197
|
+
sessionEntity.addProperty({
|
|
198
|
+
info: { name: 'token', displayName: 'Session Token', description: 'Authentication token for the session' },
|
|
199
|
+
type: 'string',
|
|
200
|
+
required: true,
|
|
201
|
+
writeOnly: true,
|
|
202
|
+
})
|
|
103
203
|
|
|
104
|
-
|
|
204
|
+
sessionEntity.addProperty({
|
|
205
|
+
info: { name: 'expires_at', displayName: 'Expires At', description: 'When the session expires' },
|
|
206
|
+
type: 'datetime',
|
|
207
|
+
required: true,
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
sessionEntity.addProperty({
|
|
211
|
+
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the session' },
|
|
212
|
+
type: 'string',
|
|
213
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
addCreatedAtField(sessionEntity, { description: 'When the session was created' })
|
|
217
|
+
|
|
218
|
+
// User-Session Association
|
|
219
|
+
userEntity.addAssociation(
|
|
220
|
+
{ key: sessionEntity.key },
|
|
221
|
+
{
|
|
222
|
+
info: { name: 'sessions', displayName: 'User Sessions', description: 'Active sessions for this user' },
|
|
223
|
+
required: false,
|
|
224
|
+
multiple: true,
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
// Profile Model (for extended user information)
|
|
229
|
+
const profileModel = userManagement.addModel({
|
|
230
|
+
info: {
|
|
231
|
+
name: 'User Profiles',
|
|
232
|
+
displayName: 'User Profile Management',
|
|
233
|
+
description: 'Extended user profile information and preferences',
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
// Customer Profile Entity (for customer-specific information)
|
|
238
|
+
const customerProfileEntity = profileModel.addEntity({
|
|
239
|
+
info: {
|
|
240
|
+
name: 'customer_profile',
|
|
241
|
+
displayName: 'Customer Profile',
|
|
242
|
+
description: 'Additional profile information specific to customers',
|
|
243
|
+
},
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
addIdField(customerProfileEntity, { displayName: 'Profile ID', description: 'Unique profile identifier' })
|
|
247
|
+
|
|
248
|
+
customerProfileEntity.addProperty({
|
|
105
249
|
info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Customer date of birth' },
|
|
106
250
|
type: 'date',
|
|
107
251
|
required: true,
|
|
108
252
|
})
|
|
109
253
|
|
|
110
|
-
|
|
254
|
+
customerProfileEntity.addProperty({
|
|
111
255
|
info: { name: 'ssn', displayName: 'Social Security Number', description: 'Customer SSN for identification' },
|
|
112
256
|
type: 'string',
|
|
113
257
|
required: true,
|
|
114
|
-
writeOnly: true,
|
|
258
|
+
writeOnly: true,
|
|
115
259
|
})
|
|
116
260
|
|
|
117
|
-
|
|
118
|
-
addPhoneField(customerEntity, { description: 'Customer phone number' })
|
|
119
|
-
|
|
120
|
-
customerEntity.addProperty({
|
|
261
|
+
customerProfileEntity.addProperty({
|
|
121
262
|
info: { name: 'address', displayName: 'Address', description: 'Customer residential address' },
|
|
122
263
|
type: 'string',
|
|
123
264
|
required: true,
|
|
124
265
|
})
|
|
125
266
|
|
|
126
|
-
|
|
267
|
+
customerProfileEntity.addProperty({
|
|
127
268
|
info: { name: 'city', displayName: 'City', description: 'Customer city' },
|
|
128
269
|
type: 'string',
|
|
129
270
|
required: true,
|
|
130
271
|
})
|
|
131
272
|
|
|
132
|
-
|
|
273
|
+
customerProfileEntity.addProperty({
|
|
133
274
|
info: { name: 'state', displayName: 'State', description: 'Customer state' },
|
|
134
275
|
type: 'string',
|
|
135
276
|
required: true,
|
|
136
277
|
})
|
|
137
278
|
|
|
138
|
-
|
|
279
|
+
customerProfileEntity.addProperty({
|
|
139
280
|
info: { name: 'zip_code', displayName: 'ZIP Code', description: 'Customer ZIP code' },
|
|
140
281
|
type: 'string',
|
|
141
282
|
required: true,
|
|
142
283
|
})
|
|
143
284
|
|
|
144
|
-
|
|
145
|
-
displayName: 'Customer Status',
|
|
146
|
-
description: 'Current status of the customer account',
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
customerEntity.addProperty({
|
|
285
|
+
customerProfileEntity.addProperty({
|
|
150
286
|
info: { name: 'customer_type', displayName: 'Customer Type', description: 'Type of customer account' },
|
|
151
287
|
type: 'string',
|
|
152
288
|
required: true,
|
|
@@ -155,13 +291,95 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
155
291
|
},
|
|
156
292
|
})
|
|
157
293
|
|
|
158
|
-
addCreatedAtField(
|
|
159
|
-
addUpdatedAtField(
|
|
294
|
+
addCreatedAtField(customerProfileEntity, { description: 'When the customer profile was created' })
|
|
295
|
+
addUpdatedAtField(customerProfileEntity, { description: 'When the customer profile was last updated' })
|
|
296
|
+
|
|
297
|
+
// User-CustomerProfile Association (one-to-one for customers)
|
|
298
|
+
userEntity.addAssociation(
|
|
299
|
+
{ key: customerProfileEntity.key },
|
|
300
|
+
{
|
|
301
|
+
info: {
|
|
302
|
+
name: 'customer_profile',
|
|
303
|
+
displayName: 'Customer Profile',
|
|
304
|
+
description: 'Extended customer profile information',
|
|
305
|
+
},
|
|
306
|
+
required: false, // Only for customers, not employees
|
|
307
|
+
multiple: false,
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
// Employee Profile Entity (for employee-specific information)
|
|
312
|
+
const employeeProfileEntity = profileModel.addEntity({
|
|
313
|
+
info: {
|
|
314
|
+
name: 'employee_profile',
|
|
315
|
+
displayName: 'Employee Profile',
|
|
316
|
+
description: 'Additional profile information specific to employees',
|
|
317
|
+
},
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
addIdField(employeeProfileEntity, {
|
|
321
|
+
displayName: 'Employee Profile ID',
|
|
322
|
+
description: 'Unique employee profile identifier',
|
|
323
|
+
})
|
|
324
|
+
|
|
325
|
+
employeeProfileEntity.addProperty({
|
|
326
|
+
info: { name: 'employee_id', displayName: 'Employee ID', description: 'Company employee identifier' },
|
|
327
|
+
type: 'string',
|
|
328
|
+
required: true,
|
|
329
|
+
unique: true,
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
employeeProfileEntity.addProperty({
|
|
333
|
+
info: { name: 'department', displayName: 'Department', description: 'Employee department' },
|
|
334
|
+
type: 'string',
|
|
335
|
+
required: true,
|
|
336
|
+
schema: {
|
|
337
|
+
enum: [
|
|
338
|
+
'retail_banking',
|
|
339
|
+
'commercial_banking',
|
|
340
|
+
'investment_services',
|
|
341
|
+
'risk_management',
|
|
342
|
+
'compliance',
|
|
343
|
+
'operations',
|
|
344
|
+
'technology',
|
|
345
|
+
'human_resources',
|
|
346
|
+
'legal',
|
|
347
|
+
],
|
|
348
|
+
},
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
employeeProfileEntity.addProperty({
|
|
352
|
+
info: { name: 'hire_date', displayName: 'Hire Date', description: 'Employee hire date' },
|
|
353
|
+
type: 'date',
|
|
354
|
+
required: true,
|
|
355
|
+
})
|
|
356
|
+
|
|
357
|
+
employeeProfileEntity.addProperty({
|
|
358
|
+
info: { name: 'manager_id', displayName: 'Manager ID', description: 'Employee manager identifier' },
|
|
359
|
+
type: 'string',
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
addCreatedAtField(employeeProfileEntity, { description: 'When the employee profile was created' })
|
|
363
|
+
addUpdatedAtField(employeeProfileEntity, { description: 'When the employee profile was last updated' })
|
|
364
|
+
|
|
365
|
+
// User-EmployeeProfile Association (one-to-one for employees)
|
|
366
|
+
userEntity.addAssociation(
|
|
367
|
+
{ key: employeeProfileEntity.key },
|
|
368
|
+
{
|
|
369
|
+
info: {
|
|
370
|
+
name: 'employee_profile',
|
|
371
|
+
displayName: 'Employee Profile',
|
|
372
|
+
description: 'Extended employee profile information',
|
|
373
|
+
},
|
|
374
|
+
required: false, // Only for employees, not customers
|
|
375
|
+
multiple: false,
|
|
376
|
+
}
|
|
377
|
+
)
|
|
160
378
|
|
|
161
|
-
// KYC Entity
|
|
162
|
-
const kycEntity =
|
|
379
|
+
// KYC Entity (enhanced for the unified approach)
|
|
380
|
+
const kycEntity = profileModel.addEntity({
|
|
163
381
|
info: {
|
|
164
|
-
name: '
|
|
382
|
+
name: 'kyc_record',
|
|
165
383
|
displayName: 'KYC Record',
|
|
166
384
|
description: 'Know Your Customer verification and documentation',
|
|
167
385
|
},
|
|
@@ -195,19 +413,20 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
195
413
|
})
|
|
196
414
|
|
|
197
415
|
addCreatedAtField(kycEntity, { description: 'When the KYC record was created' })
|
|
416
|
+
addUpdatedAtField(kycEntity, { description: 'When the KYC record was last updated' })
|
|
198
417
|
|
|
199
|
-
// KYC-
|
|
418
|
+
// KYC-User Association (One-to-One)
|
|
200
419
|
kycEntity.addAssociation(
|
|
201
|
-
{ key:
|
|
420
|
+
{ key: userEntity.key },
|
|
202
421
|
{
|
|
203
|
-
info: { name: '
|
|
422
|
+
info: { name: 'user', displayName: 'User', description: 'User for this KYC record' },
|
|
204
423
|
required: true,
|
|
205
424
|
multiple: false,
|
|
206
425
|
}
|
|
207
426
|
)
|
|
208
427
|
|
|
209
428
|
// Risk Profile Entity
|
|
210
|
-
const riskProfileEntity =
|
|
429
|
+
const riskProfileEntity = profileModel.addEntity({
|
|
211
430
|
info: {
|
|
212
431
|
name: 'risk_profile',
|
|
213
432
|
displayName: 'Risk Profile',
|
|
@@ -244,12 +463,13 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
244
463
|
addDescriptionField(riskProfileEntity, { description: 'Risk assessment notes and factors' })
|
|
245
464
|
|
|
246
465
|
addCreatedAtField(riskProfileEntity, { description: 'When the risk profile was created' })
|
|
466
|
+
addUpdatedAtField(riskProfileEntity, { description: 'When the risk profile was last updated' })
|
|
247
467
|
|
|
248
|
-
// RiskProfile-
|
|
468
|
+
// RiskProfile-User Association (One-to-One)
|
|
249
469
|
riskProfileEntity.addAssociation(
|
|
250
|
-
{ key:
|
|
470
|
+
{ key: userEntity.key },
|
|
251
471
|
{
|
|
252
|
-
info: { name: '
|
|
472
|
+
info: { name: 'user', displayName: 'User', description: 'User for this risk profile' },
|
|
253
473
|
required: true,
|
|
254
474
|
multiple: false,
|
|
255
475
|
}
|
|
@@ -324,11 +544,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
324
544
|
addCreatedAtField(bankAccountEntity, { description: 'When the account was created' })
|
|
325
545
|
addUpdatedAtField(bankAccountEntity, { description: 'When the account was last updated' })
|
|
326
546
|
|
|
327
|
-
// BankAccount-
|
|
547
|
+
// BankAccount-User Association (Many-to-One)
|
|
328
548
|
bankAccountEntity.addAssociation(
|
|
329
|
-
{ key:
|
|
549
|
+
{ key: userEntity.key },
|
|
330
550
|
{
|
|
331
|
-
info: { name: '
|
|
551
|
+
info: { name: 'user', displayName: 'Account Holder', description: 'User who owns this account' },
|
|
332
552
|
required: true,
|
|
333
553
|
multiple: false,
|
|
334
554
|
}
|
|
@@ -379,14 +599,14 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
379
599
|
|
|
380
600
|
addCreatedAtField(investmentAccountEntity, { description: 'When the investment account was created' })
|
|
381
601
|
|
|
382
|
-
// InvestmentAccount-
|
|
602
|
+
// InvestmentAccount-User Association (Many-to-One)
|
|
383
603
|
investmentAccountEntity.addAssociation(
|
|
384
|
-
{ key:
|
|
604
|
+
{ key: userEntity.key },
|
|
385
605
|
{
|
|
386
606
|
info: {
|
|
387
|
-
name: '
|
|
607
|
+
name: 'user',
|
|
388
608
|
displayName: 'Account Holder',
|
|
389
|
-
description: '
|
|
609
|
+
description: 'User who owns this investment account',
|
|
390
610
|
},
|
|
391
611
|
required: true,
|
|
392
612
|
multiple: false,
|
|
@@ -440,11 +660,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
440
660
|
|
|
441
661
|
addCreatedAtField(creditCardEntity, { description: 'When the credit card was created' })
|
|
442
662
|
|
|
443
|
-
// CreditCard-
|
|
663
|
+
// CreditCard-User Association (Many-to-One)
|
|
444
664
|
creditCardEntity.addAssociation(
|
|
445
|
-
{ key:
|
|
665
|
+
{ key: userEntity.key },
|
|
446
666
|
{
|
|
447
|
-
info: { name: '
|
|
667
|
+
info: { name: 'user', displayName: 'Cardholder', description: 'User who owns this credit card' },
|
|
448
668
|
required: true,
|
|
449
669
|
multiple: false,
|
|
450
670
|
}
|
|
@@ -455,7 +675,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
455
675
|
//
|
|
456
676
|
const transactionProcessing = domain.addNamespace({
|
|
457
677
|
info: {
|
|
458
|
-
name: '
|
|
678
|
+
name: 'Transaction Processing',
|
|
459
679
|
displayName: 'Transaction Processing',
|
|
460
680
|
description: 'Payments, transfers, deposits, and withdrawals',
|
|
461
681
|
},
|
|
@@ -528,11 +748,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
528
748
|
|
|
529
749
|
addCreatedAtField(transactionEntity, { description: 'When the transaction was created' })
|
|
530
750
|
|
|
531
|
-
// Transaction-
|
|
751
|
+
// Transaction-User Association (Many-to-One)
|
|
532
752
|
transactionEntity.addAssociation(
|
|
533
|
-
{ key:
|
|
753
|
+
{ key: userEntity.key },
|
|
534
754
|
{
|
|
535
|
-
info: { name: '
|
|
755
|
+
info: { name: 'user', displayName: 'User', description: 'User who initiated the transaction' },
|
|
536
756
|
required: true,
|
|
537
757
|
multiple: false,
|
|
538
758
|
}
|
|
@@ -601,7 +821,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
601
821
|
//
|
|
602
822
|
const investmentPortfolio = domain.addNamespace({
|
|
603
823
|
info: {
|
|
604
|
-
name: '
|
|
824
|
+
name: 'Investment Portfolio',
|
|
605
825
|
displayName: 'Investment Portfolio',
|
|
606
826
|
description: 'Assets, positions, and performance tracking',
|
|
607
827
|
},
|
|
@@ -760,7 +980,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
760
980
|
//
|
|
761
981
|
const complianceReporting = domain.addNamespace({
|
|
762
982
|
info: {
|
|
763
|
-
name: '
|
|
983
|
+
name: 'Compliance Reporting',
|
|
764
984
|
displayName: 'Compliance & Reporting',
|
|
765
985
|
description: 'Regulatory reporting and audit trails',
|
|
766
986
|
},
|
|
@@ -813,6 +1033,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
813
1033
|
auditTrailEntity.addProperty({
|
|
814
1034
|
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the user' },
|
|
815
1035
|
type: 'string',
|
|
1036
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
816
1037
|
})
|
|
817
1038
|
|
|
818
1039
|
addDescriptionField(auditTrailEntity, { description: 'Additional details about the action' })
|
|
@@ -929,11 +1150,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
929
1150
|
}
|
|
930
1151
|
)
|
|
931
1152
|
|
|
932
|
-
// FraudAlert-
|
|
1153
|
+
// FraudAlert-User Association (Many-to-One)
|
|
933
1154
|
fraudAlertEntity.addAssociation(
|
|
934
|
-
{ key:
|
|
1155
|
+
{ key: userEntity.key },
|
|
935
1156
|
{
|
|
936
|
-
info: { name: '
|
|
1157
|
+
info: { name: 'user', displayName: 'User', description: 'User associated with the alert' },
|
|
937
1158
|
required: true,
|
|
938
1159
|
multiple: false,
|
|
939
1160
|
}
|
|
@@ -454,10 +454,18 @@ export default function createBlogDomain(options: CreateTemplateOptions = {}): D
|
|
|
454
454
|
// // semantics: [{ id: SemanticType.SocialMediaLinks }],
|
|
455
455
|
// })
|
|
456
456
|
|
|
457
|
-
|
|
458
|
-
name: 'role',
|
|
459
|
-
|
|
460
|
-
|
|
457
|
+
userEntity.addProperty({
|
|
458
|
+
info: { name: 'role', displayName: 'User Role', description: 'User role for permission management' },
|
|
459
|
+
type: 'string',
|
|
460
|
+
required: true,
|
|
461
|
+
schema: {
|
|
462
|
+
enum: ['subscriber', 'author', 'editor', 'admin', 'super_admin'],
|
|
463
|
+
defaultValue: {
|
|
464
|
+
type: 'literal',
|
|
465
|
+
value: 'subscriber',
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
semantics: [{ id: SemanticType.UserRole }],
|
|
461
469
|
})
|
|
462
470
|
|
|
463
471
|
addCustomStatusField(userEntity, ['active', 'inactive', 'suspended', 'pending_verification'], {
|
|
@@ -634,11 +642,11 @@ export default function createBlogDomain(options: CreateTemplateOptions = {}): D
|
|
|
634
642
|
semantics: [createURLSemantic()],
|
|
635
643
|
})
|
|
636
644
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
645
|
+
pageViewEntity.addProperty({
|
|
646
|
+
info: { name: 'ip_address', displayName: 'IP Address', description: 'Visitor IP address' },
|
|
647
|
+
type: 'string',
|
|
648
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
649
|
+
})
|
|
642
650
|
|
|
643
651
|
pageViewEntity.addProperty({
|
|
644
652
|
info: { name: 'user_agent', displayName: 'User Agent', description: 'Browser user agent string' },
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
addCreatedAtField,
|
|
42
42
|
addUpdatedAtField,
|
|
43
43
|
} from '../../../helpers/Intelisense.js'
|
|
44
|
+
import { SemanticType } from '../../../Semantics.js'
|
|
44
45
|
import type { CreateTemplateOptions } from '../../types.js'
|
|
45
46
|
|
|
46
47
|
function createDomain(): DataDomain {
|
|
@@ -156,6 +157,7 @@ export default function createIoTSmartHomeDomain(options: CreateTemplateOptions
|
|
|
156
157
|
info: { name: 'ip_address', displayName: 'IP Address', description: 'Device IP address' },
|
|
157
158
|
type: 'string',
|
|
158
159
|
required: false,
|
|
160
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
159
161
|
})
|
|
160
162
|
|
|
161
163
|
deviceEntity.addProperty({
|