@api-client/core 0.18.25 → 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/Semantics.d.ts +186 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -1
- package/build/src/modeling/Semantics.js +111 -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 +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 +12 -12
- package/package.json +1 -1
- package/src/modeling/Semantics.ts +239 -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 +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/build/src/modeling/templates/verticals/business-services/financial-services-domain.js
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
import { DataDomain } from '../../../DataDomain.js';
|
|
26
|
+
import { SemanticType } from '../../../Semantics.js';
|
|
26
27
|
import { addIdField, addNameField, addDescriptionField, addEmailField, addFirstNameField, addLastNameField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
|
|
27
28
|
function createDomain() {
|
|
28
29
|
return new DataDomain({
|
|
@@ -50,72 +51,186 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
50
51
|
// Ensure the root data domain
|
|
51
52
|
const domain = options.domain ?? createDomain();
|
|
52
53
|
//
|
|
53
|
-
// 1.
|
|
54
|
+
// 1. USER & AUTHENTICATION NAMESPACE (Unified for customers and employees)
|
|
54
55
|
//
|
|
55
|
-
const
|
|
56
|
+
const userManagement = domain.addNamespace({
|
|
56
57
|
info: {
|
|
57
|
-
name: '
|
|
58
|
-
displayName: '
|
|
59
|
-
description: '
|
|
58
|
+
name: 'User Management',
|
|
59
|
+
displayName: 'User & Authentication Management',
|
|
60
|
+
description: 'Unified user authentication, roles, and profile management for customers and employees',
|
|
60
61
|
},
|
|
61
62
|
});
|
|
62
|
-
//
|
|
63
|
-
const
|
|
63
|
+
// Authentication Model
|
|
64
|
+
const authModel = userManagement.addModel({
|
|
64
65
|
info: {
|
|
65
|
-
name: '
|
|
66
|
-
displayName: '
|
|
67
|
-
description: '
|
|
66
|
+
name: 'Authentication',
|
|
67
|
+
displayName: 'Authentication & Access Control',
|
|
68
|
+
description: 'User authentication, sessions, and access control',
|
|
68
69
|
},
|
|
69
70
|
});
|
|
70
|
-
// Customer
|
|
71
|
-
const
|
|
71
|
+
// Unified User Entity (replaces separate Customer and Employee entities)
|
|
72
|
+
const userEntity = authModel.addEntity({
|
|
72
73
|
info: {
|
|
73
|
-
name: '
|
|
74
|
-
displayName: '
|
|
75
|
-
description: '
|
|
74
|
+
name: 'user',
|
|
75
|
+
displayName: 'User',
|
|
76
|
+
description: 'Unified user entity for both customers and employees with role-based access',
|
|
76
77
|
},
|
|
78
|
+
semantics: [{ id: SemanticType.User }], // Mark as a user entity for automatic behaviors
|
|
77
79
|
});
|
|
78
|
-
addIdField(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
addIdField(userEntity, { displayName: 'User ID', description: 'Unique identifier for the user' });
|
|
81
|
+
// Authentication fields
|
|
82
|
+
userEntity.addProperty({
|
|
83
|
+
info: { name: 'username', displayName: 'Username', description: 'Unique username for login' },
|
|
84
|
+
type: 'string',
|
|
85
|
+
required: true,
|
|
86
|
+
unique: true,
|
|
87
|
+
});
|
|
88
|
+
userEntity.addProperty({
|
|
89
|
+
info: { name: 'password', displayName: 'Password', description: 'User password (hashed)' },
|
|
90
|
+
type: 'string',
|
|
91
|
+
required: true,
|
|
92
|
+
writeOnly: true,
|
|
93
|
+
semantics: [{ id: SemanticType.Password }], // Automatic password security behaviors
|
|
94
|
+
});
|
|
95
|
+
const emailProperty = addEmailField(userEntity, { description: 'User email address' });
|
|
96
|
+
emailProperty.required = true;
|
|
97
|
+
emailProperty.unique = true;
|
|
98
|
+
// Personal Information
|
|
99
|
+
addFirstNameField(userEntity, { description: 'User first name' });
|
|
100
|
+
addLastNameField(userEntity, { description: 'User last name' });
|
|
101
|
+
addPhoneField(userEntity, { description: 'User phone number' });
|
|
102
|
+
// User Type & Role (unified approach)
|
|
103
|
+
userEntity.addProperty({
|
|
104
|
+
info: { name: 'user_type', displayName: 'User Type', description: 'Type of user account' },
|
|
105
|
+
type: 'string',
|
|
106
|
+
required: true,
|
|
107
|
+
schema: {
|
|
108
|
+
enum: ['customer', 'employee', 'admin', 'system'],
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
userEntity.addProperty({
|
|
112
|
+
info: { name: 'role', displayName: 'User Role', description: 'User role defining permissions and access level' },
|
|
113
|
+
type: 'string',
|
|
114
|
+
required: true,
|
|
115
|
+
schema: {
|
|
116
|
+
enum: [
|
|
117
|
+
// Customer roles
|
|
118
|
+
'individual_customer',
|
|
119
|
+
'business_customer',
|
|
120
|
+
'premium_customer',
|
|
121
|
+
'private_banking_customer',
|
|
122
|
+
// Employee roles
|
|
123
|
+
'teller',
|
|
124
|
+
'loan_officer',
|
|
125
|
+
'relationship_manager',
|
|
126
|
+
'compliance_officer',
|
|
127
|
+
'branch_manager',
|
|
128
|
+
'investment_advisor',
|
|
129
|
+
'risk_analyst',
|
|
130
|
+
// Admin roles
|
|
131
|
+
'system_admin',
|
|
132
|
+
'security_admin',
|
|
133
|
+
'audit_admin',
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
// Status and verification
|
|
138
|
+
addCustomStatusField(userEntity, ['active', 'inactive', 'suspended', 'pending_verification', 'locked'], {
|
|
139
|
+
displayName: 'User Status',
|
|
140
|
+
description: 'Current status of the user account',
|
|
141
|
+
});
|
|
142
|
+
userEntity.addProperty({
|
|
143
|
+
info: { name: 'email_verified', displayName: 'Email Verified', description: 'Whether user email is verified' },
|
|
144
|
+
type: 'boolean',
|
|
145
|
+
required: true,
|
|
146
|
+
});
|
|
147
|
+
userEntity.addProperty({
|
|
148
|
+
info: { name: 'last_login', displayName: 'Last Login', description: 'When user last logged in' },
|
|
149
|
+
type: 'datetime',
|
|
150
|
+
});
|
|
151
|
+
addCreatedAtField(userEntity, { description: 'When the user account was created' });
|
|
152
|
+
addUpdatedAtField(userEntity, { description: 'When the user account was last updated' });
|
|
153
|
+
// Session Entity for authentication management
|
|
154
|
+
const sessionEntity = authModel.addEntity({
|
|
155
|
+
info: {
|
|
156
|
+
name: 'user_session',
|
|
157
|
+
displayName: 'User Session',
|
|
158
|
+
description: 'Active user authentication sessions',
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
addIdField(sessionEntity, { displayName: 'Session ID', description: 'Unique session identifier' });
|
|
162
|
+
sessionEntity.addProperty({
|
|
163
|
+
info: { name: 'token', displayName: 'Session Token', description: 'Authentication token for the session' },
|
|
164
|
+
type: 'string',
|
|
165
|
+
required: true,
|
|
166
|
+
writeOnly: true,
|
|
167
|
+
});
|
|
168
|
+
sessionEntity.addProperty({
|
|
169
|
+
info: { name: 'expires_at', displayName: 'Expires At', description: 'When the session expires' },
|
|
170
|
+
type: 'datetime',
|
|
171
|
+
required: true,
|
|
172
|
+
});
|
|
173
|
+
sessionEntity.addProperty({
|
|
174
|
+
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the session' },
|
|
175
|
+
type: 'string',
|
|
176
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
177
|
+
});
|
|
178
|
+
addCreatedAtField(sessionEntity, { description: 'When the session was created' });
|
|
179
|
+
// User-Session Association
|
|
180
|
+
userEntity.addAssociation({ key: sessionEntity.key }, {
|
|
181
|
+
info: { name: 'sessions', displayName: 'User Sessions', description: 'Active sessions for this user' },
|
|
182
|
+
required: false,
|
|
183
|
+
multiple: true,
|
|
184
|
+
});
|
|
185
|
+
// Profile Model (for extended user information)
|
|
186
|
+
const profileModel = userManagement.addModel({
|
|
187
|
+
info: {
|
|
188
|
+
name: 'User Profiles',
|
|
189
|
+
displayName: 'User Profile Management',
|
|
190
|
+
description: 'Extended user profile information and preferences',
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
// Customer Profile Entity (for customer-specific information)
|
|
194
|
+
const customerProfileEntity = profileModel.addEntity({
|
|
195
|
+
info: {
|
|
196
|
+
name: 'customer_profile',
|
|
197
|
+
displayName: 'Customer Profile',
|
|
198
|
+
description: 'Additional profile information specific to customers',
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
addIdField(customerProfileEntity, { displayName: 'Profile ID', description: 'Unique profile identifier' });
|
|
202
|
+
customerProfileEntity.addProperty({
|
|
82
203
|
info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Customer date of birth' },
|
|
83
204
|
type: 'date',
|
|
84
205
|
required: true,
|
|
85
206
|
});
|
|
86
|
-
|
|
207
|
+
customerProfileEntity.addProperty({
|
|
87
208
|
info: { name: 'ssn', displayName: 'Social Security Number', description: 'Customer SSN for identification' },
|
|
88
209
|
type: 'string',
|
|
89
210
|
required: true,
|
|
90
|
-
writeOnly: true,
|
|
211
|
+
writeOnly: true,
|
|
91
212
|
});
|
|
92
|
-
|
|
93
|
-
addPhoneField(customerEntity, { description: 'Customer phone number' });
|
|
94
|
-
customerEntity.addProperty({
|
|
213
|
+
customerProfileEntity.addProperty({
|
|
95
214
|
info: { name: 'address', displayName: 'Address', description: 'Customer residential address' },
|
|
96
215
|
type: 'string',
|
|
97
216
|
required: true,
|
|
98
217
|
});
|
|
99
|
-
|
|
218
|
+
customerProfileEntity.addProperty({
|
|
100
219
|
info: { name: 'city', displayName: 'City', description: 'Customer city' },
|
|
101
220
|
type: 'string',
|
|
102
221
|
required: true,
|
|
103
222
|
});
|
|
104
|
-
|
|
223
|
+
customerProfileEntity.addProperty({
|
|
105
224
|
info: { name: 'state', displayName: 'State', description: 'Customer state' },
|
|
106
225
|
type: 'string',
|
|
107
226
|
required: true,
|
|
108
227
|
});
|
|
109
|
-
|
|
228
|
+
customerProfileEntity.addProperty({
|
|
110
229
|
info: { name: 'zip_code', displayName: 'ZIP Code', description: 'Customer ZIP code' },
|
|
111
230
|
type: 'string',
|
|
112
231
|
required: true,
|
|
113
232
|
});
|
|
114
|
-
|
|
115
|
-
displayName: 'Customer Status',
|
|
116
|
-
description: 'Current status of the customer account',
|
|
117
|
-
});
|
|
118
|
-
customerEntity.addProperty({
|
|
233
|
+
customerProfileEntity.addProperty({
|
|
119
234
|
info: { name: 'customer_type', displayName: 'Customer Type', description: 'Type of customer account' },
|
|
120
235
|
type: 'string',
|
|
121
236
|
required: true,
|
|
@@ -123,12 +238,79 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
123
238
|
enum: ['individual', 'business', 'trust', 'partnership'],
|
|
124
239
|
},
|
|
125
240
|
});
|
|
126
|
-
addCreatedAtField(
|
|
127
|
-
addUpdatedAtField(
|
|
128
|
-
//
|
|
129
|
-
|
|
241
|
+
addCreatedAtField(customerProfileEntity, { description: 'When the customer profile was created' });
|
|
242
|
+
addUpdatedAtField(customerProfileEntity, { description: 'When the customer profile was last updated' });
|
|
243
|
+
// User-CustomerProfile Association (one-to-one for customers)
|
|
244
|
+
userEntity.addAssociation({ key: customerProfileEntity.key }, {
|
|
245
|
+
info: {
|
|
246
|
+
name: 'customer_profile',
|
|
247
|
+
displayName: 'Customer Profile',
|
|
248
|
+
description: 'Extended customer profile information',
|
|
249
|
+
},
|
|
250
|
+
required: false, // Only for customers, not employees
|
|
251
|
+
multiple: false,
|
|
252
|
+
});
|
|
253
|
+
// Employee Profile Entity (for employee-specific information)
|
|
254
|
+
const employeeProfileEntity = profileModel.addEntity({
|
|
255
|
+
info: {
|
|
256
|
+
name: 'employee_profile',
|
|
257
|
+
displayName: 'Employee Profile',
|
|
258
|
+
description: 'Additional profile information specific to employees',
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
addIdField(employeeProfileEntity, {
|
|
262
|
+
displayName: 'Employee Profile ID',
|
|
263
|
+
description: 'Unique employee profile identifier',
|
|
264
|
+
});
|
|
265
|
+
employeeProfileEntity.addProperty({
|
|
266
|
+
info: { name: 'employee_id', displayName: 'Employee ID', description: 'Company employee identifier' },
|
|
267
|
+
type: 'string',
|
|
268
|
+
required: true,
|
|
269
|
+
unique: true,
|
|
270
|
+
});
|
|
271
|
+
employeeProfileEntity.addProperty({
|
|
272
|
+
info: { name: 'department', displayName: 'Department', description: 'Employee department' },
|
|
273
|
+
type: 'string',
|
|
274
|
+
required: true,
|
|
275
|
+
schema: {
|
|
276
|
+
enum: [
|
|
277
|
+
'retail_banking',
|
|
278
|
+
'commercial_banking',
|
|
279
|
+
'investment_services',
|
|
280
|
+
'risk_management',
|
|
281
|
+
'compliance',
|
|
282
|
+
'operations',
|
|
283
|
+
'technology',
|
|
284
|
+
'human_resources',
|
|
285
|
+
'legal',
|
|
286
|
+
],
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
employeeProfileEntity.addProperty({
|
|
290
|
+
info: { name: 'hire_date', displayName: 'Hire Date', description: 'Employee hire date' },
|
|
291
|
+
type: 'date',
|
|
292
|
+
required: true,
|
|
293
|
+
});
|
|
294
|
+
employeeProfileEntity.addProperty({
|
|
295
|
+
info: { name: 'manager_id', displayName: 'Manager ID', description: 'Employee manager identifier' },
|
|
296
|
+
type: 'string',
|
|
297
|
+
});
|
|
298
|
+
addCreatedAtField(employeeProfileEntity, { description: 'When the employee profile was created' });
|
|
299
|
+
addUpdatedAtField(employeeProfileEntity, { description: 'When the employee profile was last updated' });
|
|
300
|
+
// User-EmployeeProfile Association (one-to-one for employees)
|
|
301
|
+
userEntity.addAssociation({ key: employeeProfileEntity.key }, {
|
|
302
|
+
info: {
|
|
303
|
+
name: 'employee_profile',
|
|
304
|
+
displayName: 'Employee Profile',
|
|
305
|
+
description: 'Extended employee profile information',
|
|
306
|
+
},
|
|
307
|
+
required: false, // Only for employees, not customers
|
|
308
|
+
multiple: false,
|
|
309
|
+
});
|
|
310
|
+
// KYC Entity (enhanced for the unified approach)
|
|
311
|
+
const kycEntity = profileModel.addEntity({
|
|
130
312
|
info: {
|
|
131
|
-
name: '
|
|
313
|
+
name: 'kyc_record',
|
|
132
314
|
displayName: 'KYC Record',
|
|
133
315
|
description: 'Know Your Customer verification and documentation',
|
|
134
316
|
},
|
|
@@ -156,14 +338,15 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
156
338
|
required: true,
|
|
157
339
|
});
|
|
158
340
|
addCreatedAtField(kycEntity, { description: 'When the KYC record was created' });
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
341
|
+
addUpdatedAtField(kycEntity, { description: 'When the KYC record was last updated' });
|
|
342
|
+
// KYC-User Association (One-to-One)
|
|
343
|
+
kycEntity.addAssociation({ key: userEntity.key }, {
|
|
344
|
+
info: { name: 'user', displayName: 'User', description: 'User for this KYC record' },
|
|
162
345
|
required: true,
|
|
163
346
|
multiple: false,
|
|
164
347
|
});
|
|
165
348
|
// Risk Profile Entity
|
|
166
|
-
const riskProfileEntity =
|
|
349
|
+
const riskProfileEntity = profileModel.addEntity({
|
|
167
350
|
info: {
|
|
168
351
|
name: 'risk_profile',
|
|
169
352
|
displayName: 'Risk Profile',
|
|
@@ -194,9 +377,10 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
194
377
|
});
|
|
195
378
|
addDescriptionField(riskProfileEntity, { description: 'Risk assessment notes and factors' });
|
|
196
379
|
addCreatedAtField(riskProfileEntity, { description: 'When the risk profile was created' });
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
380
|
+
addUpdatedAtField(riskProfileEntity, { description: 'When the risk profile was last updated' });
|
|
381
|
+
// RiskProfile-User Association (One-to-One)
|
|
382
|
+
riskProfileEntity.addAssociation({ key: userEntity.key }, {
|
|
383
|
+
info: { name: 'user', displayName: 'User', description: 'User for this risk profile' },
|
|
200
384
|
required: true,
|
|
201
385
|
multiple: false,
|
|
202
386
|
});
|
|
@@ -258,9 +442,9 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
258
442
|
});
|
|
259
443
|
addCreatedAtField(bankAccountEntity, { description: 'When the account was created' });
|
|
260
444
|
addUpdatedAtField(bankAccountEntity, { description: 'When the account was last updated' });
|
|
261
|
-
// BankAccount-
|
|
262
|
-
bankAccountEntity.addAssociation({ key:
|
|
263
|
-
info: { name: '
|
|
445
|
+
// BankAccount-User Association (Many-to-One)
|
|
446
|
+
bankAccountEntity.addAssociation({ key: userEntity.key }, {
|
|
447
|
+
info: { name: 'user', displayName: 'Account Holder', description: 'User who owns this account' },
|
|
264
448
|
required: true,
|
|
265
449
|
multiple: false,
|
|
266
450
|
});
|
|
@@ -301,12 +485,12 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
301
485
|
description: 'Current status of the investment account',
|
|
302
486
|
});
|
|
303
487
|
addCreatedAtField(investmentAccountEntity, { description: 'When the investment account was created' });
|
|
304
|
-
// InvestmentAccount-
|
|
305
|
-
investmentAccountEntity.addAssociation({ key:
|
|
488
|
+
// InvestmentAccount-User Association (Many-to-One)
|
|
489
|
+
investmentAccountEntity.addAssociation({ key: userEntity.key }, {
|
|
306
490
|
info: {
|
|
307
|
-
name: '
|
|
491
|
+
name: 'user',
|
|
308
492
|
displayName: 'Account Holder',
|
|
309
|
-
description: '
|
|
493
|
+
description: 'User who owns this investment account',
|
|
310
494
|
},
|
|
311
495
|
required: true,
|
|
312
496
|
multiple: false,
|
|
@@ -349,9 +533,9 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
349
533
|
description: 'Current status of the credit card',
|
|
350
534
|
});
|
|
351
535
|
addCreatedAtField(creditCardEntity, { description: 'When the credit card was created' });
|
|
352
|
-
// CreditCard-
|
|
353
|
-
creditCardEntity.addAssociation({ key:
|
|
354
|
-
info: { name: '
|
|
536
|
+
// CreditCard-User Association (Many-to-One)
|
|
537
|
+
creditCardEntity.addAssociation({ key: userEntity.key }, {
|
|
538
|
+
info: { name: 'user', displayName: 'Cardholder', description: 'User who owns this credit card' },
|
|
355
539
|
required: true,
|
|
356
540
|
multiple: false,
|
|
357
541
|
});
|
|
@@ -360,7 +544,7 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
360
544
|
//
|
|
361
545
|
const transactionProcessing = domain.addNamespace({
|
|
362
546
|
info: {
|
|
363
|
-
name: '
|
|
547
|
+
name: 'Transaction Processing',
|
|
364
548
|
displayName: 'Transaction Processing',
|
|
365
549
|
description: 'Payments, transfers, deposits, and withdrawals',
|
|
366
550
|
},
|
|
@@ -421,9 +605,9 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
421
605
|
type: 'string',
|
|
422
606
|
});
|
|
423
607
|
addCreatedAtField(transactionEntity, { description: 'When the transaction was created' });
|
|
424
|
-
// Transaction-
|
|
425
|
-
transactionEntity.addAssociation({ key:
|
|
426
|
-
info: { name: '
|
|
608
|
+
// Transaction-User Association (Many-to-One)
|
|
609
|
+
transactionEntity.addAssociation({ key: userEntity.key }, {
|
|
610
|
+
info: { name: 'user', displayName: 'User', description: 'User who initiated the transaction' },
|
|
427
611
|
required: true,
|
|
428
612
|
multiple: false,
|
|
429
613
|
});
|
|
@@ -472,7 +656,7 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
472
656
|
//
|
|
473
657
|
const investmentPortfolio = domain.addNamespace({
|
|
474
658
|
info: {
|
|
475
|
-
name: '
|
|
659
|
+
name: 'Investment Portfolio',
|
|
476
660
|
displayName: 'Investment Portfolio',
|
|
477
661
|
description: 'Assets, positions, and performance tracking',
|
|
478
662
|
},
|
|
@@ -596,7 +780,7 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
596
780
|
//
|
|
597
781
|
const complianceReporting = domain.addNamespace({
|
|
598
782
|
info: {
|
|
599
|
-
name: '
|
|
783
|
+
name: 'Compliance Reporting',
|
|
600
784
|
displayName: 'Compliance & Reporting',
|
|
601
785
|
description: 'Regulatory reporting and audit trails',
|
|
602
786
|
},
|
|
@@ -641,6 +825,7 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
641
825
|
auditTrailEntity.addProperty({
|
|
642
826
|
info: { name: 'ip_address', displayName: 'IP Address', description: 'IP address of the user' },
|
|
643
827
|
type: 'string',
|
|
828
|
+
semantics: [{ id: SemanticType.ClientIPAddress }],
|
|
644
829
|
});
|
|
645
830
|
addDescriptionField(auditTrailEntity, { description: 'Additional details about the action' });
|
|
646
831
|
addCreatedAtField(auditTrailEntity, {
|
|
@@ -733,9 +918,9 @@ export default function createFinancialServicesDomain(options = {}) {
|
|
|
733
918
|
required: false,
|
|
734
919
|
multiple: false,
|
|
735
920
|
});
|
|
736
|
-
// FraudAlert-
|
|
737
|
-
fraudAlertEntity.addAssociation({ key:
|
|
738
|
-
info: { name: '
|
|
921
|
+
// FraudAlert-User Association (Many-to-One)
|
|
922
|
+
fraudAlertEntity.addAssociation({ key: userEntity.key }, {
|
|
923
|
+
info: { name: 'user', displayName: 'User', description: 'User associated with the alert' },
|
|
739
924
|
required: true,
|
|
740
925
|
multiple: false,
|
|
741
926
|
});
|