@flarehr/apollo-super-selection 4.47.40159 → 4.48.40560

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 (25) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/p-3f846618.entry.js +14 -0
  3. package/dist/lib/apollo-super-selection/p-551a0927.system.entry.js +69 -0
  4. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  5. package/dist/lib/cjs/sss-button_40.cjs.entry.js +1600 -1545
  6. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +14 -0
  7. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +1 -0
  8. package/dist/lib/collection/components/super-selection-app/consent/consent.js +10 -1
  9. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +16 -3
  10. package/dist/lib/collection/components/super-selection-app/funds/constants.js +4 -0
  11. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +14 -2
  12. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +4 -1
  13. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +1 -1
  14. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +7 -2
  15. package/dist/lib/esm/sss-button_40.entry.js +1600 -1545
  16. package/dist/lib/esm-es5/sss-button_40.entry.js +3 -3
  17. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +3 -1
  18. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +17 -1
  19. package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +1 -0
  20. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +8 -1
  21. package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +1 -0
  22. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +1 -1
  23. package/package.json +1 -1
  24. package/dist/lib/apollo-super-selection/p-3355a4b6.system.entry.js +0 -69
  25. package/dist/lib/apollo-super-selection/p-a590d0d5.entry.js +0 -14
@@ -28,6 +28,9 @@ export function hydratePromotedFundChoiceDtoKind(dto) {
28
28
  else if ('mercerMyChoice' in dto) {
29
29
  dto.kind = 'mercerMyChoice';
30
30
  }
31
+ else if ('generic' in dto) {
32
+ dto.kind = 'generic';
33
+ }
31
34
  }
32
35
  function getPromotedFundUsi(dto) {
33
36
  switch (dto.kind) {
@@ -49,6 +52,8 @@ function getPromotedFundUsi(dto) {
49
52
  return some(dto.firstSuper.usi);
50
53
  case 'mercerMyChoice':
51
54
  return some(dto.mercerMyChoice.usi);
55
+ case 'generic':
56
+ return some(dto.generic.usi);
52
57
  default:
53
58
  assertExhaustive(dto);
54
59
  return none;
@@ -66,6 +71,8 @@ export function getSuperChoiceUsi(dto) {
66
71
  return some(dto.default.usi);
67
72
  case 'PromotedDefault':
68
73
  return some(dto.promotedDefault.usi);
74
+ case 'DefinedBenefits':
75
+ return some(dto.definedBenefits.usi);
69
76
  default:
70
77
  assertExhaustive(dto);
71
78
  return none;
@@ -91,6 +98,8 @@ function getPromotedFundMemberNumber(dto) {
91
98
  return some(dto.firstSuper.memberNumber);
92
99
  case 'mercerMyChoice':
93
100
  return some(dto.mercerMyChoice.memberNumber);
101
+ case 'generic':
102
+ return some(dto.generic.memberNumber);
94
103
  default:
95
104
  assertExhaustive(dto);
96
105
  return none;
@@ -102,6 +111,8 @@ export function getSuperChoiceMemberNumber(dto) {
102
111
  return getPromotedFundMemberNumber(dto.promoted);
103
112
  case 'MyOwnFund':
104
113
  return some(dto.myOwnFund.memberNumber);
114
+ case 'DefinedBenefits':
115
+ return some(dto.definedBenefits.memberNumber);
105
116
  case 'SMSF':
106
117
  case 'Default':
107
118
  case 'PromotedDefault':
@@ -127,4 +138,7 @@ export function hydrateSuperChoiceDetailsDtoKind(dto) {
127
138
  else if ('promotedDefault' in dto) {
128
139
  dto.kind = 'PromotedDefault';
129
140
  }
141
+ else if ('definedBenefits' in dto) {
142
+ dto.kind = 'DefinedBenefits';
143
+ }
130
144
  }
@@ -40,6 +40,7 @@ export class SuperSelectionApi {
40
40
  case 'MyOwnFund':
41
41
  case 'PromotedDefault':
42
42
  case 'SMSF':
43
+ case 'DefinedBenefits':
43
44
  break;
44
45
  default:
45
46
  assertExhaustive(response.superBuyer.superChoice.choiceDetails);
@@ -1,4 +1,5 @@
1
1
  import { Component, h, Prop } from '@stencil/core';
2
+ import { isSome } from 'fp-ts/lib/Option';
2
3
  import { Link } from '../funds/promoted-fund/types';
3
4
  import { EventTrackingService } from '../services/event-tracking.service';
4
5
  import navigationService from '../services/navigation.service';
@@ -9,7 +10,15 @@ export class Consent {
9
10
  this.eventTrackingService = EventTrackingService.Instance;
10
11
  }
11
12
  componentDidLoad() {
12
- return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({});
13
+ let isDefinedBenefitsEligible = 'Not set';
14
+ if (isSome(superSelectionService.isDefinedBenefitsEligible)) {
15
+ isDefinedBenefitsEligible = superSelectionService.isDefinedBenefitsEligible.value
16
+ ? 'True'
17
+ : 'False';
18
+ }
19
+ return this.eventTrackingService.TrackSuperFundDisclaimerViewedAsync({
20
+ isDefinedBenefitsEligible
21
+ });
13
22
  }
14
23
  render() {
15
24
  return (h("div", null,
@@ -71,9 +71,20 @@ export class ExistingChoice {
71
71
  h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", class: "fill-primary-base" },
72
72
  h("path", { d: "M448 96h-64V48C384 21.53 362.5 0 336 0h-160C149.5 0 128 21.53 128 48V96H64C28.65 96 0 124.7 0 160v256c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V160C512 124.7 483.3 96 448 96zM160 48C160 39.17 167.2 32 176 32h160C344.8 32 352 39.17 352 48V96H160V48zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V288h144v64c0 8.844 7.156 16 16 16h128c8.844 0 16-7.156 16-16V288H480V416zM208 336V288h96v48H208zM480 256H32V160c0-17.64 14.36-32 32-32h384c17.64 0 32 14.36 32 32V256z" })))));
73
73
  };
74
+ const DefinedBenefitsFundView = () => {
75
+ return (h("div", { class: "flex h-20 justify-center items-center relative" },
76
+ h("div", { class: "h-20 w-20 rounded-full bg-primary-base opacity-10" }),
77
+ h("div", { class: "h-10 w-10 absolute" },
78
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 576 512", class: "fill-primary-base" },
79
+ h("path", { d: "M174.7 111.8C165.1 110.3 160.1 102.1 161.5 93.35C170.4 40.37 216.5 0 272 0C320.8 0 362.3 31.19 377.6 74.67C380.6 82.1 376.2 92.14 367.9 95.09C359.5 98.03 350.4 93.66 347.5 85.33C336.5 54.24 306.8 32 272 32C232.4 32 199.5 60.82 193.1 98.65C191.6 107.4 183.4 113.2 174.7 111.8V111.8zM400 264C400 250.7 410.7 240 424 240C437.3 240 448 250.7 448 264C448 277.3 437.3 288 424 288C410.7 288 400 277.3 400 264zM488.5 125.8L480 159.1C501.1 176.5 519.6 198.5 530.7 224H544C561.7 224 576 238.3 576 256V352C576 369.7 561.7 384 544 384H512C495.5 405.1 473.5 423.6 448 434.7V464C448 490.5 426.5 512 400 512H368C341.5 512 320 490.5 320 464V448H256V464C256 490.5 234.5 512 208 512H176C149.5 512 128 490.5 128 464V416C89.14 386.8 64 340.3 64 288C28.52 287.2 0 258.2 0 222.6C0 197.8 14 175.1 36.18 164L40.84 161.7C48.75 157.7 58.36 160.9 62.31 168.8C66.26 176.7 63.06 186.4 55.16 190.3L50.49 192.6C39.16 198.3 31.1 209.9 31.1 222.6C31.1 241 46.97 256 65.44 256H67.2C82.02 182.1 146.6 128 223.1 128H376.4C394 108.4 419.6 96 448 96H465.3C480.9 96 492.3 110.7 488.5 125.8H488.5zM224 160C153.3 160 96 217.3 96 288C96 329.9 116.1 367 147.2 390.4L160 400V464C160 472.8 167.2 480 176 480H208C216.8 480 224 472.8 224 464V416H352V464C352 472.8 359.2 480 368 480H400C408.8 480 416 472.8 416 464V413.7L435.2 405.4C455.6 396.5 473.2 382.4 486.4 364.8L496 352H544V256H509.7L501.4 236.8C492.5 216.4 478.4 198.8 460.8 185.6L443.8 172.8L455 128H448C429 128 412.1 136.2 400.3 149.3L390.7 160H224z" })))));
80
+ };
81
+ const ChooseAnotherFundView = () => {
82
+ return this.existingFund.type == 'Defined Benefits Fund' ? null : (h("div", { class: "mt-4" },
83
+ h("sss-button", { fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")));
84
+ };
74
85
  return (h("div", null,
75
86
  h("div", { class: "text-2xl sm:text-3xl font-bold text-center" }, "Your super nomination"),
76
- h("div", { class: "sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7" }, "Continue with your chosen fund or choose another fund below."),
87
+ this.existingFund.type == 'Defined Benefits Fund' ? null : (h("div", { class: "sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7" }, "Continue with your chosen fund or choose another fund below.")),
77
88
  h("div", { class: "flex justify-center mt-8 sm:mt-12" },
78
89
  h("div", { class: "max-w-400 w-full" },
79
90
  h("div", { class: "flex-col border shadow-sm p-6 pt-8 rounded-lg text-center" },
@@ -89,6 +100,8 @@ export class ExistingChoice {
89
100
  return h(MyOwnFundView, null);
90
101
  case 'Default Fund':
91
102
  return h(DefaultFundView, null);
103
+ case 'Defined Benefits Fund':
104
+ return h(DefinedBenefitsFundView, null);
92
105
  default:
93
106
  assertExhaustive(this.existingFund);
94
107
  return h("div", null);
@@ -102,6 +115,7 @@ export class ExistingChoice {
102
115
  case 'Promoted Fund':
103
116
  case 'Self Managed Fund':
104
117
  case 'Promoted Default Fund':
118
+ case 'Defined Benefits Fund':
105
119
  return this.existingFund.name;
106
120
  default:
107
121
  assertExhaustive(this.existingFund);
@@ -110,8 +124,7 @@ export class ExistingChoice {
110
124
  })())),
111
125
  h("div", { class: "mt-6" },
112
126
  h("sss-button", { fillWidth: true, promiseFn: () => this.handleFundNominationAccepted() }, "Continue with this fund"))),
113
- h("div", { class: "mt-4" },
114
- h("sss-button", { fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund"))))));
127
+ h(ChooseAnotherFundView, null)))));
115
128
  }
116
129
  async handleFundNominationAccepted() {
117
130
  const detail = this.createSuperFundNominationDetail(this.existingFund);
@@ -29,6 +29,10 @@ export const getFundByDtoPropName = (dtoPropName) => {
29
29
  const fund = allPromotedFunds.find((f) => f.dtoPropName == dtoPropName);
30
30
  return fund ? some(fund) : none;
31
31
  };
32
+ export const getFundByFundId = (fundId) => {
33
+ const fund = allPromotedFunds.find((f) => f.fundId == fundId);
34
+ return fund ? some(fund) : none;
35
+ };
32
36
  export const getFundNameByFundId = (fundId) => fundsById[fundId] != undefined ? some(fundsById[fundId].name) : none;
33
37
  export const getFooterTextOverrideByFundId = (fundId) => { var _a, _b; return (_b = (_a = fundsById[fundId]) === null || _a === void 0 ? void 0 : _a.footnoteTextOverride) !== null && _b !== void 0 ? _b : none; };
34
38
  export const getFundUsiByFundId = (fundId) => fundId == slate.fundId ? some(slateUsi) : none;
@@ -27,8 +27,9 @@ export class ExistingFundService {
27
27
  const memberNumber = getSuperChoiceMemberNumber(choiceDetails);
28
28
  switch (choiceDetails.kind) {
29
29
  case 'Promoted': {
30
- const dtoPropName = Object.keys(choiceDetails.promoted)[0];
31
- const fund = constants.getFundByDtoPropName(dtoPropName);
30
+ const fund = choiceDetails.promoted['generic']
31
+ ? constants.getFundByFundId(choiceDetails.promoted['generic'].fundId)
32
+ : constants.getFundByDtoPropName(Object.keys(choiceDetails.promoted)[0]);
32
33
  if (isNone(fund))
33
34
  return none;
34
35
  return some({
@@ -83,6 +84,17 @@ export class ExistingFundService {
83
84
  lastNominatedAt: dateSubmitted
84
85
  });
85
86
  }
87
+ case 'DefinedBenefits': {
88
+ const defaultUsi = choiceDetails.definedBenefits.usi;
89
+ const fund = await this.getFundByUsiAsync(defaultUsi);
90
+ return some({
91
+ type: 'Defined Benefits Fund',
92
+ name: isSome(fund) ? fund.value.productName : defaultUsi,
93
+ usi: usi,
94
+ valid: this.toFundValidState(fund),
95
+ lastNominatedAt: dateSubmitted
96
+ });
97
+ }
86
98
  default:
87
99
  assertExhaustive(choiceDetails);
88
100
  return none;
@@ -101,6 +101,9 @@ export class SuperSelectionAppService {
101
101
  get campaignConnectEnabled() {
102
102
  return this._state.campaignConnectEnabled;
103
103
  }
104
+ get isDefinedBenefitsEligible() {
105
+ return this._state.isDefinedBenefitsEligible;
106
+ }
104
107
  async loadAppStateAsync() {
105
108
  const appStateResponse = await superSelectionApi.getAppStateAsync();
106
109
  this._state.accountConfiguration = O.fromNullable(appStateResponse.accountConfiguration);
@@ -109,7 +112,7 @@ export class SuperSelectionAppService {
109
112
  this._state.promotedFunds = O.fromNullable(appStateResponse.promotedFunds);
110
113
  this._state.campaignConnectEnabled = appStateResponse.campaignConnectEnabled;
111
114
  this._state.superChoicePrefill = O.fromNullable(appStateResponse.prefill);
112
- this._state.definedBenefitsEligibility = appStateResponse.definedBenefitsEligibility;
115
+ this._state.isDefinedBenefitsEligible = O.fromNullable(appStateResponse.isDefinedBenefitsEligible);
113
116
  }
114
117
  async startLoadingCampaignConnectAsync() {
115
118
  if (this._state.campaignConnectEnabled) {
@@ -13,6 +13,6 @@ export const initialState = {
13
13
  hasSuperSelectionBeenSubmitted: false,
14
14
  campaignConnectEnabled: false,
15
15
  campaignConnectPromise: O.none,
16
- definedBenefitsEligibility: false,
16
+ isDefinedBenefitsEligible: O.none,
17
17
  campaignConnect: O.none
18
18
  };
@@ -1,7 +1,7 @@
1
1
  import { Component, Event, getAssetPath, h, Host, Prop, State, Watch } from '@stencil/core';
2
2
  import { injectHistory } from '@stencil/router';
3
3
  import * as O from 'fp-ts/lib/Option';
4
- import { isSome } from 'fp-ts/lib/Option';
4
+ import { isNone, isSome } from 'fp-ts/lib/Option';
5
5
  import iframe from '../../utils/iframe';
6
6
  import * as constants from './funds/constants';
7
7
  import promotedFundState from './funds/promoted-fund/promoted-fund.store';
@@ -52,7 +52,12 @@ export class SuperSelectionApp {
52
52
  });
53
53
  iframe.appReady();
54
54
  const ignoreExistingSelectionOption = O.fromNullable(this.ignoreExistingSelection);
55
- const shouldIgnoreExistingChoice = isSome(ignoreExistingSelectionOption) && ignoreExistingSelectionOption.value;
55
+ const shouldIgnoreExistingDefinedBenefitsChoice = isSome(chosenFundOption) &&
56
+ chosenFundOption.value.type == 'Defined Benefits Fund' &&
57
+ (isNone(superSelectionAppService.isDefinedBenefitsEligible) ||
58
+ !superSelectionAppService.isDefinedBenefitsEligible.value);
59
+ const shouldIgnoreExistingChoice = (isSome(ignoreExistingSelectionOption) && ignoreExistingSelectionOption.value) ||
60
+ shouldIgnoreExistingDefinedBenefitsChoice;
56
61
  if (isSome(superSelectionAppService.state.superChoicePrefill)) {
57
62
  navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.Prefill);
58
63
  }