@flarehr/apollo-super-selection 1.2.29920 → 1.2.30007

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.
Files changed (37) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/{p-d4911431.entry.js → p-b5b3c238.entry.js} +4 -4
  3. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  4. package/dist/lib/apollo-super-selection/p-cdbd526c.system.entry.js +69 -0
  5. package/dist/lib/cjs/sss-button_30.cjs.entry.js +109 -70
  6. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +12 -0
  7. package/dist/lib/collection/components/super-selection-app/consent/consent.js +2 -6
  8. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +1 -4
  9. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +1 -8
  10. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +2 -6
  11. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.js +9 -0
  12. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +4 -5
  13. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v1-iframe-builder.js +1 -10
  14. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-iframe-builder.js +14 -14
  15. package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +1 -8
  16. package/dist/lib/collection/components/super-selection-app/services/misc.service.js +7 -0
  17. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +27 -0
  18. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +4 -1
  19. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +25 -8
  20. package/dist/lib/esm/sss-button_30.entry.js +109 -70
  21. package/dist/lib/esm-es5/sss-button_30.entry.js +4 -4
  22. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +2 -6
  23. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +3 -1
  24. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +15 -0
  25. package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +0 -1
  26. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +3 -0
  27. package/dist/lib/types/components/super-selection-app/funds/custom-fund/member-name-input.d.ts +1 -1
  28. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.d.ts +2 -1
  29. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.d.ts +12 -0
  30. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +3 -2
  31. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/types.d.ts +1 -0
  32. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.d.ts +3 -0
  33. package/dist/lib/types/components/super-selection-app/services/misc.service.d.ts +6 -0
  34. package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +9 -1
  35. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +4 -1
  36. package/package.json +1 -1
  37. package/dist/lib/apollo-super-selection/p-89c33b9e.system.entry.js +0 -69
@@ -264,7 +264,7 @@ class TapSubscriber extends datoramaAkita.Subscriber {
264
264
  }
265
265
  }
266
266
 
267
- const AppVersion = '1.2.29920';
267
+ const AppVersion = '1.2.30007';
268
268
 
269
269
  // -------------------------------------------------------------------------------------
270
270
  // guards
@@ -3305,6 +3305,18 @@ class SuperSelectionApi {
3305
3305
  })
3306
3306
  .json();
3307
3307
  }
3308
+ async getCampaignConnectAsync() {
3309
+ return buildBackendApiClient()
3310
+ .url('compaign-connect')
3311
+ .get()
3312
+ .notFound(() => {
3313
+ throw new Error('Failed to fetch campaign connect.');
3314
+ })
3315
+ .json();
3316
+ }
3317
+ async clickPromotedTileAsync(payload) {
3318
+ return buildBackendApiClient().url('click-promoted-tile').post(payload).res();
3319
+ }
3308
3320
  toSearchFilterQueryString(searchFilter) {
3309
3321
  return (`search=${searchFilter.searchString}` +
3310
3322
  (searchFilter.maxRecordCount > 0 ? '&maxRecordCount=' + searchFilter.maxRecordCount : ''));
@@ -3328,7 +3340,10 @@ const initialState = {
3328
3340
  accountConfiguration: Option.none,
3329
3341
  profileConfiguration: Option.none,
3330
3342
  hasSuccessPageBeenAcknowledged: false,
3331
- hasSuperSelectionBeenSubmitted: false
3343
+ hasSuperSelectionBeenSubmitted: false,
3344
+ campaignConnectEnabled: false,
3345
+ campaignConnectPromise: Option.none,
3346
+ campaignConnect: Option.none
3332
3347
  };
3333
3348
 
3334
3349
  class SuperSelectionAppService {
@@ -3365,11 +3380,29 @@ class SuperSelectionAppService {
3365
3380
  return this._state.appBaseUrl.value;
3366
3381
  }
3367
3382
  get promotedFunds() {
3383
+ if (this._state.campaignConnectEnabled && Option.isSome(this._state.campaignConnect)) {
3384
+ return this._state.campaignConnect.value.promotedFunds;
3385
+ }
3368
3386
  if (Option.isNone(this._state.promotedFunds)) {
3369
3387
  throw Error('Promoted Funds is not set');
3370
3388
  }
3371
3389
  return this._state.promotedFunds.value;
3372
3390
  }
3391
+ get promotedDefaultFundPosition() {
3392
+ if (this._state.campaignConnectEnabled && Option.isSome(this._state.campaignConnect)) {
3393
+ return Option.fromNullable(this._state.campaignConnect.value.promotedDefaultFundPosition);
3394
+ }
3395
+ return Option.none;
3396
+ }
3397
+ get promotedFundsConfig() {
3398
+ return {
3399
+ shownFunds: this.promotedFunds,
3400
+ promotedDefaultFundPosition: Option.toUndefined(this.promotedDefaultFundPosition),
3401
+ promotedFundsConfigSource: Option.isSome(this._state.campaignConnect)
3402
+ ? 'campaignConnect'
3403
+ : 'superSelection'
3404
+ };
3405
+ }
3373
3406
  get profileId() {
3374
3407
  if (Option.isNone(this._state.profileId)) {
3375
3408
  throw Error('Failed to get Profile ID from JWT');
@@ -3407,6 +3440,15 @@ class SuperSelectionAppService {
3407
3440
  this._state.profileConfiguration = Option.fromNullable(appStateResponse.profileConfiguration);
3408
3441
  this._state.superBuyer = Option.fromNullable(appStateResponse.superBuyer);
3409
3442
  this._state.promotedFunds = Option.fromNullable(appStateResponse.promotedFunds);
3443
+ if (this._state.campaignConnectEnabled) {
3444
+ this._state.campaignConnectPromise = Option.fromNullable(superSelectionApi.getCampaignConnectAsync());
3445
+ }
3446
+ }
3447
+ async completeCampaignConnectRequest() {
3448
+ if (this._state.campaignConnectEnabled) {
3449
+ const campaignConnect = await _function.pipe(this._state.campaignConnectPromise, Option.getOrElse(() => superSelectionApi.getCampaignConnectAsync()));
3450
+ this._state.campaignConnect = Option.fromNullable(campaignConnect);
3451
+ }
3410
3452
  }
3411
3453
  }
3412
3454
  const superSelectionAppService = new SuperSelectionAppService();
@@ -3629,19 +3671,16 @@ const navigationService = new NavigationService();
3629
3671
  const Consent = class {
3630
3672
  constructor(hostRef) {
3631
3673
  index.registerInstance(this, hostRef);
3632
- this.promotedFunds = superSelectionAppService.promotedFunds;
3633
3674
  this.eventTrackingService = EventTrackingService.Instance;
3634
3675
  }
3635
3676
  componentDidLoad() {
3636
- const detail = { promotedFundsShown: this.promotedFunds };
3637
- return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync(detail);
3677
+ return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({});
3638
3678
  }
3639
3679
  render() {
3640
3680
  return (index.h("div", null, index.h("div", { class: "text-2xl sm:text-3xl font-bold text-center leading-8" }, "Important information about super"), index.h("div", { class: "sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7 sm:leading-8" }, "The choice of superannuation fund is an important personal financial decision. Next, you\u2019ll be asked to nominate a super fund to receive your employer contributions."), index.h("div", { class: "flex justify-center mt-8 sm:mt-12" }, index.h("div", { class: "border shadow-sm p-4 pb-6 sm:p-6 sm:pb-8 max-w-560 rounded-lg" }, index.h("div", { class: "sm:text-lg font-bold leading-6" }, "By clicking \u201CContinue\u201D you acknowledge that:"), index.h("ul", { class: "list-disc list-outside ml-6 mt-3 mb-6 space-y-2 text-sm leading-6" }, index.h("li", null, "Flare (we/us) provides this paperless employee management service, will feature superannuation funds and offer you employee benefits that you may be interested in;"), index.h("li", null, "all content contained in the following pages does not take into account any of your objectives, financial situation or needs and does not constitute financial product advice;"), index.h("li", null, "in featuring any superannuation funds, we, the technology partner you are accessing us via, or your employer, are not providing any opinion or recommendation (actual or implied) in relation to the suitability or appropriateness of the featured funds;"), index.h("li", null, "if you do choose one of the featured superannuation funds, we and our associates will normally receive a fee for you doing so;"), index.h("li", null, "in the event that you choose one of the featured superannuation funds, we may pass on your personal information and TFN to a related party for the purpose of completing your chosen fund's application form.")), index.h("sss-button", { fillWidth: true, promiseFn: () => this.handleSuperFundDisclaimerAccepted() }, "Continue")))));
3641
3681
  }
3642
3682
  async handleSuperFundDisclaimerAccepted() {
3643
- const detail = { promotedFundsShown: this.promotedFunds };
3644
- await this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync(detail);
3683
+ await this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync({});
3645
3684
  navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
3646
3685
  }
3647
3686
  };
@@ -3831,10 +3870,7 @@ const DefaultFund = class {
3831
3870
  history: this.history,
3832
3871
  fundName: `Employer’s default fund`,
3833
3872
  handleSubmitFn: async (standardChoiceFormSignature) => {
3834
- await customFundChoiceApi.submitDefaultFundChoiceAsync({
3835
- standardChoiceFormSignature,
3836
- shownFunds: superSelectionAppService.promotedFunds
3837
- });
3873
+ await customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({ standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig));
3838
3874
  }
3839
3875
  });
3840
3876
  }
@@ -4675,14 +4711,7 @@ const MyOwnFund = class {
4675
4711
  history: this.history,
4676
4712
  fundName: this.getOrError(state$1.myOwnFundForm.fundName),
4677
4713
  handleSubmitFn: async (standardChoiceFormSignature) => {
4678
- const customFundChoiceDto = {
4679
- fundUsi: this.getOrError(state$1.myOwnFundForm.fundUsi),
4680
- memberNumber: this.getOrError(state$1.myOwnFundForm.memberNumber),
4681
- memberFirstName: this.getOrError(state$1.myOwnFundForm.memberFirstName),
4682
- memberFamilyName: this.getOrError(state$1.myOwnFundForm.memberFamilyName),
4683
- standardChoiceFormSignature,
4684
- shownFunds: superSelectionAppService.promotedFunds
4685
- };
4714
+ const customFundChoiceDto = Object.assign({ fundUsi: this.getOrError(state$1.myOwnFundForm.fundUsi), memberNumber: this.getOrError(state$1.myOwnFundForm.memberNumber), memberFirstName: this.getOrError(state$1.myOwnFundForm.memberFirstName), memberFamilyName: this.getOrError(state$1.myOwnFundForm.memberFamilyName), standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
4686
4715
  await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
4687
4716
  }
4688
4717
  });
@@ -4813,16 +4842,23 @@ class PromotedFundChoiceApi {
4813
4842
  })
4814
4843
  .text();
4815
4844
  }
4845
+ async submitDefaultChoiceAsync(dto) {
4846
+ return buildBackendApiClient()
4847
+ .url('super-choice/promoted-fund/default')
4848
+ .post(dto)
4849
+ .badRequest(() => {
4850
+ throw new Error('Failed to process Promoted Default Fund choice request');
4851
+ })
4852
+ .text();
4853
+ }
4816
4854
  }
4817
4855
  const promotedFundChoiceApi = new PromotedFundChoiceApi();
4818
4856
 
4819
4857
  const initial$1 = {
4820
- fundId: ''
4858
+ fundId: '',
4859
+ isPromotedDefault: false
4821
4860
  };
4822
- const { state: state$2 } = createStore(initial$1);
4823
- function reset$1() {
4824
- state$2.fundId = initial$1.fundId;
4825
- }
4861
+ const { state: state$2, reset: reset$1 } = createStore(initial$1);
4826
4862
 
4827
4863
  class PromotedFundJoinV1IFrameBuilder {
4828
4864
  constructor() {
@@ -4858,16 +4894,7 @@ class PromotedFundJoinV1IFrameBuilder {
4858
4894
  navigationService.navigateInternallyToStandardChoice({
4859
4895
  history,
4860
4896
  fundName: Option.isSome(fundName) ? fundName.value : '',
4861
- handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync({
4862
- fundId: promotedFundId,
4863
- memberNumber: data.memberNumber,
4864
- memberFirstName: data.memberFirstName,
4865
- memberFamilyName: data.memberFamilyName,
4866
- usi: data.usi.replace(/ /g, ''),
4867
- standardChoiceFormSignature,
4868
- shownFunds: superSelectionAppService.promotedFunds,
4869
- defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
4870
- }),
4897
+ handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
4871
4898
  promotedFundId
4872
4899
  });
4873
4900
  break;
@@ -4968,7 +4995,7 @@ class PromotedFundJoinV2IFrameBuilder {
4968
4995
  build(iframe$1, history) {
4969
4996
  if (!(iframe$1 === null || iframe$1 === void 0 ? void 0 : iframe$1.contentDocument))
4970
4997
  return;
4971
- const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: state$2.fundId, authToken: superSelectionAppService.jwt });
4998
+ const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: state$2.fundId, authToken: superSelectionAppService.jwt, employerDefault: state$2.isPromotedDefault });
4972
4999
  const handleMessage = (event) => {
4973
5000
  const { data } = event;
4974
5001
  if (!data) {
@@ -4987,17 +5014,10 @@ class PromotedFundJoinV2IFrameBuilder {
4987
5014
  navigationService.navigateInternallyToStandardChoice({
4988
5015
  history,
4989
5016
  fundName: Option.isSome(fundName) ? fundName.value : '',
4990
- handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync({
4991
- fundId: promotedFundId,
4992
- memberNumber: data.memberNumber,
4993
- memberFirstName: data.memberFirstName,
4994
- memberFamilyName: data.memberFamilyName,
4995
- usi: data.usi.replace(/ /g, ''),
4996
- standardChoiceFormSignature,
4997
- shownFunds: superSelectionAppService.promotedFunds,
4998
- defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
4999
- }),
5000
- promotedFundId
5017
+ promotedFundId,
5018
+ handleSubmitFn: state$2.isPromotedDefault
5019
+ ? (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId: promotedFundId, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
5020
+ : (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
5001
5021
  });
5002
5022
  break;
5003
5023
  }
@@ -5034,9 +5054,16 @@ class PromotedFundJoinV2IFrameBuilder {
5034
5054
  const value = postData[prop];
5035
5055
  if (value !== undefined) {
5036
5056
  const input = document.createElement('input');
5037
- input.type = 'hidden';
5038
5057
  input.name = prop;
5039
- input.value = value;
5058
+ if (typeof value === 'boolean') {
5059
+ input.type = 'checkbox';
5060
+ input.checked = value;
5061
+ input.style.visibility = 'hidden';
5062
+ }
5063
+ else {
5064
+ input.type = 'hidden';
5065
+ input.value = value;
5066
+ }
5040
5067
  form.append(input);
5041
5068
  }
5042
5069
  }
@@ -5099,8 +5126,7 @@ const SelfManagedFund = class {
5099
5126
  history: this.history,
5100
5127
  fundName: 'Self-managed super fund',
5101
5128
  handleSubmitFn: async (standardChoiceFormSignature) => {
5102
- const requestDto = {
5103
- smsfChoice: {
5129
+ const requestDto = Object.assign({ smsfChoice: {
5104
5130
  abn: state$1.selfManagedFundForm.fundAbn,
5105
5131
  fundName: state$1.selfManagedFundForm.fundName,
5106
5132
  fundAddress: {
@@ -5116,10 +5142,7 @@ const SelfManagedFund = class {
5116
5142
  electronicServiceAddress: state$1.selfManagedFundForm.fundEsa,
5117
5143
  memberFirstName: state$1.selfManagedFundForm.memberFirstName,
5118
5144
  memberFamilyName: state$1.selfManagedFundForm.memberFamilyName
5119
- },
5120
- standardChoiceFormSignature,
5121
- shownFunds: superSelectionAppService.promotedFunds
5122
- };
5145
+ }, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
5123
5146
  await customFundChoiceApi.submitSelfManagedFundChoiceAsync(requestDto);
5124
5147
  }
5125
5148
  });
@@ -5489,14 +5512,7 @@ class SlateIFrameBuilder {
5489
5512
  navigationService.navigateInternallyToStandardChoice({
5490
5513
  history,
5491
5514
  fundName: fund$6.name,
5492
- handleSubmitFn: (standardChoiceFormSignature) => slateChoiceApi.submitSlateChoiceAsync({
5493
- memberNumber: data.memberNumber,
5494
- memberFirstName: data.memberFirstName,
5495
- memberFamilyName: data.memberFamilyName,
5496
- standardChoiceFormSignature,
5497
- shownFunds: superSelectionAppService.promotedFunds,
5498
- defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
5499
- }),
5515
+ handleSubmitFn: (standardChoiceFormSignature) => slateChoiceApi.submitSlateChoiceAsync(Object.assign({ memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, standardChoiceFormSignature, defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
5500
5516
  promotedFundId: fund$6.fundId
5501
5517
  });
5502
5518
  break;
@@ -5655,13 +5671,21 @@ const SuperChoiceItemTop = class {
5655
5671
  }
5656
5672
  };
5657
5673
 
5674
+ class MiscService {
5675
+ trackClickPromotedTileAsync(payload) {
5676
+ return superSelectionApi.clickPromotedTileAsync(payload);
5677
+ }
5678
+ }
5679
+ const miscService = new MiscService();
5680
+
5658
5681
  const SuperChoicePage = class {
5659
5682
  constructor(hostRef) {
5660
5683
  index.registerInstance(this, hostRef);
5661
5684
  this.promotedFunds = this.getPromotedFunds();
5662
5685
  this.eventTrackingService = EventTrackingService.Instance;
5663
5686
  }
5664
- componentDidLoad() {
5687
+ async componentDidLoad() {
5688
+ await superSelectionAppService.completeCampaignConnectRequest();
5665
5689
  const promotedFundsShown = this.promotedFunds.map((item) => item.fundId);
5666
5690
  return this.eventTrackingService.TrackSuperFundPanelViewedAsync({
5667
5691
  promotedFundsShown,
@@ -5702,17 +5726,32 @@ const SuperChoicePage = class {
5702
5726
  return fundTiles;
5703
5727
  }
5704
5728
  async handleJoinSuperClickAsync(fund) {
5729
+ var _a;
5705
5730
  const promotedFundsShown = superSelectionAppService.promotedFunds;
5706
5731
  const fundUsi = getFundUsiByFundId(fund.fundId);
5707
5732
  const fundName = getFundNameByFundId(fund.fundId);
5708
- await this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({
5709
- fundUsi: Option.isSome(fundUsi) ? fundUsi.value : undefined,
5710
- fundName: Option.isSome(fundName) ? fundName.value : '',
5711
- promotedFundId: fund.fundId,
5712
- promotedFundsShown,
5713
- defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
5714
- });
5733
+ await Promise.all([
5734
+ this.eventTrackingService.TrackPromotedSuperFundDetailViewedAsync({
5735
+ fundUsi: Option.isSome(fundUsi) ? fundUsi.value : undefined,
5736
+ fundName: Option.isSome(fundName) ? fundName.value : '',
5737
+ promotedFundId: fund.fundId,
5738
+ promotedFundsShown,
5739
+ defaultFundUsiSet: Option.toUndefined(superSelectionAppService.defaultFundUsi)
5740
+ }),
5741
+ miscService.trackClickPromotedTileAsync(fund.isPromotedDefault
5742
+ ? {
5743
+ promotedDefault: {
5744
+ fundId: fund.fundId
5745
+ }
5746
+ }
5747
+ : {
5748
+ promoted: {
5749
+ fundId: fund.fundId
5750
+ }
5751
+ })
5752
+ ]);
5715
5753
  state$2.fundId = fund.fundId;
5754
+ state$2.isPromotedDefault = (_a = fund.isPromotedDefault) !== null && _a !== void 0 ? _a : false;
5716
5755
  return navigationService.navigateInternally(this.history, fund.route);
5717
5756
  }
5718
5757
  static get assetsDirs() { return ["assets"]; }
@@ -28,6 +28,18 @@ export class SuperSelectionApi {
28
28
  })
29
29
  .json();
30
30
  }
31
+ async getCampaignConnectAsync() {
32
+ return buildBackendApiClient()
33
+ .url('compaign-connect')
34
+ .get()
35
+ .notFound(() => {
36
+ throw new Error('Failed to fetch campaign connect.');
37
+ })
38
+ .json();
39
+ }
40
+ async clickPromotedTileAsync(payload) {
41
+ return buildBackendApiClient().url('click-promoted-tile').post(payload).res();
42
+ }
31
43
  toSearchFilterQueryString(searchFilter) {
32
44
  return (`search=${searchFilter.searchString}` +
33
45
  (searchFilter.maxRecordCount > 0 ? '&maxRecordCount=' + searchFilter.maxRecordCount : ''));
@@ -2,15 +2,12 @@ import { Component, h, Prop } from '@stencil/core';
2
2
  import { EventTrackingService } from '../services/event-tracking.service';
3
3
  import navigationService from '../services/navigation.service';
4
4
  import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
5
- import SuperSelectionAppService from '../services/super-selection-app.service';
6
5
  export class Consent {
7
6
  constructor() {
8
- this.promotedFunds = SuperSelectionAppService.promotedFunds;
9
7
  this.eventTrackingService = EventTrackingService.Instance;
10
8
  }
11
9
  componentDidLoad() {
12
- const detail = { promotedFundsShown: this.promotedFunds };
13
- return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync(detail);
10
+ return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({});
14
11
  }
15
12
  render() {
16
13
  return (h("div", null,
@@ -28,8 +25,7 @@ export class Consent {
28
25
  h("sss-button", { fillWidth: true, promiseFn: () => this.handleSuperFundDisclaimerAccepted() }, "Continue")))));
29
26
  }
30
27
  async handleSuperFundDisclaimerAccepted() {
31
- const detail = { promotedFundsShown: this.promotedFunds };
32
- await this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync(detail);
28
+ await this.eventTrackingService.TrackSuperFundDisclaimerAcceptedAsync({});
33
29
  navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
34
30
  }
35
31
  static get is() { return "sss-consent-page"; }
@@ -76,10 +76,7 @@ export class DefaultFund {
76
76
  history: this.history,
77
77
  fundName: `Employer’s default fund`,
78
78
  handleSubmitFn: async (standardChoiceFormSignature) => {
79
- await customFundChoiceApi.submitDefaultFundChoiceAsync({
80
- standardChoiceFormSignature,
81
- shownFunds: superSelectionAppService.promotedFunds
82
- });
79
+ await customFundChoiceApi.submitDefaultFundChoiceAsync(Object.assign({ standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig));
83
80
  }
84
81
  });
85
82
  }
@@ -69,14 +69,7 @@ export class MyOwnFund {
69
69
  history: this.history,
70
70
  fundName: this.getOrError(customFundState.myOwnFundForm.fundName),
71
71
  handleSubmitFn: async (standardChoiceFormSignature) => {
72
- const customFundChoiceDto = {
73
- fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi),
74
- memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber),
75
- memberFirstName: this.getOrError(customFundState.myOwnFundForm.memberFirstName),
76
- memberFamilyName: this.getOrError(customFundState.myOwnFundForm.memberFamilyName),
77
- standardChoiceFormSignature,
78
- shownFunds: superSelectionAppService.promotedFunds
79
- };
72
+ const customFundChoiceDto = Object.assign({ fundUsi: this.getOrError(customFundState.myOwnFundForm.fundUsi), memberNumber: this.getOrError(customFundState.myOwnFundForm.memberNumber), memberFirstName: this.getOrError(customFundState.myOwnFundForm.memberFirstName), memberFamilyName: this.getOrError(customFundState.myOwnFundForm.memberFamilyName), standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
80
73
  await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
81
74
  }
82
75
  });
@@ -18,8 +18,7 @@ export class SelfManagedFund {
18
18
  history: this.history,
19
19
  fundName: 'Self-managed super fund',
20
20
  handleSubmitFn: async (standardChoiceFormSignature) => {
21
- const requestDto = {
22
- smsfChoice: {
21
+ const requestDto = Object.assign({ smsfChoice: {
23
22
  abn: customFundState.selfManagedFundForm.fundAbn,
24
23
  fundName: customFundState.selfManagedFundForm.fundName,
25
24
  fundAddress: {
@@ -35,10 +34,7 @@ export class SelfManagedFund {
35
34
  electronicServiceAddress: customFundState.selfManagedFundForm.fundEsa,
36
35
  memberFirstName: customFundState.selfManagedFundForm.memberFirstName,
37
36
  memberFamilyName: customFundState.selfManagedFundForm.memberFamilyName
38
- },
39
- standardChoiceFormSignature,
40
- shownFunds: superSelectionAppService.promotedFunds
41
- };
37
+ }, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
42
38
  await customFundChoiceApi.submitSelfManagedFundChoiceAsync(requestDto);
43
39
  }
44
40
  });
@@ -9,5 +9,14 @@ export class PromotedFundChoiceApi {
9
9
  })
10
10
  .text();
11
11
  }
12
+ async submitDefaultChoiceAsync(dto) {
13
+ return buildBackendApiClient()
14
+ .url('super-choice/promoted-fund/default')
15
+ .post(dto)
16
+ .badRequest(() => {
17
+ throw new Error('Failed to process Promoted Default Fund choice request');
18
+ })
19
+ .text();
20
+ }
12
21
  }
13
22
  export default new PromotedFundChoiceApi();
@@ -1,9 +1,8 @@
1
1
  import { createStore } from '@stencil/store';
2
2
  export const initial = {
3
- fundId: ''
3
+ fundId: '',
4
+ isPromotedDefault: false
4
5
  };
5
- const { state } = createStore(initial);
6
- export function reset() {
7
- state.fundId = initial.fundId;
8
- }
6
+ const { state, reset } = createStore(initial);
7
+ export { reset };
9
8
  export default state;
@@ -41,16 +41,7 @@ class PromotedFundJoinV1IFrameBuilder {
41
41
  navigationService.navigateInternallyToStandardChoice({
42
42
  history,
43
43
  fundName: O.isSome(fundName) ? fundName.value : '',
44
- handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync({
45
- fundId: promotedFundId,
46
- memberNumber: data.memberNumber,
47
- memberFirstName: data.memberFirstName,
48
- memberFamilyName: data.memberFamilyName,
49
- usi: data.usi.replace(/ /g, ''),
50
- standardChoiceFormSignature,
51
- shownFunds: superSelectionAppService.promotedFunds,
52
- defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
53
- }),
44
+ handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
54
45
  promotedFundId
55
46
  });
56
47
  break;
@@ -28,7 +28,7 @@ class PromotedFundJoinV2IFrameBuilder {
28
28
  build(iframe, history) {
29
29
  if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument))
30
30
  return;
31
- const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: promotedFundState.fundId, authToken: superSelectionAppService.jwt });
31
+ const postData = Object.assign(Object.assign({}, this.getMemberData()), { partnerId: superSelectionAppService.partnerIdOrDefault, accountId: superSelectionAppService.accountIdOrDefault, fundId: promotedFundState.fundId, authToken: superSelectionAppService.jwt, employerDefault: promotedFundState.isPromotedDefault });
32
32
  const handleMessage = (event) => {
33
33
  const { data } = event;
34
34
  if (!data) {
@@ -47,17 +47,10 @@ class PromotedFundJoinV2IFrameBuilder {
47
47
  navigationService.navigateInternallyToStandardChoice({
48
48
  history,
49
49
  fundName: O.isSome(fundName) ? fundName.value : '',
50
- handleSubmitFn: (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync({
51
- fundId: promotedFundId,
52
- memberNumber: data.memberNumber,
53
- memberFirstName: data.memberFirstName,
54
- memberFamilyName: data.memberFamilyName,
55
- usi: data.usi.replace(/ /g, ''),
56
- standardChoiceFormSignature,
57
- shownFunds: superSelectionAppService.promotedFunds,
58
- defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
59
- }),
60
- promotedFundId
50
+ promotedFundId,
51
+ handleSubmitFn: promotedFundState.isPromotedDefault
52
+ ? (standardChoiceFormSignature) => promotedFundChoiceApi.submitDefaultChoiceAsync(Object.assign({ fundId: promotedFundId, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
53
+ : (standardChoiceFormSignature) => promotedFundChoiceApi.submitChoiceAsync(Object.assign({ fundId: promotedFundId, memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, usi: data.usi.replace(/ /g, ''), standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig))
61
54
  });
62
55
  break;
63
56
  }
@@ -96,9 +89,16 @@ class PromotedFundJoinV2IFrameBuilder {
96
89
  const value = postData[prop];
97
90
  if (value !== undefined) {
98
91
  const input = document.createElement('input');
99
- input.type = 'hidden';
100
92
  input.name = prop;
101
- input.value = value;
93
+ if (typeof value === 'boolean') {
94
+ input.type = 'checkbox';
95
+ input.checked = value;
96
+ input.style.visibility = 'hidden';
97
+ }
98
+ else {
99
+ input.type = 'hidden';
100
+ input.value = value;
101
+ }
102
102
  form.append(input);
103
103
  }
104
104
  }
@@ -52,14 +52,7 @@ class SlateIFrameBuilder {
52
52
  navigationService.navigateInternallyToStandardChoice({
53
53
  history,
54
54
  fundName: slate.name,
55
- handleSubmitFn: (standardChoiceFormSignature) => slateChoiceApi.submitSlateChoiceAsync({
56
- memberNumber: data.memberNumber,
57
- memberFirstName: data.memberFirstName,
58
- memberFamilyName: data.memberFamilyName,
59
- standardChoiceFormSignature,
60
- shownFunds: superSelectionAppService.promotedFunds,
61
- defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
62
- }),
55
+ handleSubmitFn: (standardChoiceFormSignature) => slateChoiceApi.submitSlateChoiceAsync(Object.assign({ memberNumber: data.memberNumber, memberFirstName: data.memberFirstName, memberFamilyName: data.memberFamilyName, standardChoiceFormSignature, defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi) }, superSelectionAppService.promotedFundsConfig)),
63
56
  promotedFundId: slate.fundId
64
57
  });
65
58
  break;
@@ -0,0 +1,7 @@
1
+ import superSelectionApi from '../api/super-selection.api';
2
+ export class MiscService {
3
+ trackClickPromotedTileAsync(payload) {
4
+ return superSelectionApi.clickPromotedTileAsync(payload);
5
+ }
6
+ }
7
+ export default new MiscService();
@@ -38,11 +38,29 @@ export class SuperSelectionAppService {
38
38
  return this._state.appBaseUrl.value;
39
39
  }
40
40
  get promotedFunds() {
41
+ if (this._state.campaignConnectEnabled && O.isSome(this._state.campaignConnect)) {
42
+ return this._state.campaignConnect.value.promotedFunds;
43
+ }
41
44
  if (O.isNone(this._state.promotedFunds)) {
42
45
  throw Error('Promoted Funds is not set');
43
46
  }
44
47
  return this._state.promotedFunds.value;
45
48
  }
49
+ get promotedDefaultFundPosition() {
50
+ if (this._state.campaignConnectEnabled && O.isSome(this._state.campaignConnect)) {
51
+ return O.fromNullable(this._state.campaignConnect.value.promotedDefaultFundPosition);
52
+ }
53
+ return O.none;
54
+ }
55
+ get promotedFundsConfig() {
56
+ return {
57
+ shownFunds: this.promotedFunds,
58
+ promotedDefaultFundPosition: O.toUndefined(this.promotedDefaultFundPosition),
59
+ promotedFundsConfigSource: O.isSome(this._state.campaignConnect)
60
+ ? 'campaignConnect'
61
+ : 'superSelection'
62
+ };
63
+ }
46
64
  get profileId() {
47
65
  if (O.isNone(this._state.profileId)) {
48
66
  throw Error('Failed to get Profile ID from JWT');
@@ -80,6 +98,15 @@ export class SuperSelectionAppService {
80
98
  this._state.profileConfiguration = O.fromNullable(appStateResponse.profileConfiguration);
81
99
  this._state.superBuyer = O.fromNullable(appStateResponse.superBuyer);
82
100
  this._state.promotedFunds = O.fromNullable(appStateResponse.promotedFunds);
101
+ if (this._state.campaignConnectEnabled) {
102
+ this._state.campaignConnectPromise = O.fromNullable(superSelectionApi.getCampaignConnectAsync());
103
+ }
104
+ }
105
+ async completeCampaignConnectRequest() {
106
+ if (this._state.campaignConnectEnabled) {
107
+ const campaignConnect = await pipe(this._state.campaignConnectPromise, O.getOrElse(() => superSelectionApi.getCampaignConnectAsync()));
108
+ this._state.campaignConnect = O.fromNullable(campaignConnect);
109
+ }
83
110
  }
84
111
  }
85
112
  export default new SuperSelectionAppService();
@@ -9,5 +9,8 @@ export const initialState = {
9
9
  accountConfiguration: O.none,
10
10
  profileConfiguration: O.none,
11
11
  hasSuccessPageBeenAcknowledged: false,
12
- hasSuperSelectionBeenSubmitted: false
12
+ hasSuperSelectionBeenSubmitted: false,
13
+ campaignConnectEnabled: false,
14
+ campaignConnectPromise: O.none,
15
+ campaignConnect: O.none
13
16
  };