@mj-biz-apps/common-server 5.4.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,3471 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ /********************************************************************************
14
+ * ALL ENTITIES - TypeGraphQL Type Class Definition - AUTO GENERATED FILE
15
+ * Generated Entities and Resolvers for Server
16
+ *
17
+ * >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
18
+ * >>> YOUR CHANGES WILL BE OVERWRITTEN
19
+ * >>> THE NEXT TIME THIS FILE IS GENERATED
20
+ *
21
+ **********************************************************************************/
22
+ import { Arg, Ctx, Int, Query, Resolver, Field, Float, ObjectType, FieldResolver, Root, InputType, Mutation, PubSub, PubSubEngine, ResolverBase, RunViewByIDInput, RunViewByNameInput, RunDynamicViewInput, KeyValuePairInput, DeleteOptionsInput, GetReadOnlyDataSource, GetReadOnlyProvider, GetReadWriteProvider } from '@memberjunction/server';
23
+ import { SQLServerDataProvider } from '@memberjunction/sqlserver-dataprovider';
24
+ import { EntityPermissionType, CompositeKey } from '@memberjunction/core';
25
+ import { MaxLength } from 'class-validator';
26
+ //****************************************************************************
27
+ // ENTITY CLASS for MJ.BizApps.Common: Address Links
28
+ //****************************************************************************
29
+ let mjBizAppsCommonAddressLink_ = class mjBizAppsCommonAddressLink_ {
30
+ };
31
+ __decorate([
32
+ Field(),
33
+ MaxLength(16),
34
+ __metadata("design:type", String)
35
+ ], mjBizAppsCommonAddressLink_.prototype, "ID", void 0);
36
+ __decorate([
37
+ Field(),
38
+ MaxLength(16),
39
+ __metadata("design:type", String)
40
+ ], mjBizAppsCommonAddressLink_.prototype, "AddressID", void 0);
41
+ __decorate([
42
+ Field(),
43
+ MaxLength(16),
44
+ __metadata("design:type", String)
45
+ ], mjBizAppsCommonAddressLink_.prototype, "EntityID", void 0);
46
+ __decorate([
47
+ Field({ description: `Primary key value(s) of the linked record. NVARCHAR(700) to support concatenated composite keys for entities without single-valued primary keys` }),
48
+ MaxLength(1400),
49
+ __metadata("design:type", String)
50
+ ], mjBizAppsCommonAddressLink_.prototype, "RecordID", void 0);
51
+ __decorate([
52
+ Field(),
53
+ MaxLength(16),
54
+ __metadata("design:type", String)
55
+ ], mjBizAppsCommonAddressLink_.prototype, "AddressTypeID", void 0);
56
+ __decorate([
57
+ Field(() => Boolean, { description: `Whether this is the primary address for the linked record. Only one address per entity record should be marked primary` }),
58
+ __metadata("design:type", Boolean)
59
+ ], mjBizAppsCommonAddressLink_.prototype, "IsPrimary", void 0);
60
+ __decorate([
61
+ Field(() => Int, { nullable: true, description: `Sort order override for this specific link. When NULL, falls back to AddressType.DefaultRank. Lower values appear first` }),
62
+ __metadata("design:type", Number)
63
+ ], mjBizAppsCommonAddressLink_.prototype, "Rank", void 0);
64
+ __decorate([
65
+ Field(),
66
+ MaxLength(10),
67
+ __metadata("design:type", Date)
68
+ ], mjBizAppsCommonAddressLink_.prototype, "_mj__CreatedAt", void 0);
69
+ __decorate([
70
+ Field(),
71
+ MaxLength(10),
72
+ __metadata("design:type", Date)
73
+ ], mjBizAppsCommonAddressLink_.prototype, "_mj__UpdatedAt", void 0);
74
+ __decorate([
75
+ Field(),
76
+ MaxLength(510),
77
+ __metadata("design:type", String)
78
+ ], mjBizAppsCommonAddressLink_.prototype, "Address", void 0);
79
+ __decorate([
80
+ Field(),
81
+ MaxLength(510),
82
+ __metadata("design:type", String)
83
+ ], mjBizAppsCommonAddressLink_.prototype, "Entity", void 0);
84
+ __decorate([
85
+ Field(),
86
+ MaxLength(200),
87
+ __metadata("design:type", String)
88
+ ], mjBizAppsCommonAddressLink_.prototype, "AddressType", void 0);
89
+ mjBizAppsCommonAddressLink_ = __decorate([
90
+ ObjectType({ description: `Polymorphic link table connecting Address records to any entity record in the system via EntityID and RecordID` })
91
+ ], mjBizAppsCommonAddressLink_);
92
+ export { mjBizAppsCommonAddressLink_ };
93
+ //****************************************************************************
94
+ // INPUT TYPE for MJ.BizApps.Common: Address Links
95
+ //****************************************************************************
96
+ let CreatemjBizAppsCommonAddressLinkInput = class CreatemjBizAppsCommonAddressLinkInput {
97
+ };
98
+ __decorate([
99
+ Field({ nullable: true }),
100
+ __metadata("design:type", String)
101
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "ID", void 0);
102
+ __decorate([
103
+ Field({ nullable: true }),
104
+ __metadata("design:type", String)
105
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "AddressID", void 0);
106
+ __decorate([
107
+ Field({ nullable: true }),
108
+ __metadata("design:type", String)
109
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "EntityID", void 0);
110
+ __decorate([
111
+ Field({ nullable: true }),
112
+ __metadata("design:type", String)
113
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "RecordID", void 0);
114
+ __decorate([
115
+ Field({ nullable: true }),
116
+ __metadata("design:type", String)
117
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "AddressTypeID", void 0);
118
+ __decorate([
119
+ Field(() => Boolean, { nullable: true }),
120
+ __metadata("design:type", Boolean)
121
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "IsPrimary", void 0);
122
+ __decorate([
123
+ Field(() => Int, { nullable: true }),
124
+ __metadata("design:type", Number)
125
+ ], CreatemjBizAppsCommonAddressLinkInput.prototype, "Rank", void 0);
126
+ CreatemjBizAppsCommonAddressLinkInput = __decorate([
127
+ InputType()
128
+ ], CreatemjBizAppsCommonAddressLinkInput);
129
+ export { CreatemjBizAppsCommonAddressLinkInput };
130
+ //****************************************************************************
131
+ // INPUT TYPE for MJ.BizApps.Common: Address Links
132
+ //****************************************************************************
133
+ let UpdatemjBizAppsCommonAddressLinkInput = class UpdatemjBizAppsCommonAddressLinkInput {
134
+ };
135
+ __decorate([
136
+ Field(),
137
+ __metadata("design:type", String)
138
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "ID", void 0);
139
+ __decorate([
140
+ Field({ nullable: true }),
141
+ __metadata("design:type", String)
142
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "AddressID", void 0);
143
+ __decorate([
144
+ Field({ nullable: true }),
145
+ __metadata("design:type", String)
146
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "EntityID", void 0);
147
+ __decorate([
148
+ Field({ nullable: true }),
149
+ __metadata("design:type", String)
150
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "RecordID", void 0);
151
+ __decorate([
152
+ Field({ nullable: true }),
153
+ __metadata("design:type", String)
154
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "AddressTypeID", void 0);
155
+ __decorate([
156
+ Field(() => Boolean, { nullable: true }),
157
+ __metadata("design:type", Boolean)
158
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "IsPrimary", void 0);
159
+ __decorate([
160
+ Field(() => Int, { nullable: true }),
161
+ __metadata("design:type", Number)
162
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "Rank", void 0);
163
+ __decorate([
164
+ Field(() => [KeyValuePairInput], { nullable: true }),
165
+ __metadata("design:type", Array)
166
+ ], UpdatemjBizAppsCommonAddressLinkInput.prototype, "OldValues___", void 0);
167
+ UpdatemjBizAppsCommonAddressLinkInput = __decorate([
168
+ InputType()
169
+ ], UpdatemjBizAppsCommonAddressLinkInput);
170
+ export { UpdatemjBizAppsCommonAddressLinkInput };
171
+ //****************************************************************************
172
+ // RESOLVER for MJ.BizApps.Common: Address Links
173
+ //****************************************************************************
174
+ let RunmjBizAppsCommonAddressLinkViewResult = class RunmjBizAppsCommonAddressLinkViewResult {
175
+ };
176
+ __decorate([
177
+ Field(() => [mjBizAppsCommonAddressLink_]),
178
+ __metadata("design:type", Array)
179
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "Results", void 0);
180
+ __decorate([
181
+ Field(() => String, { nullable: true }),
182
+ __metadata("design:type", String)
183
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "UserViewRunID", void 0);
184
+ __decorate([
185
+ Field(() => Int, { nullable: true }),
186
+ __metadata("design:type", Number)
187
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "RowCount", void 0);
188
+ __decorate([
189
+ Field(() => Int, { nullable: true }),
190
+ __metadata("design:type", Number)
191
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "TotalRowCount", void 0);
192
+ __decorate([
193
+ Field(() => Int, { nullable: true }),
194
+ __metadata("design:type", Number)
195
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "ExecutionTime", void 0);
196
+ __decorate([
197
+ Field({ nullable: true }),
198
+ __metadata("design:type", String)
199
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "ErrorMessage", void 0);
200
+ __decorate([
201
+ Field(() => Boolean, { nullable: false }),
202
+ __metadata("design:type", Boolean)
203
+ ], RunmjBizAppsCommonAddressLinkViewResult.prototype, "Success", void 0);
204
+ RunmjBizAppsCommonAddressLinkViewResult = __decorate([
205
+ ObjectType()
206
+ ], RunmjBizAppsCommonAddressLinkViewResult);
207
+ export { RunmjBizAppsCommonAddressLinkViewResult };
208
+ let mjBizAppsCommonAddressLinkResolver = class mjBizAppsCommonAddressLinkResolver extends ResolverBase {
209
+ async RunmjBizAppsCommonAddressLinkViewByID(input, { providers, userPayload }, pubSub) {
210
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
211
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
212
+ }
213
+ async RunmjBizAppsCommonAddressLinkViewByName(input, { providers, userPayload }, pubSub) {
214
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
215
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
216
+ }
217
+ async RunmjBizAppsCommonAddressLinkDynamicView(input, { providers, userPayload }, pubSub) {
218
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
219
+ input.EntityName = 'MJ.BizApps.Common: Address Links';
220
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
221
+ }
222
+ async mjBizAppsCommonAddressLink(ID, { dataSources, userPayload, providers }, pubSub) {
223
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
224
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
225
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
226
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwAddressLinks] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
227
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
228
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Address Links', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
229
+ return result;
230
+ }
231
+ async CreatemjBizAppsCommonAddressLink(input, { providers, userPayload }, pubSub) {
232
+ const provider = GetReadWriteProvider(providers);
233
+ return this.CreateRecord('MJ.BizApps.Common: Address Links', input, provider, userPayload, pubSub);
234
+ }
235
+ async UpdatemjBizAppsCommonAddressLink(input, { providers, userPayload }, pubSub) {
236
+ const provider = GetReadWriteProvider(providers);
237
+ return this.UpdateRecord('MJ.BizApps.Common: Address Links', input, provider, userPayload, pubSub);
238
+ }
239
+ async DeletemjBizAppsCommonAddressLink(ID, options, { providers, userPayload }, pubSub) {
240
+ const provider = GetReadWriteProvider(providers);
241
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
242
+ return this.DeleteRecord('MJ.BizApps.Common: Address Links', key, options, provider, userPayload, pubSub);
243
+ }
244
+ };
245
+ __decorate([
246
+ Query(() => RunmjBizAppsCommonAddressLinkViewResult),
247
+ __param(0, Arg('input', () => RunViewByIDInput)),
248
+ __param(1, Ctx()),
249
+ __param(2, PubSub()),
250
+ __metadata("design:type", Function),
251
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
252
+ __metadata("design:returntype", Promise)
253
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "RunmjBizAppsCommonAddressLinkViewByID", null);
254
+ __decorate([
255
+ Query(() => RunmjBizAppsCommonAddressLinkViewResult),
256
+ __param(0, Arg('input', () => RunViewByNameInput)),
257
+ __param(1, Ctx()),
258
+ __param(2, PubSub()),
259
+ __metadata("design:type", Function),
260
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
261
+ __metadata("design:returntype", Promise)
262
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "RunmjBizAppsCommonAddressLinkViewByName", null);
263
+ __decorate([
264
+ Query(() => RunmjBizAppsCommonAddressLinkViewResult),
265
+ __param(0, Arg('input', () => RunDynamicViewInput)),
266
+ __param(1, Ctx()),
267
+ __param(2, PubSub()),
268
+ __metadata("design:type", Function),
269
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
270
+ __metadata("design:returntype", Promise)
271
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "RunmjBizAppsCommonAddressLinkDynamicView", null);
272
+ __decorate([
273
+ Query(() => mjBizAppsCommonAddressLink_, { nullable: true }),
274
+ __param(0, Arg('ID', () => String)),
275
+ __param(1, Ctx()),
276
+ __param(2, PubSub()),
277
+ __metadata("design:type", Function),
278
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
279
+ __metadata("design:returntype", Promise)
280
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "mjBizAppsCommonAddressLink", null);
281
+ __decorate([
282
+ Mutation(() => mjBizAppsCommonAddressLink_),
283
+ __param(0, Arg('input', () => CreatemjBizAppsCommonAddressLinkInput)),
284
+ __param(1, Ctx()),
285
+ __param(2, PubSub()),
286
+ __metadata("design:type", Function),
287
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonAddressLinkInput, Object, PubSubEngine]),
288
+ __metadata("design:returntype", Promise)
289
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "CreatemjBizAppsCommonAddressLink", null);
290
+ __decorate([
291
+ Mutation(() => mjBizAppsCommonAddressLink_),
292
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonAddressLinkInput)),
293
+ __param(1, Ctx()),
294
+ __param(2, PubSub()),
295
+ __metadata("design:type", Function),
296
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonAddressLinkInput, Object, PubSubEngine]),
297
+ __metadata("design:returntype", Promise)
298
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "UpdatemjBizAppsCommonAddressLink", null);
299
+ __decorate([
300
+ Mutation(() => mjBizAppsCommonAddressLink_),
301
+ __param(0, Arg('ID', () => String)),
302
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
303
+ __param(2, Ctx()),
304
+ __param(3, PubSub()),
305
+ __metadata("design:type", Function),
306
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
307
+ __metadata("design:returntype", Promise)
308
+ ], mjBizAppsCommonAddressLinkResolver.prototype, "DeletemjBizAppsCommonAddressLink", null);
309
+ mjBizAppsCommonAddressLinkResolver = __decorate([
310
+ Resolver(mjBizAppsCommonAddressLink_)
311
+ ], mjBizAppsCommonAddressLinkResolver);
312
+ export { mjBizAppsCommonAddressLinkResolver };
313
+ //****************************************************************************
314
+ // ENTITY CLASS for MJ.BizApps.Common: Address Types
315
+ //****************************************************************************
316
+ let mjBizAppsCommonAddressType_ = class mjBizAppsCommonAddressType_ {
317
+ };
318
+ __decorate([
319
+ Field(),
320
+ MaxLength(16),
321
+ __metadata("design:type", String)
322
+ ], mjBizAppsCommonAddressType_.prototype, "ID", void 0);
323
+ __decorate([
324
+ Field({ description: `Display name for the address type` }),
325
+ MaxLength(200),
326
+ __metadata("design:type", String)
327
+ ], mjBizAppsCommonAddressType_.prototype, "Name", void 0);
328
+ __decorate([
329
+ Field({ nullable: true, description: `Detailed description of this address type` }),
330
+ __metadata("design:type", String)
331
+ ], mjBizAppsCommonAddressType_.prototype, "Description", void 0);
332
+ __decorate([
333
+ Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
334
+ MaxLength(200),
335
+ __metadata("design:type", String)
336
+ ], mjBizAppsCommonAddressType_.prototype, "IconClass", void 0);
337
+ __decorate([
338
+ Field(() => Int, { description: `Default sort order for this address type in dropdown lists. Lower values appear first. Can be overridden per-record via AddressLink.Rank` }),
339
+ __metadata("design:type", Number)
340
+ ], mjBizAppsCommonAddressType_.prototype, "DefaultRank", void 0);
341
+ __decorate([
342
+ Field(() => Boolean, { description: `Whether this type is available for selection in the UI. Inactive types are hidden from dropdowns but preserved for existing records` }),
343
+ __metadata("design:type", Boolean)
344
+ ], mjBizAppsCommonAddressType_.prototype, "IsActive", void 0);
345
+ __decorate([
346
+ Field(),
347
+ MaxLength(10),
348
+ __metadata("design:type", Date)
349
+ ], mjBizAppsCommonAddressType_.prototype, "_mj__CreatedAt", void 0);
350
+ __decorate([
351
+ Field(),
352
+ MaxLength(10),
353
+ __metadata("design:type", Date)
354
+ ], mjBizAppsCommonAddressType_.prototype, "_mj__UpdatedAt", void 0);
355
+ __decorate([
356
+ Field(() => [mjBizAppsCommonAddressLink_]),
357
+ __metadata("design:type", Array)
358
+ ], mjBizAppsCommonAddressType_.prototype, "mjBizAppsCommonAddressLinks_AddressTypeIDArray", void 0);
359
+ mjBizAppsCommonAddressType_ = __decorate([
360
+ ObjectType({ description: `Categories of addresses such as Home, Work, Mailing, Billing` })
361
+ ], mjBizAppsCommonAddressType_);
362
+ export { mjBizAppsCommonAddressType_ };
363
+ //****************************************************************************
364
+ // INPUT TYPE for MJ.BizApps.Common: Address Types
365
+ //****************************************************************************
366
+ let CreatemjBizAppsCommonAddressTypeInput = class CreatemjBizAppsCommonAddressTypeInput {
367
+ };
368
+ __decorate([
369
+ Field({ nullable: true }),
370
+ __metadata("design:type", String)
371
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "ID", void 0);
372
+ __decorate([
373
+ Field({ nullable: true }),
374
+ __metadata("design:type", String)
375
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "Name", void 0);
376
+ __decorate([
377
+ Field({ nullable: true }),
378
+ __metadata("design:type", String)
379
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "Description", void 0);
380
+ __decorate([
381
+ Field({ nullable: true }),
382
+ __metadata("design:type", String)
383
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "IconClass", void 0);
384
+ __decorate([
385
+ Field(() => Int, { nullable: true }),
386
+ __metadata("design:type", Number)
387
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "DefaultRank", void 0);
388
+ __decorate([
389
+ Field(() => Boolean, { nullable: true }),
390
+ __metadata("design:type", Boolean)
391
+ ], CreatemjBizAppsCommonAddressTypeInput.prototype, "IsActive", void 0);
392
+ CreatemjBizAppsCommonAddressTypeInput = __decorate([
393
+ InputType()
394
+ ], CreatemjBizAppsCommonAddressTypeInput);
395
+ export { CreatemjBizAppsCommonAddressTypeInput };
396
+ //****************************************************************************
397
+ // INPUT TYPE for MJ.BizApps.Common: Address Types
398
+ //****************************************************************************
399
+ let UpdatemjBizAppsCommonAddressTypeInput = class UpdatemjBizAppsCommonAddressTypeInput {
400
+ };
401
+ __decorate([
402
+ Field(),
403
+ __metadata("design:type", String)
404
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "ID", void 0);
405
+ __decorate([
406
+ Field({ nullable: true }),
407
+ __metadata("design:type", String)
408
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "Name", void 0);
409
+ __decorate([
410
+ Field({ nullable: true }),
411
+ __metadata("design:type", String)
412
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "Description", void 0);
413
+ __decorate([
414
+ Field({ nullable: true }),
415
+ __metadata("design:type", String)
416
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "IconClass", void 0);
417
+ __decorate([
418
+ Field(() => Int, { nullable: true }),
419
+ __metadata("design:type", Number)
420
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "DefaultRank", void 0);
421
+ __decorate([
422
+ Field(() => Boolean, { nullable: true }),
423
+ __metadata("design:type", Boolean)
424
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "IsActive", void 0);
425
+ __decorate([
426
+ Field(() => [KeyValuePairInput], { nullable: true }),
427
+ __metadata("design:type", Array)
428
+ ], UpdatemjBizAppsCommonAddressTypeInput.prototype, "OldValues___", void 0);
429
+ UpdatemjBizAppsCommonAddressTypeInput = __decorate([
430
+ InputType()
431
+ ], UpdatemjBizAppsCommonAddressTypeInput);
432
+ export { UpdatemjBizAppsCommonAddressTypeInput };
433
+ //****************************************************************************
434
+ // RESOLVER for MJ.BizApps.Common: Address Types
435
+ //****************************************************************************
436
+ let RunmjBizAppsCommonAddressTypeViewResult = class RunmjBizAppsCommonAddressTypeViewResult {
437
+ };
438
+ __decorate([
439
+ Field(() => [mjBizAppsCommonAddressType_]),
440
+ __metadata("design:type", Array)
441
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "Results", void 0);
442
+ __decorate([
443
+ Field(() => String, { nullable: true }),
444
+ __metadata("design:type", String)
445
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "UserViewRunID", void 0);
446
+ __decorate([
447
+ Field(() => Int, { nullable: true }),
448
+ __metadata("design:type", Number)
449
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "RowCount", void 0);
450
+ __decorate([
451
+ Field(() => Int, { nullable: true }),
452
+ __metadata("design:type", Number)
453
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "TotalRowCount", void 0);
454
+ __decorate([
455
+ Field(() => Int, { nullable: true }),
456
+ __metadata("design:type", Number)
457
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "ExecutionTime", void 0);
458
+ __decorate([
459
+ Field({ nullable: true }),
460
+ __metadata("design:type", String)
461
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "ErrorMessage", void 0);
462
+ __decorate([
463
+ Field(() => Boolean, { nullable: false }),
464
+ __metadata("design:type", Boolean)
465
+ ], RunmjBizAppsCommonAddressTypeViewResult.prototype, "Success", void 0);
466
+ RunmjBizAppsCommonAddressTypeViewResult = __decorate([
467
+ ObjectType()
468
+ ], RunmjBizAppsCommonAddressTypeViewResult);
469
+ export { RunmjBizAppsCommonAddressTypeViewResult };
470
+ let mjBizAppsCommonAddressTypeResolver = class mjBizAppsCommonAddressTypeResolver extends ResolverBase {
471
+ async RunmjBizAppsCommonAddressTypeViewByID(input, { providers, userPayload }, pubSub) {
472
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
473
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
474
+ }
475
+ async RunmjBizAppsCommonAddressTypeViewByName(input, { providers, userPayload }, pubSub) {
476
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
477
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
478
+ }
479
+ async RunmjBizAppsCommonAddressTypeDynamicView(input, { providers, userPayload }, pubSub) {
480
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
481
+ input.EntityName = 'MJ.BizApps.Common: Address Types';
482
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
483
+ }
484
+ async mjBizAppsCommonAddressType(ID, { dataSources, userPayload, providers }, pubSub) {
485
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Address Types', userPayload);
486
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
487
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
488
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwAddressTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Address Types', userPayload, EntityPermissionType.Read, 'AND');
489
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
490
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Address Types', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
491
+ return result;
492
+ }
493
+ async mjBizAppsCommonAddressLinks_AddressTypeIDArray(mjbizappscommonaddresstype_, { dataSources, userPayload, providers }, pubSub) {
494
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
495
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
496
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
497
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwAddressLinks] WHERE [AddressTypeID]='${mjbizappscommonaddresstype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
498
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
499
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Address Links', rows, this.GetUserFromPayload(userPayload));
500
+ return result;
501
+ }
502
+ async CreatemjBizAppsCommonAddressType(input, { providers, userPayload }, pubSub) {
503
+ const provider = GetReadWriteProvider(providers);
504
+ return this.CreateRecord('MJ.BizApps.Common: Address Types', input, provider, userPayload, pubSub);
505
+ }
506
+ async UpdatemjBizAppsCommonAddressType(input, { providers, userPayload }, pubSub) {
507
+ const provider = GetReadWriteProvider(providers);
508
+ return this.UpdateRecord('MJ.BizApps.Common: Address Types', input, provider, userPayload, pubSub);
509
+ }
510
+ async DeletemjBizAppsCommonAddressType(ID, options, { providers, userPayload }, pubSub) {
511
+ const provider = GetReadWriteProvider(providers);
512
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
513
+ return this.DeleteRecord('MJ.BizApps.Common: Address Types', key, options, provider, userPayload, pubSub);
514
+ }
515
+ };
516
+ __decorate([
517
+ Query(() => RunmjBizAppsCommonAddressTypeViewResult),
518
+ __param(0, Arg('input', () => RunViewByIDInput)),
519
+ __param(1, Ctx()),
520
+ __param(2, PubSub()),
521
+ __metadata("design:type", Function),
522
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
523
+ __metadata("design:returntype", Promise)
524
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "RunmjBizAppsCommonAddressTypeViewByID", null);
525
+ __decorate([
526
+ Query(() => RunmjBizAppsCommonAddressTypeViewResult),
527
+ __param(0, Arg('input', () => RunViewByNameInput)),
528
+ __param(1, Ctx()),
529
+ __param(2, PubSub()),
530
+ __metadata("design:type", Function),
531
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
532
+ __metadata("design:returntype", Promise)
533
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "RunmjBizAppsCommonAddressTypeViewByName", null);
534
+ __decorate([
535
+ Query(() => RunmjBizAppsCommonAddressTypeViewResult),
536
+ __param(0, Arg('input', () => RunDynamicViewInput)),
537
+ __param(1, Ctx()),
538
+ __param(2, PubSub()),
539
+ __metadata("design:type", Function),
540
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
541
+ __metadata("design:returntype", Promise)
542
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "RunmjBizAppsCommonAddressTypeDynamicView", null);
543
+ __decorate([
544
+ Query(() => mjBizAppsCommonAddressType_, { nullable: true }),
545
+ __param(0, Arg('ID', () => String)),
546
+ __param(1, Ctx()),
547
+ __param(2, PubSub()),
548
+ __metadata("design:type", Function),
549
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
550
+ __metadata("design:returntype", Promise)
551
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "mjBizAppsCommonAddressType", null);
552
+ __decorate([
553
+ FieldResolver(() => [mjBizAppsCommonAddressLink_]),
554
+ __param(0, Root()),
555
+ __param(1, Ctx()),
556
+ __param(2, PubSub()),
557
+ __metadata("design:type", Function),
558
+ __metadata("design:paramtypes", [mjBizAppsCommonAddressType_, Object, PubSubEngine]),
559
+ __metadata("design:returntype", Promise)
560
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "mjBizAppsCommonAddressLinks_AddressTypeIDArray", null);
561
+ __decorate([
562
+ Mutation(() => mjBizAppsCommonAddressType_),
563
+ __param(0, Arg('input', () => CreatemjBizAppsCommonAddressTypeInput)),
564
+ __param(1, Ctx()),
565
+ __param(2, PubSub()),
566
+ __metadata("design:type", Function),
567
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonAddressTypeInput, Object, PubSubEngine]),
568
+ __metadata("design:returntype", Promise)
569
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "CreatemjBizAppsCommonAddressType", null);
570
+ __decorate([
571
+ Mutation(() => mjBizAppsCommonAddressType_),
572
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonAddressTypeInput)),
573
+ __param(1, Ctx()),
574
+ __param(2, PubSub()),
575
+ __metadata("design:type", Function),
576
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonAddressTypeInput, Object, PubSubEngine]),
577
+ __metadata("design:returntype", Promise)
578
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "UpdatemjBizAppsCommonAddressType", null);
579
+ __decorate([
580
+ Mutation(() => mjBizAppsCommonAddressType_),
581
+ __param(0, Arg('ID', () => String)),
582
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
583
+ __param(2, Ctx()),
584
+ __param(3, PubSub()),
585
+ __metadata("design:type", Function),
586
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
587
+ __metadata("design:returntype", Promise)
588
+ ], mjBizAppsCommonAddressTypeResolver.prototype, "DeletemjBizAppsCommonAddressType", null);
589
+ mjBizAppsCommonAddressTypeResolver = __decorate([
590
+ Resolver(mjBizAppsCommonAddressType_)
591
+ ], mjBizAppsCommonAddressTypeResolver);
592
+ export { mjBizAppsCommonAddressTypeResolver };
593
+ //****************************************************************************
594
+ // ENTITY CLASS for MJ.BizApps.Common: Addresses
595
+ //****************************************************************************
596
+ let mjBizAppsCommonAddress_ = class mjBizAppsCommonAddress_ {
597
+ };
598
+ __decorate([
599
+ Field(),
600
+ MaxLength(16),
601
+ __metadata("design:type", String)
602
+ ], mjBizAppsCommonAddress_.prototype, "ID", void 0);
603
+ __decorate([
604
+ Field({ description: `Street address line 1` }),
605
+ MaxLength(510),
606
+ __metadata("design:type", String)
607
+ ], mjBizAppsCommonAddress_.prototype, "Line1", void 0);
608
+ __decorate([
609
+ Field({ nullable: true, description: `Street address line 2 (suite, apt, etc.)` }),
610
+ MaxLength(510),
611
+ __metadata("design:type", String)
612
+ ], mjBizAppsCommonAddress_.prototype, "Line2", void 0);
613
+ __decorate([
614
+ Field({ nullable: true, description: `Street address line 3 (additional detail)` }),
615
+ MaxLength(510),
616
+ __metadata("design:type", String)
617
+ ], mjBizAppsCommonAddress_.prototype, "Line3", void 0);
618
+ __decorate([
619
+ Field({ description: `City or locality name` }),
620
+ MaxLength(200),
621
+ __metadata("design:type", String)
622
+ ], mjBizAppsCommonAddress_.prototype, "City", void 0);
623
+ __decorate([
624
+ Field({ nullable: true, description: `State, province, or region` }),
625
+ MaxLength(200),
626
+ __metadata("design:type", String)
627
+ ], mjBizAppsCommonAddress_.prototype, "StateProvince", void 0);
628
+ __decorate([
629
+ Field({ nullable: true, description: `Postal or ZIP code` }),
630
+ MaxLength(40),
631
+ __metadata("design:type", String)
632
+ ], mjBizAppsCommonAddress_.prototype, "PostalCode", void 0);
633
+ __decorate([
634
+ Field({ description: `Country code or name, defaults to US` }),
635
+ MaxLength(200),
636
+ __metadata("design:type", String)
637
+ ], mjBizAppsCommonAddress_.prototype, "Country", void 0);
638
+ __decorate([
639
+ Field(() => Float, { nullable: true, description: `Geographic latitude for mapping` }),
640
+ __metadata("design:type", Number)
641
+ ], mjBizAppsCommonAddress_.prototype, "Latitude", void 0);
642
+ __decorate([
643
+ Field(() => Float, { nullable: true, description: `Geographic longitude for mapping` }),
644
+ __metadata("design:type", Number)
645
+ ], mjBizAppsCommonAddress_.prototype, "Longitude", void 0);
646
+ __decorate([
647
+ Field(),
648
+ MaxLength(10),
649
+ __metadata("design:type", Date)
650
+ ], mjBizAppsCommonAddress_.prototype, "_mj__CreatedAt", void 0);
651
+ __decorate([
652
+ Field(),
653
+ MaxLength(10),
654
+ __metadata("design:type", Date)
655
+ ], mjBizAppsCommonAddress_.prototype, "_mj__UpdatedAt", void 0);
656
+ __decorate([
657
+ Field(() => [mjBizAppsCommonAddressLink_]),
658
+ __metadata("design:type", Array)
659
+ ], mjBizAppsCommonAddress_.prototype, "mjBizAppsCommonAddressLinks_AddressIDArray", void 0);
660
+ mjBizAppsCommonAddress_ = __decorate([
661
+ ObjectType({ description: `Standalone physical address records linked to entities via AddressLink for sharing across people and organizations` })
662
+ ], mjBizAppsCommonAddress_);
663
+ export { mjBizAppsCommonAddress_ };
664
+ //****************************************************************************
665
+ // INPUT TYPE for MJ.BizApps.Common: Addresses
666
+ //****************************************************************************
667
+ let CreatemjBizAppsCommonAddressInput = class CreatemjBizAppsCommonAddressInput {
668
+ };
669
+ __decorate([
670
+ Field({ nullable: true }),
671
+ __metadata("design:type", String)
672
+ ], CreatemjBizAppsCommonAddressInput.prototype, "ID", void 0);
673
+ __decorate([
674
+ Field({ nullable: true }),
675
+ __metadata("design:type", String)
676
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Line1", void 0);
677
+ __decorate([
678
+ Field({ nullable: true }),
679
+ __metadata("design:type", String)
680
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Line2", void 0);
681
+ __decorate([
682
+ Field({ nullable: true }),
683
+ __metadata("design:type", String)
684
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Line3", void 0);
685
+ __decorate([
686
+ Field({ nullable: true }),
687
+ __metadata("design:type", String)
688
+ ], CreatemjBizAppsCommonAddressInput.prototype, "City", void 0);
689
+ __decorate([
690
+ Field({ nullable: true }),
691
+ __metadata("design:type", String)
692
+ ], CreatemjBizAppsCommonAddressInput.prototype, "StateProvince", void 0);
693
+ __decorate([
694
+ Field({ nullable: true }),
695
+ __metadata("design:type", String)
696
+ ], CreatemjBizAppsCommonAddressInput.prototype, "PostalCode", void 0);
697
+ __decorate([
698
+ Field({ nullable: true }),
699
+ __metadata("design:type", String)
700
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Country", void 0);
701
+ __decorate([
702
+ Field(() => Float, { nullable: true }),
703
+ __metadata("design:type", Number)
704
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Latitude", void 0);
705
+ __decorate([
706
+ Field(() => Float, { nullable: true }),
707
+ __metadata("design:type", Number)
708
+ ], CreatemjBizAppsCommonAddressInput.prototype, "Longitude", void 0);
709
+ CreatemjBizAppsCommonAddressInput = __decorate([
710
+ InputType()
711
+ ], CreatemjBizAppsCommonAddressInput);
712
+ export { CreatemjBizAppsCommonAddressInput };
713
+ //****************************************************************************
714
+ // INPUT TYPE for MJ.BizApps.Common: Addresses
715
+ //****************************************************************************
716
+ let UpdatemjBizAppsCommonAddressInput = class UpdatemjBizAppsCommonAddressInput {
717
+ };
718
+ __decorate([
719
+ Field(),
720
+ __metadata("design:type", String)
721
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "ID", void 0);
722
+ __decorate([
723
+ Field({ nullable: true }),
724
+ __metadata("design:type", String)
725
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Line1", void 0);
726
+ __decorate([
727
+ Field({ nullable: true }),
728
+ __metadata("design:type", String)
729
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Line2", void 0);
730
+ __decorate([
731
+ Field({ nullable: true }),
732
+ __metadata("design:type", String)
733
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Line3", void 0);
734
+ __decorate([
735
+ Field({ nullable: true }),
736
+ __metadata("design:type", String)
737
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "City", void 0);
738
+ __decorate([
739
+ Field({ nullable: true }),
740
+ __metadata("design:type", String)
741
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "StateProvince", void 0);
742
+ __decorate([
743
+ Field({ nullable: true }),
744
+ __metadata("design:type", String)
745
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "PostalCode", void 0);
746
+ __decorate([
747
+ Field({ nullable: true }),
748
+ __metadata("design:type", String)
749
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Country", void 0);
750
+ __decorate([
751
+ Field(() => Float, { nullable: true }),
752
+ __metadata("design:type", Number)
753
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Latitude", void 0);
754
+ __decorate([
755
+ Field(() => Float, { nullable: true }),
756
+ __metadata("design:type", Number)
757
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "Longitude", void 0);
758
+ __decorate([
759
+ Field(() => [KeyValuePairInput], { nullable: true }),
760
+ __metadata("design:type", Array)
761
+ ], UpdatemjBizAppsCommonAddressInput.prototype, "OldValues___", void 0);
762
+ UpdatemjBizAppsCommonAddressInput = __decorate([
763
+ InputType()
764
+ ], UpdatemjBizAppsCommonAddressInput);
765
+ export { UpdatemjBizAppsCommonAddressInput };
766
+ //****************************************************************************
767
+ // RESOLVER for MJ.BizApps.Common: Addresses
768
+ //****************************************************************************
769
+ let RunmjBizAppsCommonAddressViewResult = class RunmjBizAppsCommonAddressViewResult {
770
+ };
771
+ __decorate([
772
+ Field(() => [mjBizAppsCommonAddress_]),
773
+ __metadata("design:type", Array)
774
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "Results", void 0);
775
+ __decorate([
776
+ Field(() => String, { nullable: true }),
777
+ __metadata("design:type", String)
778
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "UserViewRunID", void 0);
779
+ __decorate([
780
+ Field(() => Int, { nullable: true }),
781
+ __metadata("design:type", Number)
782
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "RowCount", void 0);
783
+ __decorate([
784
+ Field(() => Int, { nullable: true }),
785
+ __metadata("design:type", Number)
786
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "TotalRowCount", void 0);
787
+ __decorate([
788
+ Field(() => Int, { nullable: true }),
789
+ __metadata("design:type", Number)
790
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "ExecutionTime", void 0);
791
+ __decorate([
792
+ Field({ nullable: true }),
793
+ __metadata("design:type", String)
794
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "ErrorMessage", void 0);
795
+ __decorate([
796
+ Field(() => Boolean, { nullable: false }),
797
+ __metadata("design:type", Boolean)
798
+ ], RunmjBizAppsCommonAddressViewResult.prototype, "Success", void 0);
799
+ RunmjBizAppsCommonAddressViewResult = __decorate([
800
+ ObjectType()
801
+ ], RunmjBizAppsCommonAddressViewResult);
802
+ export { RunmjBizAppsCommonAddressViewResult };
803
+ let mjBizAppsCommonAddressResolver = class mjBizAppsCommonAddressResolver extends ResolverBase {
804
+ async RunmjBizAppsCommonAddressViewByID(input, { providers, userPayload }, pubSub) {
805
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
806
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
807
+ }
808
+ async RunmjBizAppsCommonAddressViewByName(input, { providers, userPayload }, pubSub) {
809
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
810
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
811
+ }
812
+ async RunmjBizAppsCommonAddressDynamicView(input, { providers, userPayload }, pubSub) {
813
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
814
+ input.EntityName = 'MJ.BizApps.Common: Addresses';
815
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
816
+ }
817
+ async mjBizAppsCommonAddress(ID, { dataSources, userPayload, providers }, pubSub) {
818
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Addresses', userPayload);
819
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
820
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
821
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwAddresses] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Addresses', userPayload, EntityPermissionType.Read, 'AND');
822
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
823
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Addresses', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
824
+ return result;
825
+ }
826
+ async mjBizAppsCommonAddressLinks_AddressIDArray(mjbizappscommonaddress_, { dataSources, userPayload, providers }, pubSub) {
827
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
828
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
829
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
830
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwAddressLinks] WHERE [AddressID]='${mjbizappscommonaddress_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
831
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
832
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Address Links', rows, this.GetUserFromPayload(userPayload));
833
+ return result;
834
+ }
835
+ async CreatemjBizAppsCommonAddress(input, { providers, userPayload }, pubSub) {
836
+ const provider = GetReadWriteProvider(providers);
837
+ return this.CreateRecord('MJ.BizApps.Common: Addresses', input, provider, userPayload, pubSub);
838
+ }
839
+ async UpdatemjBizAppsCommonAddress(input, { providers, userPayload }, pubSub) {
840
+ const provider = GetReadWriteProvider(providers);
841
+ return this.UpdateRecord('MJ.BizApps.Common: Addresses', input, provider, userPayload, pubSub);
842
+ }
843
+ async DeletemjBizAppsCommonAddress(ID, options, { providers, userPayload }, pubSub) {
844
+ const provider = GetReadWriteProvider(providers);
845
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
846
+ return this.DeleteRecord('MJ.BizApps.Common: Addresses', key, options, provider, userPayload, pubSub);
847
+ }
848
+ };
849
+ __decorate([
850
+ Query(() => RunmjBizAppsCommonAddressViewResult),
851
+ __param(0, Arg('input', () => RunViewByIDInput)),
852
+ __param(1, Ctx()),
853
+ __param(2, PubSub()),
854
+ __metadata("design:type", Function),
855
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
856
+ __metadata("design:returntype", Promise)
857
+ ], mjBizAppsCommonAddressResolver.prototype, "RunmjBizAppsCommonAddressViewByID", null);
858
+ __decorate([
859
+ Query(() => RunmjBizAppsCommonAddressViewResult),
860
+ __param(0, Arg('input', () => RunViewByNameInput)),
861
+ __param(1, Ctx()),
862
+ __param(2, PubSub()),
863
+ __metadata("design:type", Function),
864
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
865
+ __metadata("design:returntype", Promise)
866
+ ], mjBizAppsCommonAddressResolver.prototype, "RunmjBizAppsCommonAddressViewByName", null);
867
+ __decorate([
868
+ Query(() => RunmjBizAppsCommonAddressViewResult),
869
+ __param(0, Arg('input', () => RunDynamicViewInput)),
870
+ __param(1, Ctx()),
871
+ __param(2, PubSub()),
872
+ __metadata("design:type", Function),
873
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
874
+ __metadata("design:returntype", Promise)
875
+ ], mjBizAppsCommonAddressResolver.prototype, "RunmjBizAppsCommonAddressDynamicView", null);
876
+ __decorate([
877
+ Query(() => mjBizAppsCommonAddress_, { nullable: true }),
878
+ __param(0, Arg('ID', () => String)),
879
+ __param(1, Ctx()),
880
+ __param(2, PubSub()),
881
+ __metadata("design:type", Function),
882
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
883
+ __metadata("design:returntype", Promise)
884
+ ], mjBizAppsCommonAddressResolver.prototype, "mjBizAppsCommonAddress", null);
885
+ __decorate([
886
+ FieldResolver(() => [mjBizAppsCommonAddressLink_]),
887
+ __param(0, Root()),
888
+ __param(1, Ctx()),
889
+ __param(2, PubSub()),
890
+ __metadata("design:type", Function),
891
+ __metadata("design:paramtypes", [mjBizAppsCommonAddress_, Object, PubSubEngine]),
892
+ __metadata("design:returntype", Promise)
893
+ ], mjBizAppsCommonAddressResolver.prototype, "mjBizAppsCommonAddressLinks_AddressIDArray", null);
894
+ __decorate([
895
+ Mutation(() => mjBizAppsCommonAddress_),
896
+ __param(0, Arg('input', () => CreatemjBizAppsCommonAddressInput)),
897
+ __param(1, Ctx()),
898
+ __param(2, PubSub()),
899
+ __metadata("design:type", Function),
900
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonAddressInput, Object, PubSubEngine]),
901
+ __metadata("design:returntype", Promise)
902
+ ], mjBizAppsCommonAddressResolver.prototype, "CreatemjBizAppsCommonAddress", null);
903
+ __decorate([
904
+ Mutation(() => mjBizAppsCommonAddress_),
905
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonAddressInput)),
906
+ __param(1, Ctx()),
907
+ __param(2, PubSub()),
908
+ __metadata("design:type", Function),
909
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonAddressInput, Object, PubSubEngine]),
910
+ __metadata("design:returntype", Promise)
911
+ ], mjBizAppsCommonAddressResolver.prototype, "UpdatemjBizAppsCommonAddress", null);
912
+ __decorate([
913
+ Mutation(() => mjBizAppsCommonAddress_),
914
+ __param(0, Arg('ID', () => String)),
915
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
916
+ __param(2, Ctx()),
917
+ __param(3, PubSub()),
918
+ __metadata("design:type", Function),
919
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
920
+ __metadata("design:returntype", Promise)
921
+ ], mjBizAppsCommonAddressResolver.prototype, "DeletemjBizAppsCommonAddress", null);
922
+ mjBizAppsCommonAddressResolver = __decorate([
923
+ Resolver(mjBizAppsCommonAddress_)
924
+ ], mjBizAppsCommonAddressResolver);
925
+ export { mjBizAppsCommonAddressResolver };
926
+ //****************************************************************************
927
+ // ENTITY CLASS for MJ.BizApps.Common: Contact Methods
928
+ //****************************************************************************
929
+ let mjBizAppsCommonContactMethod_ = class mjBizAppsCommonContactMethod_ {
930
+ };
931
+ __decorate([
932
+ Field(),
933
+ MaxLength(16),
934
+ __metadata("design:type", String)
935
+ ], mjBizAppsCommonContactMethod_.prototype, "ID", void 0);
936
+ __decorate([
937
+ Field({ nullable: true }),
938
+ MaxLength(16),
939
+ __metadata("design:type", String)
940
+ ], mjBizAppsCommonContactMethod_.prototype, "PersonID", void 0);
941
+ __decorate([
942
+ Field({ nullable: true }),
943
+ MaxLength(16),
944
+ __metadata("design:type", String)
945
+ ], mjBizAppsCommonContactMethod_.prototype, "OrganizationID", void 0);
946
+ __decorate([
947
+ Field(),
948
+ MaxLength(16),
949
+ __metadata("design:type", String)
950
+ ], mjBizAppsCommonContactMethod_.prototype, "ContactTypeID", void 0);
951
+ __decorate([
952
+ Field({ description: `The contact value: phone number, email address, URL, social media handle, etc.` }),
953
+ MaxLength(1000),
954
+ __metadata("design:type", String)
955
+ ], mjBizAppsCommonContactMethod_.prototype, "Value", void 0);
956
+ __decorate([
957
+ Field({ nullable: true, description: `Descriptive label such as Work cell, Personal Gmail, Corporate LinkedIn` }),
958
+ MaxLength(200),
959
+ __metadata("design:type", String)
960
+ ], mjBizAppsCommonContactMethod_.prototype, "Label", void 0);
961
+ __decorate([
962
+ Field(() => Boolean, { description: `Whether this is the primary contact method of its type for the linked person or organization` }),
963
+ __metadata("design:type", Boolean)
964
+ ], mjBizAppsCommonContactMethod_.prototype, "IsPrimary", void 0);
965
+ __decorate([
966
+ Field(),
967
+ MaxLength(10),
968
+ __metadata("design:type", Date)
969
+ ], mjBizAppsCommonContactMethod_.prototype, "_mj__CreatedAt", void 0);
970
+ __decorate([
971
+ Field(),
972
+ MaxLength(10),
973
+ __metadata("design:type", Date)
974
+ ], mjBizAppsCommonContactMethod_.prototype, "_mj__UpdatedAt", void 0);
975
+ __decorate([
976
+ Field({ nullable: true }),
977
+ MaxLength(200),
978
+ __metadata("design:type", String)
979
+ ], mjBizAppsCommonContactMethod_.prototype, "Person", void 0);
980
+ __decorate([
981
+ Field({ nullable: true }),
982
+ MaxLength(510),
983
+ __metadata("design:type", String)
984
+ ], mjBizAppsCommonContactMethod_.prototype, "Organization", void 0);
985
+ __decorate([
986
+ Field(),
987
+ MaxLength(200),
988
+ __metadata("design:type", String)
989
+ ], mjBizAppsCommonContactMethod_.prototype, "ContactType", void 0);
990
+ mjBizAppsCommonContactMethod_ = __decorate([
991
+ ObjectType({ description: `Additional contact methods for people and organizations beyond the primary email and phone fields` })
992
+ ], mjBizAppsCommonContactMethod_);
993
+ export { mjBizAppsCommonContactMethod_ };
994
+ //****************************************************************************
995
+ // INPUT TYPE for MJ.BizApps.Common: Contact Methods
996
+ //****************************************************************************
997
+ let CreatemjBizAppsCommonContactMethodInput = class CreatemjBizAppsCommonContactMethodInput {
998
+ };
999
+ __decorate([
1000
+ Field({ nullable: true }),
1001
+ __metadata("design:type", String)
1002
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "ID", void 0);
1003
+ __decorate([
1004
+ Field({ nullable: true }),
1005
+ __metadata("design:type", String)
1006
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "PersonID", void 0);
1007
+ __decorate([
1008
+ Field({ nullable: true }),
1009
+ __metadata("design:type", String)
1010
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "OrganizationID", void 0);
1011
+ __decorate([
1012
+ Field({ nullable: true }),
1013
+ __metadata("design:type", String)
1014
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "ContactTypeID", void 0);
1015
+ __decorate([
1016
+ Field({ nullable: true }),
1017
+ __metadata("design:type", String)
1018
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "Value", void 0);
1019
+ __decorate([
1020
+ Field({ nullable: true }),
1021
+ __metadata("design:type", String)
1022
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "Label", void 0);
1023
+ __decorate([
1024
+ Field(() => Boolean, { nullable: true }),
1025
+ __metadata("design:type", Boolean)
1026
+ ], CreatemjBizAppsCommonContactMethodInput.prototype, "IsPrimary", void 0);
1027
+ CreatemjBizAppsCommonContactMethodInput = __decorate([
1028
+ InputType()
1029
+ ], CreatemjBizAppsCommonContactMethodInput);
1030
+ export { CreatemjBizAppsCommonContactMethodInput };
1031
+ //****************************************************************************
1032
+ // INPUT TYPE for MJ.BizApps.Common: Contact Methods
1033
+ //****************************************************************************
1034
+ let UpdatemjBizAppsCommonContactMethodInput = class UpdatemjBizAppsCommonContactMethodInput {
1035
+ };
1036
+ __decorate([
1037
+ Field(),
1038
+ __metadata("design:type", String)
1039
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "ID", void 0);
1040
+ __decorate([
1041
+ Field({ nullable: true }),
1042
+ __metadata("design:type", String)
1043
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "PersonID", void 0);
1044
+ __decorate([
1045
+ Field({ nullable: true }),
1046
+ __metadata("design:type", String)
1047
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "OrganizationID", void 0);
1048
+ __decorate([
1049
+ Field({ nullable: true }),
1050
+ __metadata("design:type", String)
1051
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "ContactTypeID", void 0);
1052
+ __decorate([
1053
+ Field({ nullable: true }),
1054
+ __metadata("design:type", String)
1055
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "Value", void 0);
1056
+ __decorate([
1057
+ Field({ nullable: true }),
1058
+ __metadata("design:type", String)
1059
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "Label", void 0);
1060
+ __decorate([
1061
+ Field(() => Boolean, { nullable: true }),
1062
+ __metadata("design:type", Boolean)
1063
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "IsPrimary", void 0);
1064
+ __decorate([
1065
+ Field(() => [KeyValuePairInput], { nullable: true }),
1066
+ __metadata("design:type", Array)
1067
+ ], UpdatemjBizAppsCommonContactMethodInput.prototype, "OldValues___", void 0);
1068
+ UpdatemjBizAppsCommonContactMethodInput = __decorate([
1069
+ InputType()
1070
+ ], UpdatemjBizAppsCommonContactMethodInput);
1071
+ export { UpdatemjBizAppsCommonContactMethodInput };
1072
+ //****************************************************************************
1073
+ // RESOLVER for MJ.BizApps.Common: Contact Methods
1074
+ //****************************************************************************
1075
+ let RunmjBizAppsCommonContactMethodViewResult = class RunmjBizAppsCommonContactMethodViewResult {
1076
+ };
1077
+ __decorate([
1078
+ Field(() => [mjBizAppsCommonContactMethod_]),
1079
+ __metadata("design:type", Array)
1080
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "Results", void 0);
1081
+ __decorate([
1082
+ Field(() => String, { nullable: true }),
1083
+ __metadata("design:type", String)
1084
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "UserViewRunID", void 0);
1085
+ __decorate([
1086
+ Field(() => Int, { nullable: true }),
1087
+ __metadata("design:type", Number)
1088
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "RowCount", void 0);
1089
+ __decorate([
1090
+ Field(() => Int, { nullable: true }),
1091
+ __metadata("design:type", Number)
1092
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "TotalRowCount", void 0);
1093
+ __decorate([
1094
+ Field(() => Int, { nullable: true }),
1095
+ __metadata("design:type", Number)
1096
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "ExecutionTime", void 0);
1097
+ __decorate([
1098
+ Field({ nullable: true }),
1099
+ __metadata("design:type", String)
1100
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "ErrorMessage", void 0);
1101
+ __decorate([
1102
+ Field(() => Boolean, { nullable: false }),
1103
+ __metadata("design:type", Boolean)
1104
+ ], RunmjBizAppsCommonContactMethodViewResult.prototype, "Success", void 0);
1105
+ RunmjBizAppsCommonContactMethodViewResult = __decorate([
1106
+ ObjectType()
1107
+ ], RunmjBizAppsCommonContactMethodViewResult);
1108
+ export { RunmjBizAppsCommonContactMethodViewResult };
1109
+ let mjBizAppsCommonContactMethodResolver = class mjBizAppsCommonContactMethodResolver extends ResolverBase {
1110
+ async RunmjBizAppsCommonContactMethodViewByID(input, { providers, userPayload }, pubSub) {
1111
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1112
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
1113
+ }
1114
+ async RunmjBizAppsCommonContactMethodViewByName(input, { providers, userPayload }, pubSub) {
1115
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1116
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
1117
+ }
1118
+ async RunmjBizAppsCommonContactMethodDynamicView(input, { providers, userPayload }, pubSub) {
1119
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1120
+ input.EntityName = 'MJ.BizApps.Common: Contact Methods';
1121
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1122
+ }
1123
+ async mjBizAppsCommonContactMethod(ID, { dataSources, userPayload, providers }, pubSub) {
1124
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
1125
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1126
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
1127
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwContactMethods] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
1128
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
1129
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Contact Methods', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
1130
+ return result;
1131
+ }
1132
+ async CreatemjBizAppsCommonContactMethod(input, { providers, userPayload }, pubSub) {
1133
+ const provider = GetReadWriteProvider(providers);
1134
+ return this.CreateRecord('MJ.BizApps.Common: Contact Methods', input, provider, userPayload, pubSub);
1135
+ }
1136
+ async UpdatemjBizAppsCommonContactMethod(input, { providers, userPayload }, pubSub) {
1137
+ const provider = GetReadWriteProvider(providers);
1138
+ return this.UpdateRecord('MJ.BizApps.Common: Contact Methods', input, provider, userPayload, pubSub);
1139
+ }
1140
+ async DeletemjBizAppsCommonContactMethod(ID, options, { providers, userPayload }, pubSub) {
1141
+ const provider = GetReadWriteProvider(providers);
1142
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1143
+ return this.DeleteRecord('MJ.BizApps.Common: Contact Methods', key, options, provider, userPayload, pubSub);
1144
+ }
1145
+ };
1146
+ __decorate([
1147
+ Query(() => RunmjBizAppsCommonContactMethodViewResult),
1148
+ __param(0, Arg('input', () => RunViewByIDInput)),
1149
+ __param(1, Ctx()),
1150
+ __param(2, PubSub()),
1151
+ __metadata("design:type", Function),
1152
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
1153
+ __metadata("design:returntype", Promise)
1154
+ ], mjBizAppsCommonContactMethodResolver.prototype, "RunmjBizAppsCommonContactMethodViewByID", null);
1155
+ __decorate([
1156
+ Query(() => RunmjBizAppsCommonContactMethodViewResult),
1157
+ __param(0, Arg('input', () => RunViewByNameInput)),
1158
+ __param(1, Ctx()),
1159
+ __param(2, PubSub()),
1160
+ __metadata("design:type", Function),
1161
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
1162
+ __metadata("design:returntype", Promise)
1163
+ ], mjBizAppsCommonContactMethodResolver.prototype, "RunmjBizAppsCommonContactMethodViewByName", null);
1164
+ __decorate([
1165
+ Query(() => RunmjBizAppsCommonContactMethodViewResult),
1166
+ __param(0, Arg('input', () => RunDynamicViewInput)),
1167
+ __param(1, Ctx()),
1168
+ __param(2, PubSub()),
1169
+ __metadata("design:type", Function),
1170
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
1171
+ __metadata("design:returntype", Promise)
1172
+ ], mjBizAppsCommonContactMethodResolver.prototype, "RunmjBizAppsCommonContactMethodDynamicView", null);
1173
+ __decorate([
1174
+ Query(() => mjBizAppsCommonContactMethod_, { nullable: true }),
1175
+ __param(0, Arg('ID', () => String)),
1176
+ __param(1, Ctx()),
1177
+ __param(2, PubSub()),
1178
+ __metadata("design:type", Function),
1179
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
1180
+ __metadata("design:returntype", Promise)
1181
+ ], mjBizAppsCommonContactMethodResolver.prototype, "mjBizAppsCommonContactMethod", null);
1182
+ __decorate([
1183
+ Mutation(() => mjBizAppsCommonContactMethod_),
1184
+ __param(0, Arg('input', () => CreatemjBizAppsCommonContactMethodInput)),
1185
+ __param(1, Ctx()),
1186
+ __param(2, PubSub()),
1187
+ __metadata("design:type", Function),
1188
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonContactMethodInput, Object, PubSubEngine]),
1189
+ __metadata("design:returntype", Promise)
1190
+ ], mjBizAppsCommonContactMethodResolver.prototype, "CreatemjBizAppsCommonContactMethod", null);
1191
+ __decorate([
1192
+ Mutation(() => mjBizAppsCommonContactMethod_),
1193
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonContactMethodInput)),
1194
+ __param(1, Ctx()),
1195
+ __param(2, PubSub()),
1196
+ __metadata("design:type", Function),
1197
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonContactMethodInput, Object, PubSubEngine]),
1198
+ __metadata("design:returntype", Promise)
1199
+ ], mjBizAppsCommonContactMethodResolver.prototype, "UpdatemjBizAppsCommonContactMethod", null);
1200
+ __decorate([
1201
+ Mutation(() => mjBizAppsCommonContactMethod_),
1202
+ __param(0, Arg('ID', () => String)),
1203
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
1204
+ __param(2, Ctx()),
1205
+ __param(3, PubSub()),
1206
+ __metadata("design:type", Function),
1207
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
1208
+ __metadata("design:returntype", Promise)
1209
+ ], mjBizAppsCommonContactMethodResolver.prototype, "DeletemjBizAppsCommonContactMethod", null);
1210
+ mjBizAppsCommonContactMethodResolver = __decorate([
1211
+ Resolver(mjBizAppsCommonContactMethod_)
1212
+ ], mjBizAppsCommonContactMethodResolver);
1213
+ export { mjBizAppsCommonContactMethodResolver };
1214
+ //****************************************************************************
1215
+ // ENTITY CLASS for MJ.BizApps.Common: Contact Types
1216
+ //****************************************************************************
1217
+ let mjBizAppsCommonContactType_ = class mjBizAppsCommonContactType_ {
1218
+ };
1219
+ __decorate([
1220
+ Field(),
1221
+ MaxLength(16),
1222
+ __metadata("design:type", String)
1223
+ ], mjBizAppsCommonContactType_.prototype, "ID", void 0);
1224
+ __decorate([
1225
+ Field({ description: `Display name for the contact type` }),
1226
+ MaxLength(200),
1227
+ __metadata("design:type", String)
1228
+ ], mjBizAppsCommonContactType_.prototype, "Name", void 0);
1229
+ __decorate([
1230
+ Field({ nullable: true, description: `Detailed description of this contact type` }),
1231
+ __metadata("design:type", String)
1232
+ ], mjBizAppsCommonContactType_.prototype, "Description", void 0);
1233
+ __decorate([
1234
+ Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
1235
+ MaxLength(200),
1236
+ __metadata("design:type", String)
1237
+ ], mjBizAppsCommonContactType_.prototype, "IconClass", void 0);
1238
+ __decorate([
1239
+ Field(() => Int, { description: `Sort order in dropdown lists. Lower values appear first` }),
1240
+ __metadata("design:type", Number)
1241
+ ], mjBizAppsCommonContactType_.prototype, "DisplayRank", void 0);
1242
+ __decorate([
1243
+ Field(() => Boolean, { description: `Whether this type is available for selection in the UI. Inactive types are hidden from dropdowns but preserved for existing records` }),
1244
+ __metadata("design:type", Boolean)
1245
+ ], mjBizAppsCommonContactType_.prototype, "IsActive", void 0);
1246
+ __decorate([
1247
+ Field(),
1248
+ MaxLength(10),
1249
+ __metadata("design:type", Date)
1250
+ ], mjBizAppsCommonContactType_.prototype, "_mj__CreatedAt", void 0);
1251
+ __decorate([
1252
+ Field(),
1253
+ MaxLength(10),
1254
+ __metadata("design:type", Date)
1255
+ ], mjBizAppsCommonContactType_.prototype, "_mj__UpdatedAt", void 0);
1256
+ __decorate([
1257
+ Field(() => [mjBizAppsCommonContactMethod_]),
1258
+ __metadata("design:type", Array)
1259
+ ], mjBizAppsCommonContactType_.prototype, "mjBizAppsCommonContactMethods_ContactTypeIDArray", void 0);
1260
+ mjBizAppsCommonContactType_ = __decorate([
1261
+ ObjectType({ description: `Categories of contact methods such as Phone, Mobile, Email, LinkedIn, Website` })
1262
+ ], mjBizAppsCommonContactType_);
1263
+ export { mjBizAppsCommonContactType_ };
1264
+ //****************************************************************************
1265
+ // INPUT TYPE for MJ.BizApps.Common: Contact Types
1266
+ //****************************************************************************
1267
+ let CreatemjBizAppsCommonContactTypeInput = class CreatemjBizAppsCommonContactTypeInput {
1268
+ };
1269
+ __decorate([
1270
+ Field({ nullable: true }),
1271
+ __metadata("design:type", String)
1272
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "ID", void 0);
1273
+ __decorate([
1274
+ Field({ nullable: true }),
1275
+ __metadata("design:type", String)
1276
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "Name", void 0);
1277
+ __decorate([
1278
+ Field({ nullable: true }),
1279
+ __metadata("design:type", String)
1280
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "Description", void 0);
1281
+ __decorate([
1282
+ Field({ nullable: true }),
1283
+ __metadata("design:type", String)
1284
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "IconClass", void 0);
1285
+ __decorate([
1286
+ Field(() => Int, { nullable: true }),
1287
+ __metadata("design:type", Number)
1288
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "DisplayRank", void 0);
1289
+ __decorate([
1290
+ Field(() => Boolean, { nullable: true }),
1291
+ __metadata("design:type", Boolean)
1292
+ ], CreatemjBizAppsCommonContactTypeInput.prototype, "IsActive", void 0);
1293
+ CreatemjBizAppsCommonContactTypeInput = __decorate([
1294
+ InputType()
1295
+ ], CreatemjBizAppsCommonContactTypeInput);
1296
+ export { CreatemjBizAppsCommonContactTypeInput };
1297
+ //****************************************************************************
1298
+ // INPUT TYPE for MJ.BizApps.Common: Contact Types
1299
+ //****************************************************************************
1300
+ let UpdatemjBizAppsCommonContactTypeInput = class UpdatemjBizAppsCommonContactTypeInput {
1301
+ };
1302
+ __decorate([
1303
+ Field(),
1304
+ __metadata("design:type", String)
1305
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "ID", void 0);
1306
+ __decorate([
1307
+ Field({ nullable: true }),
1308
+ __metadata("design:type", String)
1309
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "Name", void 0);
1310
+ __decorate([
1311
+ Field({ nullable: true }),
1312
+ __metadata("design:type", String)
1313
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "Description", void 0);
1314
+ __decorate([
1315
+ Field({ nullable: true }),
1316
+ __metadata("design:type", String)
1317
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "IconClass", void 0);
1318
+ __decorate([
1319
+ Field(() => Int, { nullable: true }),
1320
+ __metadata("design:type", Number)
1321
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "DisplayRank", void 0);
1322
+ __decorate([
1323
+ Field(() => Boolean, { nullable: true }),
1324
+ __metadata("design:type", Boolean)
1325
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "IsActive", void 0);
1326
+ __decorate([
1327
+ Field(() => [KeyValuePairInput], { nullable: true }),
1328
+ __metadata("design:type", Array)
1329
+ ], UpdatemjBizAppsCommonContactTypeInput.prototype, "OldValues___", void 0);
1330
+ UpdatemjBizAppsCommonContactTypeInput = __decorate([
1331
+ InputType()
1332
+ ], UpdatemjBizAppsCommonContactTypeInput);
1333
+ export { UpdatemjBizAppsCommonContactTypeInput };
1334
+ //****************************************************************************
1335
+ // RESOLVER for MJ.BizApps.Common: Contact Types
1336
+ //****************************************************************************
1337
+ let RunmjBizAppsCommonContactTypeViewResult = class RunmjBizAppsCommonContactTypeViewResult {
1338
+ };
1339
+ __decorate([
1340
+ Field(() => [mjBizAppsCommonContactType_]),
1341
+ __metadata("design:type", Array)
1342
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "Results", void 0);
1343
+ __decorate([
1344
+ Field(() => String, { nullable: true }),
1345
+ __metadata("design:type", String)
1346
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "UserViewRunID", void 0);
1347
+ __decorate([
1348
+ Field(() => Int, { nullable: true }),
1349
+ __metadata("design:type", Number)
1350
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "RowCount", void 0);
1351
+ __decorate([
1352
+ Field(() => Int, { nullable: true }),
1353
+ __metadata("design:type", Number)
1354
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "TotalRowCount", void 0);
1355
+ __decorate([
1356
+ Field(() => Int, { nullable: true }),
1357
+ __metadata("design:type", Number)
1358
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "ExecutionTime", void 0);
1359
+ __decorate([
1360
+ Field({ nullable: true }),
1361
+ __metadata("design:type", String)
1362
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "ErrorMessage", void 0);
1363
+ __decorate([
1364
+ Field(() => Boolean, { nullable: false }),
1365
+ __metadata("design:type", Boolean)
1366
+ ], RunmjBizAppsCommonContactTypeViewResult.prototype, "Success", void 0);
1367
+ RunmjBizAppsCommonContactTypeViewResult = __decorate([
1368
+ ObjectType()
1369
+ ], RunmjBizAppsCommonContactTypeViewResult);
1370
+ export { RunmjBizAppsCommonContactTypeViewResult };
1371
+ let mjBizAppsCommonContactTypeResolver = class mjBizAppsCommonContactTypeResolver extends ResolverBase {
1372
+ async RunmjBizAppsCommonContactTypeViewByID(input, { providers, userPayload }, pubSub) {
1373
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1374
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
1375
+ }
1376
+ async RunmjBizAppsCommonContactTypeViewByName(input, { providers, userPayload }, pubSub) {
1377
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1378
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
1379
+ }
1380
+ async RunmjBizAppsCommonContactTypeDynamicView(input, { providers, userPayload }, pubSub) {
1381
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1382
+ input.EntityName = 'MJ.BizApps.Common: Contact Types';
1383
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1384
+ }
1385
+ async mjBizAppsCommonContactType(ID, { dataSources, userPayload, providers }, pubSub) {
1386
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Types', userPayload);
1387
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1388
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
1389
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwContactTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Contact Types', userPayload, EntityPermissionType.Read, 'AND');
1390
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
1391
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Contact Types', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
1392
+ return result;
1393
+ }
1394
+ async mjBizAppsCommonContactMethods_ContactTypeIDArray(mjbizappscommoncontacttype_, { dataSources, userPayload, providers }, pubSub) {
1395
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
1396
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1397
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
1398
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwContactMethods] WHERE [ContactTypeID]='${mjbizappscommoncontacttype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
1399
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
1400
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
1401
+ return result;
1402
+ }
1403
+ async CreatemjBizAppsCommonContactType(input, { providers, userPayload }, pubSub) {
1404
+ const provider = GetReadWriteProvider(providers);
1405
+ return this.CreateRecord('MJ.BizApps.Common: Contact Types', input, provider, userPayload, pubSub);
1406
+ }
1407
+ async UpdatemjBizAppsCommonContactType(input, { providers, userPayload }, pubSub) {
1408
+ const provider = GetReadWriteProvider(providers);
1409
+ return this.UpdateRecord('MJ.BizApps.Common: Contact Types', input, provider, userPayload, pubSub);
1410
+ }
1411
+ async DeletemjBizAppsCommonContactType(ID, options, { providers, userPayload }, pubSub) {
1412
+ const provider = GetReadWriteProvider(providers);
1413
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1414
+ return this.DeleteRecord('MJ.BizApps.Common: Contact Types', key, options, provider, userPayload, pubSub);
1415
+ }
1416
+ };
1417
+ __decorate([
1418
+ Query(() => RunmjBizAppsCommonContactTypeViewResult),
1419
+ __param(0, Arg('input', () => RunViewByIDInput)),
1420
+ __param(1, Ctx()),
1421
+ __param(2, PubSub()),
1422
+ __metadata("design:type", Function),
1423
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
1424
+ __metadata("design:returntype", Promise)
1425
+ ], mjBizAppsCommonContactTypeResolver.prototype, "RunmjBizAppsCommonContactTypeViewByID", null);
1426
+ __decorate([
1427
+ Query(() => RunmjBizAppsCommonContactTypeViewResult),
1428
+ __param(0, Arg('input', () => RunViewByNameInput)),
1429
+ __param(1, Ctx()),
1430
+ __param(2, PubSub()),
1431
+ __metadata("design:type", Function),
1432
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
1433
+ __metadata("design:returntype", Promise)
1434
+ ], mjBizAppsCommonContactTypeResolver.prototype, "RunmjBizAppsCommonContactTypeViewByName", null);
1435
+ __decorate([
1436
+ Query(() => RunmjBizAppsCommonContactTypeViewResult),
1437
+ __param(0, Arg('input', () => RunDynamicViewInput)),
1438
+ __param(1, Ctx()),
1439
+ __param(2, PubSub()),
1440
+ __metadata("design:type", Function),
1441
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
1442
+ __metadata("design:returntype", Promise)
1443
+ ], mjBizAppsCommonContactTypeResolver.prototype, "RunmjBizAppsCommonContactTypeDynamicView", null);
1444
+ __decorate([
1445
+ Query(() => mjBizAppsCommonContactType_, { nullable: true }),
1446
+ __param(0, Arg('ID', () => String)),
1447
+ __param(1, Ctx()),
1448
+ __param(2, PubSub()),
1449
+ __metadata("design:type", Function),
1450
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
1451
+ __metadata("design:returntype", Promise)
1452
+ ], mjBizAppsCommonContactTypeResolver.prototype, "mjBizAppsCommonContactType", null);
1453
+ __decorate([
1454
+ FieldResolver(() => [mjBizAppsCommonContactMethod_]),
1455
+ __param(0, Root()),
1456
+ __param(1, Ctx()),
1457
+ __param(2, PubSub()),
1458
+ __metadata("design:type", Function),
1459
+ __metadata("design:paramtypes", [mjBizAppsCommonContactType_, Object, PubSubEngine]),
1460
+ __metadata("design:returntype", Promise)
1461
+ ], mjBizAppsCommonContactTypeResolver.prototype, "mjBizAppsCommonContactMethods_ContactTypeIDArray", null);
1462
+ __decorate([
1463
+ Mutation(() => mjBizAppsCommonContactType_),
1464
+ __param(0, Arg('input', () => CreatemjBizAppsCommonContactTypeInput)),
1465
+ __param(1, Ctx()),
1466
+ __param(2, PubSub()),
1467
+ __metadata("design:type", Function),
1468
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonContactTypeInput, Object, PubSubEngine]),
1469
+ __metadata("design:returntype", Promise)
1470
+ ], mjBizAppsCommonContactTypeResolver.prototype, "CreatemjBizAppsCommonContactType", null);
1471
+ __decorate([
1472
+ Mutation(() => mjBizAppsCommonContactType_),
1473
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonContactTypeInput)),
1474
+ __param(1, Ctx()),
1475
+ __param(2, PubSub()),
1476
+ __metadata("design:type", Function),
1477
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonContactTypeInput, Object, PubSubEngine]),
1478
+ __metadata("design:returntype", Promise)
1479
+ ], mjBizAppsCommonContactTypeResolver.prototype, "UpdatemjBizAppsCommonContactType", null);
1480
+ __decorate([
1481
+ Mutation(() => mjBizAppsCommonContactType_),
1482
+ __param(0, Arg('ID', () => String)),
1483
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
1484
+ __param(2, Ctx()),
1485
+ __param(3, PubSub()),
1486
+ __metadata("design:type", Function),
1487
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
1488
+ __metadata("design:returntype", Promise)
1489
+ ], mjBizAppsCommonContactTypeResolver.prototype, "DeletemjBizAppsCommonContactType", null);
1490
+ mjBizAppsCommonContactTypeResolver = __decorate([
1491
+ Resolver(mjBizAppsCommonContactType_)
1492
+ ], mjBizAppsCommonContactTypeResolver);
1493
+ export { mjBizAppsCommonContactTypeResolver };
1494
+ //****************************************************************************
1495
+ // ENTITY CLASS for MJ.BizApps.Common: Organization Types
1496
+ //****************************************************************************
1497
+ let mjBizAppsCommonOrganizationType_ = class mjBizAppsCommonOrganizationType_ {
1498
+ };
1499
+ __decorate([
1500
+ Field(),
1501
+ MaxLength(16),
1502
+ __metadata("design:type", String)
1503
+ ], mjBizAppsCommonOrganizationType_.prototype, "ID", void 0);
1504
+ __decorate([
1505
+ Field({ description: `Display name for the organization type` }),
1506
+ MaxLength(200),
1507
+ __metadata("design:type", String)
1508
+ ], mjBizAppsCommonOrganizationType_.prototype, "Name", void 0);
1509
+ __decorate([
1510
+ Field({ nullable: true, description: `Detailed description of this organization type` }),
1511
+ __metadata("design:type", String)
1512
+ ], mjBizAppsCommonOrganizationType_.prototype, "Description", void 0);
1513
+ __decorate([
1514
+ Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
1515
+ MaxLength(200),
1516
+ __metadata("design:type", String)
1517
+ ], mjBizAppsCommonOrganizationType_.prototype, "IconClass", void 0);
1518
+ __decorate([
1519
+ Field(() => Int, { description: `Sort order in dropdown lists. Lower values appear first` }),
1520
+ __metadata("design:type", Number)
1521
+ ], mjBizAppsCommonOrganizationType_.prototype, "DisplayRank", void 0);
1522
+ __decorate([
1523
+ Field(() => Boolean, { description: `Whether this type is available for selection in the UI. Inactive types are hidden from dropdowns but preserved for existing records` }),
1524
+ __metadata("design:type", Boolean)
1525
+ ], mjBizAppsCommonOrganizationType_.prototype, "IsActive", void 0);
1526
+ __decorate([
1527
+ Field(),
1528
+ MaxLength(10),
1529
+ __metadata("design:type", Date)
1530
+ ], mjBizAppsCommonOrganizationType_.prototype, "_mj__CreatedAt", void 0);
1531
+ __decorate([
1532
+ Field(),
1533
+ MaxLength(10),
1534
+ __metadata("design:type", Date)
1535
+ ], mjBizAppsCommonOrganizationType_.prototype, "_mj__UpdatedAt", void 0);
1536
+ __decorate([
1537
+ Field(() => [mjBizAppsCommonOrganization_]),
1538
+ __metadata("design:type", Array)
1539
+ ], mjBizAppsCommonOrganizationType_.prototype, "mjBizAppsCommonOrganizations_OrganizationTypeIDArray", void 0);
1540
+ mjBizAppsCommonOrganizationType_ = __decorate([
1541
+ ObjectType({ description: `Categories of organizations such as Company, Non-Profit, Association, Government` })
1542
+ ], mjBizAppsCommonOrganizationType_);
1543
+ export { mjBizAppsCommonOrganizationType_ };
1544
+ //****************************************************************************
1545
+ // INPUT TYPE for MJ.BizApps.Common: Organization Types
1546
+ //****************************************************************************
1547
+ let CreatemjBizAppsCommonOrganizationTypeInput = class CreatemjBizAppsCommonOrganizationTypeInput {
1548
+ };
1549
+ __decorate([
1550
+ Field({ nullable: true }),
1551
+ __metadata("design:type", String)
1552
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "ID", void 0);
1553
+ __decorate([
1554
+ Field({ nullable: true }),
1555
+ __metadata("design:type", String)
1556
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "Name", void 0);
1557
+ __decorate([
1558
+ Field({ nullable: true }),
1559
+ __metadata("design:type", String)
1560
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "Description", void 0);
1561
+ __decorate([
1562
+ Field({ nullable: true }),
1563
+ __metadata("design:type", String)
1564
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "IconClass", void 0);
1565
+ __decorate([
1566
+ Field(() => Int, { nullable: true }),
1567
+ __metadata("design:type", Number)
1568
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "DisplayRank", void 0);
1569
+ __decorate([
1570
+ Field(() => Boolean, { nullable: true }),
1571
+ __metadata("design:type", Boolean)
1572
+ ], CreatemjBizAppsCommonOrganizationTypeInput.prototype, "IsActive", void 0);
1573
+ CreatemjBizAppsCommonOrganizationTypeInput = __decorate([
1574
+ InputType()
1575
+ ], CreatemjBizAppsCommonOrganizationTypeInput);
1576
+ export { CreatemjBizAppsCommonOrganizationTypeInput };
1577
+ //****************************************************************************
1578
+ // INPUT TYPE for MJ.BizApps.Common: Organization Types
1579
+ //****************************************************************************
1580
+ let UpdatemjBizAppsCommonOrganizationTypeInput = class UpdatemjBizAppsCommonOrganizationTypeInput {
1581
+ };
1582
+ __decorate([
1583
+ Field(),
1584
+ __metadata("design:type", String)
1585
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "ID", void 0);
1586
+ __decorate([
1587
+ Field({ nullable: true }),
1588
+ __metadata("design:type", String)
1589
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "Name", void 0);
1590
+ __decorate([
1591
+ Field({ nullable: true }),
1592
+ __metadata("design:type", String)
1593
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "Description", void 0);
1594
+ __decorate([
1595
+ Field({ nullable: true }),
1596
+ __metadata("design:type", String)
1597
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "IconClass", void 0);
1598
+ __decorate([
1599
+ Field(() => Int, { nullable: true }),
1600
+ __metadata("design:type", Number)
1601
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "DisplayRank", void 0);
1602
+ __decorate([
1603
+ Field(() => Boolean, { nullable: true }),
1604
+ __metadata("design:type", Boolean)
1605
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "IsActive", void 0);
1606
+ __decorate([
1607
+ Field(() => [KeyValuePairInput], { nullable: true }),
1608
+ __metadata("design:type", Array)
1609
+ ], UpdatemjBizAppsCommonOrganizationTypeInput.prototype, "OldValues___", void 0);
1610
+ UpdatemjBizAppsCommonOrganizationTypeInput = __decorate([
1611
+ InputType()
1612
+ ], UpdatemjBizAppsCommonOrganizationTypeInput);
1613
+ export { UpdatemjBizAppsCommonOrganizationTypeInput };
1614
+ //****************************************************************************
1615
+ // RESOLVER for MJ.BizApps.Common: Organization Types
1616
+ //****************************************************************************
1617
+ let RunmjBizAppsCommonOrganizationTypeViewResult = class RunmjBizAppsCommonOrganizationTypeViewResult {
1618
+ };
1619
+ __decorate([
1620
+ Field(() => [mjBizAppsCommonOrganizationType_]),
1621
+ __metadata("design:type", Array)
1622
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "Results", void 0);
1623
+ __decorate([
1624
+ Field(() => String, { nullable: true }),
1625
+ __metadata("design:type", String)
1626
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "UserViewRunID", void 0);
1627
+ __decorate([
1628
+ Field(() => Int, { nullable: true }),
1629
+ __metadata("design:type", Number)
1630
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "RowCount", void 0);
1631
+ __decorate([
1632
+ Field(() => Int, { nullable: true }),
1633
+ __metadata("design:type", Number)
1634
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "TotalRowCount", void 0);
1635
+ __decorate([
1636
+ Field(() => Int, { nullable: true }),
1637
+ __metadata("design:type", Number)
1638
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "ExecutionTime", void 0);
1639
+ __decorate([
1640
+ Field({ nullable: true }),
1641
+ __metadata("design:type", String)
1642
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "ErrorMessage", void 0);
1643
+ __decorate([
1644
+ Field(() => Boolean, { nullable: false }),
1645
+ __metadata("design:type", Boolean)
1646
+ ], RunmjBizAppsCommonOrganizationTypeViewResult.prototype, "Success", void 0);
1647
+ RunmjBizAppsCommonOrganizationTypeViewResult = __decorate([
1648
+ ObjectType()
1649
+ ], RunmjBizAppsCommonOrganizationTypeViewResult);
1650
+ export { RunmjBizAppsCommonOrganizationTypeViewResult };
1651
+ let mjBizAppsCommonOrganizationTypeResolver = class mjBizAppsCommonOrganizationTypeResolver extends ResolverBase {
1652
+ async RunmjBizAppsCommonOrganizationTypeViewByID(input, { providers, userPayload }, pubSub) {
1653
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1654
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
1655
+ }
1656
+ async RunmjBizAppsCommonOrganizationTypeViewByName(input, { providers, userPayload }, pubSub) {
1657
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1658
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
1659
+ }
1660
+ async RunmjBizAppsCommonOrganizationTypeDynamicView(input, { providers, userPayload }, pubSub) {
1661
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1662
+ input.EntityName = 'MJ.BizApps.Common: Organization Types';
1663
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1664
+ }
1665
+ async mjBizAppsCommonOrganizationType(ID, { dataSources, userPayload, providers }, pubSub) {
1666
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Organization Types', userPayload);
1667
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1668
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
1669
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwOrganizationTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Organization Types', userPayload, EntityPermissionType.Read, 'AND');
1670
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
1671
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Organization Types', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
1672
+ return result;
1673
+ }
1674
+ async mjBizAppsCommonOrganizations_OrganizationTypeIDArray(mjbizappscommonorganizationtype_, { dataSources, userPayload, providers }, pubSub) {
1675
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
1676
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1677
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
1678
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwOrganizationsExtended] WHERE [OrganizationTypeID]='${mjbizappscommonorganizationtype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
1679
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
1680
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Organizations', rows, this.GetUserFromPayload(userPayload));
1681
+ return result;
1682
+ }
1683
+ async CreatemjBizAppsCommonOrganizationType(input, { providers, userPayload }, pubSub) {
1684
+ const provider = GetReadWriteProvider(providers);
1685
+ return this.CreateRecord('MJ.BizApps.Common: Organization Types', input, provider, userPayload, pubSub);
1686
+ }
1687
+ async UpdatemjBizAppsCommonOrganizationType(input, { providers, userPayload }, pubSub) {
1688
+ const provider = GetReadWriteProvider(providers);
1689
+ return this.UpdateRecord('MJ.BizApps.Common: Organization Types', input, provider, userPayload, pubSub);
1690
+ }
1691
+ async DeletemjBizAppsCommonOrganizationType(ID, options, { providers, userPayload }, pubSub) {
1692
+ const provider = GetReadWriteProvider(providers);
1693
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1694
+ return this.DeleteRecord('MJ.BizApps.Common: Organization Types', key, options, provider, userPayload, pubSub);
1695
+ }
1696
+ };
1697
+ __decorate([
1698
+ Query(() => RunmjBizAppsCommonOrganizationTypeViewResult),
1699
+ __param(0, Arg('input', () => RunViewByIDInput)),
1700
+ __param(1, Ctx()),
1701
+ __param(2, PubSub()),
1702
+ __metadata("design:type", Function),
1703
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
1704
+ __metadata("design:returntype", Promise)
1705
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "RunmjBizAppsCommonOrganizationTypeViewByID", null);
1706
+ __decorate([
1707
+ Query(() => RunmjBizAppsCommonOrganizationTypeViewResult),
1708
+ __param(0, Arg('input', () => RunViewByNameInput)),
1709
+ __param(1, Ctx()),
1710
+ __param(2, PubSub()),
1711
+ __metadata("design:type", Function),
1712
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
1713
+ __metadata("design:returntype", Promise)
1714
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "RunmjBizAppsCommonOrganizationTypeViewByName", null);
1715
+ __decorate([
1716
+ Query(() => RunmjBizAppsCommonOrganizationTypeViewResult),
1717
+ __param(0, Arg('input', () => RunDynamicViewInput)),
1718
+ __param(1, Ctx()),
1719
+ __param(2, PubSub()),
1720
+ __metadata("design:type", Function),
1721
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
1722
+ __metadata("design:returntype", Promise)
1723
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "RunmjBizAppsCommonOrganizationTypeDynamicView", null);
1724
+ __decorate([
1725
+ Query(() => mjBizAppsCommonOrganizationType_, { nullable: true }),
1726
+ __param(0, Arg('ID', () => String)),
1727
+ __param(1, Ctx()),
1728
+ __param(2, PubSub()),
1729
+ __metadata("design:type", Function),
1730
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
1731
+ __metadata("design:returntype", Promise)
1732
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "mjBizAppsCommonOrganizationType", null);
1733
+ __decorate([
1734
+ FieldResolver(() => [mjBizAppsCommonOrganization_]),
1735
+ __param(0, Root()),
1736
+ __param(1, Ctx()),
1737
+ __param(2, PubSub()),
1738
+ __metadata("design:type", Function),
1739
+ __metadata("design:paramtypes", [mjBizAppsCommonOrganizationType_, Object, PubSubEngine]),
1740
+ __metadata("design:returntype", Promise)
1741
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "mjBizAppsCommonOrganizations_OrganizationTypeIDArray", null);
1742
+ __decorate([
1743
+ Mutation(() => mjBizAppsCommonOrganizationType_),
1744
+ __param(0, Arg('input', () => CreatemjBizAppsCommonOrganizationTypeInput)),
1745
+ __param(1, Ctx()),
1746
+ __param(2, PubSub()),
1747
+ __metadata("design:type", Function),
1748
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonOrganizationTypeInput, Object, PubSubEngine]),
1749
+ __metadata("design:returntype", Promise)
1750
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "CreatemjBizAppsCommonOrganizationType", null);
1751
+ __decorate([
1752
+ Mutation(() => mjBizAppsCommonOrganizationType_),
1753
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonOrganizationTypeInput)),
1754
+ __param(1, Ctx()),
1755
+ __param(2, PubSub()),
1756
+ __metadata("design:type", Function),
1757
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonOrganizationTypeInput, Object, PubSubEngine]),
1758
+ __metadata("design:returntype", Promise)
1759
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "UpdatemjBizAppsCommonOrganizationType", null);
1760
+ __decorate([
1761
+ Mutation(() => mjBizAppsCommonOrganizationType_),
1762
+ __param(0, Arg('ID', () => String)),
1763
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
1764
+ __param(2, Ctx()),
1765
+ __param(3, PubSub()),
1766
+ __metadata("design:type", Function),
1767
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
1768
+ __metadata("design:returntype", Promise)
1769
+ ], mjBizAppsCommonOrganizationTypeResolver.prototype, "DeletemjBizAppsCommonOrganizationType", null);
1770
+ mjBizAppsCommonOrganizationTypeResolver = __decorate([
1771
+ Resolver(mjBizAppsCommonOrganizationType_)
1772
+ ], mjBizAppsCommonOrganizationTypeResolver);
1773
+ export { mjBizAppsCommonOrganizationTypeResolver };
1774
+ //****************************************************************************
1775
+ // ENTITY CLASS for MJ.BizApps.Common: Organizations
1776
+ //****************************************************************************
1777
+ let mjBizAppsCommonOrganization_ = class mjBizAppsCommonOrganization_ {
1778
+ };
1779
+ __decorate([
1780
+ Field(),
1781
+ MaxLength(16),
1782
+ __metadata("design:type", String)
1783
+ ], mjBizAppsCommonOrganization_.prototype, "ID", void 0);
1784
+ __decorate([
1785
+ Field({ description: `Common or display name of the organization` }),
1786
+ MaxLength(510),
1787
+ __metadata("design:type", String)
1788
+ ], mjBizAppsCommonOrganization_.prototype, "Name", void 0);
1789
+ __decorate([
1790
+ Field({ nullable: true, description: `Full legal name if different from display name` }),
1791
+ MaxLength(510),
1792
+ __metadata("design:type", String)
1793
+ ], mjBizAppsCommonOrganization_.prototype, "LegalName", void 0);
1794
+ __decorate([
1795
+ Field({ nullable: true }),
1796
+ MaxLength(16),
1797
+ __metadata("design:type", String)
1798
+ ], mjBizAppsCommonOrganization_.prototype, "OrganizationTypeID", void 0);
1799
+ __decorate([
1800
+ Field({ nullable: true }),
1801
+ MaxLength(16),
1802
+ __metadata("design:type", String)
1803
+ ], mjBizAppsCommonOrganization_.prototype, "ParentID", void 0);
1804
+ __decorate([
1805
+ Field({ nullable: true, description: `Primary website URL` }),
1806
+ MaxLength(2000),
1807
+ __metadata("design:type", String)
1808
+ ], mjBizAppsCommonOrganization_.prototype, "Website", void 0);
1809
+ __decorate([
1810
+ Field({ nullable: true, description: `URL to organization logo image` }),
1811
+ MaxLength(2000),
1812
+ __metadata("design:type", String)
1813
+ ], mjBizAppsCommonOrganization_.prototype, "LogoURL", void 0);
1814
+ __decorate([
1815
+ Field({ nullable: true, description: `Description of the organization purpose and scope` }),
1816
+ __metadata("design:type", String)
1817
+ ], mjBizAppsCommonOrganization_.prototype, "Description", void 0);
1818
+ __decorate([
1819
+ Field({ nullable: true, description: `Primary contact email address` }),
1820
+ MaxLength(510),
1821
+ __metadata("design:type", String)
1822
+ ], mjBizAppsCommonOrganization_.prototype, "Email", void 0);
1823
+ __decorate([
1824
+ Field({ nullable: true, description: `Primary phone number` }),
1825
+ MaxLength(100),
1826
+ __metadata("design:type", String)
1827
+ ], mjBizAppsCommonOrganization_.prototype, "Phone", void 0);
1828
+ __decorate([
1829
+ Field({ nullable: true, description: `Date the organization was founded or incorporated` }),
1830
+ MaxLength(3),
1831
+ __metadata("design:type", Date)
1832
+ ], mjBizAppsCommonOrganization_.prototype, "FoundedDate", void 0);
1833
+ __decorate([
1834
+ Field({ nullable: true, description: `Tax identification number such as EIN` }),
1835
+ MaxLength(100),
1836
+ __metadata("design:type", String)
1837
+ ], mjBizAppsCommonOrganization_.prototype, "TaxID", void 0);
1838
+ __decorate([
1839
+ Field({ description: `Current status: Active, Inactive, or Dissolved` }),
1840
+ MaxLength(100),
1841
+ __metadata("design:type", String)
1842
+ ], mjBizAppsCommonOrganization_.prototype, "Status", void 0);
1843
+ __decorate([
1844
+ Field(),
1845
+ MaxLength(10),
1846
+ __metadata("design:type", Date)
1847
+ ], mjBizAppsCommonOrganization_.prototype, "_mj__CreatedAt", void 0);
1848
+ __decorate([
1849
+ Field(),
1850
+ MaxLength(10),
1851
+ __metadata("design:type", Date)
1852
+ ], mjBizAppsCommonOrganization_.prototype, "_mj__UpdatedAt", void 0);
1853
+ __decorate([
1854
+ Field({ nullable: true }),
1855
+ MaxLength(200),
1856
+ __metadata("design:type", String)
1857
+ ], mjBizAppsCommonOrganization_.prototype, "OrganizationType", void 0);
1858
+ __decorate([
1859
+ Field({ nullable: true }),
1860
+ MaxLength(510),
1861
+ __metadata("design:type", String)
1862
+ ], mjBizAppsCommonOrganization_.prototype, "Parent", void 0);
1863
+ __decorate([
1864
+ Field({ nullable: true }),
1865
+ MaxLength(16),
1866
+ __metadata("design:type", String)
1867
+ ], mjBizAppsCommonOrganization_.prototype, "RootParentID", void 0);
1868
+ __decorate([
1869
+ Field({ nullable: true }),
1870
+ MaxLength(510),
1871
+ __metadata("design:type", String)
1872
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressLine1", void 0);
1873
+ __decorate([
1874
+ Field({ nullable: true }),
1875
+ MaxLength(510),
1876
+ __metadata("design:type", String)
1877
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressLine2", void 0);
1878
+ __decorate([
1879
+ Field({ nullable: true }),
1880
+ MaxLength(200),
1881
+ __metadata("design:type", String)
1882
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressCity", void 0);
1883
+ __decorate([
1884
+ Field({ nullable: true }),
1885
+ MaxLength(200),
1886
+ __metadata("design:type", String)
1887
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressState", void 0);
1888
+ __decorate([
1889
+ Field({ nullable: true }),
1890
+ MaxLength(40),
1891
+ __metadata("design:type", String)
1892
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressPostalCode", void 0);
1893
+ __decorate([
1894
+ Field({ nullable: true }),
1895
+ MaxLength(200),
1896
+ __metadata("design:type", String)
1897
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressCountry", void 0);
1898
+ __decorate([
1899
+ Field({ nullable: true }),
1900
+ MaxLength(200),
1901
+ __metadata("design:type", String)
1902
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryAddressType", void 0);
1903
+ __decorate([
1904
+ Field({ nullable: true }),
1905
+ MaxLength(1000),
1906
+ __metadata("design:type", String)
1907
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryEmail", void 0);
1908
+ __decorate([
1909
+ Field({ nullable: true }),
1910
+ MaxLength(1000),
1911
+ __metadata("design:type", String)
1912
+ ], mjBizAppsCommonOrganization_.prototype, "PrimaryPhone", void 0);
1913
+ __decorate([
1914
+ Field(() => Int, { nullable: true }),
1915
+ __metadata("design:type", Number)
1916
+ ], mjBizAppsCommonOrganization_.prototype, "ActivePersonCount", void 0);
1917
+ __decorate([
1918
+ Field(() => Int, { nullable: true }),
1919
+ __metadata("design:type", Number)
1920
+ ], mjBizAppsCommonOrganization_.prototype, "ChildOrgCount", void 0);
1921
+ __decorate([
1922
+ Field(() => [mjBizAppsCommonOrganization_]),
1923
+ __metadata("design:type", Array)
1924
+ ], mjBizAppsCommonOrganization_.prototype, "mjBizAppsCommonOrganizations_ParentIDArray", void 0);
1925
+ __decorate([
1926
+ Field(() => [mjBizAppsCommonRelationship_]),
1927
+ __metadata("design:type", Array)
1928
+ ], mjBizAppsCommonOrganization_.prototype, "mjBizAppsCommonRelationships_ToOrganizationIDArray", void 0);
1929
+ __decorate([
1930
+ Field(() => [mjBizAppsCommonContactMethod_]),
1931
+ __metadata("design:type", Array)
1932
+ ], mjBizAppsCommonOrganization_.prototype, "mjBizAppsCommonContactMethods_OrganizationIDArray", void 0);
1933
+ __decorate([
1934
+ Field(() => [mjBizAppsCommonRelationship_]),
1935
+ __metadata("design:type", Array)
1936
+ ], mjBizAppsCommonOrganization_.prototype, "mjBizAppsCommonRelationships_FromOrganizationIDArray", void 0);
1937
+ mjBizAppsCommonOrganization_ = __decorate([
1938
+ ObjectType({ description: `Companies, associations, government bodies, and other organizations with hierarchy support` })
1939
+ ], mjBizAppsCommonOrganization_);
1940
+ export { mjBizAppsCommonOrganization_ };
1941
+ //****************************************************************************
1942
+ // INPUT TYPE for MJ.BizApps.Common: Organizations
1943
+ //****************************************************************************
1944
+ let CreatemjBizAppsCommonOrganizationInput = class CreatemjBizAppsCommonOrganizationInput {
1945
+ };
1946
+ __decorate([
1947
+ Field({ nullable: true }),
1948
+ __metadata("design:type", String)
1949
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "ID", void 0);
1950
+ __decorate([
1951
+ Field({ nullable: true }),
1952
+ __metadata("design:type", String)
1953
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Name", void 0);
1954
+ __decorate([
1955
+ Field({ nullable: true }),
1956
+ __metadata("design:type", String)
1957
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "LegalName", void 0);
1958
+ __decorate([
1959
+ Field({ nullable: true }),
1960
+ __metadata("design:type", String)
1961
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "OrganizationTypeID", void 0);
1962
+ __decorate([
1963
+ Field({ nullable: true }),
1964
+ __metadata("design:type", String)
1965
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "ParentID", void 0);
1966
+ __decorate([
1967
+ Field({ nullable: true }),
1968
+ __metadata("design:type", String)
1969
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Website", void 0);
1970
+ __decorate([
1971
+ Field({ nullable: true }),
1972
+ __metadata("design:type", String)
1973
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "LogoURL", void 0);
1974
+ __decorate([
1975
+ Field({ nullable: true }),
1976
+ __metadata("design:type", String)
1977
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Description", void 0);
1978
+ __decorate([
1979
+ Field({ nullable: true }),
1980
+ __metadata("design:type", String)
1981
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Email", void 0);
1982
+ __decorate([
1983
+ Field({ nullable: true }),
1984
+ __metadata("design:type", String)
1985
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Phone", void 0);
1986
+ __decorate([
1987
+ Field({ nullable: true }),
1988
+ __metadata("design:type", Date)
1989
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "FoundedDate", void 0);
1990
+ __decorate([
1991
+ Field({ nullable: true }),
1992
+ __metadata("design:type", String)
1993
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "TaxID", void 0);
1994
+ __decorate([
1995
+ Field({ nullable: true }),
1996
+ __metadata("design:type", String)
1997
+ ], CreatemjBizAppsCommonOrganizationInput.prototype, "Status", void 0);
1998
+ CreatemjBizAppsCommonOrganizationInput = __decorate([
1999
+ InputType()
2000
+ ], CreatemjBizAppsCommonOrganizationInput);
2001
+ export { CreatemjBizAppsCommonOrganizationInput };
2002
+ //****************************************************************************
2003
+ // INPUT TYPE for MJ.BizApps.Common: Organizations
2004
+ //****************************************************************************
2005
+ let UpdatemjBizAppsCommonOrganizationInput = class UpdatemjBizAppsCommonOrganizationInput {
2006
+ };
2007
+ __decorate([
2008
+ Field(),
2009
+ __metadata("design:type", String)
2010
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "ID", void 0);
2011
+ __decorate([
2012
+ Field({ nullable: true }),
2013
+ __metadata("design:type", String)
2014
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Name", void 0);
2015
+ __decorate([
2016
+ Field({ nullable: true }),
2017
+ __metadata("design:type", String)
2018
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "LegalName", void 0);
2019
+ __decorate([
2020
+ Field({ nullable: true }),
2021
+ __metadata("design:type", String)
2022
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "OrganizationTypeID", void 0);
2023
+ __decorate([
2024
+ Field({ nullable: true }),
2025
+ __metadata("design:type", String)
2026
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "ParentID", void 0);
2027
+ __decorate([
2028
+ Field({ nullable: true }),
2029
+ __metadata("design:type", String)
2030
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Website", void 0);
2031
+ __decorate([
2032
+ Field({ nullable: true }),
2033
+ __metadata("design:type", String)
2034
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "LogoURL", void 0);
2035
+ __decorate([
2036
+ Field({ nullable: true }),
2037
+ __metadata("design:type", String)
2038
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Description", void 0);
2039
+ __decorate([
2040
+ Field({ nullable: true }),
2041
+ __metadata("design:type", String)
2042
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Email", void 0);
2043
+ __decorate([
2044
+ Field({ nullable: true }),
2045
+ __metadata("design:type", String)
2046
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Phone", void 0);
2047
+ __decorate([
2048
+ Field({ nullable: true }),
2049
+ __metadata("design:type", Date)
2050
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "FoundedDate", void 0);
2051
+ __decorate([
2052
+ Field({ nullable: true }),
2053
+ __metadata("design:type", String)
2054
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "TaxID", void 0);
2055
+ __decorate([
2056
+ Field({ nullable: true }),
2057
+ __metadata("design:type", String)
2058
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "Status", void 0);
2059
+ __decorate([
2060
+ Field(() => [KeyValuePairInput], { nullable: true }),
2061
+ __metadata("design:type", Array)
2062
+ ], UpdatemjBizAppsCommonOrganizationInput.prototype, "OldValues___", void 0);
2063
+ UpdatemjBizAppsCommonOrganizationInput = __decorate([
2064
+ InputType()
2065
+ ], UpdatemjBizAppsCommonOrganizationInput);
2066
+ export { UpdatemjBizAppsCommonOrganizationInput };
2067
+ //****************************************************************************
2068
+ // RESOLVER for MJ.BizApps.Common: Organizations
2069
+ //****************************************************************************
2070
+ let RunmjBizAppsCommonOrganizationViewResult = class RunmjBizAppsCommonOrganizationViewResult {
2071
+ };
2072
+ __decorate([
2073
+ Field(() => [mjBizAppsCommonOrganization_]),
2074
+ __metadata("design:type", Array)
2075
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "Results", void 0);
2076
+ __decorate([
2077
+ Field(() => String, { nullable: true }),
2078
+ __metadata("design:type", String)
2079
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "UserViewRunID", void 0);
2080
+ __decorate([
2081
+ Field(() => Int, { nullable: true }),
2082
+ __metadata("design:type", Number)
2083
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "RowCount", void 0);
2084
+ __decorate([
2085
+ Field(() => Int, { nullable: true }),
2086
+ __metadata("design:type", Number)
2087
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "TotalRowCount", void 0);
2088
+ __decorate([
2089
+ Field(() => Int, { nullable: true }),
2090
+ __metadata("design:type", Number)
2091
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "ExecutionTime", void 0);
2092
+ __decorate([
2093
+ Field({ nullable: true }),
2094
+ __metadata("design:type", String)
2095
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "ErrorMessage", void 0);
2096
+ __decorate([
2097
+ Field(() => Boolean, { nullable: false }),
2098
+ __metadata("design:type", Boolean)
2099
+ ], RunmjBizAppsCommonOrganizationViewResult.prototype, "Success", void 0);
2100
+ RunmjBizAppsCommonOrganizationViewResult = __decorate([
2101
+ ObjectType()
2102
+ ], RunmjBizAppsCommonOrganizationViewResult);
2103
+ export { RunmjBizAppsCommonOrganizationViewResult };
2104
+ let mjBizAppsCommonOrganizationResolver = class mjBizAppsCommonOrganizationResolver extends ResolverBase {
2105
+ async RunmjBizAppsCommonOrganizationViewByID(input, { providers, userPayload }, pubSub) {
2106
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2107
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
2108
+ }
2109
+ async RunmjBizAppsCommonOrganizationViewByName(input, { providers, userPayload }, pubSub) {
2110
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2111
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
2112
+ }
2113
+ async RunmjBizAppsCommonOrganizationDynamicView(input, { providers, userPayload }, pubSub) {
2114
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2115
+ input.EntityName = 'MJ.BizApps.Common: Organizations';
2116
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
2117
+ }
2118
+ async mjBizAppsCommonOrganization(ID, { dataSources, userPayload, providers }, pubSub) {
2119
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
2120
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2121
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2122
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwOrganizationsExtended] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
2123
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2124
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Organizations', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
2125
+ return result;
2126
+ }
2127
+ async mjBizAppsCommonOrganizations_ParentIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2128
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
2129
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2130
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2131
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwOrganizationsExtended] WHERE [ParentID]='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
2132
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2133
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Organizations', rows, this.GetUserFromPayload(userPayload));
2134
+ return result;
2135
+ }
2136
+ async mjBizAppsCommonRelationships_ToOrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2137
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2138
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2139
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2140
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [ToOrganizationID]='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2141
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2142
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2143
+ return result;
2144
+ }
2145
+ async mjBizAppsCommonContactMethods_OrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2146
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
2147
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2148
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2149
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwContactMethods] WHERE [OrganizationID]='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
2150
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2151
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
2152
+ return result;
2153
+ }
2154
+ async mjBizAppsCommonRelationships_FromOrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2155
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2156
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2157
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2158
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [FromOrganizationID]='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2159
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2160
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2161
+ return result;
2162
+ }
2163
+ async CreatemjBizAppsCommonOrganization(input, { providers, userPayload }, pubSub) {
2164
+ const provider = GetReadWriteProvider(providers);
2165
+ return this.CreateRecord('MJ.BizApps.Common: Organizations', input, provider, userPayload, pubSub);
2166
+ }
2167
+ async UpdatemjBizAppsCommonOrganization(input, { providers, userPayload }, pubSub) {
2168
+ const provider = GetReadWriteProvider(providers);
2169
+ return this.UpdateRecord('MJ.BizApps.Common: Organizations', input, provider, userPayload, pubSub);
2170
+ }
2171
+ async DeletemjBizAppsCommonOrganization(ID, options, { providers, userPayload }, pubSub) {
2172
+ const provider = GetReadWriteProvider(providers);
2173
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
2174
+ return this.DeleteRecord('MJ.BizApps.Common: Organizations', key, options, provider, userPayload, pubSub);
2175
+ }
2176
+ };
2177
+ __decorate([
2178
+ Query(() => RunmjBizAppsCommonOrganizationViewResult),
2179
+ __param(0, Arg('input', () => RunViewByIDInput)),
2180
+ __param(1, Ctx()),
2181
+ __param(2, PubSub()),
2182
+ __metadata("design:type", Function),
2183
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
2184
+ __metadata("design:returntype", Promise)
2185
+ ], mjBizAppsCommonOrganizationResolver.prototype, "RunmjBizAppsCommonOrganizationViewByID", null);
2186
+ __decorate([
2187
+ Query(() => RunmjBizAppsCommonOrganizationViewResult),
2188
+ __param(0, Arg('input', () => RunViewByNameInput)),
2189
+ __param(1, Ctx()),
2190
+ __param(2, PubSub()),
2191
+ __metadata("design:type", Function),
2192
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
2193
+ __metadata("design:returntype", Promise)
2194
+ ], mjBizAppsCommonOrganizationResolver.prototype, "RunmjBizAppsCommonOrganizationViewByName", null);
2195
+ __decorate([
2196
+ Query(() => RunmjBizAppsCommonOrganizationViewResult),
2197
+ __param(0, Arg('input', () => RunDynamicViewInput)),
2198
+ __param(1, Ctx()),
2199
+ __param(2, PubSub()),
2200
+ __metadata("design:type", Function),
2201
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
2202
+ __metadata("design:returntype", Promise)
2203
+ ], mjBizAppsCommonOrganizationResolver.prototype, "RunmjBizAppsCommonOrganizationDynamicView", null);
2204
+ __decorate([
2205
+ Query(() => mjBizAppsCommonOrganization_, { nullable: true }),
2206
+ __param(0, Arg('ID', () => String)),
2207
+ __param(1, Ctx()),
2208
+ __param(2, PubSub()),
2209
+ __metadata("design:type", Function),
2210
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
2211
+ __metadata("design:returntype", Promise)
2212
+ ], mjBizAppsCommonOrganizationResolver.prototype, "mjBizAppsCommonOrganization", null);
2213
+ __decorate([
2214
+ FieldResolver(() => [mjBizAppsCommonOrganization_]),
2215
+ __param(0, Root()),
2216
+ __param(1, Ctx()),
2217
+ __param(2, PubSub()),
2218
+ __metadata("design:type", Function),
2219
+ __metadata("design:paramtypes", [mjBizAppsCommonOrganization_, Object, PubSubEngine]),
2220
+ __metadata("design:returntype", Promise)
2221
+ ], mjBizAppsCommonOrganizationResolver.prototype, "mjBizAppsCommonOrganizations_ParentIDArray", null);
2222
+ __decorate([
2223
+ FieldResolver(() => [mjBizAppsCommonRelationship_]),
2224
+ __param(0, Root()),
2225
+ __param(1, Ctx()),
2226
+ __param(2, PubSub()),
2227
+ __metadata("design:type", Function),
2228
+ __metadata("design:paramtypes", [mjBizAppsCommonOrganization_, Object, PubSubEngine]),
2229
+ __metadata("design:returntype", Promise)
2230
+ ], mjBizAppsCommonOrganizationResolver.prototype, "mjBizAppsCommonRelationships_ToOrganizationIDArray", null);
2231
+ __decorate([
2232
+ FieldResolver(() => [mjBizAppsCommonContactMethod_]),
2233
+ __param(0, Root()),
2234
+ __param(1, Ctx()),
2235
+ __param(2, PubSub()),
2236
+ __metadata("design:type", Function),
2237
+ __metadata("design:paramtypes", [mjBizAppsCommonOrganization_, Object, PubSubEngine]),
2238
+ __metadata("design:returntype", Promise)
2239
+ ], mjBizAppsCommonOrganizationResolver.prototype, "mjBizAppsCommonContactMethods_OrganizationIDArray", null);
2240
+ __decorate([
2241
+ FieldResolver(() => [mjBizAppsCommonRelationship_]),
2242
+ __param(0, Root()),
2243
+ __param(1, Ctx()),
2244
+ __param(2, PubSub()),
2245
+ __metadata("design:type", Function),
2246
+ __metadata("design:paramtypes", [mjBizAppsCommonOrganization_, Object, PubSubEngine]),
2247
+ __metadata("design:returntype", Promise)
2248
+ ], mjBizAppsCommonOrganizationResolver.prototype, "mjBizAppsCommonRelationships_FromOrganizationIDArray", null);
2249
+ __decorate([
2250
+ Mutation(() => mjBizAppsCommonOrganization_),
2251
+ __param(0, Arg('input', () => CreatemjBizAppsCommonOrganizationInput)),
2252
+ __param(1, Ctx()),
2253
+ __param(2, PubSub()),
2254
+ __metadata("design:type", Function),
2255
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonOrganizationInput, Object, PubSubEngine]),
2256
+ __metadata("design:returntype", Promise)
2257
+ ], mjBizAppsCommonOrganizationResolver.prototype, "CreatemjBizAppsCommonOrganization", null);
2258
+ __decorate([
2259
+ Mutation(() => mjBizAppsCommonOrganization_),
2260
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonOrganizationInput)),
2261
+ __param(1, Ctx()),
2262
+ __param(2, PubSub()),
2263
+ __metadata("design:type", Function),
2264
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonOrganizationInput, Object, PubSubEngine]),
2265
+ __metadata("design:returntype", Promise)
2266
+ ], mjBizAppsCommonOrganizationResolver.prototype, "UpdatemjBizAppsCommonOrganization", null);
2267
+ __decorate([
2268
+ Mutation(() => mjBizAppsCommonOrganization_),
2269
+ __param(0, Arg('ID', () => String)),
2270
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
2271
+ __param(2, Ctx()),
2272
+ __param(3, PubSub()),
2273
+ __metadata("design:type", Function),
2274
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
2275
+ __metadata("design:returntype", Promise)
2276
+ ], mjBizAppsCommonOrganizationResolver.prototype, "DeletemjBizAppsCommonOrganization", null);
2277
+ mjBizAppsCommonOrganizationResolver = __decorate([
2278
+ Resolver(mjBizAppsCommonOrganization_)
2279
+ ], mjBizAppsCommonOrganizationResolver);
2280
+ export { mjBizAppsCommonOrganizationResolver };
2281
+ //****************************************************************************
2282
+ // ENTITY CLASS for MJ.BizApps.Common: People
2283
+ //****************************************************************************
2284
+ let mjBizAppsCommonPerson_ = class mjBizAppsCommonPerson_ {
2285
+ };
2286
+ __decorate([
2287
+ Field(),
2288
+ MaxLength(16),
2289
+ __metadata("design:type", String)
2290
+ ], mjBizAppsCommonPerson_.prototype, "ID", void 0);
2291
+ __decorate([
2292
+ Field({ description: `First (given) name` }),
2293
+ MaxLength(200),
2294
+ __metadata("design:type", String)
2295
+ ], mjBizAppsCommonPerson_.prototype, "FirstName", void 0);
2296
+ __decorate([
2297
+ Field({ description: `Last (family) name` }),
2298
+ MaxLength(200),
2299
+ __metadata("design:type", String)
2300
+ ], mjBizAppsCommonPerson_.prototype, "LastName", void 0);
2301
+ __decorate([
2302
+ Field({ nullable: true, description: `Middle name or initial` }),
2303
+ MaxLength(200),
2304
+ __metadata("design:type", String)
2305
+ ], mjBizAppsCommonPerson_.prototype, "MiddleName", void 0);
2306
+ __decorate([
2307
+ Field({ nullable: true, description: `Name prefix such as Dr., Mr., Ms., Rev.` }),
2308
+ MaxLength(40),
2309
+ __metadata("design:type", String)
2310
+ ], mjBizAppsCommonPerson_.prototype, "Prefix", void 0);
2311
+ __decorate([
2312
+ Field({ nullable: true, description: `Name suffix such as Jr., III, PhD, Esq.` }),
2313
+ MaxLength(40),
2314
+ __metadata("design:type", String)
2315
+ ], mjBizAppsCommonPerson_.prototype, "Suffix", void 0);
2316
+ __decorate([
2317
+ Field({ nullable: true, description: `Nickname or preferred name the person goes by` }),
2318
+ MaxLength(200),
2319
+ __metadata("design:type", String)
2320
+ ], mjBizAppsCommonPerson_.prototype, "PreferredName", void 0);
2321
+ __decorate([
2322
+ Field({ nullable: true, description: `Professional or job title, e.g. VP of Engineering, Board Director` }),
2323
+ MaxLength(400),
2324
+ __metadata("design:type", String)
2325
+ ], mjBizAppsCommonPerson_.prototype, "Title", void 0);
2326
+ __decorate([
2327
+ Field({ nullable: true, description: `Primary email address for this person` }),
2328
+ MaxLength(510),
2329
+ __metadata("design:type", String)
2330
+ ], mjBizAppsCommonPerson_.prototype, "Email", void 0);
2331
+ __decorate([
2332
+ Field({ nullable: true, description: `Primary phone number for this person` }),
2333
+ MaxLength(100),
2334
+ __metadata("design:type", String)
2335
+ ], mjBizAppsCommonPerson_.prototype, "Phone", void 0);
2336
+ __decorate([
2337
+ Field({ nullable: true, description: `Date of birth` }),
2338
+ MaxLength(3),
2339
+ __metadata("design:type", Date)
2340
+ ], mjBizAppsCommonPerson_.prototype, "DateOfBirth", void 0);
2341
+ __decorate([
2342
+ Field({ nullable: true, description: `Gender identity` }),
2343
+ MaxLength(100),
2344
+ __metadata("design:type", String)
2345
+ ], mjBizAppsCommonPerson_.prototype, "Gender", void 0);
2346
+ __decorate([
2347
+ Field({ nullable: true, description: `URL to profile photo or avatar image` }),
2348
+ MaxLength(2000),
2349
+ __metadata("design:type", String)
2350
+ ], mjBizAppsCommonPerson_.prototype, "PhotoURL", void 0);
2351
+ __decorate([
2352
+ Field({ nullable: true, description: `Biographical text or notes about this person` }),
2353
+ __metadata("design:type", String)
2354
+ ], mjBizAppsCommonPerson_.prototype, "Bio", void 0);
2355
+ __decorate([
2356
+ Field({ nullable: true }),
2357
+ MaxLength(16),
2358
+ __metadata("design:type", String)
2359
+ ], mjBizAppsCommonPerson_.prototype, "LinkedUserID", void 0);
2360
+ __decorate([
2361
+ Field({ description: `Current status: Active, Inactive, or Deceased` }),
2362
+ MaxLength(100),
2363
+ __metadata("design:type", String)
2364
+ ], mjBizAppsCommonPerson_.prototype, "Status", void 0);
2365
+ __decorate([
2366
+ Field(),
2367
+ MaxLength(10),
2368
+ __metadata("design:type", Date)
2369
+ ], mjBizAppsCommonPerson_.prototype, "_mj__CreatedAt", void 0);
2370
+ __decorate([
2371
+ Field(),
2372
+ MaxLength(10),
2373
+ __metadata("design:type", Date)
2374
+ ], mjBizAppsCommonPerson_.prototype, "_mj__UpdatedAt", void 0);
2375
+ __decorate([
2376
+ Field({ nullable: true }),
2377
+ MaxLength(200),
2378
+ __metadata("design:type", String)
2379
+ ], mjBizAppsCommonPerson_.prototype, "LinkedUser", void 0);
2380
+ __decorate([
2381
+ Field({ nullable: true }),
2382
+ MaxLength(488),
2383
+ __metadata("design:type", String)
2384
+ ], mjBizAppsCommonPerson_.prototype, "DisplayName", void 0);
2385
+ __decorate([
2386
+ Field({ nullable: true }),
2387
+ MaxLength(510),
2388
+ __metadata("design:type", String)
2389
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressLine1", void 0);
2390
+ __decorate([
2391
+ Field({ nullable: true }),
2392
+ MaxLength(510),
2393
+ __metadata("design:type", String)
2394
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressLine2", void 0);
2395
+ __decorate([
2396
+ Field({ nullable: true }),
2397
+ MaxLength(200),
2398
+ __metadata("design:type", String)
2399
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressCity", void 0);
2400
+ __decorate([
2401
+ Field({ nullable: true }),
2402
+ MaxLength(200),
2403
+ __metadata("design:type", String)
2404
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressState", void 0);
2405
+ __decorate([
2406
+ Field({ nullable: true }),
2407
+ MaxLength(40),
2408
+ __metadata("design:type", String)
2409
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressPostalCode", void 0);
2410
+ __decorate([
2411
+ Field({ nullable: true }),
2412
+ MaxLength(200),
2413
+ __metadata("design:type", String)
2414
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressCountry", void 0);
2415
+ __decorate([
2416
+ Field(() => Float, { nullable: true }),
2417
+ __metadata("design:type", Number)
2418
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressLatitude", void 0);
2419
+ __decorate([
2420
+ Field(() => Float, { nullable: true }),
2421
+ __metadata("design:type", Number)
2422
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressLongitude", void 0);
2423
+ __decorate([
2424
+ Field({ nullable: true }),
2425
+ MaxLength(200),
2426
+ __metadata("design:type", String)
2427
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryAddressType", void 0);
2428
+ __decorate([
2429
+ Field({ nullable: true }),
2430
+ MaxLength(1000),
2431
+ __metadata("design:type", String)
2432
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryEmail", void 0);
2433
+ __decorate([
2434
+ Field({ nullable: true }),
2435
+ MaxLength(1000),
2436
+ __metadata("design:type", String)
2437
+ ], mjBizAppsCommonPerson_.prototype, "PrimaryPhone", void 0);
2438
+ __decorate([
2439
+ Field({ nullable: true }),
2440
+ MaxLength(16),
2441
+ __metadata("design:type", String)
2442
+ ], mjBizAppsCommonPerson_.prototype, "CurrentOrganizationID", void 0);
2443
+ __decorate([
2444
+ Field({ nullable: true }),
2445
+ MaxLength(510),
2446
+ __metadata("design:type", String)
2447
+ ], mjBizAppsCommonPerson_.prototype, "CurrentOrganizationName", void 0);
2448
+ __decorate([
2449
+ Field({ nullable: true }),
2450
+ MaxLength(510),
2451
+ __metadata("design:type", String)
2452
+ ], mjBizAppsCommonPerson_.prototype, "CurrentJobTitle", void 0);
2453
+ __decorate([
2454
+ Field(() => [mjBizAppsCommonContactMethod_]),
2455
+ __metadata("design:type", Array)
2456
+ ], mjBizAppsCommonPerson_.prototype, "mjBizAppsCommonContactMethods_PersonIDArray", void 0);
2457
+ __decorate([
2458
+ Field(() => [mjBizAppsCommonRelationship_]),
2459
+ __metadata("design:type", Array)
2460
+ ], mjBizAppsCommonPerson_.prototype, "mjBizAppsCommonRelationships_ToPersonIDArray", void 0);
2461
+ __decorate([
2462
+ Field(() => [mjBizAppsCommonRelationship_]),
2463
+ __metadata("design:type", Array)
2464
+ ], mjBizAppsCommonPerson_.prototype, "mjBizAppsCommonRelationships_FromPersonIDArray", void 0);
2465
+ mjBizAppsCommonPerson_ = __decorate([
2466
+ ObjectType({ description: `Individual people, optionally linked to MJ system user accounts` })
2467
+ ], mjBizAppsCommonPerson_);
2468
+ export { mjBizAppsCommonPerson_ };
2469
+ //****************************************************************************
2470
+ // INPUT TYPE for MJ.BizApps.Common: People
2471
+ //****************************************************************************
2472
+ let CreatemjBizAppsCommonPersonInput = class CreatemjBizAppsCommonPersonInput {
2473
+ };
2474
+ __decorate([
2475
+ Field({ nullable: true }),
2476
+ __metadata("design:type", String)
2477
+ ], CreatemjBizAppsCommonPersonInput.prototype, "ID", void 0);
2478
+ __decorate([
2479
+ Field({ nullable: true }),
2480
+ __metadata("design:type", String)
2481
+ ], CreatemjBizAppsCommonPersonInput.prototype, "FirstName", void 0);
2482
+ __decorate([
2483
+ Field({ nullable: true }),
2484
+ __metadata("design:type", String)
2485
+ ], CreatemjBizAppsCommonPersonInput.prototype, "LastName", void 0);
2486
+ __decorate([
2487
+ Field({ nullable: true }),
2488
+ __metadata("design:type", String)
2489
+ ], CreatemjBizAppsCommonPersonInput.prototype, "MiddleName", void 0);
2490
+ __decorate([
2491
+ Field({ nullable: true }),
2492
+ __metadata("design:type", String)
2493
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Prefix", void 0);
2494
+ __decorate([
2495
+ Field({ nullable: true }),
2496
+ __metadata("design:type", String)
2497
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Suffix", void 0);
2498
+ __decorate([
2499
+ Field({ nullable: true }),
2500
+ __metadata("design:type", String)
2501
+ ], CreatemjBizAppsCommonPersonInput.prototype, "PreferredName", void 0);
2502
+ __decorate([
2503
+ Field({ nullable: true }),
2504
+ __metadata("design:type", String)
2505
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Title", void 0);
2506
+ __decorate([
2507
+ Field({ nullable: true }),
2508
+ __metadata("design:type", String)
2509
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Email", void 0);
2510
+ __decorate([
2511
+ Field({ nullable: true }),
2512
+ __metadata("design:type", String)
2513
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Phone", void 0);
2514
+ __decorate([
2515
+ Field({ nullable: true }),
2516
+ __metadata("design:type", Date)
2517
+ ], CreatemjBizAppsCommonPersonInput.prototype, "DateOfBirth", void 0);
2518
+ __decorate([
2519
+ Field({ nullable: true }),
2520
+ __metadata("design:type", String)
2521
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Gender", void 0);
2522
+ __decorate([
2523
+ Field({ nullable: true }),
2524
+ __metadata("design:type", String)
2525
+ ], CreatemjBizAppsCommonPersonInput.prototype, "PhotoURL", void 0);
2526
+ __decorate([
2527
+ Field({ nullable: true }),
2528
+ __metadata("design:type", String)
2529
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Bio", void 0);
2530
+ __decorate([
2531
+ Field({ nullable: true }),
2532
+ __metadata("design:type", String)
2533
+ ], CreatemjBizAppsCommonPersonInput.prototype, "LinkedUserID", void 0);
2534
+ __decorate([
2535
+ Field({ nullable: true }),
2536
+ __metadata("design:type", String)
2537
+ ], CreatemjBizAppsCommonPersonInput.prototype, "Status", void 0);
2538
+ CreatemjBizAppsCommonPersonInput = __decorate([
2539
+ InputType()
2540
+ ], CreatemjBizAppsCommonPersonInput);
2541
+ export { CreatemjBizAppsCommonPersonInput };
2542
+ //****************************************************************************
2543
+ // INPUT TYPE for MJ.BizApps.Common: People
2544
+ //****************************************************************************
2545
+ let UpdatemjBizAppsCommonPersonInput = class UpdatemjBizAppsCommonPersonInput {
2546
+ };
2547
+ __decorate([
2548
+ Field(),
2549
+ __metadata("design:type", String)
2550
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "ID", void 0);
2551
+ __decorate([
2552
+ Field({ nullable: true }),
2553
+ __metadata("design:type", String)
2554
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "FirstName", void 0);
2555
+ __decorate([
2556
+ Field({ nullable: true }),
2557
+ __metadata("design:type", String)
2558
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "LastName", void 0);
2559
+ __decorate([
2560
+ Field({ nullable: true }),
2561
+ __metadata("design:type", String)
2562
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "MiddleName", void 0);
2563
+ __decorate([
2564
+ Field({ nullable: true }),
2565
+ __metadata("design:type", String)
2566
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Prefix", void 0);
2567
+ __decorate([
2568
+ Field({ nullable: true }),
2569
+ __metadata("design:type", String)
2570
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Suffix", void 0);
2571
+ __decorate([
2572
+ Field({ nullable: true }),
2573
+ __metadata("design:type", String)
2574
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "PreferredName", void 0);
2575
+ __decorate([
2576
+ Field({ nullable: true }),
2577
+ __metadata("design:type", String)
2578
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Title", void 0);
2579
+ __decorate([
2580
+ Field({ nullable: true }),
2581
+ __metadata("design:type", String)
2582
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Email", void 0);
2583
+ __decorate([
2584
+ Field({ nullable: true }),
2585
+ __metadata("design:type", String)
2586
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Phone", void 0);
2587
+ __decorate([
2588
+ Field({ nullable: true }),
2589
+ __metadata("design:type", Date)
2590
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "DateOfBirth", void 0);
2591
+ __decorate([
2592
+ Field({ nullable: true }),
2593
+ __metadata("design:type", String)
2594
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Gender", void 0);
2595
+ __decorate([
2596
+ Field({ nullable: true }),
2597
+ __metadata("design:type", String)
2598
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "PhotoURL", void 0);
2599
+ __decorate([
2600
+ Field({ nullable: true }),
2601
+ __metadata("design:type", String)
2602
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Bio", void 0);
2603
+ __decorate([
2604
+ Field({ nullable: true }),
2605
+ __metadata("design:type", String)
2606
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "LinkedUserID", void 0);
2607
+ __decorate([
2608
+ Field({ nullable: true }),
2609
+ __metadata("design:type", String)
2610
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "Status", void 0);
2611
+ __decorate([
2612
+ Field(() => [KeyValuePairInput], { nullable: true }),
2613
+ __metadata("design:type", Array)
2614
+ ], UpdatemjBizAppsCommonPersonInput.prototype, "OldValues___", void 0);
2615
+ UpdatemjBizAppsCommonPersonInput = __decorate([
2616
+ InputType()
2617
+ ], UpdatemjBizAppsCommonPersonInput);
2618
+ export { UpdatemjBizAppsCommonPersonInput };
2619
+ //****************************************************************************
2620
+ // RESOLVER for MJ.BizApps.Common: People
2621
+ //****************************************************************************
2622
+ let RunmjBizAppsCommonPersonViewResult = class RunmjBizAppsCommonPersonViewResult {
2623
+ };
2624
+ __decorate([
2625
+ Field(() => [mjBizAppsCommonPerson_]),
2626
+ __metadata("design:type", Array)
2627
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "Results", void 0);
2628
+ __decorate([
2629
+ Field(() => String, { nullable: true }),
2630
+ __metadata("design:type", String)
2631
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "UserViewRunID", void 0);
2632
+ __decorate([
2633
+ Field(() => Int, { nullable: true }),
2634
+ __metadata("design:type", Number)
2635
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "RowCount", void 0);
2636
+ __decorate([
2637
+ Field(() => Int, { nullable: true }),
2638
+ __metadata("design:type", Number)
2639
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "TotalRowCount", void 0);
2640
+ __decorate([
2641
+ Field(() => Int, { nullable: true }),
2642
+ __metadata("design:type", Number)
2643
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "ExecutionTime", void 0);
2644
+ __decorate([
2645
+ Field({ nullable: true }),
2646
+ __metadata("design:type", String)
2647
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "ErrorMessage", void 0);
2648
+ __decorate([
2649
+ Field(() => Boolean, { nullable: false }),
2650
+ __metadata("design:type", Boolean)
2651
+ ], RunmjBizAppsCommonPersonViewResult.prototype, "Success", void 0);
2652
+ RunmjBizAppsCommonPersonViewResult = __decorate([
2653
+ ObjectType()
2654
+ ], RunmjBizAppsCommonPersonViewResult);
2655
+ export { RunmjBizAppsCommonPersonViewResult };
2656
+ let mjBizAppsCommonPersonResolver = class mjBizAppsCommonPersonResolver extends ResolverBase {
2657
+ async RunmjBizAppsCommonPersonViewByID(input, { providers, userPayload }, pubSub) {
2658
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2659
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
2660
+ }
2661
+ async RunmjBizAppsCommonPersonViewByName(input, { providers, userPayload }, pubSub) {
2662
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2663
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
2664
+ }
2665
+ async RunmjBizAppsCommonPersonDynamicView(input, { providers, userPayload }, pubSub) {
2666
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2667
+ input.EntityName = 'MJ.BizApps.Common: People';
2668
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
2669
+ }
2670
+ async mjBizAppsCommonPerson(ID, { dataSources, userPayload, providers }, pubSub) {
2671
+ this.CheckUserReadPermissions('MJ.BizApps.Common: People', userPayload);
2672
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2673
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2674
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwPeopleExtended] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: People', userPayload, EntityPermissionType.Read, 'AND');
2675
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2676
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: People', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
2677
+ return result;
2678
+ }
2679
+ async mjBizAppsCommonContactMethods_PersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2680
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
2681
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2682
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2683
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwContactMethods] WHERE [PersonID]='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
2684
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2685
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
2686
+ return result;
2687
+ }
2688
+ async mjBizAppsCommonRelationships_ToPersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2689
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2690
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2691
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2692
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [ToPersonID]='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2693
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2694
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2695
+ return result;
2696
+ }
2697
+ async mjBizAppsCommonRelationships_FromPersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2698
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2699
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2700
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2701
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [FromPersonID]='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2702
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2703
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2704
+ return result;
2705
+ }
2706
+ async CreatemjBizAppsCommonPerson(input, { providers, userPayload }, pubSub) {
2707
+ const provider = GetReadWriteProvider(providers);
2708
+ return this.CreateRecord('MJ.BizApps.Common: People', input, provider, userPayload, pubSub);
2709
+ }
2710
+ async UpdatemjBizAppsCommonPerson(input, { providers, userPayload }, pubSub) {
2711
+ const provider = GetReadWriteProvider(providers);
2712
+ return this.UpdateRecord('MJ.BizApps.Common: People', input, provider, userPayload, pubSub);
2713
+ }
2714
+ async DeletemjBizAppsCommonPerson(ID, options, { providers, userPayload }, pubSub) {
2715
+ const provider = GetReadWriteProvider(providers);
2716
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
2717
+ return this.DeleteRecord('MJ.BizApps.Common: People', key, options, provider, userPayload, pubSub);
2718
+ }
2719
+ };
2720
+ __decorate([
2721
+ Query(() => RunmjBizAppsCommonPersonViewResult),
2722
+ __param(0, Arg('input', () => RunViewByIDInput)),
2723
+ __param(1, Ctx()),
2724
+ __param(2, PubSub()),
2725
+ __metadata("design:type", Function),
2726
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
2727
+ __metadata("design:returntype", Promise)
2728
+ ], mjBizAppsCommonPersonResolver.prototype, "RunmjBizAppsCommonPersonViewByID", null);
2729
+ __decorate([
2730
+ Query(() => RunmjBizAppsCommonPersonViewResult),
2731
+ __param(0, Arg('input', () => RunViewByNameInput)),
2732
+ __param(1, Ctx()),
2733
+ __param(2, PubSub()),
2734
+ __metadata("design:type", Function),
2735
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
2736
+ __metadata("design:returntype", Promise)
2737
+ ], mjBizAppsCommonPersonResolver.prototype, "RunmjBizAppsCommonPersonViewByName", null);
2738
+ __decorate([
2739
+ Query(() => RunmjBizAppsCommonPersonViewResult),
2740
+ __param(0, Arg('input', () => RunDynamicViewInput)),
2741
+ __param(1, Ctx()),
2742
+ __param(2, PubSub()),
2743
+ __metadata("design:type", Function),
2744
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
2745
+ __metadata("design:returntype", Promise)
2746
+ ], mjBizAppsCommonPersonResolver.prototype, "RunmjBizAppsCommonPersonDynamicView", null);
2747
+ __decorate([
2748
+ Query(() => mjBizAppsCommonPerson_, { nullable: true }),
2749
+ __param(0, Arg('ID', () => String)),
2750
+ __param(1, Ctx()),
2751
+ __param(2, PubSub()),
2752
+ __metadata("design:type", Function),
2753
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
2754
+ __metadata("design:returntype", Promise)
2755
+ ], mjBizAppsCommonPersonResolver.prototype, "mjBizAppsCommonPerson", null);
2756
+ __decorate([
2757
+ FieldResolver(() => [mjBizAppsCommonContactMethod_]),
2758
+ __param(0, Root()),
2759
+ __param(1, Ctx()),
2760
+ __param(2, PubSub()),
2761
+ __metadata("design:type", Function),
2762
+ __metadata("design:paramtypes", [mjBizAppsCommonPerson_, Object, PubSubEngine]),
2763
+ __metadata("design:returntype", Promise)
2764
+ ], mjBizAppsCommonPersonResolver.prototype, "mjBizAppsCommonContactMethods_PersonIDArray", null);
2765
+ __decorate([
2766
+ FieldResolver(() => [mjBizAppsCommonRelationship_]),
2767
+ __param(0, Root()),
2768
+ __param(1, Ctx()),
2769
+ __param(2, PubSub()),
2770
+ __metadata("design:type", Function),
2771
+ __metadata("design:paramtypes", [mjBizAppsCommonPerson_, Object, PubSubEngine]),
2772
+ __metadata("design:returntype", Promise)
2773
+ ], mjBizAppsCommonPersonResolver.prototype, "mjBizAppsCommonRelationships_ToPersonIDArray", null);
2774
+ __decorate([
2775
+ FieldResolver(() => [mjBizAppsCommonRelationship_]),
2776
+ __param(0, Root()),
2777
+ __param(1, Ctx()),
2778
+ __param(2, PubSub()),
2779
+ __metadata("design:type", Function),
2780
+ __metadata("design:paramtypes", [mjBizAppsCommonPerson_, Object, PubSubEngine]),
2781
+ __metadata("design:returntype", Promise)
2782
+ ], mjBizAppsCommonPersonResolver.prototype, "mjBizAppsCommonRelationships_FromPersonIDArray", null);
2783
+ __decorate([
2784
+ Mutation(() => mjBizAppsCommonPerson_),
2785
+ __param(0, Arg('input', () => CreatemjBizAppsCommonPersonInput)),
2786
+ __param(1, Ctx()),
2787
+ __param(2, PubSub()),
2788
+ __metadata("design:type", Function),
2789
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonPersonInput, Object, PubSubEngine]),
2790
+ __metadata("design:returntype", Promise)
2791
+ ], mjBizAppsCommonPersonResolver.prototype, "CreatemjBizAppsCommonPerson", null);
2792
+ __decorate([
2793
+ Mutation(() => mjBizAppsCommonPerson_),
2794
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonPersonInput)),
2795
+ __param(1, Ctx()),
2796
+ __param(2, PubSub()),
2797
+ __metadata("design:type", Function),
2798
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonPersonInput, Object, PubSubEngine]),
2799
+ __metadata("design:returntype", Promise)
2800
+ ], mjBizAppsCommonPersonResolver.prototype, "UpdatemjBizAppsCommonPerson", null);
2801
+ __decorate([
2802
+ Mutation(() => mjBizAppsCommonPerson_),
2803
+ __param(0, Arg('ID', () => String)),
2804
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
2805
+ __param(2, Ctx()),
2806
+ __param(3, PubSub()),
2807
+ __metadata("design:type", Function),
2808
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
2809
+ __metadata("design:returntype", Promise)
2810
+ ], mjBizAppsCommonPersonResolver.prototype, "DeletemjBizAppsCommonPerson", null);
2811
+ mjBizAppsCommonPersonResolver = __decorate([
2812
+ Resolver(mjBizAppsCommonPerson_)
2813
+ ], mjBizAppsCommonPersonResolver);
2814
+ export { mjBizAppsCommonPersonResolver };
2815
+ //****************************************************************************
2816
+ // ENTITY CLASS for MJ.BizApps.Common: Relationship Types
2817
+ //****************************************************************************
2818
+ let mjBizAppsCommonRelationshipType_ = class mjBizAppsCommonRelationshipType_ {
2819
+ };
2820
+ __decorate([
2821
+ Field(),
2822
+ MaxLength(16),
2823
+ __metadata("design:type", String)
2824
+ ], mjBizAppsCommonRelationshipType_.prototype, "ID", void 0);
2825
+ __decorate([
2826
+ Field({ description: `Display name for the relationship type, e.g. Employee, Spouse, Partner` }),
2827
+ MaxLength(200),
2828
+ __metadata("design:type", String)
2829
+ ], mjBizAppsCommonRelationshipType_.prototype, "Name", void 0);
2830
+ __decorate([
2831
+ Field({ nullable: true, description: `Detailed description of this relationship type` }),
2832
+ __metadata("design:type", String)
2833
+ ], mjBizAppsCommonRelationshipType_.prototype, "Description", void 0);
2834
+ __decorate([
2835
+ Field({ description: `Which entity types this relationship connects: PersonToPerson, PersonToOrganization, or OrganizationToOrganization` }),
2836
+ MaxLength(100),
2837
+ __metadata("design:type", String)
2838
+ ], mjBizAppsCommonRelationshipType_.prototype, "Category", void 0);
2839
+ __decorate([
2840
+ Field(() => Boolean, { description: `Whether the relationship has a direction. False for symmetric relationships like Spouse or Partner` }),
2841
+ __metadata("design:type", Boolean)
2842
+ ], mjBizAppsCommonRelationshipType_.prototype, "IsDirectional", void 0);
2843
+ __decorate([
2844
+ Field({ nullable: true, description: `Label describing the From-to-To direction, e.g. is employee of, is parent of` }),
2845
+ MaxLength(200),
2846
+ __metadata("design:type", String)
2847
+ ], mjBizAppsCommonRelationshipType_.prototype, "ForwardLabel", void 0);
2848
+ __decorate([
2849
+ Field({ nullable: true, description: `Label describing the To-to-From direction, e.g. employs, is child of` }),
2850
+ MaxLength(200),
2851
+ __metadata("design:type", String)
2852
+ ], mjBizAppsCommonRelationshipType_.prototype, "ReverseLabel", void 0);
2853
+ __decorate([
2854
+ Field(() => Boolean, { description: `Whether this type is available for selection in the UI. Inactive types are hidden from dropdowns but preserved for existing records` }),
2855
+ __metadata("design:type", Boolean)
2856
+ ], mjBizAppsCommonRelationshipType_.prototype, "IsActive", void 0);
2857
+ __decorate([
2858
+ Field(),
2859
+ MaxLength(10),
2860
+ __metadata("design:type", Date)
2861
+ ], mjBizAppsCommonRelationshipType_.prototype, "_mj__CreatedAt", void 0);
2862
+ __decorate([
2863
+ Field(),
2864
+ MaxLength(10),
2865
+ __metadata("design:type", Date)
2866
+ ], mjBizAppsCommonRelationshipType_.prototype, "_mj__UpdatedAt", void 0);
2867
+ __decorate([
2868
+ Field(() => [mjBizAppsCommonRelationship_]),
2869
+ __metadata("design:type", Array)
2870
+ ], mjBizAppsCommonRelationshipType_.prototype, "mjBizAppsCommonRelationships_RelationshipTypeIDArray", void 0);
2871
+ mjBizAppsCommonRelationshipType_ = __decorate([
2872
+ ObjectType({ description: `Defines types of relationships between people and organizations with directionality and labeling` })
2873
+ ], mjBizAppsCommonRelationshipType_);
2874
+ export { mjBizAppsCommonRelationshipType_ };
2875
+ //****************************************************************************
2876
+ // INPUT TYPE for MJ.BizApps.Common: Relationship Types
2877
+ //****************************************************************************
2878
+ let CreatemjBizAppsCommonRelationshipTypeInput = class CreatemjBizAppsCommonRelationshipTypeInput {
2879
+ };
2880
+ __decorate([
2881
+ Field({ nullable: true }),
2882
+ __metadata("design:type", String)
2883
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "ID", void 0);
2884
+ __decorate([
2885
+ Field({ nullable: true }),
2886
+ __metadata("design:type", String)
2887
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "Name", void 0);
2888
+ __decorate([
2889
+ Field({ nullable: true }),
2890
+ __metadata("design:type", String)
2891
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "Description", void 0);
2892
+ __decorate([
2893
+ Field({ nullable: true }),
2894
+ __metadata("design:type", String)
2895
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "Category", void 0);
2896
+ __decorate([
2897
+ Field(() => Boolean, { nullable: true }),
2898
+ __metadata("design:type", Boolean)
2899
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "IsDirectional", void 0);
2900
+ __decorate([
2901
+ Field({ nullable: true }),
2902
+ __metadata("design:type", String)
2903
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "ForwardLabel", void 0);
2904
+ __decorate([
2905
+ Field({ nullable: true }),
2906
+ __metadata("design:type", String)
2907
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "ReverseLabel", void 0);
2908
+ __decorate([
2909
+ Field(() => Boolean, { nullable: true }),
2910
+ __metadata("design:type", Boolean)
2911
+ ], CreatemjBizAppsCommonRelationshipTypeInput.prototype, "IsActive", void 0);
2912
+ CreatemjBizAppsCommonRelationshipTypeInput = __decorate([
2913
+ InputType()
2914
+ ], CreatemjBizAppsCommonRelationshipTypeInput);
2915
+ export { CreatemjBizAppsCommonRelationshipTypeInput };
2916
+ //****************************************************************************
2917
+ // INPUT TYPE for MJ.BizApps.Common: Relationship Types
2918
+ //****************************************************************************
2919
+ let UpdatemjBizAppsCommonRelationshipTypeInput = class UpdatemjBizAppsCommonRelationshipTypeInput {
2920
+ };
2921
+ __decorate([
2922
+ Field(),
2923
+ __metadata("design:type", String)
2924
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "ID", void 0);
2925
+ __decorate([
2926
+ Field({ nullable: true }),
2927
+ __metadata("design:type", String)
2928
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "Name", void 0);
2929
+ __decorate([
2930
+ Field({ nullable: true }),
2931
+ __metadata("design:type", String)
2932
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "Description", void 0);
2933
+ __decorate([
2934
+ Field({ nullable: true }),
2935
+ __metadata("design:type", String)
2936
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "Category", void 0);
2937
+ __decorate([
2938
+ Field(() => Boolean, { nullable: true }),
2939
+ __metadata("design:type", Boolean)
2940
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "IsDirectional", void 0);
2941
+ __decorate([
2942
+ Field({ nullable: true }),
2943
+ __metadata("design:type", String)
2944
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "ForwardLabel", void 0);
2945
+ __decorate([
2946
+ Field({ nullable: true }),
2947
+ __metadata("design:type", String)
2948
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "ReverseLabel", void 0);
2949
+ __decorate([
2950
+ Field(() => Boolean, { nullable: true }),
2951
+ __metadata("design:type", Boolean)
2952
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "IsActive", void 0);
2953
+ __decorate([
2954
+ Field(() => [KeyValuePairInput], { nullable: true }),
2955
+ __metadata("design:type", Array)
2956
+ ], UpdatemjBizAppsCommonRelationshipTypeInput.prototype, "OldValues___", void 0);
2957
+ UpdatemjBizAppsCommonRelationshipTypeInput = __decorate([
2958
+ InputType()
2959
+ ], UpdatemjBizAppsCommonRelationshipTypeInput);
2960
+ export { UpdatemjBizAppsCommonRelationshipTypeInput };
2961
+ //****************************************************************************
2962
+ // RESOLVER for MJ.BizApps.Common: Relationship Types
2963
+ //****************************************************************************
2964
+ let RunmjBizAppsCommonRelationshipTypeViewResult = class RunmjBizAppsCommonRelationshipTypeViewResult {
2965
+ };
2966
+ __decorate([
2967
+ Field(() => [mjBizAppsCommonRelationshipType_]),
2968
+ __metadata("design:type", Array)
2969
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "Results", void 0);
2970
+ __decorate([
2971
+ Field(() => String, { nullable: true }),
2972
+ __metadata("design:type", String)
2973
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "UserViewRunID", void 0);
2974
+ __decorate([
2975
+ Field(() => Int, { nullable: true }),
2976
+ __metadata("design:type", Number)
2977
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "RowCount", void 0);
2978
+ __decorate([
2979
+ Field(() => Int, { nullable: true }),
2980
+ __metadata("design:type", Number)
2981
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "TotalRowCount", void 0);
2982
+ __decorate([
2983
+ Field(() => Int, { nullable: true }),
2984
+ __metadata("design:type", Number)
2985
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "ExecutionTime", void 0);
2986
+ __decorate([
2987
+ Field({ nullable: true }),
2988
+ __metadata("design:type", String)
2989
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "ErrorMessage", void 0);
2990
+ __decorate([
2991
+ Field(() => Boolean, { nullable: false }),
2992
+ __metadata("design:type", Boolean)
2993
+ ], RunmjBizAppsCommonRelationshipTypeViewResult.prototype, "Success", void 0);
2994
+ RunmjBizAppsCommonRelationshipTypeViewResult = __decorate([
2995
+ ObjectType()
2996
+ ], RunmjBizAppsCommonRelationshipTypeViewResult);
2997
+ export { RunmjBizAppsCommonRelationshipTypeViewResult };
2998
+ let mjBizAppsCommonRelationshipTypeResolver = class mjBizAppsCommonRelationshipTypeResolver extends ResolverBase {
2999
+ async RunmjBizAppsCommonRelationshipTypeViewByID(input, { providers, userPayload }, pubSub) {
3000
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3001
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
3002
+ }
3003
+ async RunmjBizAppsCommonRelationshipTypeViewByName(input, { providers, userPayload }, pubSub) {
3004
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3005
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
3006
+ }
3007
+ async RunmjBizAppsCommonRelationshipTypeDynamicView(input, { providers, userPayload }, pubSub) {
3008
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3009
+ input.EntityName = 'MJ.BizApps.Common: Relationship Types';
3010
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
3011
+ }
3012
+ async mjBizAppsCommonRelationshipType(ID, { dataSources, userPayload, providers }, pubSub) {
3013
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationship Types', userPayload);
3014
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3015
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3016
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationshipTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationship Types', userPayload, EntityPermissionType.Read, 'AND');
3017
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3018
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Relationship Types', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
3019
+ return result;
3020
+ }
3021
+ async mjBizAppsCommonRelationships_RelationshipTypeIDArray(mjbizappscommonrelationshiptype_, { dataSources, userPayload, providers }, pubSub) {
3022
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
3023
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3024
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3025
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [RelationshipTypeID]='${mjbizappscommonrelationshiptype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
3026
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3027
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows, this.GetUserFromPayload(userPayload));
3028
+ return result;
3029
+ }
3030
+ async CreatemjBizAppsCommonRelationshipType(input, { providers, userPayload }, pubSub) {
3031
+ const provider = GetReadWriteProvider(providers);
3032
+ return this.CreateRecord('MJ.BizApps.Common: Relationship Types', input, provider, userPayload, pubSub);
3033
+ }
3034
+ async UpdatemjBizAppsCommonRelationshipType(input, { providers, userPayload }, pubSub) {
3035
+ const provider = GetReadWriteProvider(providers);
3036
+ return this.UpdateRecord('MJ.BizApps.Common: Relationship Types', input, provider, userPayload, pubSub);
3037
+ }
3038
+ async DeletemjBizAppsCommonRelationshipType(ID, options, { providers, userPayload }, pubSub) {
3039
+ const provider = GetReadWriteProvider(providers);
3040
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
3041
+ return this.DeleteRecord('MJ.BizApps.Common: Relationship Types', key, options, provider, userPayload, pubSub);
3042
+ }
3043
+ };
3044
+ __decorate([
3045
+ Query(() => RunmjBizAppsCommonRelationshipTypeViewResult),
3046
+ __param(0, Arg('input', () => RunViewByIDInput)),
3047
+ __param(1, Ctx()),
3048
+ __param(2, PubSub()),
3049
+ __metadata("design:type", Function),
3050
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
3051
+ __metadata("design:returntype", Promise)
3052
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "RunmjBizAppsCommonRelationshipTypeViewByID", null);
3053
+ __decorate([
3054
+ Query(() => RunmjBizAppsCommonRelationshipTypeViewResult),
3055
+ __param(0, Arg('input', () => RunViewByNameInput)),
3056
+ __param(1, Ctx()),
3057
+ __param(2, PubSub()),
3058
+ __metadata("design:type", Function),
3059
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
3060
+ __metadata("design:returntype", Promise)
3061
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "RunmjBizAppsCommonRelationshipTypeViewByName", null);
3062
+ __decorate([
3063
+ Query(() => RunmjBizAppsCommonRelationshipTypeViewResult),
3064
+ __param(0, Arg('input', () => RunDynamicViewInput)),
3065
+ __param(1, Ctx()),
3066
+ __param(2, PubSub()),
3067
+ __metadata("design:type", Function),
3068
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
3069
+ __metadata("design:returntype", Promise)
3070
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "RunmjBizAppsCommonRelationshipTypeDynamicView", null);
3071
+ __decorate([
3072
+ Query(() => mjBizAppsCommonRelationshipType_, { nullable: true }),
3073
+ __param(0, Arg('ID', () => String)),
3074
+ __param(1, Ctx()),
3075
+ __param(2, PubSub()),
3076
+ __metadata("design:type", Function),
3077
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
3078
+ __metadata("design:returntype", Promise)
3079
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "mjBizAppsCommonRelationshipType", null);
3080
+ __decorate([
3081
+ FieldResolver(() => [mjBizAppsCommonRelationship_]),
3082
+ __param(0, Root()),
3083
+ __param(1, Ctx()),
3084
+ __param(2, PubSub()),
3085
+ __metadata("design:type", Function),
3086
+ __metadata("design:paramtypes", [mjBizAppsCommonRelationshipType_, Object, PubSubEngine]),
3087
+ __metadata("design:returntype", Promise)
3088
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "mjBizAppsCommonRelationships_RelationshipTypeIDArray", null);
3089
+ __decorate([
3090
+ Mutation(() => mjBizAppsCommonRelationshipType_),
3091
+ __param(0, Arg('input', () => CreatemjBizAppsCommonRelationshipTypeInput)),
3092
+ __param(1, Ctx()),
3093
+ __param(2, PubSub()),
3094
+ __metadata("design:type", Function),
3095
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonRelationshipTypeInput, Object, PubSubEngine]),
3096
+ __metadata("design:returntype", Promise)
3097
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "CreatemjBizAppsCommonRelationshipType", null);
3098
+ __decorate([
3099
+ Mutation(() => mjBizAppsCommonRelationshipType_),
3100
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonRelationshipTypeInput)),
3101
+ __param(1, Ctx()),
3102
+ __param(2, PubSub()),
3103
+ __metadata("design:type", Function),
3104
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonRelationshipTypeInput, Object, PubSubEngine]),
3105
+ __metadata("design:returntype", Promise)
3106
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "UpdatemjBizAppsCommonRelationshipType", null);
3107
+ __decorate([
3108
+ Mutation(() => mjBizAppsCommonRelationshipType_),
3109
+ __param(0, Arg('ID', () => String)),
3110
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
3111
+ __param(2, Ctx()),
3112
+ __param(3, PubSub()),
3113
+ __metadata("design:type", Function),
3114
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
3115
+ __metadata("design:returntype", Promise)
3116
+ ], mjBizAppsCommonRelationshipTypeResolver.prototype, "DeletemjBizAppsCommonRelationshipType", null);
3117
+ mjBizAppsCommonRelationshipTypeResolver = __decorate([
3118
+ Resolver(mjBizAppsCommonRelationshipType_)
3119
+ ], mjBizAppsCommonRelationshipTypeResolver);
3120
+ export { mjBizAppsCommonRelationshipTypeResolver };
3121
+ //****************************************************************************
3122
+ // ENTITY CLASS for MJ.BizApps.Common: Relationships
3123
+ //****************************************************************************
3124
+ let mjBizAppsCommonRelationship_ = class mjBizAppsCommonRelationship_ {
3125
+ };
3126
+ __decorate([
3127
+ Field(),
3128
+ MaxLength(16),
3129
+ __metadata("design:type", String)
3130
+ ], mjBizAppsCommonRelationship_.prototype, "ID", void 0);
3131
+ __decorate([
3132
+ Field(),
3133
+ MaxLength(16),
3134
+ __metadata("design:type", String)
3135
+ ], mjBizAppsCommonRelationship_.prototype, "RelationshipTypeID", void 0);
3136
+ __decorate([
3137
+ Field({ nullable: true }),
3138
+ MaxLength(16),
3139
+ __metadata("design:type", String)
3140
+ ], mjBizAppsCommonRelationship_.prototype, "FromPersonID", void 0);
3141
+ __decorate([
3142
+ Field({ nullable: true }),
3143
+ MaxLength(16),
3144
+ __metadata("design:type", String)
3145
+ ], mjBizAppsCommonRelationship_.prototype, "FromOrganizationID", void 0);
3146
+ __decorate([
3147
+ Field({ nullable: true }),
3148
+ MaxLength(16),
3149
+ __metadata("design:type", String)
3150
+ ], mjBizAppsCommonRelationship_.prototype, "ToPersonID", void 0);
3151
+ __decorate([
3152
+ Field({ nullable: true }),
3153
+ MaxLength(16),
3154
+ __metadata("design:type", String)
3155
+ ], mjBizAppsCommonRelationship_.prototype, "ToOrganizationID", void 0);
3156
+ __decorate([
3157
+ Field({ nullable: true, description: `Contextual title for this specific relationship, e.g. CEO, Primary Contact, Founding Member` }),
3158
+ MaxLength(510),
3159
+ __metadata("design:type", String)
3160
+ ], mjBizAppsCommonRelationship_.prototype, "Title", void 0);
3161
+ __decorate([
3162
+ Field({ nullable: true, description: `Date the relationship began` }),
3163
+ MaxLength(3),
3164
+ __metadata("design:type", Date)
3165
+ ], mjBizAppsCommonRelationship_.prototype, "StartDate", void 0);
3166
+ __decorate([
3167
+ Field({ nullable: true, description: `Date the relationship ended, if applicable` }),
3168
+ MaxLength(3),
3169
+ __metadata("design:type", Date)
3170
+ ], mjBizAppsCommonRelationship_.prototype, "EndDate", void 0);
3171
+ __decorate([
3172
+ Field({ description: `Current status: Active, Inactive, or Ended` }),
3173
+ MaxLength(100),
3174
+ __metadata("design:type", String)
3175
+ ], mjBizAppsCommonRelationship_.prototype, "Status", void 0);
3176
+ __decorate([
3177
+ Field({ nullable: true, description: `Additional notes about this relationship` }),
3178
+ __metadata("design:type", String)
3179
+ ], mjBizAppsCommonRelationship_.prototype, "Notes", void 0);
3180
+ __decorate([
3181
+ Field(),
3182
+ MaxLength(10),
3183
+ __metadata("design:type", Date)
3184
+ ], mjBizAppsCommonRelationship_.prototype, "_mj__CreatedAt", void 0);
3185
+ __decorate([
3186
+ Field(),
3187
+ MaxLength(10),
3188
+ __metadata("design:type", Date)
3189
+ ], mjBizAppsCommonRelationship_.prototype, "_mj__UpdatedAt", void 0);
3190
+ __decorate([
3191
+ Field(),
3192
+ MaxLength(200),
3193
+ __metadata("design:type", String)
3194
+ ], mjBizAppsCommonRelationship_.prototype, "RelationshipType", void 0);
3195
+ __decorate([
3196
+ Field({ nullable: true }),
3197
+ MaxLength(200),
3198
+ __metadata("design:type", String)
3199
+ ], mjBizAppsCommonRelationship_.prototype, "FromPerson", void 0);
3200
+ __decorate([
3201
+ Field({ nullable: true }),
3202
+ MaxLength(510),
3203
+ __metadata("design:type", String)
3204
+ ], mjBizAppsCommonRelationship_.prototype, "FromOrganization", void 0);
3205
+ __decorate([
3206
+ Field({ nullable: true }),
3207
+ MaxLength(200),
3208
+ __metadata("design:type", String)
3209
+ ], mjBizAppsCommonRelationship_.prototype, "ToPerson", void 0);
3210
+ __decorate([
3211
+ Field({ nullable: true }),
3212
+ MaxLength(510),
3213
+ __metadata("design:type", String)
3214
+ ], mjBizAppsCommonRelationship_.prototype, "ToOrganization", void 0);
3215
+ mjBizAppsCommonRelationship_ = __decorate([
3216
+ ObjectType({ description: `Typed, directional links between people and organizations supporting Person-to-Person, Person-to-Organization, and Organization-to-Organization relationships` })
3217
+ ], mjBizAppsCommonRelationship_);
3218
+ export { mjBizAppsCommonRelationship_ };
3219
+ //****************************************************************************
3220
+ // INPUT TYPE for MJ.BizApps.Common: Relationships
3221
+ //****************************************************************************
3222
+ let CreatemjBizAppsCommonRelationshipInput = class CreatemjBizAppsCommonRelationshipInput {
3223
+ };
3224
+ __decorate([
3225
+ Field({ nullable: true }),
3226
+ __metadata("design:type", String)
3227
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "ID", void 0);
3228
+ __decorate([
3229
+ Field({ nullable: true }),
3230
+ __metadata("design:type", String)
3231
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "RelationshipTypeID", void 0);
3232
+ __decorate([
3233
+ Field({ nullable: true }),
3234
+ __metadata("design:type", String)
3235
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "FromPersonID", void 0);
3236
+ __decorate([
3237
+ Field({ nullable: true }),
3238
+ __metadata("design:type", String)
3239
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "FromOrganizationID", void 0);
3240
+ __decorate([
3241
+ Field({ nullable: true }),
3242
+ __metadata("design:type", String)
3243
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "ToPersonID", void 0);
3244
+ __decorate([
3245
+ Field({ nullable: true }),
3246
+ __metadata("design:type", String)
3247
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "ToOrganizationID", void 0);
3248
+ __decorate([
3249
+ Field({ nullable: true }),
3250
+ __metadata("design:type", String)
3251
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "Title", void 0);
3252
+ __decorate([
3253
+ Field({ nullable: true }),
3254
+ __metadata("design:type", Date)
3255
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "StartDate", void 0);
3256
+ __decorate([
3257
+ Field({ nullable: true }),
3258
+ __metadata("design:type", Date)
3259
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "EndDate", void 0);
3260
+ __decorate([
3261
+ Field({ nullable: true }),
3262
+ __metadata("design:type", String)
3263
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "Status", void 0);
3264
+ __decorate([
3265
+ Field({ nullable: true }),
3266
+ __metadata("design:type", String)
3267
+ ], CreatemjBizAppsCommonRelationshipInput.prototype, "Notes", void 0);
3268
+ CreatemjBizAppsCommonRelationshipInput = __decorate([
3269
+ InputType()
3270
+ ], CreatemjBizAppsCommonRelationshipInput);
3271
+ export { CreatemjBizAppsCommonRelationshipInput };
3272
+ //****************************************************************************
3273
+ // INPUT TYPE for MJ.BizApps.Common: Relationships
3274
+ //****************************************************************************
3275
+ let UpdatemjBizAppsCommonRelationshipInput = class UpdatemjBizAppsCommonRelationshipInput {
3276
+ };
3277
+ __decorate([
3278
+ Field(),
3279
+ __metadata("design:type", String)
3280
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "ID", void 0);
3281
+ __decorate([
3282
+ Field({ nullable: true }),
3283
+ __metadata("design:type", String)
3284
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "RelationshipTypeID", void 0);
3285
+ __decorate([
3286
+ Field({ nullable: true }),
3287
+ __metadata("design:type", String)
3288
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "FromPersonID", void 0);
3289
+ __decorate([
3290
+ Field({ nullable: true }),
3291
+ __metadata("design:type", String)
3292
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "FromOrganizationID", void 0);
3293
+ __decorate([
3294
+ Field({ nullable: true }),
3295
+ __metadata("design:type", String)
3296
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "ToPersonID", void 0);
3297
+ __decorate([
3298
+ Field({ nullable: true }),
3299
+ __metadata("design:type", String)
3300
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "ToOrganizationID", void 0);
3301
+ __decorate([
3302
+ Field({ nullable: true }),
3303
+ __metadata("design:type", String)
3304
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "Title", void 0);
3305
+ __decorate([
3306
+ Field({ nullable: true }),
3307
+ __metadata("design:type", Date)
3308
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "StartDate", void 0);
3309
+ __decorate([
3310
+ Field({ nullable: true }),
3311
+ __metadata("design:type", Date)
3312
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "EndDate", void 0);
3313
+ __decorate([
3314
+ Field({ nullable: true }),
3315
+ __metadata("design:type", String)
3316
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "Status", void 0);
3317
+ __decorate([
3318
+ Field({ nullable: true }),
3319
+ __metadata("design:type", String)
3320
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "Notes", void 0);
3321
+ __decorate([
3322
+ Field(() => [KeyValuePairInput], { nullable: true }),
3323
+ __metadata("design:type", Array)
3324
+ ], UpdatemjBizAppsCommonRelationshipInput.prototype, "OldValues___", void 0);
3325
+ UpdatemjBizAppsCommonRelationshipInput = __decorate([
3326
+ InputType()
3327
+ ], UpdatemjBizAppsCommonRelationshipInput);
3328
+ export { UpdatemjBizAppsCommonRelationshipInput };
3329
+ //****************************************************************************
3330
+ // RESOLVER for MJ.BizApps.Common: Relationships
3331
+ //****************************************************************************
3332
+ let RunmjBizAppsCommonRelationshipViewResult = class RunmjBizAppsCommonRelationshipViewResult {
3333
+ };
3334
+ __decorate([
3335
+ Field(() => [mjBizAppsCommonRelationship_]),
3336
+ __metadata("design:type", Array)
3337
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "Results", void 0);
3338
+ __decorate([
3339
+ Field(() => String, { nullable: true }),
3340
+ __metadata("design:type", String)
3341
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "UserViewRunID", void 0);
3342
+ __decorate([
3343
+ Field(() => Int, { nullable: true }),
3344
+ __metadata("design:type", Number)
3345
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "RowCount", void 0);
3346
+ __decorate([
3347
+ Field(() => Int, { nullable: true }),
3348
+ __metadata("design:type", Number)
3349
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "TotalRowCount", void 0);
3350
+ __decorate([
3351
+ Field(() => Int, { nullable: true }),
3352
+ __metadata("design:type", Number)
3353
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "ExecutionTime", void 0);
3354
+ __decorate([
3355
+ Field({ nullable: true }),
3356
+ __metadata("design:type", String)
3357
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "ErrorMessage", void 0);
3358
+ __decorate([
3359
+ Field(() => Boolean, { nullable: false }),
3360
+ __metadata("design:type", Boolean)
3361
+ ], RunmjBizAppsCommonRelationshipViewResult.prototype, "Success", void 0);
3362
+ RunmjBizAppsCommonRelationshipViewResult = __decorate([
3363
+ ObjectType()
3364
+ ], RunmjBizAppsCommonRelationshipViewResult);
3365
+ export { RunmjBizAppsCommonRelationshipViewResult };
3366
+ let mjBizAppsCommonRelationshipResolver = class mjBizAppsCommonRelationshipResolver extends ResolverBase {
3367
+ async RunmjBizAppsCommonRelationshipViewByID(input, { providers, userPayload }, pubSub) {
3368
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3369
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
3370
+ }
3371
+ async RunmjBizAppsCommonRelationshipViewByName(input, { providers, userPayload }, pubSub) {
3372
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3373
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
3374
+ }
3375
+ async RunmjBizAppsCommonRelationshipDynamicView(input, { providers, userPayload }, pubSub) {
3376
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3377
+ input.EntityName = 'MJ.BizApps.Common: Relationships';
3378
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
3379
+ }
3380
+ async mjBizAppsCommonRelationship(ID, { dataSources, userPayload, providers }, pubSub) {
3381
+ this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
3382
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3383
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3384
+ const sSQL = `SELECT * FROM [__mj_BizAppsCommon].[vwRelationships] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ.BizApps.Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
3385
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3386
+ const result = await this.MapFieldNamesToCodeNames('MJ.BizApps.Common: Relationships', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
3387
+ return result;
3388
+ }
3389
+ async CreatemjBizAppsCommonRelationship(input, { providers, userPayload }, pubSub) {
3390
+ const provider = GetReadWriteProvider(providers);
3391
+ return this.CreateRecord('MJ.BizApps.Common: Relationships', input, provider, userPayload, pubSub);
3392
+ }
3393
+ async UpdatemjBizAppsCommonRelationship(input, { providers, userPayload }, pubSub) {
3394
+ const provider = GetReadWriteProvider(providers);
3395
+ return this.UpdateRecord('MJ.BizApps.Common: Relationships', input, provider, userPayload, pubSub);
3396
+ }
3397
+ async DeletemjBizAppsCommonRelationship(ID, options, { providers, userPayload }, pubSub) {
3398
+ const provider = GetReadWriteProvider(providers);
3399
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
3400
+ return this.DeleteRecord('MJ.BizApps.Common: Relationships', key, options, provider, userPayload, pubSub);
3401
+ }
3402
+ };
3403
+ __decorate([
3404
+ Query(() => RunmjBizAppsCommonRelationshipViewResult),
3405
+ __param(0, Arg('input', () => RunViewByIDInput)),
3406
+ __param(1, Ctx()),
3407
+ __param(2, PubSub()),
3408
+ __metadata("design:type", Function),
3409
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
3410
+ __metadata("design:returntype", Promise)
3411
+ ], mjBizAppsCommonRelationshipResolver.prototype, "RunmjBizAppsCommonRelationshipViewByID", null);
3412
+ __decorate([
3413
+ Query(() => RunmjBizAppsCommonRelationshipViewResult),
3414
+ __param(0, Arg('input', () => RunViewByNameInput)),
3415
+ __param(1, Ctx()),
3416
+ __param(2, PubSub()),
3417
+ __metadata("design:type", Function),
3418
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
3419
+ __metadata("design:returntype", Promise)
3420
+ ], mjBizAppsCommonRelationshipResolver.prototype, "RunmjBizAppsCommonRelationshipViewByName", null);
3421
+ __decorate([
3422
+ Query(() => RunmjBizAppsCommonRelationshipViewResult),
3423
+ __param(0, Arg('input', () => RunDynamicViewInput)),
3424
+ __param(1, Ctx()),
3425
+ __param(2, PubSub()),
3426
+ __metadata("design:type", Function),
3427
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
3428
+ __metadata("design:returntype", Promise)
3429
+ ], mjBizAppsCommonRelationshipResolver.prototype, "RunmjBizAppsCommonRelationshipDynamicView", null);
3430
+ __decorate([
3431
+ Query(() => mjBizAppsCommonRelationship_, { nullable: true }),
3432
+ __param(0, Arg('ID', () => String)),
3433
+ __param(1, Ctx()),
3434
+ __param(2, PubSub()),
3435
+ __metadata("design:type", Function),
3436
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
3437
+ __metadata("design:returntype", Promise)
3438
+ ], mjBizAppsCommonRelationshipResolver.prototype, "mjBizAppsCommonRelationship", null);
3439
+ __decorate([
3440
+ Mutation(() => mjBizAppsCommonRelationship_),
3441
+ __param(0, Arg('input', () => CreatemjBizAppsCommonRelationshipInput)),
3442
+ __param(1, Ctx()),
3443
+ __param(2, PubSub()),
3444
+ __metadata("design:type", Function),
3445
+ __metadata("design:paramtypes", [CreatemjBizAppsCommonRelationshipInput, Object, PubSubEngine]),
3446
+ __metadata("design:returntype", Promise)
3447
+ ], mjBizAppsCommonRelationshipResolver.prototype, "CreatemjBizAppsCommonRelationship", null);
3448
+ __decorate([
3449
+ Mutation(() => mjBizAppsCommonRelationship_),
3450
+ __param(0, Arg('input', () => UpdatemjBizAppsCommonRelationshipInput)),
3451
+ __param(1, Ctx()),
3452
+ __param(2, PubSub()),
3453
+ __metadata("design:type", Function),
3454
+ __metadata("design:paramtypes", [UpdatemjBizAppsCommonRelationshipInput, Object, PubSubEngine]),
3455
+ __metadata("design:returntype", Promise)
3456
+ ], mjBizAppsCommonRelationshipResolver.prototype, "UpdatemjBizAppsCommonRelationship", null);
3457
+ __decorate([
3458
+ Mutation(() => mjBizAppsCommonRelationship_),
3459
+ __param(0, Arg('ID', () => String)),
3460
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
3461
+ __param(2, Ctx()),
3462
+ __param(3, PubSub()),
3463
+ __metadata("design:type", Function),
3464
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
3465
+ __metadata("design:returntype", Promise)
3466
+ ], mjBizAppsCommonRelationshipResolver.prototype, "DeletemjBizAppsCommonRelationship", null);
3467
+ mjBizAppsCommonRelationshipResolver = __decorate([
3468
+ Resolver(mjBizAppsCommonRelationship_)
3469
+ ], mjBizAppsCommonRelationshipResolver);
3470
+ export { mjBizAppsCommonRelationshipResolver };
3471
+ //# sourceMappingURL=generated.js.map