@mj-biz-apps/sales-server 6.24.1 → 6.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3031,7 +3031,7 @@ __decorate([
3031
3031
  __metadata("design:type", String)
3032
3032
  ], mjBizAppsSalesDeal_.prototype, "BillingContactID", void 0);
3033
3033
  __decorate([
3034
- Field({ nullable: true, description: "The company selling the deal. It must match the pipeline's company." }),
3034
+ Field({ nullable: true, description: "The SELLING company, chosen by the rep. Must be actively linked to the deal's pipeline through PipelineCompany; enforced by the entity server, since a CHECK cannot reach across the link. FK to __mj.Company." }),
3035
3035
  MaxLength(36),
3036
3036
  __metadata("design:type", String)
3037
3037
  ], mjBizAppsSalesDeal_.prototype, "CompanyID", void 0);
@@ -5464,6 +5464,259 @@ mjBizAppsSalesLossReasonResolver = __decorate([
5464
5464
  ], mjBizAppsSalesLossReasonResolver);
5465
5465
  export { mjBizAppsSalesLossReasonResolver };
5466
5466
  //****************************************************************************
5467
+ // ENTITY CLASS for MJ_BizApps_Sales: Pipeline Companies
5468
+ //****************************************************************************
5469
+ let mjBizAppsSalesPipelineCompany_ = class mjBizAppsSalesPipelineCompany_ {
5470
+ };
5471
+ __decorate([
5472
+ Field(),
5473
+ MaxLength(36),
5474
+ __metadata("design:type", String)
5475
+ ], mjBizAppsSalesPipelineCompany_.prototype, "ID", void 0);
5476
+ __decorate([
5477
+ Field({ nullable: true, description: "The pipeline the company sells through." }),
5478
+ MaxLength(36),
5479
+ __metadata("design:type", String)
5480
+ ], mjBizAppsSalesPipelineCompany_.prototype, "PipelineID", void 0);
5481
+ __decorate([
5482
+ Field({ nullable: true, description: "The selling company. Deals for this company can use the pipeline while the link is active." }),
5483
+ MaxLength(36),
5484
+ __metadata("design:type", String)
5485
+ ], mjBizAppsSalesPipelineCompany_.prototype, "CompanyID", void 0);
5486
+ __decorate([
5487
+ Field(() => Boolean, { nullable: true, description: "Whether new deals for the company can choose the pipeline. Clearing it retires the link without touching existing deals on the pipeline." }),
5488
+ __metadata("design:type", Boolean)
5489
+ ], mjBizAppsSalesPipelineCompany_.prototype, "IsActive", void 0);
5490
+ __decorate([
5491
+ Field(),
5492
+ __metadata("design:type", Date)
5493
+ ], mjBizAppsSalesPipelineCompany_.prototype, "_mj__CreatedAt", void 0);
5494
+ __decorate([
5495
+ Field(),
5496
+ __metadata("design:type", Date)
5497
+ ], mjBizAppsSalesPipelineCompany_.prototype, "_mj__UpdatedAt", void 0);
5498
+ __decorate([
5499
+ Field({ nullable: true }),
5500
+ MaxLength(200),
5501
+ __metadata("design:type", String)
5502
+ ], mjBizAppsSalesPipelineCompany_.prototype, "Pipeline", void 0);
5503
+ __decorate([
5504
+ Field({ nullable: true }),
5505
+ MaxLength(50),
5506
+ __metadata("design:type", String)
5507
+ ], mjBizAppsSalesPipelineCompany_.prototype, "Company", void 0);
5508
+ __decorate([
5509
+ Field(() => [String], { nullable: true, description: `Field-level security: when non-null, the fields on this entity the calling user may read. Any other field arriving as null was withheld by the server rather than genuinely empty. Null for callers with no field restrictions.` }),
5510
+ __metadata("design:type", Array)
5511
+ ], mjBizAppsSalesPipelineCompany_.prototype, "ReadableFields___", void 0);
5512
+ mjBizAppsSalesPipelineCompany_ = __decorate([
5513
+ ObjectType({ description: "Links a pipeline to a company that sells through it. A pipeline can serve several companies; a deal's company must be actively linked to the deal's pipeline." })
5514
+ ], mjBizAppsSalesPipelineCompany_);
5515
+ export { mjBizAppsSalesPipelineCompany_ };
5516
+ //****************************************************************************
5517
+ // INPUT TYPE for MJ_BizApps_Sales: Pipeline Companies
5518
+ //****************************************************************************
5519
+ let CreatemjBizAppsSalesPipelineCompanyInput = class CreatemjBizAppsSalesPipelineCompanyInput {
5520
+ };
5521
+ __decorate([
5522
+ Field({ nullable: true }),
5523
+ __metadata("design:type", String)
5524
+ ], CreatemjBizAppsSalesPipelineCompanyInput.prototype, "ID", void 0);
5525
+ __decorate([
5526
+ Field({ nullable: true }),
5527
+ __metadata("design:type", String)
5528
+ ], CreatemjBizAppsSalesPipelineCompanyInput.prototype, "PipelineID", void 0);
5529
+ __decorate([
5530
+ Field({ nullable: true }),
5531
+ __metadata("design:type", String)
5532
+ ], CreatemjBizAppsSalesPipelineCompanyInput.prototype, "CompanyID", void 0);
5533
+ __decorate([
5534
+ Field(() => Boolean, { nullable: true }),
5535
+ __metadata("design:type", Boolean)
5536
+ ], CreatemjBizAppsSalesPipelineCompanyInput.prototype, "IsActive", void 0);
5537
+ __decorate([
5538
+ Field(() => RestoreContextInput, { nullable: true }),
5539
+ __metadata("design:type", RestoreContextInput)
5540
+ ], CreatemjBizAppsSalesPipelineCompanyInput.prototype, "RestoreContext___", void 0);
5541
+ CreatemjBizAppsSalesPipelineCompanyInput = __decorate([
5542
+ InputType()
5543
+ ], CreatemjBizAppsSalesPipelineCompanyInput);
5544
+ export { CreatemjBizAppsSalesPipelineCompanyInput };
5545
+ //****************************************************************************
5546
+ // INPUT TYPE for MJ_BizApps_Sales: Pipeline Companies
5547
+ //****************************************************************************
5548
+ let UpdatemjBizAppsSalesPipelineCompanyInput = class UpdatemjBizAppsSalesPipelineCompanyInput {
5549
+ };
5550
+ __decorate([
5551
+ Field(),
5552
+ __metadata("design:type", String)
5553
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "ID", void 0);
5554
+ __decorate([
5555
+ Field({ nullable: true }),
5556
+ __metadata("design:type", String)
5557
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "PipelineID", void 0);
5558
+ __decorate([
5559
+ Field({ nullable: true }),
5560
+ __metadata("design:type", String)
5561
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "CompanyID", void 0);
5562
+ __decorate([
5563
+ Field(() => Boolean, { nullable: true }),
5564
+ __metadata("design:type", Boolean)
5565
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "IsActive", void 0);
5566
+ __decorate([
5567
+ Field(() => [KeyValuePairInput], { nullable: true }),
5568
+ __metadata("design:type", Array)
5569
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "OldValues___", void 0);
5570
+ __decorate([
5571
+ Field(() => RestoreContextInput, { nullable: true }),
5572
+ __metadata("design:type", RestoreContextInput)
5573
+ ], UpdatemjBizAppsSalesPipelineCompanyInput.prototype, "RestoreContext___", void 0);
5574
+ UpdatemjBizAppsSalesPipelineCompanyInput = __decorate([
5575
+ InputType()
5576
+ ], UpdatemjBizAppsSalesPipelineCompanyInput);
5577
+ export { UpdatemjBizAppsSalesPipelineCompanyInput };
5578
+ //****************************************************************************
5579
+ // RESOLVER for MJ_BizApps_Sales: Pipeline Companies
5580
+ //****************************************************************************
5581
+ let RunmjBizAppsSalesPipelineCompanyViewResult = class RunmjBizAppsSalesPipelineCompanyViewResult {
5582
+ };
5583
+ __decorate([
5584
+ Field(() => [mjBizAppsSalesPipelineCompany_]),
5585
+ __metadata("design:type", Array)
5586
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "Results", void 0);
5587
+ __decorate([
5588
+ Field(() => String, { nullable: true }),
5589
+ __metadata("design:type", String)
5590
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "UserViewRunID", void 0);
5591
+ __decorate([
5592
+ Field(() => Int, { nullable: true }),
5593
+ __metadata("design:type", Number)
5594
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "RowCount", void 0);
5595
+ __decorate([
5596
+ Field(() => Int, { nullable: true }),
5597
+ __metadata("design:type", Number)
5598
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "TotalRowCount", void 0);
5599
+ __decorate([
5600
+ Field(() => Int, { nullable: true }),
5601
+ __metadata("design:type", Number)
5602
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "ExecutionTime", void 0);
5603
+ __decorate([
5604
+ Field({ nullable: true }),
5605
+ __metadata("design:type", String)
5606
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "ErrorMessage", void 0);
5607
+ __decorate([
5608
+ Field(() => Boolean, { nullable: false }),
5609
+ __metadata("design:type", Boolean)
5610
+ ], RunmjBizAppsSalesPipelineCompanyViewResult.prototype, "Success", void 0);
5611
+ RunmjBizAppsSalesPipelineCompanyViewResult = __decorate([
5612
+ ObjectType()
5613
+ ], RunmjBizAppsSalesPipelineCompanyViewResult);
5614
+ export { RunmjBizAppsSalesPipelineCompanyViewResult };
5615
+ let mjBizAppsSalesPipelineCompanyResolver = class mjBizAppsSalesPipelineCompanyResolver extends ResolverBase {
5616
+ async RunmjBizAppsSalesPipelineCompanyViewByID(input, { providers, userPayload }, pubSub) {
5617
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5618
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
5619
+ }
5620
+ async RunmjBizAppsSalesPipelineCompanyViewByName(input, { providers, userPayload }, pubSub) {
5621
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5622
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
5623
+ }
5624
+ async RunmjBizAppsSalesPipelineCompanyDynamicView(input, { providers, userPayload }, pubSub) {
5625
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5626
+ input.EntityName = 'MJ_BizApps_Sales: Pipeline Companies';
5627
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
5628
+ }
5629
+ async mjBizAppsSalesPipelineCompany(ID, { userPayload, providers }, pubSub) {
5630
+ this.CheckUserReadPermissions('MJ_BizApps_Sales: Pipeline Companies', userPayload);
5631
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5632
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView('__mj_BizAppsSales', 'vwPipelineCompanies')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ_BizApps_Sales: Pipeline Companies', userPayload, EntityPermissionType.Read, 'AND');
5633
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
5634
+ const result = await this.MapFieldNamesToCodeNames('MJ_BizApps_Sales: Pipeline Companies', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
5635
+ return result;
5636
+ }
5637
+ async CreatemjBizAppsSalesPipelineCompany(input, { providers, userPayload }, pubSub) {
5638
+ const provider = GetReadWriteProvider(providers);
5639
+ return this.CreateRecord('MJ_BizApps_Sales: Pipeline Companies', input, provider, userPayload, pubSub);
5640
+ }
5641
+ async UpdatemjBizAppsSalesPipelineCompany(input, { providers, userPayload }, pubSub) {
5642
+ const provider = GetReadWriteProvider(providers);
5643
+ return this.UpdateRecord('MJ_BizApps_Sales: Pipeline Companies', input, provider, userPayload, pubSub);
5644
+ }
5645
+ async DeletemjBizAppsSalesPipelineCompany(ID, options, { providers, userPayload }, pubSub) {
5646
+ const provider = GetReadWriteProvider(providers);
5647
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
5648
+ return this.DeleteRecord('MJ_BizApps_Sales: Pipeline Companies', key, options, provider, userPayload, pubSub);
5649
+ }
5650
+ };
5651
+ __decorate([
5652
+ Query(() => RunmjBizAppsSalesPipelineCompanyViewResult),
5653
+ __param(0, Arg('input', () => RunViewByIDInput)),
5654
+ __param(1, Ctx()),
5655
+ __param(2, PubSub()),
5656
+ __metadata("design:type", Function),
5657
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
5658
+ __metadata("design:returntype", Promise)
5659
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "RunmjBizAppsSalesPipelineCompanyViewByID", null);
5660
+ __decorate([
5661
+ Query(() => RunmjBizAppsSalesPipelineCompanyViewResult),
5662
+ __param(0, Arg('input', () => RunViewByNameInput)),
5663
+ __param(1, Ctx()),
5664
+ __param(2, PubSub()),
5665
+ __metadata("design:type", Function),
5666
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
5667
+ __metadata("design:returntype", Promise)
5668
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "RunmjBizAppsSalesPipelineCompanyViewByName", null);
5669
+ __decorate([
5670
+ Query(() => RunmjBizAppsSalesPipelineCompanyViewResult),
5671
+ __param(0, Arg('input', () => RunDynamicViewInput)),
5672
+ __param(1, Ctx()),
5673
+ __param(2, PubSub()),
5674
+ __metadata("design:type", Function),
5675
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
5676
+ __metadata("design:returntype", Promise)
5677
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "RunmjBizAppsSalesPipelineCompanyDynamicView", null);
5678
+ __decorate([
5679
+ Query(() => mjBizAppsSalesPipelineCompany_, { nullable: true }),
5680
+ __param(0, Arg('ID', () => String)),
5681
+ __param(1, Ctx()),
5682
+ __param(2, PubSub()),
5683
+ __metadata("design:type", Function),
5684
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
5685
+ __metadata("design:returntype", Promise)
5686
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "mjBizAppsSalesPipelineCompany", null);
5687
+ __decorate([
5688
+ Mutation(() => mjBizAppsSalesPipelineCompany_),
5689
+ __param(0, Arg('input', () => CreatemjBizAppsSalesPipelineCompanyInput)),
5690
+ __param(1, Ctx()),
5691
+ __param(2, PubSub()),
5692
+ __metadata("design:type", Function),
5693
+ __metadata("design:paramtypes", [CreatemjBizAppsSalesPipelineCompanyInput, Object, PubSubEngine]),
5694
+ __metadata("design:returntype", Promise)
5695
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "CreatemjBizAppsSalesPipelineCompany", null);
5696
+ __decorate([
5697
+ Mutation(() => mjBizAppsSalesPipelineCompany_),
5698
+ __param(0, Arg('input', () => UpdatemjBizAppsSalesPipelineCompanyInput)),
5699
+ __param(1, Ctx()),
5700
+ __param(2, PubSub()),
5701
+ __metadata("design:type", Function),
5702
+ __metadata("design:paramtypes", [UpdatemjBizAppsSalesPipelineCompanyInput, Object, PubSubEngine]),
5703
+ __metadata("design:returntype", Promise)
5704
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "UpdatemjBizAppsSalesPipelineCompany", null);
5705
+ __decorate([
5706
+ Mutation(() => mjBizAppsSalesPipelineCompany_),
5707
+ __param(0, Arg('ID', () => String)),
5708
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
5709
+ __param(2, Ctx()),
5710
+ __param(3, PubSub()),
5711
+ __metadata("design:type", Function),
5712
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
5713
+ __metadata("design:returntype", Promise)
5714
+ ], mjBizAppsSalesPipelineCompanyResolver.prototype, "DeletemjBizAppsSalesPipelineCompany", null);
5715
+ mjBizAppsSalesPipelineCompanyResolver = __decorate([
5716
+ Resolver(mjBizAppsSalesPipelineCompany_)
5717
+ ], mjBizAppsSalesPipelineCompanyResolver);
5718
+ export { mjBizAppsSalesPipelineCompanyResolver };
5719
+ //****************************************************************************
5467
5720
  // ENTITY CLASS for MJ_BizApps_Sales: Pipeline Stages
5468
5721
  //****************************************************************************
5469
5722
  let mjBizAppsSalesPipelineStage_ = class mjBizAppsSalesPipelineStage_ {
@@ -5867,18 +6120,13 @@ __decorate([
5867
6120
  MaxLength(36),
5868
6121
  __metadata("design:type", String)
5869
6122
  ], mjBizAppsSalesPipeline_.prototype, "ID", void 0);
5870
- __decorate([
5871
- Field({ nullable: true, description: "The company that owns this pipeline. Every deal in the pipeline belongs to this company." }),
5872
- MaxLength(36),
5873
- __metadata("design:type", String)
5874
- ], mjBizAppsSalesPipeline_.prototype, "CompanyID", void 0);
5875
6123
  __decorate([
5876
6124
  Field({ nullable: true }),
5877
6125
  MaxLength(200),
5878
6126
  __metadata("design:type", String)
5879
6127
  ], mjBizAppsSalesPipeline_.prototype, "Name", void 0);
5880
6128
  __decorate([
5881
- Field({ nullable: true, description: "Short identifier for the pipeline, unique within its company." }),
6129
+ Field({ nullable: true, description: "Short code for the pipeline. Not unique: deployments that copied the default pipeline per company hold several pipelines with the same code." }),
5882
6130
  MaxLength(40),
5883
6131
  __metadata("design:type", String)
5884
6132
  ], mjBizAppsSalesPipeline_.prototype, "Code", void 0);
@@ -5933,11 +6181,6 @@ __decorate([
5933
6181
  MaxLength(36),
5934
6182
  __metadata("design:type", String)
5935
6183
  ], mjBizAppsSalesPipeline_.prototype, "CloseWonAssigneePersonID", void 0);
5936
- __decorate([
5937
- Field({ nullable: true }),
5938
- MaxLength(50),
5939
- __metadata("design:type", String)
5940
- ], mjBizAppsSalesPipeline_.prototype, "Company", void 0);
5941
6184
  __decorate([
5942
6185
  Field({ nullable: true }),
5943
6186
  MaxLength(200),
@@ -5958,7 +6201,7 @@ __decorate([
5958
6201
  __metadata("design:type", Array)
5959
6202
  ], mjBizAppsSalesPipeline_.prototype, "ReadableFields___", void 0);
5960
6203
  mjBizAppsSalesPipeline_ = __decorate([
5961
- ObjectType({ description: "A sales pipeline, owned by exactly one company. A company may have any number of pipelines; a pipeline may have any number of deals." })
6204
+ ObjectType({ description: "A sales pipeline: an ordered set of stages a deal moves through. Serves every company it is actively linked to through PipelineCompany." })
5962
6205
  ], mjBizAppsSalesPipeline_);
5963
6206
  export { mjBizAppsSalesPipeline_ };
5964
6207
  //****************************************************************************
@@ -5970,10 +6213,6 @@ __decorate([
5970
6213
  Field({ nullable: true }),
5971
6214
  __metadata("design:type", String)
5972
6215
  ], CreatemjBizAppsSalesPipelineInput.prototype, "ID", void 0);
5973
- __decorate([
5974
- Field({ nullable: true }),
5975
- __metadata("design:type", String)
5976
- ], CreatemjBizAppsSalesPipelineInput.prototype, "CompanyID", void 0);
5977
6216
  __decorate([
5978
6217
  Field({ nullable: true }),
5979
6218
  __metadata("design:type", String)
@@ -6039,10 +6278,6 @@ __decorate([
6039
6278
  Field(),
6040
6279
  __metadata("design:type", String)
6041
6280
  ], UpdatemjBizAppsSalesPipelineInput.prototype, "ID", void 0);
6042
- __decorate([
6043
- Field({ nullable: true }),
6044
- __metadata("design:type", String)
6045
- ], UpdatemjBizAppsSalesPipelineInput.prototype, "CompanyID", void 0);
6046
6281
  __decorate([
6047
6282
  Field({ nullable: true }),
6048
6283
  __metadata("design:type", String)