@api-client/core 0.18.24 → 0.18.26
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/DomainEntity.d.ts +6 -1
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +24 -5
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/Semantics.d.ts +254 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +328 -0
- package/build/src/modeling/Semantics.js.map +1 -1
- package/build/src/modeling/definitions/Email.js +1 -1
- package/build/src/modeling/definitions/Email.js.map +1 -1
- package/build/src/modeling/definitions/Password.d.ts.map +1 -1
- package/build/src/modeling/definitions/Password.js +1 -3
- package/build/src/modeling/definitions/Password.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 +24 -58
- 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 +248 -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.js +5 -5
- 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 +8 -8
- package/package.json +1 -1
- package/src/modeling/DomainEntity.ts +27 -5
- package/src/modeling/Semantics.ts +493 -0
- package/src/modeling/definitions/Email.ts +1 -1
- package/src/modeling/definitions/Password.ts +1 -3
- package/src/modeling/helpers/Intelisense.ts +33 -65
- 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 +285 -65
- package/src/modeling/templates/verticals/technology-media/blog-domain.ts +5 -5
- 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/definitions/password.spec.ts +0 -2
- package/tests/unit/modeling/domain_entity_parents.spec.ts +243 -0
- package/tests/unit/modeling/semantic_runtime.spec.ts +113 -0
- package/tests/unit/modeling/semantics.spec.ts +68 -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,219 @@ 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
|
+
})
|
|
164
|
+
|
|
165
|
+
// Status and verification
|
|
166
|
+
addCustomStatusField(userEntity, ['active', 'inactive', 'suspended', 'pending_verification', 'locked'], {
|
|
167
|
+
displayName: 'User Status',
|
|
168
|
+
description: 'Current status of the user account',
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
userEntity.addProperty({
|
|
172
|
+
info: { name: 'email_verified', displayName: 'Email Verified', description: 'Whether user email is verified' },
|
|
173
|
+
type: 'boolean',
|
|
174
|
+
required: true,
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
userEntity.addProperty({
|
|
178
|
+
info: { name: 'last_login', displayName: 'Last Login', description: 'When user last logged in' },
|
|
179
|
+
type: 'datetime',
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
addCreatedAtField(userEntity, { description: 'When the user account was created' })
|
|
183
|
+
addUpdatedAtField(userEntity, { description: 'When the user account was last updated' })
|
|
184
|
+
|
|
185
|
+
// Session Entity for authentication management
|
|
186
|
+
const sessionEntity = authModel.addEntity({
|
|
187
|
+
info: {
|
|
188
|
+
name: 'user_session',
|
|
189
|
+
displayName: 'User Session',
|
|
190
|
+
description: 'Active user authentication sessions',
|
|
191
|
+
},
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
addIdField(sessionEntity, { displayName: 'Session ID', description: 'Unique session identifier' })
|
|
195
|
+
|
|
196
|
+
sessionEntity.addProperty({
|
|
197
|
+
info: { name: 'token', displayName: 'Session Token', description: 'Authentication token for the session' },
|
|
198
|
+
type: 'string',
|
|
199
|
+
required: true,
|
|
200
|
+
writeOnly: true,
|
|
201
|
+
})
|
|
103
202
|
|
|
104
|
-
|
|
203
|
+
sessionEntity.addProperty({
|
|
204
|
+
info: { name: 'expires_at', displayName: 'Expires At', description: 'When the session expires' },
|
|
205
|
+
type: 'datetime',
|
|
206
|
+
required: true,
|
|
207
|
+
})
|
|
208
|
+
|
|
209
|
+
sessionEntity.addProperty({
|
|
210
|
+
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the session' },
|
|
211
|
+
type: 'string',
|
|
212
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
addCreatedAtField(sessionEntity, { description: 'When the session was created' })
|
|
216
|
+
|
|
217
|
+
// User-Session Association
|
|
218
|
+
userEntity.addAssociation(
|
|
219
|
+
{ key: sessionEntity.key },
|
|
220
|
+
{
|
|
221
|
+
info: { name: 'sessions', displayName: 'User Sessions', description: 'Active sessions for this user' },
|
|
222
|
+
required: false,
|
|
223
|
+
multiple: true,
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
// Profile Model (for extended user information)
|
|
228
|
+
const profileModel = userManagement.addModel({
|
|
229
|
+
info: {
|
|
230
|
+
name: 'User Profiles',
|
|
231
|
+
displayName: 'User Profile Management',
|
|
232
|
+
description: 'Extended user profile information and preferences',
|
|
233
|
+
},
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
// Customer Profile Entity (for customer-specific information)
|
|
237
|
+
const customerProfileEntity = profileModel.addEntity({
|
|
238
|
+
info: {
|
|
239
|
+
name: 'customer_profile',
|
|
240
|
+
displayName: 'Customer Profile',
|
|
241
|
+
description: 'Additional profile information specific to customers',
|
|
242
|
+
},
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
addIdField(customerProfileEntity, { displayName: 'Profile ID', description: 'Unique profile identifier' })
|
|
246
|
+
|
|
247
|
+
customerProfileEntity.addProperty({
|
|
105
248
|
info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Customer date of birth' },
|
|
106
249
|
type: 'date',
|
|
107
250
|
required: true,
|
|
108
251
|
})
|
|
109
252
|
|
|
110
|
-
|
|
253
|
+
customerProfileEntity.addProperty({
|
|
111
254
|
info: { name: 'ssn', displayName: 'Social Security Number', description: 'Customer SSN for identification' },
|
|
112
255
|
type: 'string',
|
|
113
256
|
required: true,
|
|
114
|
-
writeOnly: true,
|
|
257
|
+
writeOnly: true,
|
|
115
258
|
})
|
|
116
259
|
|
|
117
|
-
|
|
118
|
-
addPhoneField(customerEntity, { description: 'Customer phone number' })
|
|
119
|
-
|
|
120
|
-
customerEntity.addProperty({
|
|
260
|
+
customerProfileEntity.addProperty({
|
|
121
261
|
info: { name: 'address', displayName: 'Address', description: 'Customer residential address' },
|
|
122
262
|
type: 'string',
|
|
123
263
|
required: true,
|
|
124
264
|
})
|
|
125
265
|
|
|
126
|
-
|
|
266
|
+
customerProfileEntity.addProperty({
|
|
127
267
|
info: { name: 'city', displayName: 'City', description: 'Customer city' },
|
|
128
268
|
type: 'string',
|
|
129
269
|
required: true,
|
|
130
270
|
})
|
|
131
271
|
|
|
132
|
-
|
|
272
|
+
customerProfileEntity.addProperty({
|
|
133
273
|
info: { name: 'state', displayName: 'State', description: 'Customer state' },
|
|
134
274
|
type: 'string',
|
|
135
275
|
required: true,
|
|
136
276
|
})
|
|
137
277
|
|
|
138
|
-
|
|
278
|
+
customerProfileEntity.addProperty({
|
|
139
279
|
info: { name: 'zip_code', displayName: 'ZIP Code', description: 'Customer ZIP code' },
|
|
140
280
|
type: 'string',
|
|
141
281
|
required: true,
|
|
142
282
|
})
|
|
143
283
|
|
|
144
|
-
|
|
145
|
-
displayName: 'Customer Status',
|
|
146
|
-
description: 'Current status of the customer account',
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
customerEntity.addProperty({
|
|
284
|
+
customerProfileEntity.addProperty({
|
|
150
285
|
info: { name: 'customer_type', displayName: 'Customer Type', description: 'Type of customer account' },
|
|
151
286
|
type: 'string',
|
|
152
287
|
required: true,
|
|
@@ -155,13 +290,95 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
155
290
|
},
|
|
156
291
|
})
|
|
157
292
|
|
|
158
|
-
addCreatedAtField(
|
|
159
|
-
addUpdatedAtField(
|
|
293
|
+
addCreatedAtField(customerProfileEntity, { description: 'When the customer profile was created' })
|
|
294
|
+
addUpdatedAtField(customerProfileEntity, { description: 'When the customer profile was last updated' })
|
|
295
|
+
|
|
296
|
+
// User-CustomerProfile Association (one-to-one for customers)
|
|
297
|
+
userEntity.addAssociation(
|
|
298
|
+
{ key: customerProfileEntity.key },
|
|
299
|
+
{
|
|
300
|
+
info: {
|
|
301
|
+
name: 'customer_profile',
|
|
302
|
+
displayName: 'Customer Profile',
|
|
303
|
+
description: 'Extended customer profile information',
|
|
304
|
+
},
|
|
305
|
+
required: false, // Only for customers, not employees
|
|
306
|
+
multiple: false,
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
// Employee Profile Entity (for employee-specific information)
|
|
311
|
+
const employeeProfileEntity = profileModel.addEntity({
|
|
312
|
+
info: {
|
|
313
|
+
name: 'employee_profile',
|
|
314
|
+
displayName: 'Employee Profile',
|
|
315
|
+
description: 'Additional profile information specific to employees',
|
|
316
|
+
},
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
addIdField(employeeProfileEntity, {
|
|
320
|
+
displayName: 'Employee Profile ID',
|
|
321
|
+
description: 'Unique employee profile identifier',
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
employeeProfileEntity.addProperty({
|
|
325
|
+
info: { name: 'employee_id', displayName: 'Employee ID', description: 'Company employee identifier' },
|
|
326
|
+
type: 'string',
|
|
327
|
+
required: true,
|
|
328
|
+
unique: true,
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
employeeProfileEntity.addProperty({
|
|
332
|
+
info: { name: 'department', displayName: 'Department', description: 'Employee department' },
|
|
333
|
+
type: 'string',
|
|
334
|
+
required: true,
|
|
335
|
+
schema: {
|
|
336
|
+
enum: [
|
|
337
|
+
'retail_banking',
|
|
338
|
+
'commercial_banking',
|
|
339
|
+
'investment_services',
|
|
340
|
+
'risk_management',
|
|
341
|
+
'compliance',
|
|
342
|
+
'operations',
|
|
343
|
+
'technology',
|
|
344
|
+
'human_resources',
|
|
345
|
+
'legal',
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
employeeProfileEntity.addProperty({
|
|
351
|
+
info: { name: 'hire_date', displayName: 'Hire Date', description: 'Employee hire date' },
|
|
352
|
+
type: 'date',
|
|
353
|
+
required: true,
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
employeeProfileEntity.addProperty({
|
|
357
|
+
info: { name: 'manager_id', displayName: 'Manager ID', description: 'Employee manager identifier' },
|
|
358
|
+
type: 'string',
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
addCreatedAtField(employeeProfileEntity, { description: 'When the employee profile was created' })
|
|
362
|
+
addUpdatedAtField(employeeProfileEntity, { description: 'When the employee profile was last updated' })
|
|
363
|
+
|
|
364
|
+
// User-EmployeeProfile Association (one-to-one for employees)
|
|
365
|
+
userEntity.addAssociation(
|
|
366
|
+
{ key: employeeProfileEntity.key },
|
|
367
|
+
{
|
|
368
|
+
info: {
|
|
369
|
+
name: 'employee_profile',
|
|
370
|
+
displayName: 'Employee Profile',
|
|
371
|
+
description: 'Extended employee profile information',
|
|
372
|
+
},
|
|
373
|
+
required: false, // Only for employees, not customers
|
|
374
|
+
multiple: false,
|
|
375
|
+
}
|
|
376
|
+
)
|
|
160
377
|
|
|
161
|
-
// KYC Entity
|
|
162
|
-
const kycEntity =
|
|
378
|
+
// KYC Entity (enhanced for the unified approach)
|
|
379
|
+
const kycEntity = profileModel.addEntity({
|
|
163
380
|
info: {
|
|
164
|
-
name: '
|
|
381
|
+
name: 'kyc_record',
|
|
165
382
|
displayName: 'KYC Record',
|
|
166
383
|
description: 'Know Your Customer verification and documentation',
|
|
167
384
|
},
|
|
@@ -195,19 +412,20 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
195
412
|
})
|
|
196
413
|
|
|
197
414
|
addCreatedAtField(kycEntity, { description: 'When the KYC record was created' })
|
|
415
|
+
addUpdatedAtField(kycEntity, { description: 'When the KYC record was last updated' })
|
|
198
416
|
|
|
199
|
-
// KYC-
|
|
417
|
+
// KYC-User Association (One-to-One)
|
|
200
418
|
kycEntity.addAssociation(
|
|
201
|
-
{ key:
|
|
419
|
+
{ key: userEntity.key },
|
|
202
420
|
{
|
|
203
|
-
info: { name: '
|
|
421
|
+
info: { name: 'user', displayName: 'User', description: 'User for this KYC record' },
|
|
204
422
|
required: true,
|
|
205
423
|
multiple: false,
|
|
206
424
|
}
|
|
207
425
|
)
|
|
208
426
|
|
|
209
427
|
// Risk Profile Entity
|
|
210
|
-
const riskProfileEntity =
|
|
428
|
+
const riskProfileEntity = profileModel.addEntity({
|
|
211
429
|
info: {
|
|
212
430
|
name: 'risk_profile',
|
|
213
431
|
displayName: 'Risk Profile',
|
|
@@ -244,12 +462,13 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
244
462
|
addDescriptionField(riskProfileEntity, { description: 'Risk assessment notes and factors' })
|
|
245
463
|
|
|
246
464
|
addCreatedAtField(riskProfileEntity, { description: 'When the risk profile was created' })
|
|
465
|
+
addUpdatedAtField(riskProfileEntity, { description: 'When the risk profile was last updated' })
|
|
247
466
|
|
|
248
|
-
// RiskProfile-
|
|
467
|
+
// RiskProfile-User Association (One-to-One)
|
|
249
468
|
riskProfileEntity.addAssociation(
|
|
250
|
-
{ key:
|
|
469
|
+
{ key: userEntity.key },
|
|
251
470
|
{
|
|
252
|
-
info: { name: '
|
|
471
|
+
info: { name: 'user', displayName: 'User', description: 'User for this risk profile' },
|
|
253
472
|
required: true,
|
|
254
473
|
multiple: false,
|
|
255
474
|
}
|
|
@@ -324,11 +543,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
324
543
|
addCreatedAtField(bankAccountEntity, { description: 'When the account was created' })
|
|
325
544
|
addUpdatedAtField(bankAccountEntity, { description: 'When the account was last updated' })
|
|
326
545
|
|
|
327
|
-
// BankAccount-
|
|
546
|
+
// BankAccount-User Association (Many-to-One)
|
|
328
547
|
bankAccountEntity.addAssociation(
|
|
329
|
-
{ key:
|
|
548
|
+
{ key: userEntity.key },
|
|
330
549
|
{
|
|
331
|
-
info: { name: '
|
|
550
|
+
info: { name: 'user', displayName: 'Account Holder', description: 'User who owns this account' },
|
|
332
551
|
required: true,
|
|
333
552
|
multiple: false,
|
|
334
553
|
}
|
|
@@ -379,14 +598,14 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
379
598
|
|
|
380
599
|
addCreatedAtField(investmentAccountEntity, { description: 'When the investment account was created' })
|
|
381
600
|
|
|
382
|
-
// InvestmentAccount-
|
|
601
|
+
// InvestmentAccount-User Association (Many-to-One)
|
|
383
602
|
investmentAccountEntity.addAssociation(
|
|
384
|
-
{ key:
|
|
603
|
+
{ key: userEntity.key },
|
|
385
604
|
{
|
|
386
605
|
info: {
|
|
387
|
-
name: '
|
|
606
|
+
name: 'user',
|
|
388
607
|
displayName: 'Account Holder',
|
|
389
|
-
description: '
|
|
608
|
+
description: 'User who owns this investment account',
|
|
390
609
|
},
|
|
391
610
|
required: true,
|
|
392
611
|
multiple: false,
|
|
@@ -440,11 +659,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
440
659
|
|
|
441
660
|
addCreatedAtField(creditCardEntity, { description: 'When the credit card was created' })
|
|
442
661
|
|
|
443
|
-
// CreditCard-
|
|
662
|
+
// CreditCard-User Association (Many-to-One)
|
|
444
663
|
creditCardEntity.addAssociation(
|
|
445
|
-
{ key:
|
|
664
|
+
{ key: userEntity.key },
|
|
446
665
|
{
|
|
447
|
-
info: { name: '
|
|
666
|
+
info: { name: 'user', displayName: 'Cardholder', description: 'User who owns this credit card' },
|
|
448
667
|
required: true,
|
|
449
668
|
multiple: false,
|
|
450
669
|
}
|
|
@@ -455,7 +674,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
455
674
|
//
|
|
456
675
|
const transactionProcessing = domain.addNamespace({
|
|
457
676
|
info: {
|
|
458
|
-
name: '
|
|
677
|
+
name: 'Transaction Processing',
|
|
459
678
|
displayName: 'Transaction Processing',
|
|
460
679
|
description: 'Payments, transfers, deposits, and withdrawals',
|
|
461
680
|
},
|
|
@@ -528,11 +747,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
528
747
|
|
|
529
748
|
addCreatedAtField(transactionEntity, { description: 'When the transaction was created' })
|
|
530
749
|
|
|
531
|
-
// Transaction-
|
|
750
|
+
// Transaction-User Association (Many-to-One)
|
|
532
751
|
transactionEntity.addAssociation(
|
|
533
|
-
{ key:
|
|
752
|
+
{ key: userEntity.key },
|
|
534
753
|
{
|
|
535
|
-
info: { name: '
|
|
754
|
+
info: { name: 'user', displayName: 'User', description: 'User who initiated the transaction' },
|
|
536
755
|
required: true,
|
|
537
756
|
multiple: false,
|
|
538
757
|
}
|
|
@@ -601,7 +820,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
601
820
|
//
|
|
602
821
|
const investmentPortfolio = domain.addNamespace({
|
|
603
822
|
info: {
|
|
604
|
-
name: '
|
|
823
|
+
name: 'Investment Portfolio',
|
|
605
824
|
displayName: 'Investment Portfolio',
|
|
606
825
|
description: 'Assets, positions, and performance tracking',
|
|
607
826
|
},
|
|
@@ -760,7 +979,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
760
979
|
//
|
|
761
980
|
const complianceReporting = domain.addNamespace({
|
|
762
981
|
info: {
|
|
763
|
-
name: '
|
|
982
|
+
name: 'Compliance Reporting',
|
|
764
983
|
displayName: 'Compliance & Reporting',
|
|
765
984
|
description: 'Regulatory reporting and audit trails',
|
|
766
985
|
},
|
|
@@ -813,6 +1032,7 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
813
1032
|
auditTrailEntity.addProperty({
|
|
814
1033
|
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the user' },
|
|
815
1034
|
type: 'string',
|
|
1035
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
816
1036
|
})
|
|
817
1037
|
|
|
818
1038
|
addDescriptionField(auditTrailEntity, { description: 'Additional details about the action' })
|
|
@@ -929,11 +1149,11 @@ export default function createFinancialServicesDomain(options: CreateTemplateOpt
|
|
|
929
1149
|
}
|
|
930
1150
|
)
|
|
931
1151
|
|
|
932
|
-
// FraudAlert-
|
|
1152
|
+
// FraudAlert-User Association (Many-to-One)
|
|
933
1153
|
fraudAlertEntity.addAssociation(
|
|
934
|
-
{ key:
|
|
1154
|
+
{ key: userEntity.key },
|
|
935
1155
|
{
|
|
936
|
-
info: { name: '
|
|
1156
|
+
info: { name: 'user', displayName: 'User', description: 'User associated with the alert' },
|
|
937
1157
|
required: true,
|
|
938
1158
|
multiple: false,
|
|
939
1159
|
}
|
|
@@ -634,11 +634,11 @@ export default function createBlogDomain(options: CreateTemplateOptions = {}): D
|
|
|
634
634
|
semantics: [createURLSemantic()],
|
|
635
635
|
})
|
|
636
636
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
637
|
+
pageViewEntity.addProperty({
|
|
638
|
+
info: { name: 'ip_address', displayName: 'IP Address', description: 'Visitor IP address' },
|
|
639
|
+
type: 'string',
|
|
640
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
641
|
+
})
|
|
642
642
|
|
|
643
643
|
pageViewEntity.addProperty({
|
|
644
644
|
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({
|