@mj-biz-apps/common-server 5.26.0 → 5.26.2

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.
@@ -19,38 +19,37 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
19
19
  * >>> THE NEXT TIME THIS FILE IS GENERATED
20
20
  *
21
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';
22
+ import { Arg, Ctx, Int, Query, Resolver, Field, Float, ObjectType, FieldResolver, Root, InputType, Mutation, PubSub, PubSubEngine, ResolverBase, RunViewByIDInput, RunViewByNameInput, RunDynamicViewInput, KeyValuePairInput, DeleteOptionsInput, GetReadOnlyProvider, GetReadWriteProvider } from '@memberjunction/server';
24
23
  import { EntityPermissionType, CompositeKey } from '@memberjunction/core';
25
24
  import { MaxLength } from 'class-validator';
26
25
  //****************************************************************************
27
- // ENTITY CLASS for MJ.BizApps.Common: Address Links
26
+ // ENTITY CLASS for MJ_BizApps_Common: Address Links
28
27
  //****************************************************************************
29
28
  let mjBizAppsCommonAddressLink_ = class mjBizAppsCommonAddressLink_ {
30
29
  };
31
30
  __decorate([
32
31
  Field(),
33
- MaxLength(16),
32
+ MaxLength(36),
34
33
  __metadata("design:type", String)
35
34
  ], mjBizAppsCommonAddressLink_.prototype, "ID", void 0);
36
35
  __decorate([
37
36
  Field(),
38
- MaxLength(16),
37
+ MaxLength(36),
39
38
  __metadata("design:type", String)
40
39
  ], mjBizAppsCommonAddressLink_.prototype, "AddressID", void 0);
41
40
  __decorate([
42
41
  Field(),
43
- MaxLength(16),
42
+ MaxLength(36),
44
43
  __metadata("design:type", String)
45
44
  ], mjBizAppsCommonAddressLink_.prototype, "EntityID", void 0);
46
45
  __decorate([
47
46
  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),
47
+ MaxLength(700),
49
48
  __metadata("design:type", String)
50
49
  ], mjBizAppsCommonAddressLink_.prototype, "RecordID", void 0);
51
50
  __decorate([
52
51
  Field(),
53
- MaxLength(16),
52
+ MaxLength(36),
54
53
  __metadata("design:type", String)
55
54
  ], mjBizAppsCommonAddressLink_.prototype, "AddressTypeID", void 0);
56
55
  __decorate([
@@ -63,27 +62,25 @@ __decorate([
63
62
  ], mjBizAppsCommonAddressLink_.prototype, "Rank", void 0);
64
63
  __decorate([
65
64
  Field(),
66
- MaxLength(10),
67
65
  __metadata("design:type", Date)
68
66
  ], mjBizAppsCommonAddressLink_.prototype, "_mj__CreatedAt", void 0);
69
67
  __decorate([
70
68
  Field(),
71
- MaxLength(10),
72
69
  __metadata("design:type", Date)
73
70
  ], mjBizAppsCommonAddressLink_.prototype, "_mj__UpdatedAt", void 0);
74
71
  __decorate([
75
72
  Field(),
76
- MaxLength(510),
73
+ MaxLength(255),
77
74
  __metadata("design:type", String)
78
75
  ], mjBizAppsCommonAddressLink_.prototype, "Address", void 0);
79
76
  __decorate([
80
77
  Field(),
81
- MaxLength(510),
78
+ MaxLength(255),
82
79
  __metadata("design:type", String)
83
80
  ], mjBizAppsCommonAddressLink_.prototype, "Entity", void 0);
84
81
  __decorate([
85
82
  Field(),
86
- MaxLength(200),
83
+ MaxLength(100),
87
84
  __metadata("design:type", String)
88
85
  ], mjBizAppsCommonAddressLink_.prototype, "AddressType", void 0);
89
86
  mjBizAppsCommonAddressLink_ = __decorate([
@@ -91,7 +88,7 @@ mjBizAppsCommonAddressLink_ = __decorate([
91
88
  ], mjBizAppsCommonAddressLink_);
92
89
  export { mjBizAppsCommonAddressLink_ };
93
90
  //****************************************************************************
94
- // INPUT TYPE for MJ.BizApps.Common: Address Links
91
+ // INPUT TYPE for MJ_BizApps_Common: Address Links
95
92
  //****************************************************************************
96
93
  let CreatemjBizAppsCommonAddressLinkInput = class CreatemjBizAppsCommonAddressLinkInput {
97
94
  };
@@ -128,7 +125,7 @@ CreatemjBizAppsCommonAddressLinkInput = __decorate([
128
125
  ], CreatemjBizAppsCommonAddressLinkInput);
129
126
  export { CreatemjBizAppsCommonAddressLinkInput };
130
127
  //****************************************************************************
131
- // INPUT TYPE for MJ.BizApps.Common: Address Links
128
+ // INPUT TYPE for MJ_BizApps_Common: Address Links
132
129
  //****************************************************************************
133
130
  let UpdatemjBizAppsCommonAddressLinkInput = class UpdatemjBizAppsCommonAddressLinkInput {
134
131
  };
@@ -169,7 +166,7 @@ UpdatemjBizAppsCommonAddressLinkInput = __decorate([
169
166
  ], UpdatemjBizAppsCommonAddressLinkInput);
170
167
  export { UpdatemjBizAppsCommonAddressLinkInput };
171
168
  //****************************************************************************
172
- // RESOLVER for MJ.BizApps.Common: Address Links
169
+ // RESOLVER for MJ_BizApps_Common: Address Links
173
170
  //****************************************************************************
174
171
  let RunmjBizAppsCommonAddressLinkViewResult = class RunmjBizAppsCommonAddressLinkViewResult {
175
172
  };
@@ -216,30 +213,29 @@ let mjBizAppsCommonAddressLinkResolver = class mjBizAppsCommonAddressLinkResolve
216
213
  }
217
214
  async RunmjBizAppsCommonAddressLinkDynamicView(input, { providers, userPayload }, pubSub) {
218
215
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
219
- input.EntityName = 'MJ.BizApps.Common: Address Links';
216
+ input.EntityName = 'MJ_BizApps_Common: Address Links';
220
217
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
221
218
  }
222
- async mjBizAppsCommonAddressLink(ID, { dataSources, userPayload, providers }, pubSub) {
223
- this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
219
+ async mjBizAppsCommonAddressLink(ID, { userPayload, providers }, pubSub) {
220
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Address Links', userPayload);
224
221
  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));
222
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwAddressLinks')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
223
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
224
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Address Links', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
229
225
  return result;
230
226
  }
231
227
  async CreatemjBizAppsCommonAddressLink(input, { providers, userPayload }, pubSub) {
232
228
  const provider = GetReadWriteProvider(providers);
233
- return this.CreateRecord('MJ.BizApps.Common: Address Links', input, provider, userPayload, pubSub);
229
+ return this.CreateRecord('MJ_BizApps_Common: Address Links', input, provider, userPayload, pubSub);
234
230
  }
235
231
  async UpdatemjBizAppsCommonAddressLink(input, { providers, userPayload }, pubSub) {
236
232
  const provider = GetReadWriteProvider(providers);
237
- return this.UpdateRecord('MJ.BizApps.Common: Address Links', input, provider, userPayload, pubSub);
233
+ return this.UpdateRecord('MJ_BizApps_Common: Address Links', input, provider, userPayload, pubSub);
238
234
  }
239
235
  async DeletemjBizAppsCommonAddressLink(ID, options, { providers, userPayload }, pubSub) {
240
236
  const provider = GetReadWriteProvider(providers);
241
237
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
242
- return this.DeleteRecord('MJ.BizApps.Common: Address Links', key, options, provider, userPayload, pubSub);
238
+ return this.DeleteRecord('MJ_BizApps_Common: Address Links', key, options, provider, userPayload, pubSub);
243
239
  }
244
240
  };
245
241
  __decorate([
@@ -311,18 +307,18 @@ mjBizAppsCommonAddressLinkResolver = __decorate([
311
307
  ], mjBizAppsCommonAddressLinkResolver);
312
308
  export { mjBizAppsCommonAddressLinkResolver };
313
309
  //****************************************************************************
314
- // ENTITY CLASS for MJ.BizApps.Common: Address Types
310
+ // ENTITY CLASS for MJ_BizApps_Common: Address Types
315
311
  //****************************************************************************
316
312
  let mjBizAppsCommonAddressType_ = class mjBizAppsCommonAddressType_ {
317
313
  };
318
314
  __decorate([
319
315
  Field(),
320
- MaxLength(16),
316
+ MaxLength(36),
321
317
  __metadata("design:type", String)
322
318
  ], mjBizAppsCommonAddressType_.prototype, "ID", void 0);
323
319
  __decorate([
324
320
  Field({ description: `Display name for the address type` }),
325
- MaxLength(200),
321
+ MaxLength(100),
326
322
  __metadata("design:type", String)
327
323
  ], mjBizAppsCommonAddressType_.prototype, "Name", void 0);
328
324
  __decorate([
@@ -331,7 +327,7 @@ __decorate([
331
327
  ], mjBizAppsCommonAddressType_.prototype, "Description", void 0);
332
328
  __decorate([
333
329
  Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
334
- MaxLength(200),
330
+ MaxLength(100),
335
331
  __metadata("design:type", String)
336
332
  ], mjBizAppsCommonAddressType_.prototype, "IconClass", void 0);
337
333
  __decorate([
@@ -344,12 +340,10 @@ __decorate([
344
340
  ], mjBizAppsCommonAddressType_.prototype, "IsActive", void 0);
345
341
  __decorate([
346
342
  Field(),
347
- MaxLength(10),
348
343
  __metadata("design:type", Date)
349
344
  ], mjBizAppsCommonAddressType_.prototype, "_mj__CreatedAt", void 0);
350
345
  __decorate([
351
346
  Field(),
352
- MaxLength(10),
353
347
  __metadata("design:type", Date)
354
348
  ], mjBizAppsCommonAddressType_.prototype, "_mj__UpdatedAt", void 0);
355
349
  __decorate([
@@ -361,7 +355,7 @@ mjBizAppsCommonAddressType_ = __decorate([
361
355
  ], mjBizAppsCommonAddressType_);
362
356
  export { mjBizAppsCommonAddressType_ };
363
357
  //****************************************************************************
364
- // INPUT TYPE for MJ.BizApps.Common: Address Types
358
+ // INPUT TYPE for MJ_BizApps_Common: Address Types
365
359
  //****************************************************************************
366
360
  let CreatemjBizAppsCommonAddressTypeInput = class CreatemjBizAppsCommonAddressTypeInput {
367
361
  };
@@ -394,7 +388,7 @@ CreatemjBizAppsCommonAddressTypeInput = __decorate([
394
388
  ], CreatemjBizAppsCommonAddressTypeInput);
395
389
  export { CreatemjBizAppsCommonAddressTypeInput };
396
390
  //****************************************************************************
397
- // INPUT TYPE for MJ.BizApps.Common: Address Types
391
+ // INPUT TYPE for MJ_BizApps_Common: Address Types
398
392
  //****************************************************************************
399
393
  let UpdatemjBizAppsCommonAddressTypeInput = class UpdatemjBizAppsCommonAddressTypeInput {
400
394
  };
@@ -431,7 +425,7 @@ UpdatemjBizAppsCommonAddressTypeInput = __decorate([
431
425
  ], UpdatemjBizAppsCommonAddressTypeInput);
432
426
  export { UpdatemjBizAppsCommonAddressTypeInput };
433
427
  //****************************************************************************
434
- // RESOLVER for MJ.BizApps.Common: Address Types
428
+ // RESOLVER for MJ_BizApps_Common: Address Types
435
429
  //****************************************************************************
436
430
  let RunmjBizAppsCommonAddressTypeViewResult = class RunmjBizAppsCommonAddressTypeViewResult {
437
431
  };
@@ -478,39 +472,37 @@ let mjBizAppsCommonAddressTypeResolver = class mjBizAppsCommonAddressTypeResolve
478
472
  }
479
473
  async RunmjBizAppsCommonAddressTypeDynamicView(input, { providers, userPayload }, pubSub) {
480
474
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
481
- input.EntityName = 'MJ.BizApps.Common: Address Types';
475
+ input.EntityName = 'MJ_BizApps_Common: Address Types';
482
476
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
483
477
  }
484
- async mjBizAppsCommonAddressType(ID, { dataSources, userPayload, providers }, pubSub) {
485
- this.CheckUserReadPermissions('MJ.BizApps.Common: Address Types', userPayload);
478
+ async mjBizAppsCommonAddressType(ID, { userPayload, providers }, pubSub) {
479
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Address Types', userPayload);
486
480
  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));
481
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwAddressTypes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Address Types', userPayload, EntityPermissionType.Read, 'AND');
482
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
483
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Address Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
491
484
  return result;
492
485
  }
493
- async mjBizAppsCommonAddressLinks_AddressTypeIDArray(mjbizappscommonaddresstype_, { dataSources, userPayload, providers }, pubSub) {
494
- this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
486
+ async mjBizAppsCommonAddressLinks_AddressTypeIDArray(mjbizappscommonaddresstype_, { userPayload, providers }, pubSub) {
487
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Address Links', userPayload);
495
488
  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));
489
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwAddressLinks')} WHERE ${provider.QuoteIdentifier('AddressTypeID')}='${mjbizappscommonaddresstype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
490
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
491
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Address Links', rows, this.GetUserFromPayload(userPayload));
500
492
  return result;
501
493
  }
502
494
  async CreatemjBizAppsCommonAddressType(input, { providers, userPayload }, pubSub) {
503
495
  const provider = GetReadWriteProvider(providers);
504
- return this.CreateRecord('MJ.BizApps.Common: Address Types', input, provider, userPayload, pubSub);
496
+ return this.CreateRecord('MJ_BizApps_Common: Address Types', input, provider, userPayload, pubSub);
505
497
  }
506
498
  async UpdatemjBizAppsCommonAddressType(input, { providers, userPayload }, pubSub) {
507
499
  const provider = GetReadWriteProvider(providers);
508
- return this.UpdateRecord('MJ.BizApps.Common: Address Types', input, provider, userPayload, pubSub);
500
+ return this.UpdateRecord('MJ_BizApps_Common: Address Types', input, provider, userPayload, pubSub);
509
501
  }
510
502
  async DeletemjBizAppsCommonAddressType(ID, options, { providers, userPayload }, pubSub) {
511
503
  const provider = GetReadWriteProvider(providers);
512
504
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
513
- return this.DeleteRecord('MJ.BizApps.Common: Address Types', key, options, provider, userPayload, pubSub);
505
+ return this.DeleteRecord('MJ_BizApps_Common: Address Types', key, options, provider, userPayload, pubSub);
514
506
  }
515
507
  };
516
508
  __decorate([
@@ -591,48 +583,48 @@ mjBizAppsCommonAddressTypeResolver = __decorate([
591
583
  ], mjBizAppsCommonAddressTypeResolver);
592
584
  export { mjBizAppsCommonAddressTypeResolver };
593
585
  //****************************************************************************
594
- // ENTITY CLASS for MJ.BizApps.Common: Addresses
586
+ // ENTITY CLASS for MJ_BizApps_Common: Addresses
595
587
  //****************************************************************************
596
588
  let mjBizAppsCommonAddress_ = class mjBizAppsCommonAddress_ {
597
589
  };
598
590
  __decorate([
599
591
  Field(),
600
- MaxLength(16),
592
+ MaxLength(36),
601
593
  __metadata("design:type", String)
602
594
  ], mjBizAppsCommonAddress_.prototype, "ID", void 0);
603
595
  __decorate([
604
596
  Field({ description: `Street address line 1` }),
605
- MaxLength(510),
597
+ MaxLength(255),
606
598
  __metadata("design:type", String)
607
599
  ], mjBizAppsCommonAddress_.prototype, "Line1", void 0);
608
600
  __decorate([
609
601
  Field({ nullable: true, description: `Street address line 2 (suite, apt, etc.)` }),
610
- MaxLength(510),
602
+ MaxLength(255),
611
603
  __metadata("design:type", String)
612
604
  ], mjBizAppsCommonAddress_.prototype, "Line2", void 0);
613
605
  __decorate([
614
606
  Field({ nullable: true, description: `Street address line 3 (additional detail)` }),
615
- MaxLength(510),
607
+ MaxLength(255),
616
608
  __metadata("design:type", String)
617
609
  ], mjBizAppsCommonAddress_.prototype, "Line3", void 0);
618
610
  __decorate([
619
611
  Field({ description: `City or locality name` }),
620
- MaxLength(200),
612
+ MaxLength(100),
621
613
  __metadata("design:type", String)
622
614
  ], mjBizAppsCommonAddress_.prototype, "City", void 0);
623
615
  __decorate([
624
616
  Field({ nullable: true, description: `State, province, or region` }),
625
- MaxLength(200),
617
+ MaxLength(100),
626
618
  __metadata("design:type", String)
627
619
  ], mjBizAppsCommonAddress_.prototype, "StateProvince", void 0);
628
620
  __decorate([
629
621
  Field({ nullable: true, description: `Postal or ZIP code` }),
630
- MaxLength(40),
622
+ MaxLength(20),
631
623
  __metadata("design:type", String)
632
624
  ], mjBizAppsCommonAddress_.prototype, "PostalCode", void 0);
633
625
  __decorate([
634
626
  Field({ description: `Country code or name, defaults to US` }),
635
- MaxLength(200),
627
+ MaxLength(100),
636
628
  __metadata("design:type", String)
637
629
  ], mjBizAppsCommonAddress_.prototype, "Country", void 0);
638
630
  __decorate([
@@ -645,12 +637,10 @@ __decorate([
645
637
  ], mjBizAppsCommonAddress_.prototype, "Longitude", void 0);
646
638
  __decorate([
647
639
  Field(),
648
- MaxLength(10),
649
640
  __metadata("design:type", Date)
650
641
  ], mjBizAppsCommonAddress_.prototype, "_mj__CreatedAt", void 0);
651
642
  __decorate([
652
643
  Field(),
653
- MaxLength(10),
654
644
  __metadata("design:type", Date)
655
645
  ], mjBizAppsCommonAddress_.prototype, "_mj__UpdatedAt", void 0);
656
646
  __decorate([
@@ -662,7 +652,7 @@ mjBizAppsCommonAddress_ = __decorate([
662
652
  ], mjBizAppsCommonAddress_);
663
653
  export { mjBizAppsCommonAddress_ };
664
654
  //****************************************************************************
665
- // INPUT TYPE for MJ.BizApps.Common: Addresses
655
+ // INPUT TYPE for MJ_BizApps_Common: Addresses
666
656
  //****************************************************************************
667
657
  let CreatemjBizAppsCommonAddressInput = class CreatemjBizAppsCommonAddressInput {
668
658
  };
@@ -711,7 +701,7 @@ CreatemjBizAppsCommonAddressInput = __decorate([
711
701
  ], CreatemjBizAppsCommonAddressInput);
712
702
  export { CreatemjBizAppsCommonAddressInput };
713
703
  //****************************************************************************
714
- // INPUT TYPE for MJ.BizApps.Common: Addresses
704
+ // INPUT TYPE for MJ_BizApps_Common: Addresses
715
705
  //****************************************************************************
716
706
  let UpdatemjBizAppsCommonAddressInput = class UpdatemjBizAppsCommonAddressInput {
717
707
  };
@@ -764,7 +754,7 @@ UpdatemjBizAppsCommonAddressInput = __decorate([
764
754
  ], UpdatemjBizAppsCommonAddressInput);
765
755
  export { UpdatemjBizAppsCommonAddressInput };
766
756
  //****************************************************************************
767
- // RESOLVER for MJ.BizApps.Common: Addresses
757
+ // RESOLVER for MJ_BizApps_Common: Addresses
768
758
  //****************************************************************************
769
759
  let RunmjBizAppsCommonAddressViewResult = class RunmjBizAppsCommonAddressViewResult {
770
760
  };
@@ -811,39 +801,37 @@ let mjBizAppsCommonAddressResolver = class mjBizAppsCommonAddressResolver extend
811
801
  }
812
802
  async RunmjBizAppsCommonAddressDynamicView(input, { providers, userPayload }, pubSub) {
813
803
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
814
- input.EntityName = 'MJ.BizApps.Common: Addresses';
804
+ input.EntityName = 'MJ_BizApps_Common: Addresses';
815
805
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
816
806
  }
817
- async mjBizAppsCommonAddress(ID, { dataSources, userPayload, providers }, pubSub) {
818
- this.CheckUserReadPermissions('MJ.BizApps.Common: Addresses', userPayload);
807
+ async mjBizAppsCommonAddress(ID, { userPayload, providers }, pubSub) {
808
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Addresses', userPayload);
819
809
  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));
810
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwAddresses')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Addresses', userPayload, EntityPermissionType.Read, 'AND');
811
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
812
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Addresses', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
824
813
  return result;
825
814
  }
826
- async mjBizAppsCommonAddressLinks_AddressIDArray(mjbizappscommonaddress_, { dataSources, userPayload, providers }, pubSub) {
827
- this.CheckUserReadPermissions('MJ.BizApps.Common: Address Links', userPayload);
815
+ async mjBizAppsCommonAddressLinks_AddressIDArray(mjbizappscommonaddress_, { userPayload, providers }, pubSub) {
816
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Address Links', userPayload);
828
817
  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));
818
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwAddressLinks')} WHERE ${provider.QuoteIdentifier('AddressID')}='${mjbizappscommonaddress_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Address Links', userPayload, EntityPermissionType.Read, 'AND');
819
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
820
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Address Links', rows, this.GetUserFromPayload(userPayload));
833
821
  return result;
834
822
  }
835
823
  async CreatemjBizAppsCommonAddress(input, { providers, userPayload }, pubSub) {
836
824
  const provider = GetReadWriteProvider(providers);
837
- return this.CreateRecord('MJ.BizApps.Common: Addresses', input, provider, userPayload, pubSub);
825
+ return this.CreateRecord('MJ_BizApps_Common: Addresses', input, provider, userPayload, pubSub);
838
826
  }
839
827
  async UpdatemjBizAppsCommonAddress(input, { providers, userPayload }, pubSub) {
840
828
  const provider = GetReadWriteProvider(providers);
841
- return this.UpdateRecord('MJ.BizApps.Common: Addresses', input, provider, userPayload, pubSub);
829
+ return this.UpdateRecord('MJ_BizApps_Common: Addresses', input, provider, userPayload, pubSub);
842
830
  }
843
831
  async DeletemjBizAppsCommonAddress(ID, options, { providers, userPayload }, pubSub) {
844
832
  const provider = GetReadWriteProvider(providers);
845
833
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
846
- return this.DeleteRecord('MJ.BizApps.Common: Addresses', key, options, provider, userPayload, pubSub);
834
+ return this.DeleteRecord('MJ_BizApps_Common: Addresses', key, options, provider, userPayload, pubSub);
847
835
  }
848
836
  };
849
837
  __decorate([
@@ -924,38 +912,38 @@ mjBizAppsCommonAddressResolver = __decorate([
924
912
  ], mjBizAppsCommonAddressResolver);
925
913
  export { mjBizAppsCommonAddressResolver };
926
914
  //****************************************************************************
927
- // ENTITY CLASS for MJ.BizApps.Common: Contact Methods
915
+ // ENTITY CLASS for MJ_BizApps_Common: Contact Methods
928
916
  //****************************************************************************
929
917
  let mjBizAppsCommonContactMethod_ = class mjBizAppsCommonContactMethod_ {
930
918
  };
931
919
  __decorate([
932
920
  Field(),
933
- MaxLength(16),
921
+ MaxLength(36),
934
922
  __metadata("design:type", String)
935
923
  ], mjBizAppsCommonContactMethod_.prototype, "ID", void 0);
936
924
  __decorate([
937
925
  Field({ nullable: true }),
938
- MaxLength(16),
926
+ MaxLength(36),
939
927
  __metadata("design:type", String)
940
928
  ], mjBizAppsCommonContactMethod_.prototype, "PersonID", void 0);
941
929
  __decorate([
942
930
  Field({ nullable: true }),
943
- MaxLength(16),
931
+ MaxLength(36),
944
932
  __metadata("design:type", String)
945
933
  ], mjBizAppsCommonContactMethod_.prototype, "OrganizationID", void 0);
946
934
  __decorate([
947
935
  Field(),
948
- MaxLength(16),
936
+ MaxLength(36),
949
937
  __metadata("design:type", String)
950
938
  ], mjBizAppsCommonContactMethod_.prototype, "ContactTypeID", void 0);
951
939
  __decorate([
952
940
  Field({ description: `The contact value: phone number, email address, URL, social media handle, etc.` }),
953
- MaxLength(1000),
941
+ MaxLength(500),
954
942
  __metadata("design:type", String)
955
943
  ], mjBizAppsCommonContactMethod_.prototype, "Value", void 0);
956
944
  __decorate([
957
945
  Field({ nullable: true, description: `Descriptive label such as Work cell, Personal Gmail, Corporate LinkedIn` }),
958
- MaxLength(200),
946
+ MaxLength(100),
959
947
  __metadata("design:type", String)
960
948
  ], mjBizAppsCommonContactMethod_.prototype, "Label", void 0);
961
949
  __decorate([
@@ -964,27 +952,25 @@ __decorate([
964
952
  ], mjBizAppsCommonContactMethod_.prototype, "IsPrimary", void 0);
965
953
  __decorate([
966
954
  Field(),
967
- MaxLength(10),
968
955
  __metadata("design:type", Date)
969
956
  ], mjBizAppsCommonContactMethod_.prototype, "_mj__CreatedAt", void 0);
970
957
  __decorate([
971
958
  Field(),
972
- MaxLength(10),
973
959
  __metadata("design:type", Date)
974
960
  ], mjBizAppsCommonContactMethod_.prototype, "_mj__UpdatedAt", void 0);
975
961
  __decorate([
976
962
  Field({ nullable: true }),
977
- MaxLength(200),
963
+ MaxLength(100),
978
964
  __metadata("design:type", String)
979
965
  ], mjBizAppsCommonContactMethod_.prototype, "Person", void 0);
980
966
  __decorate([
981
967
  Field({ nullable: true }),
982
- MaxLength(510),
968
+ MaxLength(255),
983
969
  __metadata("design:type", String)
984
970
  ], mjBizAppsCommonContactMethod_.prototype, "Organization", void 0);
985
971
  __decorate([
986
972
  Field(),
987
- MaxLength(200),
973
+ MaxLength(100),
988
974
  __metadata("design:type", String)
989
975
  ], mjBizAppsCommonContactMethod_.prototype, "ContactType", void 0);
990
976
  mjBizAppsCommonContactMethod_ = __decorate([
@@ -992,7 +978,7 @@ mjBizAppsCommonContactMethod_ = __decorate([
992
978
  ], mjBizAppsCommonContactMethod_);
993
979
  export { mjBizAppsCommonContactMethod_ };
994
980
  //****************************************************************************
995
- // INPUT TYPE for MJ.BizApps.Common: Contact Methods
981
+ // INPUT TYPE for MJ_BizApps_Common: Contact Methods
996
982
  //****************************************************************************
997
983
  let CreatemjBizAppsCommonContactMethodInput = class CreatemjBizAppsCommonContactMethodInput {
998
984
  };
@@ -1029,7 +1015,7 @@ CreatemjBizAppsCommonContactMethodInput = __decorate([
1029
1015
  ], CreatemjBizAppsCommonContactMethodInput);
1030
1016
  export { CreatemjBizAppsCommonContactMethodInput };
1031
1017
  //****************************************************************************
1032
- // INPUT TYPE for MJ.BizApps.Common: Contact Methods
1018
+ // INPUT TYPE for MJ_BizApps_Common: Contact Methods
1033
1019
  //****************************************************************************
1034
1020
  let UpdatemjBizAppsCommonContactMethodInput = class UpdatemjBizAppsCommonContactMethodInput {
1035
1021
  };
@@ -1070,7 +1056,7 @@ UpdatemjBizAppsCommonContactMethodInput = __decorate([
1070
1056
  ], UpdatemjBizAppsCommonContactMethodInput);
1071
1057
  export { UpdatemjBizAppsCommonContactMethodInput };
1072
1058
  //****************************************************************************
1073
- // RESOLVER for MJ.BizApps.Common: Contact Methods
1059
+ // RESOLVER for MJ_BizApps_Common: Contact Methods
1074
1060
  //****************************************************************************
1075
1061
  let RunmjBizAppsCommonContactMethodViewResult = class RunmjBizAppsCommonContactMethodViewResult {
1076
1062
  };
@@ -1117,30 +1103,29 @@ let mjBizAppsCommonContactMethodResolver = class mjBizAppsCommonContactMethodRes
1117
1103
  }
1118
1104
  async RunmjBizAppsCommonContactMethodDynamicView(input, { providers, userPayload }, pubSub) {
1119
1105
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1120
- input.EntityName = 'MJ.BizApps.Common: Contact Methods';
1106
+ input.EntityName = 'MJ_BizApps_Common: Contact Methods';
1121
1107
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1122
1108
  }
1123
- async mjBizAppsCommonContactMethod(ID, { dataSources, userPayload, providers }, pubSub) {
1124
- this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
1109
+ async mjBizAppsCommonContactMethod(ID, { userPayload, providers }, pubSub) {
1110
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Contact Methods', userPayload);
1125
1111
  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));
1112
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwContactMethods')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
1113
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
1114
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Contact Methods', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
1130
1115
  return result;
1131
1116
  }
1132
1117
  async CreatemjBizAppsCommonContactMethod(input, { providers, userPayload }, pubSub) {
1133
1118
  const provider = GetReadWriteProvider(providers);
1134
- return this.CreateRecord('MJ.BizApps.Common: Contact Methods', input, provider, userPayload, pubSub);
1119
+ return this.CreateRecord('MJ_BizApps_Common: Contact Methods', input, provider, userPayload, pubSub);
1135
1120
  }
1136
1121
  async UpdatemjBizAppsCommonContactMethod(input, { providers, userPayload }, pubSub) {
1137
1122
  const provider = GetReadWriteProvider(providers);
1138
- return this.UpdateRecord('MJ.BizApps.Common: Contact Methods', input, provider, userPayload, pubSub);
1123
+ return this.UpdateRecord('MJ_BizApps_Common: Contact Methods', input, provider, userPayload, pubSub);
1139
1124
  }
1140
1125
  async DeletemjBizAppsCommonContactMethod(ID, options, { providers, userPayload }, pubSub) {
1141
1126
  const provider = GetReadWriteProvider(providers);
1142
1127
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1143
- return this.DeleteRecord('MJ.BizApps.Common: Contact Methods', key, options, provider, userPayload, pubSub);
1128
+ return this.DeleteRecord('MJ_BizApps_Common: Contact Methods', key, options, provider, userPayload, pubSub);
1144
1129
  }
1145
1130
  };
1146
1131
  __decorate([
@@ -1212,18 +1197,18 @@ mjBizAppsCommonContactMethodResolver = __decorate([
1212
1197
  ], mjBizAppsCommonContactMethodResolver);
1213
1198
  export { mjBizAppsCommonContactMethodResolver };
1214
1199
  //****************************************************************************
1215
- // ENTITY CLASS for MJ.BizApps.Common: Contact Types
1200
+ // ENTITY CLASS for MJ_BizApps_Common: Contact Types
1216
1201
  //****************************************************************************
1217
1202
  let mjBizAppsCommonContactType_ = class mjBizAppsCommonContactType_ {
1218
1203
  };
1219
1204
  __decorate([
1220
1205
  Field(),
1221
- MaxLength(16),
1206
+ MaxLength(36),
1222
1207
  __metadata("design:type", String)
1223
1208
  ], mjBizAppsCommonContactType_.prototype, "ID", void 0);
1224
1209
  __decorate([
1225
1210
  Field({ description: `Display name for the contact type` }),
1226
- MaxLength(200),
1211
+ MaxLength(100),
1227
1212
  __metadata("design:type", String)
1228
1213
  ], mjBizAppsCommonContactType_.prototype, "Name", void 0);
1229
1214
  __decorate([
@@ -1232,7 +1217,7 @@ __decorate([
1232
1217
  ], mjBizAppsCommonContactType_.prototype, "Description", void 0);
1233
1218
  __decorate([
1234
1219
  Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
1235
- MaxLength(200),
1220
+ MaxLength(100),
1236
1221
  __metadata("design:type", String)
1237
1222
  ], mjBizAppsCommonContactType_.prototype, "IconClass", void 0);
1238
1223
  __decorate([
@@ -1245,12 +1230,10 @@ __decorate([
1245
1230
  ], mjBizAppsCommonContactType_.prototype, "IsActive", void 0);
1246
1231
  __decorate([
1247
1232
  Field(),
1248
- MaxLength(10),
1249
1233
  __metadata("design:type", Date)
1250
1234
  ], mjBizAppsCommonContactType_.prototype, "_mj__CreatedAt", void 0);
1251
1235
  __decorate([
1252
1236
  Field(),
1253
- MaxLength(10),
1254
1237
  __metadata("design:type", Date)
1255
1238
  ], mjBizAppsCommonContactType_.prototype, "_mj__UpdatedAt", void 0);
1256
1239
  __decorate([
@@ -1262,7 +1245,7 @@ mjBizAppsCommonContactType_ = __decorate([
1262
1245
  ], mjBizAppsCommonContactType_);
1263
1246
  export { mjBizAppsCommonContactType_ };
1264
1247
  //****************************************************************************
1265
- // INPUT TYPE for MJ.BizApps.Common: Contact Types
1248
+ // INPUT TYPE for MJ_BizApps_Common: Contact Types
1266
1249
  //****************************************************************************
1267
1250
  let CreatemjBizAppsCommonContactTypeInput = class CreatemjBizAppsCommonContactTypeInput {
1268
1251
  };
@@ -1295,7 +1278,7 @@ CreatemjBizAppsCommonContactTypeInput = __decorate([
1295
1278
  ], CreatemjBizAppsCommonContactTypeInput);
1296
1279
  export { CreatemjBizAppsCommonContactTypeInput };
1297
1280
  //****************************************************************************
1298
- // INPUT TYPE for MJ.BizApps.Common: Contact Types
1281
+ // INPUT TYPE for MJ_BizApps_Common: Contact Types
1299
1282
  //****************************************************************************
1300
1283
  let UpdatemjBizAppsCommonContactTypeInput = class UpdatemjBizAppsCommonContactTypeInput {
1301
1284
  };
@@ -1332,7 +1315,7 @@ UpdatemjBizAppsCommonContactTypeInput = __decorate([
1332
1315
  ], UpdatemjBizAppsCommonContactTypeInput);
1333
1316
  export { UpdatemjBizAppsCommonContactTypeInput };
1334
1317
  //****************************************************************************
1335
- // RESOLVER for MJ.BizApps.Common: Contact Types
1318
+ // RESOLVER for MJ_BizApps_Common: Contact Types
1336
1319
  //****************************************************************************
1337
1320
  let RunmjBizAppsCommonContactTypeViewResult = class RunmjBizAppsCommonContactTypeViewResult {
1338
1321
  };
@@ -1379,39 +1362,37 @@ let mjBizAppsCommonContactTypeResolver = class mjBizAppsCommonContactTypeResolve
1379
1362
  }
1380
1363
  async RunmjBizAppsCommonContactTypeDynamicView(input, { providers, userPayload }, pubSub) {
1381
1364
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1382
- input.EntityName = 'MJ.BizApps.Common: Contact Types';
1365
+ input.EntityName = 'MJ_BizApps_Common: Contact Types';
1383
1366
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1384
1367
  }
1385
- async mjBizAppsCommonContactType(ID, { dataSources, userPayload, providers }, pubSub) {
1386
- this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Types', userPayload);
1368
+ async mjBizAppsCommonContactType(ID, { userPayload, providers }, pubSub) {
1369
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Contact Types', userPayload);
1387
1370
  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));
1371
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwContactTypes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Contact Types', userPayload, EntityPermissionType.Read, 'AND');
1372
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
1373
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Contact Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
1392
1374
  return result;
1393
1375
  }
1394
- async mjBizAppsCommonContactMethods_ContactTypeIDArray(mjbizappscommoncontacttype_, { dataSources, userPayload, providers }, pubSub) {
1395
- this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
1376
+ async mjBizAppsCommonContactMethods_ContactTypeIDArray(mjbizappscommoncontacttype_, { userPayload, providers }, pubSub) {
1377
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Contact Methods', userPayload);
1396
1378
  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));
1379
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwContactMethods')} WHERE ${provider.QuoteIdentifier('ContactTypeID')}='${mjbizappscommoncontacttype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
1380
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
1381
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
1401
1382
  return result;
1402
1383
  }
1403
1384
  async CreatemjBizAppsCommonContactType(input, { providers, userPayload }, pubSub) {
1404
1385
  const provider = GetReadWriteProvider(providers);
1405
- return this.CreateRecord('MJ.BizApps.Common: Contact Types', input, provider, userPayload, pubSub);
1386
+ return this.CreateRecord('MJ_BizApps_Common: Contact Types', input, provider, userPayload, pubSub);
1406
1387
  }
1407
1388
  async UpdatemjBizAppsCommonContactType(input, { providers, userPayload }, pubSub) {
1408
1389
  const provider = GetReadWriteProvider(providers);
1409
- return this.UpdateRecord('MJ.BizApps.Common: Contact Types', input, provider, userPayload, pubSub);
1390
+ return this.UpdateRecord('MJ_BizApps_Common: Contact Types', input, provider, userPayload, pubSub);
1410
1391
  }
1411
1392
  async DeletemjBizAppsCommonContactType(ID, options, { providers, userPayload }, pubSub) {
1412
1393
  const provider = GetReadWriteProvider(providers);
1413
1394
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1414
- return this.DeleteRecord('MJ.BizApps.Common: Contact Types', key, options, provider, userPayload, pubSub);
1395
+ return this.DeleteRecord('MJ_BizApps_Common: Contact Types', key, options, provider, userPayload, pubSub);
1415
1396
  }
1416
1397
  };
1417
1398
  __decorate([
@@ -1492,18 +1473,18 @@ mjBizAppsCommonContactTypeResolver = __decorate([
1492
1473
  ], mjBizAppsCommonContactTypeResolver);
1493
1474
  export { mjBizAppsCommonContactTypeResolver };
1494
1475
  //****************************************************************************
1495
- // ENTITY CLASS for MJ.BizApps.Common: Organization Types
1476
+ // ENTITY CLASS for MJ_BizApps_Common: Organization Types
1496
1477
  //****************************************************************************
1497
1478
  let mjBizAppsCommonOrganizationType_ = class mjBizAppsCommonOrganizationType_ {
1498
1479
  };
1499
1480
  __decorate([
1500
1481
  Field(),
1501
- MaxLength(16),
1482
+ MaxLength(36),
1502
1483
  __metadata("design:type", String)
1503
1484
  ], mjBizAppsCommonOrganizationType_.prototype, "ID", void 0);
1504
1485
  __decorate([
1505
1486
  Field({ description: `Display name for the organization type` }),
1506
- MaxLength(200),
1487
+ MaxLength(100),
1507
1488
  __metadata("design:type", String)
1508
1489
  ], mjBizAppsCommonOrganizationType_.prototype, "Name", void 0);
1509
1490
  __decorate([
@@ -1512,7 +1493,7 @@ __decorate([
1512
1493
  ], mjBizAppsCommonOrganizationType_.prototype, "Description", void 0);
1513
1494
  __decorate([
1514
1495
  Field({ nullable: true, description: `Font Awesome icon class for UI display` }),
1515
- MaxLength(200),
1496
+ MaxLength(100),
1516
1497
  __metadata("design:type", String)
1517
1498
  ], mjBizAppsCommonOrganizationType_.prototype, "IconClass", void 0);
1518
1499
  __decorate([
@@ -1525,12 +1506,10 @@ __decorate([
1525
1506
  ], mjBizAppsCommonOrganizationType_.prototype, "IsActive", void 0);
1526
1507
  __decorate([
1527
1508
  Field(),
1528
- MaxLength(10),
1529
1509
  __metadata("design:type", Date)
1530
1510
  ], mjBizAppsCommonOrganizationType_.prototype, "_mj__CreatedAt", void 0);
1531
1511
  __decorate([
1532
1512
  Field(),
1533
- MaxLength(10),
1534
1513
  __metadata("design:type", Date)
1535
1514
  ], mjBizAppsCommonOrganizationType_.prototype, "_mj__UpdatedAt", void 0);
1536
1515
  __decorate([
@@ -1542,7 +1521,7 @@ mjBizAppsCommonOrganizationType_ = __decorate([
1542
1521
  ], mjBizAppsCommonOrganizationType_);
1543
1522
  export { mjBizAppsCommonOrganizationType_ };
1544
1523
  //****************************************************************************
1545
- // INPUT TYPE for MJ.BizApps.Common: Organization Types
1524
+ // INPUT TYPE for MJ_BizApps_Common: Organization Types
1546
1525
  //****************************************************************************
1547
1526
  let CreatemjBizAppsCommonOrganizationTypeInput = class CreatemjBizAppsCommonOrganizationTypeInput {
1548
1527
  };
@@ -1575,7 +1554,7 @@ CreatemjBizAppsCommonOrganizationTypeInput = __decorate([
1575
1554
  ], CreatemjBizAppsCommonOrganizationTypeInput);
1576
1555
  export { CreatemjBizAppsCommonOrganizationTypeInput };
1577
1556
  //****************************************************************************
1578
- // INPUT TYPE for MJ.BizApps.Common: Organization Types
1557
+ // INPUT TYPE for MJ_BizApps_Common: Organization Types
1579
1558
  //****************************************************************************
1580
1559
  let UpdatemjBizAppsCommonOrganizationTypeInput = class UpdatemjBizAppsCommonOrganizationTypeInput {
1581
1560
  };
@@ -1612,7 +1591,7 @@ UpdatemjBizAppsCommonOrganizationTypeInput = __decorate([
1612
1591
  ], UpdatemjBizAppsCommonOrganizationTypeInput);
1613
1592
  export { UpdatemjBizAppsCommonOrganizationTypeInput };
1614
1593
  //****************************************************************************
1615
- // RESOLVER for MJ.BizApps.Common: Organization Types
1594
+ // RESOLVER for MJ_BizApps_Common: Organization Types
1616
1595
  //****************************************************************************
1617
1596
  let RunmjBizAppsCommonOrganizationTypeViewResult = class RunmjBizAppsCommonOrganizationTypeViewResult {
1618
1597
  };
@@ -1659,39 +1638,37 @@ let mjBizAppsCommonOrganizationTypeResolver = class mjBizAppsCommonOrganizationT
1659
1638
  }
1660
1639
  async RunmjBizAppsCommonOrganizationTypeDynamicView(input, { providers, userPayload }, pubSub) {
1661
1640
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1662
- input.EntityName = 'MJ.BizApps.Common: Organization Types';
1641
+ input.EntityName = 'MJ_BizApps_Common: Organization Types';
1663
1642
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
1664
1643
  }
1665
- async mjBizAppsCommonOrganizationType(ID, { dataSources, userPayload, providers }, pubSub) {
1666
- this.CheckUserReadPermissions('MJ.BizApps.Common: Organization Types', userPayload);
1644
+ async mjBizAppsCommonOrganizationType(ID, { userPayload, providers }, pubSub) {
1645
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Organization Types', userPayload);
1667
1646
  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));
1647
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwOrganizationTypes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Organization Types', userPayload, EntityPermissionType.Read, 'AND');
1648
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
1649
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Organization Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
1672
1650
  return result;
1673
1651
  }
1674
- async mjBizAppsCommonOrganizations_OrganizationTypeIDArray(mjbizappscommonorganizationtype_, { dataSources, userPayload, providers }, pubSub) {
1675
- this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
1652
+ async mjBizAppsCommonOrganizations_OrganizationTypeIDArray(mjbizappscommonorganizationtype_, { userPayload, providers }, pubSub) {
1653
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Organizations', userPayload);
1676
1654
  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));
1655
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwOrganizations')} WHERE ${provider.QuoteIdentifier('OrganizationTypeID')}='${mjbizappscommonorganizationtype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
1656
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
1657
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Organizations', rows, this.GetUserFromPayload(userPayload));
1681
1658
  return result;
1682
1659
  }
1683
1660
  async CreatemjBizAppsCommonOrganizationType(input, { providers, userPayload }, pubSub) {
1684
1661
  const provider = GetReadWriteProvider(providers);
1685
- return this.CreateRecord('MJ.BizApps.Common: Organization Types', input, provider, userPayload, pubSub);
1662
+ return this.CreateRecord('MJ_BizApps_Common: Organization Types', input, provider, userPayload, pubSub);
1686
1663
  }
1687
1664
  async UpdatemjBizAppsCommonOrganizationType(input, { providers, userPayload }, pubSub) {
1688
1665
  const provider = GetReadWriteProvider(providers);
1689
- return this.UpdateRecord('MJ.BizApps.Common: Organization Types', input, provider, userPayload, pubSub);
1666
+ return this.UpdateRecord('MJ_BizApps_Common: Organization Types', input, provider, userPayload, pubSub);
1690
1667
  }
1691
1668
  async DeletemjBizAppsCommonOrganizationType(ID, options, { providers, userPayload }, pubSub) {
1692
1669
  const provider = GetReadWriteProvider(providers);
1693
1670
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
1694
- return this.DeleteRecord('MJ.BizApps.Common: Organization Types', key, options, provider, userPayload, pubSub);
1671
+ return this.DeleteRecord('MJ_BizApps_Common: Organization Types', key, options, provider, userPayload, pubSub);
1695
1672
  }
1696
1673
  };
1697
1674
  __decorate([
@@ -1772,43 +1749,43 @@ mjBizAppsCommonOrganizationTypeResolver = __decorate([
1772
1749
  ], mjBizAppsCommonOrganizationTypeResolver);
1773
1750
  export { mjBizAppsCommonOrganizationTypeResolver };
1774
1751
  //****************************************************************************
1775
- // ENTITY CLASS for MJ.BizApps.Common: Organizations
1752
+ // ENTITY CLASS for MJ_BizApps_Common: Organizations
1776
1753
  //****************************************************************************
1777
1754
  let mjBizAppsCommonOrganization_ = class mjBizAppsCommonOrganization_ {
1778
1755
  };
1779
1756
  __decorate([
1780
1757
  Field(),
1781
- MaxLength(16),
1758
+ MaxLength(36),
1782
1759
  __metadata("design:type", String)
1783
1760
  ], mjBizAppsCommonOrganization_.prototype, "ID", void 0);
1784
1761
  __decorate([
1785
1762
  Field({ description: `Common or display name of the organization` }),
1786
- MaxLength(510),
1763
+ MaxLength(255),
1787
1764
  __metadata("design:type", String)
1788
1765
  ], mjBizAppsCommonOrganization_.prototype, "Name", void 0);
1789
1766
  __decorate([
1790
1767
  Field({ nullable: true, description: `Full legal name if different from display name` }),
1791
- MaxLength(510),
1768
+ MaxLength(255),
1792
1769
  __metadata("design:type", String)
1793
1770
  ], mjBizAppsCommonOrganization_.prototype, "LegalName", void 0);
1794
1771
  __decorate([
1795
1772
  Field({ nullable: true }),
1796
- MaxLength(16),
1773
+ MaxLength(36),
1797
1774
  __metadata("design:type", String)
1798
1775
  ], mjBizAppsCommonOrganization_.prototype, "OrganizationTypeID", void 0);
1799
1776
  __decorate([
1800
1777
  Field({ nullable: true }),
1801
- MaxLength(16),
1778
+ MaxLength(36),
1802
1779
  __metadata("design:type", String)
1803
1780
  ], mjBizAppsCommonOrganization_.prototype, "ParentID", void 0);
1804
1781
  __decorate([
1805
1782
  Field({ nullable: true, description: `Primary website URL` }),
1806
- MaxLength(2000),
1783
+ MaxLength(1000),
1807
1784
  __metadata("design:type", String)
1808
1785
  ], mjBizAppsCommonOrganization_.prototype, "Website", void 0);
1809
1786
  __decorate([
1810
1787
  Field({ nullable: true, description: `URL to organization logo image` }),
1811
- MaxLength(2000),
1788
+ MaxLength(1000),
1812
1789
  __metadata("design:type", String)
1813
1790
  ], mjBizAppsCommonOrganization_.prototype, "LogoURL", void 0);
1814
1791
  __decorate([
@@ -1817,107 +1794,51 @@ __decorate([
1817
1794
  ], mjBizAppsCommonOrganization_.prototype, "Description", void 0);
1818
1795
  __decorate([
1819
1796
  Field({ nullable: true, description: `Primary contact email address` }),
1820
- MaxLength(510),
1797
+ MaxLength(255),
1821
1798
  __metadata("design:type", String)
1822
1799
  ], mjBizAppsCommonOrganization_.prototype, "Email", void 0);
1823
1800
  __decorate([
1824
1801
  Field({ nullable: true, description: `Primary phone number` }),
1825
- MaxLength(100),
1802
+ MaxLength(50),
1826
1803
  __metadata("design:type", String)
1827
1804
  ], mjBizAppsCommonOrganization_.prototype, "Phone", void 0);
1828
1805
  __decorate([
1829
1806
  Field({ nullable: true, description: `Date the organization was founded or incorporated` }),
1830
- MaxLength(3),
1831
1807
  __metadata("design:type", Date)
1832
1808
  ], mjBizAppsCommonOrganization_.prototype, "FoundedDate", void 0);
1833
1809
  __decorate([
1834
1810
  Field({ nullable: true, description: `Tax identification number such as EIN` }),
1835
- MaxLength(100),
1811
+ MaxLength(50),
1836
1812
  __metadata("design:type", String)
1837
1813
  ], mjBizAppsCommonOrganization_.prototype, "TaxID", void 0);
1838
1814
  __decorate([
1839
1815
  Field({ description: `Current status: Active, Inactive, or Dissolved` }),
1840
- MaxLength(100),
1816
+ MaxLength(50),
1841
1817
  __metadata("design:type", String)
1842
1818
  ], mjBizAppsCommonOrganization_.prototype, "Status", void 0);
1843
1819
  __decorate([
1844
1820
  Field(),
1845
- MaxLength(10),
1846
1821
  __metadata("design:type", Date)
1847
1822
  ], mjBizAppsCommonOrganization_.prototype, "_mj__CreatedAt", void 0);
1848
1823
  __decorate([
1849
1824
  Field(),
1850
- MaxLength(10),
1851
1825
  __metadata("design:type", Date)
1852
1826
  ], mjBizAppsCommonOrganization_.prototype, "_mj__UpdatedAt", void 0);
1853
1827
  __decorate([
1854
1828
  Field({ nullable: true }),
1855
- MaxLength(200),
1829
+ MaxLength(100),
1856
1830
  __metadata("design:type", String)
1857
1831
  ], mjBizAppsCommonOrganization_.prototype, "OrganizationType", void 0);
1858
1832
  __decorate([
1859
1833
  Field({ nullable: true }),
1860
- MaxLength(510),
1834
+ MaxLength(255),
1861
1835
  __metadata("design:type", String)
1862
1836
  ], mjBizAppsCommonOrganization_.prototype, "Parent", void 0);
1863
1837
  __decorate([
1864
1838
  Field({ nullable: true }),
1865
- MaxLength(16),
1839
+ MaxLength(36),
1866
1840
  __metadata("design:type", String)
1867
1841
  ], 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
1842
  __decorate([
1922
1843
  Field(() => [mjBizAppsCommonOrganization_]),
1923
1844
  __metadata("design:type", Array)
@@ -1939,7 +1860,7 @@ mjBizAppsCommonOrganization_ = __decorate([
1939
1860
  ], mjBizAppsCommonOrganization_);
1940
1861
  export { mjBizAppsCommonOrganization_ };
1941
1862
  //****************************************************************************
1942
- // INPUT TYPE for MJ.BizApps.Common: Organizations
1863
+ // INPUT TYPE for MJ_BizApps_Common: Organizations
1943
1864
  //****************************************************************************
1944
1865
  let CreatemjBizAppsCommonOrganizationInput = class CreatemjBizAppsCommonOrganizationInput {
1945
1866
  };
@@ -2000,7 +1921,7 @@ CreatemjBizAppsCommonOrganizationInput = __decorate([
2000
1921
  ], CreatemjBizAppsCommonOrganizationInput);
2001
1922
  export { CreatemjBizAppsCommonOrganizationInput };
2002
1923
  //****************************************************************************
2003
- // INPUT TYPE for MJ.BizApps.Common: Organizations
1924
+ // INPUT TYPE for MJ_BizApps_Common: Organizations
2004
1925
  //****************************************************************************
2005
1926
  let UpdatemjBizAppsCommonOrganizationInput = class UpdatemjBizAppsCommonOrganizationInput {
2006
1927
  };
@@ -2065,7 +1986,7 @@ UpdatemjBizAppsCommonOrganizationInput = __decorate([
2065
1986
  ], UpdatemjBizAppsCommonOrganizationInput);
2066
1987
  export { UpdatemjBizAppsCommonOrganizationInput };
2067
1988
  //****************************************************************************
2068
- // RESOLVER for MJ.BizApps.Common: Organizations
1989
+ // RESOLVER for MJ_BizApps_Common: Organizations
2069
1990
  //****************************************************************************
2070
1991
  let RunmjBizAppsCommonOrganizationViewResult = class RunmjBizAppsCommonOrganizationViewResult {
2071
1992
  };
@@ -2112,66 +2033,61 @@ let mjBizAppsCommonOrganizationResolver = class mjBizAppsCommonOrganizationResol
2112
2033
  }
2113
2034
  async RunmjBizAppsCommonOrganizationDynamicView(input, { providers, userPayload }, pubSub) {
2114
2035
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2115
- input.EntityName = 'MJ.BizApps.Common: Organizations';
2036
+ input.EntityName = 'MJ_BizApps_Common: Organizations';
2116
2037
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
2117
2038
  }
2118
- async mjBizAppsCommonOrganization(ID, { dataSources, userPayload, providers }, pubSub) {
2119
- this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
2039
+ async mjBizAppsCommonOrganization(ID, { userPayload, providers }, pubSub) {
2040
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Organizations', userPayload);
2120
2041
  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));
2042
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwOrganizations')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
2043
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2044
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Organizations', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
2125
2045
  return result;
2126
2046
  }
2127
- async mjBizAppsCommonOrganizations_ParentIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2128
- this.CheckUserReadPermissions('MJ.BizApps.Common: Organizations', userPayload);
2047
+ async mjBizAppsCommonOrganizations_ParentIDArray(mjbizappscommonorganization_, { userPayload, providers }, pubSub) {
2048
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Organizations', userPayload);
2129
2049
  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));
2050
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwOrganizations')} WHERE ${provider.QuoteIdentifier('ParentID')}='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Organizations', userPayload, EntityPermissionType.Read, 'AND');
2051
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2052
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Organizations', rows, this.GetUserFromPayload(userPayload));
2134
2053
  return result;
2135
2054
  }
2136
- async mjBizAppsCommonRelationships_ToOrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2137
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2055
+ async mjBizAppsCommonRelationships_ToOrganizationIDArray(mjbizappscommonorganization_, { userPayload, providers }, pubSub) {
2056
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
2138
2057
  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));
2058
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('ToOrganizationID')}='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2059
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2060
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2143
2061
  return result;
2144
2062
  }
2145
- async mjBizAppsCommonContactMethods_OrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2146
- this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
2063
+ async mjBizAppsCommonContactMethods_OrganizationIDArray(mjbizappscommonorganization_, { userPayload, providers }, pubSub) {
2064
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Contact Methods', userPayload);
2147
2065
  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));
2066
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwContactMethods')} WHERE ${provider.QuoteIdentifier('OrganizationID')}='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
2067
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2068
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
2152
2069
  return result;
2153
2070
  }
2154
- async mjBizAppsCommonRelationships_FromOrganizationIDArray(mjbizappscommonorganization_, { dataSources, userPayload, providers }, pubSub) {
2155
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2071
+ async mjBizAppsCommonRelationships_FromOrganizationIDArray(mjbizappscommonorganization_, { userPayload, providers }, pubSub) {
2072
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
2156
2073
  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));
2074
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('FromOrganizationID')}='${mjbizappscommonorganization_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2075
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2076
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2161
2077
  return result;
2162
2078
  }
2163
2079
  async CreatemjBizAppsCommonOrganization(input, { providers, userPayload }, pubSub) {
2164
2080
  const provider = GetReadWriteProvider(providers);
2165
- return this.CreateRecord('MJ.BizApps.Common: Organizations', input, provider, userPayload, pubSub);
2081
+ return this.CreateRecord('MJ_BizApps_Common: Organizations', input, provider, userPayload, pubSub);
2166
2082
  }
2167
2083
  async UpdatemjBizAppsCommonOrganization(input, { providers, userPayload }, pubSub) {
2168
2084
  const provider = GetReadWriteProvider(providers);
2169
- return this.UpdateRecord('MJ.BizApps.Common: Organizations', input, provider, userPayload, pubSub);
2085
+ return this.UpdateRecord('MJ_BizApps_Common: Organizations', input, provider, userPayload, pubSub);
2170
2086
  }
2171
2087
  async DeletemjBizAppsCommonOrganization(ID, options, { providers, userPayload }, pubSub) {
2172
2088
  const provider = GetReadWriteProvider(providers);
2173
2089
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
2174
- return this.DeleteRecord('MJ.BizApps.Common: Organizations', key, options, provider, userPayload, pubSub);
2090
+ return this.DeleteRecord('MJ_BizApps_Common: Organizations', key, options, provider, userPayload, pubSub);
2175
2091
  }
2176
2092
  };
2177
2093
  __decorate([
@@ -2279,73 +2195,72 @@ mjBizAppsCommonOrganizationResolver = __decorate([
2279
2195
  ], mjBizAppsCommonOrganizationResolver);
2280
2196
  export { mjBizAppsCommonOrganizationResolver };
2281
2197
  //****************************************************************************
2282
- // ENTITY CLASS for MJ.BizApps.Common: People
2198
+ // ENTITY CLASS for MJ_BizApps_Common: People
2283
2199
  //****************************************************************************
2284
2200
  let mjBizAppsCommonPerson_ = class mjBizAppsCommonPerson_ {
2285
2201
  };
2286
2202
  __decorate([
2287
2203
  Field(),
2288
- MaxLength(16),
2204
+ MaxLength(36),
2289
2205
  __metadata("design:type", String)
2290
2206
  ], mjBizAppsCommonPerson_.prototype, "ID", void 0);
2291
2207
  __decorate([
2292
2208
  Field({ description: `First (given) name` }),
2293
- MaxLength(200),
2209
+ MaxLength(100),
2294
2210
  __metadata("design:type", String)
2295
2211
  ], mjBizAppsCommonPerson_.prototype, "FirstName", void 0);
2296
2212
  __decorate([
2297
2213
  Field({ description: `Last (family) name` }),
2298
- MaxLength(200),
2214
+ MaxLength(100),
2299
2215
  __metadata("design:type", String)
2300
2216
  ], mjBizAppsCommonPerson_.prototype, "LastName", void 0);
2301
2217
  __decorate([
2302
2218
  Field({ nullable: true, description: `Middle name or initial` }),
2303
- MaxLength(200),
2219
+ MaxLength(100),
2304
2220
  __metadata("design:type", String)
2305
2221
  ], mjBizAppsCommonPerson_.prototype, "MiddleName", void 0);
2306
2222
  __decorate([
2307
2223
  Field({ nullable: true, description: `Name prefix such as Dr., Mr., Ms., Rev.` }),
2308
- MaxLength(40),
2224
+ MaxLength(20),
2309
2225
  __metadata("design:type", String)
2310
2226
  ], mjBizAppsCommonPerson_.prototype, "Prefix", void 0);
2311
2227
  __decorate([
2312
2228
  Field({ nullable: true, description: `Name suffix such as Jr., III, PhD, Esq.` }),
2313
- MaxLength(40),
2229
+ MaxLength(20),
2314
2230
  __metadata("design:type", String)
2315
2231
  ], mjBizAppsCommonPerson_.prototype, "Suffix", void 0);
2316
2232
  __decorate([
2317
2233
  Field({ nullable: true, description: `Nickname or preferred name the person goes by` }),
2318
- MaxLength(200),
2234
+ MaxLength(100),
2319
2235
  __metadata("design:type", String)
2320
2236
  ], mjBizAppsCommonPerson_.prototype, "PreferredName", void 0);
2321
2237
  __decorate([
2322
2238
  Field({ nullable: true, description: `Professional or job title, e.g. VP of Engineering, Board Director` }),
2323
- MaxLength(400),
2239
+ MaxLength(200),
2324
2240
  __metadata("design:type", String)
2325
2241
  ], mjBizAppsCommonPerson_.prototype, "Title", void 0);
2326
2242
  __decorate([
2327
2243
  Field({ nullable: true, description: `Primary email address for this person` }),
2328
- MaxLength(510),
2244
+ MaxLength(255),
2329
2245
  __metadata("design:type", String)
2330
2246
  ], mjBizAppsCommonPerson_.prototype, "Email", void 0);
2331
2247
  __decorate([
2332
2248
  Field({ nullable: true, description: `Primary phone number for this person` }),
2333
- MaxLength(100),
2249
+ MaxLength(50),
2334
2250
  __metadata("design:type", String)
2335
2251
  ], mjBizAppsCommonPerson_.prototype, "Phone", void 0);
2336
2252
  __decorate([
2337
2253
  Field({ nullable: true, description: `Date of birth` }),
2338
- MaxLength(3),
2339
2254
  __metadata("design:type", Date)
2340
2255
  ], mjBizAppsCommonPerson_.prototype, "DateOfBirth", void 0);
2341
2256
  __decorate([
2342
2257
  Field({ nullable: true, description: `Gender identity` }),
2343
- MaxLength(100),
2258
+ MaxLength(50),
2344
2259
  __metadata("design:type", String)
2345
2260
  ], mjBizAppsCommonPerson_.prototype, "Gender", void 0);
2346
2261
  __decorate([
2347
2262
  Field({ nullable: true, description: `URL to profile photo or avatar image` }),
2348
- MaxLength(2000),
2263
+ MaxLength(1000),
2349
2264
  __metadata("design:type", String)
2350
2265
  ], mjBizAppsCommonPerson_.prototype, "PhotoURL", void 0);
2351
2266
  __decorate([
@@ -2354,102 +2269,27 @@ __decorate([
2354
2269
  ], mjBizAppsCommonPerson_.prototype, "Bio", void 0);
2355
2270
  __decorate([
2356
2271
  Field({ nullable: true }),
2357
- MaxLength(16),
2272
+ MaxLength(36),
2358
2273
  __metadata("design:type", String)
2359
2274
  ], mjBizAppsCommonPerson_.prototype, "LinkedUserID", void 0);
2360
2275
  __decorate([
2361
2276
  Field({ description: `Current status: Active, Inactive, or Deceased` }),
2362
- MaxLength(100),
2277
+ MaxLength(50),
2363
2278
  __metadata("design:type", String)
2364
2279
  ], mjBizAppsCommonPerson_.prototype, "Status", void 0);
2365
2280
  __decorate([
2366
2281
  Field(),
2367
- MaxLength(10),
2368
2282
  __metadata("design:type", Date)
2369
2283
  ], mjBizAppsCommonPerson_.prototype, "_mj__CreatedAt", void 0);
2370
2284
  __decorate([
2371
2285
  Field(),
2372
- MaxLength(10),
2373
2286
  __metadata("design:type", Date)
2374
2287
  ], mjBizAppsCommonPerson_.prototype, "_mj__UpdatedAt", void 0);
2375
2288
  __decorate([
2376
2289
  Field({ nullable: true }),
2377
- MaxLength(200),
2290
+ MaxLength(100),
2378
2291
  __metadata("design:type", String)
2379
2292
  ], 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
2293
  __decorate([
2454
2294
  Field(() => [mjBizAppsCommonContactMethod_]),
2455
2295
  __metadata("design:type", Array)
@@ -2467,7 +2307,7 @@ mjBizAppsCommonPerson_ = __decorate([
2467
2307
  ], mjBizAppsCommonPerson_);
2468
2308
  export { mjBizAppsCommonPerson_ };
2469
2309
  //****************************************************************************
2470
- // INPUT TYPE for MJ.BizApps.Common: People
2310
+ // INPUT TYPE for MJ_BizApps_Common: People
2471
2311
  //****************************************************************************
2472
2312
  let CreatemjBizAppsCommonPersonInput = class CreatemjBizAppsCommonPersonInput {
2473
2313
  };
@@ -2540,7 +2380,7 @@ CreatemjBizAppsCommonPersonInput = __decorate([
2540
2380
  ], CreatemjBizAppsCommonPersonInput);
2541
2381
  export { CreatemjBizAppsCommonPersonInput };
2542
2382
  //****************************************************************************
2543
- // INPUT TYPE for MJ.BizApps.Common: People
2383
+ // INPUT TYPE for MJ_BizApps_Common: People
2544
2384
  //****************************************************************************
2545
2385
  let UpdatemjBizAppsCommonPersonInput = class UpdatemjBizAppsCommonPersonInput {
2546
2386
  };
@@ -2617,7 +2457,7 @@ UpdatemjBizAppsCommonPersonInput = __decorate([
2617
2457
  ], UpdatemjBizAppsCommonPersonInput);
2618
2458
  export { UpdatemjBizAppsCommonPersonInput };
2619
2459
  //****************************************************************************
2620
- // RESOLVER for MJ.BizApps.Common: People
2460
+ // RESOLVER for MJ_BizApps_Common: People
2621
2461
  //****************************************************************************
2622
2462
  let RunmjBizAppsCommonPersonViewResult = class RunmjBizAppsCommonPersonViewResult {
2623
2463
  };
@@ -2664,57 +2504,53 @@ let mjBizAppsCommonPersonResolver = class mjBizAppsCommonPersonResolver extends
2664
2504
  }
2665
2505
  async RunmjBizAppsCommonPersonDynamicView(input, { providers, userPayload }, pubSub) {
2666
2506
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2667
- input.EntityName = 'MJ.BizApps.Common: People';
2507
+ input.EntityName = 'MJ_BizApps_Common: People';
2668
2508
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
2669
2509
  }
2670
- async mjBizAppsCommonPerson(ID, { dataSources, userPayload, providers }, pubSub) {
2671
- this.CheckUserReadPermissions('MJ.BizApps.Common: People', userPayload);
2510
+ async mjBizAppsCommonPerson(ID, { userPayload, providers }, pubSub) {
2511
+ this.CheckUserReadPermissions('MJ_BizApps_Common: People', userPayload);
2672
2512
  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));
2513
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwPeople')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: People', userPayload, EntityPermissionType.Read, 'AND');
2514
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2515
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: People', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
2677
2516
  return result;
2678
2517
  }
2679
- async mjBizAppsCommonContactMethods_PersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2680
- this.CheckUserReadPermissions('MJ.BizApps.Common: Contact Methods', userPayload);
2518
+ async mjBizAppsCommonContactMethods_PersonIDArray(mjbizappscommonperson_, { userPayload, providers }, pubSub) {
2519
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Contact Methods', userPayload);
2681
2520
  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));
2521
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwContactMethods')} WHERE ${provider.QuoteIdentifier('PersonID')}='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Contact Methods', userPayload, EntityPermissionType.Read, 'AND');
2522
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2523
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Contact Methods', rows, this.GetUserFromPayload(userPayload));
2686
2524
  return result;
2687
2525
  }
2688
- async mjBizAppsCommonRelationships_ToPersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2689
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2526
+ async mjBizAppsCommonRelationships_ToPersonIDArray(mjbizappscommonperson_, { userPayload, providers }, pubSub) {
2527
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
2690
2528
  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));
2529
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('ToPersonID')}='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2530
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2531
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2695
2532
  return result;
2696
2533
  }
2697
- async mjBizAppsCommonRelationships_FromPersonIDArray(mjbizappscommonperson_, { dataSources, userPayload, providers }, pubSub) {
2698
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2534
+ async mjBizAppsCommonRelationships_FromPersonIDArray(mjbizappscommonperson_, { userPayload, providers }, pubSub) {
2535
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
2699
2536
  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));
2537
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('FromPersonID')}='${mjbizappscommonperson_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2538
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2539
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows, this.GetUserFromPayload(userPayload));
2704
2540
  return result;
2705
2541
  }
2706
2542
  async CreatemjBizAppsCommonPerson(input, { providers, userPayload }, pubSub) {
2707
2543
  const provider = GetReadWriteProvider(providers);
2708
- return this.CreateRecord('MJ.BizApps.Common: People', input, provider, userPayload, pubSub);
2544
+ return this.CreateRecord('MJ_BizApps_Common: People', input, provider, userPayload, pubSub);
2709
2545
  }
2710
2546
  async UpdatemjBizAppsCommonPerson(input, { providers, userPayload }, pubSub) {
2711
2547
  const provider = GetReadWriteProvider(providers);
2712
- return this.UpdateRecord('MJ.BizApps.Common: People', input, provider, userPayload, pubSub);
2548
+ return this.UpdateRecord('MJ_BizApps_Common: People', input, provider, userPayload, pubSub);
2713
2549
  }
2714
2550
  async DeletemjBizAppsCommonPerson(ID, options, { providers, userPayload }, pubSub) {
2715
2551
  const provider = GetReadWriteProvider(providers);
2716
2552
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
2717
- return this.DeleteRecord('MJ.BizApps.Common: People', key, options, provider, userPayload, pubSub);
2553
+ return this.DeleteRecord('MJ_BizApps_Common: People', key, options, provider, userPayload, pubSub);
2718
2554
  }
2719
2555
  };
2720
2556
  __decorate([
@@ -2813,18 +2649,18 @@ mjBizAppsCommonPersonResolver = __decorate([
2813
2649
  ], mjBizAppsCommonPersonResolver);
2814
2650
  export { mjBizAppsCommonPersonResolver };
2815
2651
  //****************************************************************************
2816
- // ENTITY CLASS for MJ.BizApps.Common: Relationship Types
2652
+ // ENTITY CLASS for MJ_BizApps_Common: Relationship Types
2817
2653
  //****************************************************************************
2818
2654
  let mjBizAppsCommonRelationshipType_ = class mjBizAppsCommonRelationshipType_ {
2819
2655
  };
2820
2656
  __decorate([
2821
2657
  Field(),
2822
- MaxLength(16),
2658
+ MaxLength(36),
2823
2659
  __metadata("design:type", String)
2824
2660
  ], mjBizAppsCommonRelationshipType_.prototype, "ID", void 0);
2825
2661
  __decorate([
2826
2662
  Field({ description: `Display name for the relationship type, e.g. Employee, Spouse, Partner` }),
2827
- MaxLength(200),
2663
+ MaxLength(100),
2828
2664
  __metadata("design:type", String)
2829
2665
  ], mjBizAppsCommonRelationshipType_.prototype, "Name", void 0);
2830
2666
  __decorate([
@@ -2833,7 +2669,7 @@ __decorate([
2833
2669
  ], mjBizAppsCommonRelationshipType_.prototype, "Description", void 0);
2834
2670
  __decorate([
2835
2671
  Field({ description: `Which entity types this relationship connects: PersonToPerson, PersonToOrganization, or OrganizationToOrganization` }),
2836
- MaxLength(100),
2672
+ MaxLength(50),
2837
2673
  __metadata("design:type", String)
2838
2674
  ], mjBizAppsCommonRelationshipType_.prototype, "Category", void 0);
2839
2675
  __decorate([
@@ -2842,12 +2678,12 @@ __decorate([
2842
2678
  ], mjBizAppsCommonRelationshipType_.prototype, "IsDirectional", void 0);
2843
2679
  __decorate([
2844
2680
  Field({ nullable: true, description: `Label describing the From-to-To direction, e.g. is employee of, is parent of` }),
2845
- MaxLength(200),
2681
+ MaxLength(100),
2846
2682
  __metadata("design:type", String)
2847
2683
  ], mjBizAppsCommonRelationshipType_.prototype, "ForwardLabel", void 0);
2848
2684
  __decorate([
2849
2685
  Field({ nullable: true, description: `Label describing the To-to-From direction, e.g. employs, is child of` }),
2850
- MaxLength(200),
2686
+ MaxLength(100),
2851
2687
  __metadata("design:type", String)
2852
2688
  ], mjBizAppsCommonRelationshipType_.prototype, "ReverseLabel", void 0);
2853
2689
  __decorate([
@@ -2856,12 +2692,10 @@ __decorate([
2856
2692
  ], mjBizAppsCommonRelationshipType_.prototype, "IsActive", void 0);
2857
2693
  __decorate([
2858
2694
  Field(),
2859
- MaxLength(10),
2860
2695
  __metadata("design:type", Date)
2861
2696
  ], mjBizAppsCommonRelationshipType_.prototype, "_mj__CreatedAt", void 0);
2862
2697
  __decorate([
2863
2698
  Field(),
2864
- MaxLength(10),
2865
2699
  __metadata("design:type", Date)
2866
2700
  ], mjBizAppsCommonRelationshipType_.prototype, "_mj__UpdatedAt", void 0);
2867
2701
  __decorate([
@@ -2873,7 +2707,7 @@ mjBizAppsCommonRelationshipType_ = __decorate([
2873
2707
  ], mjBizAppsCommonRelationshipType_);
2874
2708
  export { mjBizAppsCommonRelationshipType_ };
2875
2709
  //****************************************************************************
2876
- // INPUT TYPE for MJ.BizApps.Common: Relationship Types
2710
+ // INPUT TYPE for MJ_BizApps_Common: Relationship Types
2877
2711
  //****************************************************************************
2878
2712
  let CreatemjBizAppsCommonRelationshipTypeInput = class CreatemjBizAppsCommonRelationshipTypeInput {
2879
2713
  };
@@ -2914,7 +2748,7 @@ CreatemjBizAppsCommonRelationshipTypeInput = __decorate([
2914
2748
  ], CreatemjBizAppsCommonRelationshipTypeInput);
2915
2749
  export { CreatemjBizAppsCommonRelationshipTypeInput };
2916
2750
  //****************************************************************************
2917
- // INPUT TYPE for MJ.BizApps.Common: Relationship Types
2751
+ // INPUT TYPE for MJ_BizApps_Common: Relationship Types
2918
2752
  //****************************************************************************
2919
2753
  let UpdatemjBizAppsCommonRelationshipTypeInput = class UpdatemjBizAppsCommonRelationshipTypeInput {
2920
2754
  };
@@ -2959,7 +2793,7 @@ UpdatemjBizAppsCommonRelationshipTypeInput = __decorate([
2959
2793
  ], UpdatemjBizAppsCommonRelationshipTypeInput);
2960
2794
  export { UpdatemjBizAppsCommonRelationshipTypeInput };
2961
2795
  //****************************************************************************
2962
- // RESOLVER for MJ.BizApps.Common: Relationship Types
2796
+ // RESOLVER for MJ_BizApps_Common: Relationship Types
2963
2797
  //****************************************************************************
2964
2798
  let RunmjBizAppsCommonRelationshipTypeViewResult = class RunmjBizAppsCommonRelationshipTypeViewResult {
2965
2799
  };
@@ -3006,39 +2840,37 @@ let mjBizAppsCommonRelationshipTypeResolver = class mjBizAppsCommonRelationshipT
3006
2840
  }
3007
2841
  async RunmjBizAppsCommonRelationshipTypeDynamicView(input, { providers, userPayload }, pubSub) {
3008
2842
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3009
- input.EntityName = 'MJ.BizApps.Common: Relationship Types';
2843
+ input.EntityName = 'MJ_BizApps_Common: Relationship Types';
3010
2844
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
3011
2845
  }
3012
- async mjBizAppsCommonRelationshipType(ID, { dataSources, userPayload, providers }, pubSub) {
3013
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationship Types', userPayload);
2846
+ async mjBizAppsCommonRelationshipType(ID, { userPayload, providers }, pubSub) {
2847
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationship Types', userPayload);
3014
2848
  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));
2849
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationshipTypes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationship Types', userPayload, EntityPermissionType.Read, 'AND');
2850
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2851
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Relationship Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
3019
2852
  return result;
3020
2853
  }
3021
- async mjBizAppsCommonRelationships_RelationshipTypeIDArray(mjbizappscommonrelationshiptype_, { dataSources, userPayload, providers }, pubSub) {
3022
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
2854
+ async mjBizAppsCommonRelationships_RelationshipTypeIDArray(mjbizappscommonrelationshiptype_, { userPayload, providers }, pubSub) {
2855
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
3023
2856
  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));
2857
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('RelationshipTypeID')}='${mjbizappscommonrelationshiptype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
2858
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
2859
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows, this.GetUserFromPayload(userPayload));
3028
2860
  return result;
3029
2861
  }
3030
2862
  async CreatemjBizAppsCommonRelationshipType(input, { providers, userPayload }, pubSub) {
3031
2863
  const provider = GetReadWriteProvider(providers);
3032
- return this.CreateRecord('MJ.BizApps.Common: Relationship Types', input, provider, userPayload, pubSub);
2864
+ return this.CreateRecord('MJ_BizApps_Common: Relationship Types', input, provider, userPayload, pubSub);
3033
2865
  }
3034
2866
  async UpdatemjBizAppsCommonRelationshipType(input, { providers, userPayload }, pubSub) {
3035
2867
  const provider = GetReadWriteProvider(providers);
3036
- return this.UpdateRecord('MJ.BizApps.Common: Relationship Types', input, provider, userPayload, pubSub);
2868
+ return this.UpdateRecord('MJ_BizApps_Common: Relationship Types', input, provider, userPayload, pubSub);
3037
2869
  }
3038
2870
  async DeletemjBizAppsCommonRelationshipType(ID, options, { providers, userPayload }, pubSub) {
3039
2871
  const provider = GetReadWriteProvider(providers);
3040
2872
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
3041
- return this.DeleteRecord('MJ.BizApps.Common: Relationship Types', key, options, provider, userPayload, pubSub);
2873
+ return this.DeleteRecord('MJ_BizApps_Common: Relationship Types', key, options, provider, userPayload, pubSub);
3042
2874
  }
3043
2875
  };
3044
2876
  __decorate([
@@ -3119,58 +2951,56 @@ mjBizAppsCommonRelationshipTypeResolver = __decorate([
3119
2951
  ], mjBizAppsCommonRelationshipTypeResolver);
3120
2952
  export { mjBizAppsCommonRelationshipTypeResolver };
3121
2953
  //****************************************************************************
3122
- // ENTITY CLASS for MJ.BizApps.Common: Relationships
2954
+ // ENTITY CLASS for MJ_BizApps_Common: Relationships
3123
2955
  //****************************************************************************
3124
2956
  let mjBizAppsCommonRelationship_ = class mjBizAppsCommonRelationship_ {
3125
2957
  };
3126
2958
  __decorate([
3127
2959
  Field(),
3128
- MaxLength(16),
2960
+ MaxLength(36),
3129
2961
  __metadata("design:type", String)
3130
2962
  ], mjBizAppsCommonRelationship_.prototype, "ID", void 0);
3131
2963
  __decorate([
3132
2964
  Field(),
3133
- MaxLength(16),
2965
+ MaxLength(36),
3134
2966
  __metadata("design:type", String)
3135
2967
  ], mjBizAppsCommonRelationship_.prototype, "RelationshipTypeID", void 0);
3136
2968
  __decorate([
3137
2969
  Field({ nullable: true }),
3138
- MaxLength(16),
2970
+ MaxLength(36),
3139
2971
  __metadata("design:type", String)
3140
2972
  ], mjBizAppsCommonRelationship_.prototype, "FromPersonID", void 0);
3141
2973
  __decorate([
3142
2974
  Field({ nullable: true }),
3143
- MaxLength(16),
2975
+ MaxLength(36),
3144
2976
  __metadata("design:type", String)
3145
2977
  ], mjBizAppsCommonRelationship_.prototype, "FromOrganizationID", void 0);
3146
2978
  __decorate([
3147
2979
  Field({ nullable: true }),
3148
- MaxLength(16),
2980
+ MaxLength(36),
3149
2981
  __metadata("design:type", String)
3150
2982
  ], mjBizAppsCommonRelationship_.prototype, "ToPersonID", void 0);
3151
2983
  __decorate([
3152
2984
  Field({ nullable: true }),
3153
- MaxLength(16),
2985
+ MaxLength(36),
3154
2986
  __metadata("design:type", String)
3155
2987
  ], mjBizAppsCommonRelationship_.prototype, "ToOrganizationID", void 0);
3156
2988
  __decorate([
3157
2989
  Field({ nullable: true, description: `Contextual title for this specific relationship, e.g. CEO, Primary Contact, Founding Member` }),
3158
- MaxLength(510),
2990
+ MaxLength(255),
3159
2991
  __metadata("design:type", String)
3160
2992
  ], mjBizAppsCommonRelationship_.prototype, "Title", void 0);
3161
2993
  __decorate([
3162
2994
  Field({ nullable: true, description: `Date the relationship began` }),
3163
- MaxLength(3),
3164
2995
  __metadata("design:type", Date)
3165
2996
  ], mjBizAppsCommonRelationship_.prototype, "StartDate", void 0);
3166
2997
  __decorate([
3167
2998
  Field({ nullable: true, description: `Date the relationship ended, if applicable` }),
3168
- MaxLength(3),
3169
2999
  __metadata("design:type", Date)
3170
3000
  ], mjBizAppsCommonRelationship_.prototype, "EndDate", void 0);
3171
3001
  __decorate([
3172
3002
  Field({ description: `Current status: Active, Inactive, or Ended` }),
3173
- MaxLength(100),
3003
+ MaxLength(50),
3174
3004
  __metadata("design:type", String)
3175
3005
  ], mjBizAppsCommonRelationship_.prototype, "Status", void 0);
3176
3006
  __decorate([
@@ -3179,37 +3009,35 @@ __decorate([
3179
3009
  ], mjBizAppsCommonRelationship_.prototype, "Notes", void 0);
3180
3010
  __decorate([
3181
3011
  Field(),
3182
- MaxLength(10),
3183
3012
  __metadata("design:type", Date)
3184
3013
  ], mjBizAppsCommonRelationship_.prototype, "_mj__CreatedAt", void 0);
3185
3014
  __decorate([
3186
3015
  Field(),
3187
- MaxLength(10),
3188
3016
  __metadata("design:type", Date)
3189
3017
  ], mjBizAppsCommonRelationship_.prototype, "_mj__UpdatedAt", void 0);
3190
3018
  __decorate([
3191
3019
  Field(),
3192
- MaxLength(200),
3020
+ MaxLength(100),
3193
3021
  __metadata("design:type", String)
3194
3022
  ], mjBizAppsCommonRelationship_.prototype, "RelationshipType", void 0);
3195
3023
  __decorate([
3196
3024
  Field({ nullable: true }),
3197
- MaxLength(200),
3025
+ MaxLength(100),
3198
3026
  __metadata("design:type", String)
3199
3027
  ], mjBizAppsCommonRelationship_.prototype, "FromPerson", void 0);
3200
3028
  __decorate([
3201
3029
  Field({ nullable: true }),
3202
- MaxLength(510),
3030
+ MaxLength(255),
3203
3031
  __metadata("design:type", String)
3204
3032
  ], mjBizAppsCommonRelationship_.prototype, "FromOrganization", void 0);
3205
3033
  __decorate([
3206
3034
  Field({ nullable: true }),
3207
- MaxLength(200),
3035
+ MaxLength(100),
3208
3036
  __metadata("design:type", String)
3209
3037
  ], mjBizAppsCommonRelationship_.prototype, "ToPerson", void 0);
3210
3038
  __decorate([
3211
3039
  Field({ nullable: true }),
3212
- MaxLength(510),
3040
+ MaxLength(255),
3213
3041
  __metadata("design:type", String)
3214
3042
  ], mjBizAppsCommonRelationship_.prototype, "ToOrganization", void 0);
3215
3043
  mjBizAppsCommonRelationship_ = __decorate([
@@ -3217,7 +3045,7 @@ mjBizAppsCommonRelationship_ = __decorate([
3217
3045
  ], mjBizAppsCommonRelationship_);
3218
3046
  export { mjBizAppsCommonRelationship_ };
3219
3047
  //****************************************************************************
3220
- // INPUT TYPE for MJ.BizApps.Common: Relationships
3048
+ // INPUT TYPE for MJ_BizApps_Common: Relationships
3221
3049
  //****************************************************************************
3222
3050
  let CreatemjBizAppsCommonRelationshipInput = class CreatemjBizAppsCommonRelationshipInput {
3223
3051
  };
@@ -3270,7 +3098,7 @@ CreatemjBizAppsCommonRelationshipInput = __decorate([
3270
3098
  ], CreatemjBizAppsCommonRelationshipInput);
3271
3099
  export { CreatemjBizAppsCommonRelationshipInput };
3272
3100
  //****************************************************************************
3273
- // INPUT TYPE for MJ.BizApps.Common: Relationships
3101
+ // INPUT TYPE for MJ_BizApps_Common: Relationships
3274
3102
  //****************************************************************************
3275
3103
  let UpdatemjBizAppsCommonRelationshipInput = class UpdatemjBizAppsCommonRelationshipInput {
3276
3104
  };
@@ -3327,7 +3155,7 @@ UpdatemjBizAppsCommonRelationshipInput = __decorate([
3327
3155
  ], UpdatemjBizAppsCommonRelationshipInput);
3328
3156
  export { UpdatemjBizAppsCommonRelationshipInput };
3329
3157
  //****************************************************************************
3330
- // RESOLVER for MJ.BizApps.Common: Relationships
3158
+ // RESOLVER for MJ_BizApps_Common: Relationships
3331
3159
  //****************************************************************************
3332
3160
  let RunmjBizAppsCommonRelationshipViewResult = class RunmjBizAppsCommonRelationshipViewResult {
3333
3161
  };
@@ -3374,30 +3202,29 @@ let mjBizAppsCommonRelationshipResolver = class mjBizAppsCommonRelationshipResol
3374
3202
  }
3375
3203
  async RunmjBizAppsCommonRelationshipDynamicView(input, { providers, userPayload }, pubSub) {
3376
3204
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3377
- input.EntityName = 'MJ.BizApps.Common: Relationships';
3205
+ input.EntityName = 'MJ_BizApps_Common: Relationships';
3378
3206
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
3379
3207
  }
3380
- async mjBizAppsCommonRelationship(ID, { dataSources, userPayload, providers }, pubSub) {
3381
- this.CheckUserReadPermissions('MJ.BizApps.Common: Relationships', userPayload);
3208
+ async mjBizAppsCommonRelationship(ID, { userPayload, providers }, pubSub) {
3209
+ this.CheckUserReadPermissions('MJ_BizApps_Common: Relationships', userPayload);
3382
3210
  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));
3211
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsCommon', 'vwRelationships')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Common: Relationships', userPayload, EntityPermissionType.Read, 'AND');
3212
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
3213
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Common: Relationships', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
3387
3214
  return result;
3388
3215
  }
3389
3216
  async CreatemjBizAppsCommonRelationship(input, { providers, userPayload }, pubSub) {
3390
3217
  const provider = GetReadWriteProvider(providers);
3391
- return this.CreateRecord('MJ.BizApps.Common: Relationships', input, provider, userPayload, pubSub);
3218
+ return this.CreateRecord('MJ_BizApps_Common: Relationships', input, provider, userPayload, pubSub);
3392
3219
  }
3393
3220
  async UpdatemjBizAppsCommonRelationship(input, { providers, userPayload }, pubSub) {
3394
3221
  const provider = GetReadWriteProvider(providers);
3395
- return this.UpdateRecord('MJ.BizApps.Common: Relationships', input, provider, userPayload, pubSub);
3222
+ return this.UpdateRecord('MJ_BizApps_Common: Relationships', input, provider, userPayload, pubSub);
3396
3223
  }
3397
3224
  async DeletemjBizAppsCommonRelationship(ID, options, { providers, userPayload }, pubSub) {
3398
3225
  const provider = GetReadWriteProvider(providers);
3399
3226
  const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
3400
- return this.DeleteRecord('MJ.BizApps.Common: Relationships', key, options, provider, userPayload, pubSub);
3227
+ return this.DeleteRecord('MJ_BizApps_Common: Relationships', key, options, provider, userPayload, pubSub);
3401
3228
  }
3402
3229
  };
3403
3230
  __decorate([