@flarehr/apollo-super-selection 1.2.30260 → 1.2.30309

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 (19) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  2. package/dist/lib/apollo-super-selection/{p-0a1d6ac9.system.entry.js → p-1869be51.system.entry.js} +1 -1
  3. package/dist/lib/apollo-super-selection/{p-aa074b1b.entry.js → p-25ff0cdc.entry.js} +4 -4
  4. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  5. package/dist/lib/cjs/sss-button_30.cjs.entry.js +128 -133
  6. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +71 -86
  7. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +1 -1
  8. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/hesta-default.js +23 -0
  9. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +61 -45
  10. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +1 -0
  11. package/dist/lib/collection/utils/index.js +3 -0
  12. package/dist/lib/esm/sss-button_30.entry.js +128 -133
  13. package/dist/lib/esm-es5/sss-button_30.entry.js +3 -3
  14. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +20 -0
  15. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/hesta-default.d.ts +3 -0
  16. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/types.d.ts +1 -1
  17. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +9 -1
  18. package/dist/lib/types/utils/index.d.ts +1 -0
  19. package/package.json +1 -1
@@ -1 +1 @@
1
- System.register(["./p-44bec843.system.js","./p-14885f78.system.js","./p-15f0e5eb.system.js"],(function(s,e){"use strict";var t,o,i;return{setters:[function(s){t=s.p;o=s.b},function(){},function(s){i=s.g}],execute:function(){var s=function(){var s=e.meta.url;var o={};if(s!==""){o.resourcesUrl=new URL(".",s).href}return t(o)};s().then((function(s){i();return o([["p-6ac8791e.system",[[0,"context-consumer",{context:[16],renderer:[16],subscribe:[16],unsubscribe:[32]}]]],["p-02f24922.system",[[0,"stencil-async-content",{documentLocation:[1,"document-location"],content:[32]}]]],["p-ef3afa00.system",[[0,"stencil-route-title",{titleSuffix:[1,"title-suffix"],pageTitle:[1,"page-title"]}]]],["p-f29066b9.system",[[0,"stencil-router-prompt",{when:[4],message:[1],history:[16],unblock:[32]}]]],["p-51aefdb1.system",[[0,"stencil-router-redirect",{history:[16],root:[1],url:[1]}]]],["p-0a1d6ac9.system",[[0,"sss-my-own-fund",{history:[16],formState:[32],isNotAllInformationProvidedMessageVisible:[32],isSubmitDisabled:[32]}],[0,"sss-self-managed-fund",{history:[16],formState:[32],isSubmitDisabled:[32]}],[0,"sss-super-choice-page",{history:[16],promotedFunds:[32],campaignConnectRequestInProgress:[32]}],[1,"super-selection-app-host",{sessionState:[32],jwt:[32],appConfiguration:[32],ignoreExistingSelection:[32]}],[0,"sss-default-fund",{history:[16],defaultFundProductName:[32]}],[0,"sss-standard-choice-form",{history:[16],standardChoiceFormSignature:[32],formState:[32],isSubmitDisabled:[32]}],[0,"sss-consent-page",{history:[16]}],[0,"sss-existing-choice-page",{history:[16],existingFund:[32]}],[0,"sss-promoted-fund-join-v1-page",{history:[16]}],[0,"sss-promoted-fund-join-v2-page",{history:[16]}],[0,"sss-slate-join-page",{history:[16]}],[0,"sss-success"],[1,"super-selection-app",{ignoreExistingSelection:[4,"ignore-existing-selection"],accessToken:[1,"access-token"],backendUrl:[1,"backend-url"],appBaseUrl:[1,"app-base-url"],history:[16],location:[16],isSelfHosted:[4,"is-self-hosted"],isAppInitialised:[32]}],[0,"sss-my-own-fund-inputs",{myOwnFundForm:[16],showValidationErrors:[4,"show-validation-errors"],selectedOption:[32]}],[0,"sss-self-managed-fund-inputs",{fundForm:[16],showValidationErrors:[4,"show-validation-errors"],isAbnValid:[32],isAbnTouched:[32],isAbnUsedForRegulated:[32],currentBank:[32],addressErrorMessage:[32]}],[0,"sss-super-choice-item-bottom",{disclaimer:[16],abnInfo:[1,"abn-info"],abn:[1]}],[0,"sss-loading-page"],[0,"sss-super-choice-item-top",{name:[1],logo:[1],features:[16],featureSubText:[16]}],[0,"sss-dropdown-async",{placeholder:[1],searchFunction:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],minSearchStringLength:[2,"min-search-string-length"],showValidationErrors:[4,"show-validation-errors"],searchState:[32],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]],[0,"sss-footer-section",{textOverride:[16]}],[4,"stencil-route-switch",{group:[513],scrollTopOffset:[2,"scroll-top-offset"],location:[16],routeViewsUpdated:[16]}],[4,"stencil-router",{root:[1],historyType:[1,"history-type"],titleSuffix:[1,"title-suffix"],scrollTopOffset:[2,"scroll-top-offset"],location:[32],history:[32]}],[4,"sss-custom-fund",{history:[16],currentCustomFund:[32],fundOptionsList:[32],showFundOptionsSelection:[32]}],[0,"sss-iframe-host",{build:[16]}],[0,"sss-header-section",{currentPage:[1,"current-page"]}],[0,"sss-name-input",{value:[1],name:[1],readableName:[1,"readable-name"],showValidationErrors:[4,"show-validation-errors"],errorMessage:[32]}],[4,"stencil-route-link",{url:[1],urlMatch:[1,"url-match"],activeClass:[1,"active-class"],exact:[4],strict:[4],custom:[1],anchorClass:[1,"anchor-class"],anchorRole:[1,"anchor-role"],anchorTitle:[1,"anchor-title"],anchorTabIndex:[1,"anchor-tab-index"],anchorId:[1,"anchor-id"],history:[16],location:[16],root:[1],ariaHaspopup:[1,"aria-haspopup"],ariaPosinset:[1,"aria-posinset"],ariaSetsize:[2,"aria-setsize"],ariaLabel:[1,"aria-label"],match:[32]}],[4,"sss-button",{fillWidth:[4,"fill-width"],fillWidthOnMobile:[4,"fill-width-on-mobile"],disabled:[4],variant:[1],size:[1],promiseFn:[16],state:[32]}],[0,"sss-loading-indicator",{theme:[1],size:[2]}],[0,"stencil-route",{group:[513],componentUpdated:[16],match:[1040],url:[1],component:[1],componentProps:[16],exact:[4],routeRender:[16],scrollTopOffset:[2,"scroll-top-offset"],routeViewsUpdated:[16],location:[16],history:[16],historyType:[1,"history-type"]}]]]],s)}))}}}));
1
+ System.register(["./p-44bec843.system.js","./p-14885f78.system.js","./p-15f0e5eb.system.js"],(function(e,s){"use strict";var t,o,i;return{setters:[function(e){t=e.p;o=e.b},function(){},function(e){i=e.g}],execute:function(){var e=function(){var e=s.meta.url;var o={};if(e!==""){o.resourcesUrl=new URL(".",e).href}return t(o)};e().then((function(e){i();return o([["p-6ac8791e.system",[[0,"context-consumer",{context:[16],renderer:[16],subscribe:[16],unsubscribe:[32]}]]],["p-02f24922.system",[[0,"stencil-async-content",{documentLocation:[1,"document-location"],content:[32]}]]],["p-ef3afa00.system",[[0,"stencil-route-title",{titleSuffix:[1,"title-suffix"],pageTitle:[1,"page-title"]}]]],["p-f29066b9.system",[[0,"stencil-router-prompt",{when:[4],message:[1],history:[16],unblock:[32]}]]],["p-51aefdb1.system",[[0,"stencil-router-redirect",{history:[16],root:[1],url:[1]}]]],["p-1869be51.system",[[0,"sss-my-own-fund",{history:[16],formState:[32],isNotAllInformationProvidedMessageVisible:[32],isSubmitDisabled:[32]}],[0,"sss-self-managed-fund",{history:[16],formState:[32],isSubmitDisabled:[32]}],[0,"sss-super-choice-page",{history:[16],promotedFunds:[32],campaignConnectRequestInProgress:[32]}],[1,"super-selection-app-host",{sessionState:[32],jwt:[32],appConfiguration:[32],ignoreExistingSelection:[32]}],[0,"sss-default-fund",{history:[16],defaultFundProductName:[32]}],[0,"sss-standard-choice-form",{history:[16],standardChoiceFormSignature:[32],formState:[32],isSubmitDisabled:[32]}],[0,"sss-consent-page",{history:[16]}],[0,"sss-existing-choice-page",{history:[16],existingFund:[32]}],[0,"sss-promoted-fund-join-v1-page",{history:[16]}],[0,"sss-promoted-fund-join-v2-page",{history:[16]}],[0,"sss-slate-join-page",{history:[16]}],[0,"sss-success"],[1,"super-selection-app",{ignoreExistingSelection:[4,"ignore-existing-selection"],accessToken:[1,"access-token"],backendUrl:[1,"backend-url"],appBaseUrl:[1,"app-base-url"],history:[16],location:[16],isSelfHosted:[4,"is-self-hosted"],isAppInitialised:[32]}],[0,"sss-my-own-fund-inputs",{myOwnFundForm:[16],showValidationErrors:[4,"show-validation-errors"],selectedOption:[32]}],[0,"sss-self-managed-fund-inputs",{fundForm:[16],showValidationErrors:[4,"show-validation-errors"],isAbnValid:[32],isAbnTouched:[32],isAbnUsedForRegulated:[32],currentBank:[32],addressErrorMessage:[32]}],[0,"sss-super-choice-item-bottom",{disclaimer:[16],abnInfo:[1,"abn-info"],abn:[1]}],[0,"sss-loading-page"],[0,"sss-super-choice-item-top",{name:[1],logo:[1],features:[16],featureSubText:[16]}],[0,"sss-dropdown-async",{placeholder:[1],searchFunction:[16],value:[16],required:[4],requiredValidationMessage:[1,"required-validation-message"],disabled:[4],minSearchStringLength:[2,"min-search-string-length"],showValidationErrors:[4,"show-validation-errors"],searchState:[32],inputValue:[32],isDropdownVisible:[32],filteredOptions:[32],highlightedOptionIndex:[32],selectedOption:[32]},[[2,"focus","handleFocus"],[2,"blur","handleBlur"],[2,"keydown","handleKeyDown"]]],[0,"sss-footer-section",{textOverride:[16]}],[4,"stencil-route-switch",{group:[513],scrollTopOffset:[2,"scroll-top-offset"],location:[16],routeViewsUpdated:[16]}],[4,"stencil-router",{root:[1],historyType:[1,"history-type"],titleSuffix:[1,"title-suffix"],scrollTopOffset:[2,"scroll-top-offset"],location:[32],history:[32]}],[4,"sss-custom-fund",{history:[16],currentCustomFund:[32],fundOptionsList:[32],showFundOptionsSelection:[32]}],[0,"sss-iframe-host",{build:[16]}],[0,"sss-header-section",{currentPage:[1,"current-page"]}],[0,"sss-name-input",{value:[1],name:[1],readableName:[1,"readable-name"],showValidationErrors:[4,"show-validation-errors"],errorMessage:[32]}],[4,"stencil-route-link",{url:[1],urlMatch:[1,"url-match"],activeClass:[1,"active-class"],exact:[4],strict:[4],custom:[1],anchorClass:[1,"anchor-class"],anchorRole:[1,"anchor-role"],anchorTitle:[1,"anchor-title"],anchorTabIndex:[1,"anchor-tab-index"],anchorId:[1,"anchor-id"],history:[16],location:[16],root:[1],ariaHaspopup:[1,"aria-haspopup"],ariaPosinset:[1,"aria-posinset"],ariaSetsize:[2,"aria-setsize"],ariaLabel:[1,"aria-label"],match:[32]}],[4,"sss-button",{fillWidth:[4,"fill-width"],fillWidthOnMobile:[4,"fill-width-on-mobile"],disabled:[4],variant:[1],size:[1],promiseFn:[16],state:[32]}],[0,"sss-loading-indicator",{theme:[1],size:[2]}],[0,"stencil-route",{group:[513],componentUpdated:[16],match:[1040],url:[1],component:[1],componentProps:[16],exact:[4],routeRender:[16],scrollTopOffset:[2,"scroll-top-offset"],routeViewsUpdated:[16],location:[16],history:[16],historyType:[1,"history-type"]}]]]],e)}))}}}));
@@ -264,7 +264,7 @@ class TapSubscriber extends datoramaAkita.Subscriber {
264
264
  }
265
265
  }
266
266
 
267
- const AppVersion = '1.2.30260';
267
+ const AppVersion = '1.2.30309';
268
268
 
269
269
  // -------------------------------------------------------------------------------------
270
270
  // guards
@@ -3307,7 +3307,7 @@ class SuperSelectionApi {
3307
3307
  }
3308
3308
  async getCampaignConnectAsync() {
3309
3309
  return buildBackendApiClient()
3310
- .url('compaign-connect')
3310
+ .url('campaign-connect')
3311
3311
  .get()
3312
3312
  .notFound(() => {
3313
3313
  throw new Error('Failed to fetch campaign connect.');
@@ -3440,6 +3440,7 @@ class SuperSelectionAppService {
3440
3440
  this._state.profileConfiguration = Option.fromNullable(appStateResponse.profileConfiguration);
3441
3441
  this._state.superBuyer = Option.fromNullable(appStateResponse.superBuyer);
3442
3442
  this._state.promotedFunds = Option.fromNullable(appStateResponse.promotedFunds);
3443
+ this._state.campaignConnectEnabled = appStateResponse.campaignConnectEnabled;
3443
3444
  if (this._state.campaignConnectEnabled) {
3444
3445
  this._state.campaignConnectPromise = Option.fromNullable(superSelectionApi.getCampaignConnectAsync());
3445
3446
  }
@@ -4345,101 +4346,81 @@ const getFundUsiByFundId = (fundId) => fundId == fund$6.fundId ? some(slateUsi)
4345
4346
  const getLogoSrcByFundId = (fundId) => fundsById[fundId] != undefined ? some(index.getAssetPath(`assets/${fundsById[fundId].logo}`)) : none;
4346
4347
 
4347
4348
  function getPromotedFundUsi(dto) {
4348
- if ('slate' in dto) {
4349
- return none;
4350
- }
4351
- else if ('australianRetirementTrust' in dto) {
4352
- return some(dto.australianRetirementTrust.usi);
4353
- }
4354
- else if ('aware' in dto) {
4355
- return some(dto.aware.usi);
4356
- }
4357
- else if ('active' in dto) {
4358
- return some(dto.active.usi);
4359
- }
4360
- else if ('australianEthical' in dto) {
4361
- return some(dto.australianEthical.usi);
4362
- }
4363
- else if ('virgin' in dto) {
4364
- return some(dto.virgin.usi);
4365
- }
4366
- else if ('spirit' in dto) {
4367
- return some(dto.spirit.usi);
4368
- }
4369
- else if ('firstSuper' in dto) {
4370
- return some(dto.firstSuper.usi);
4371
- }
4372
- else if ('mercerMyChoice' in dto) {
4373
- return some(dto.mercerMyChoice.usi);
4374
- }
4375
- else {
4376
- return none;
4349
+ switch (dto.kind) {
4350
+ case 'slate':
4351
+ return none;
4352
+ case 'australianRetirementTrust':
4353
+ return some(dto.australianRetirementTrust.usi);
4354
+ case 'aware':
4355
+ return some(dto.aware.usi);
4356
+ case 'active':
4357
+ return some(dto.active.usi);
4358
+ case 'australianEthical':
4359
+ return some(dto.australianEthical.usi);
4360
+ case 'virgin':
4361
+ return some(dto.virgin.usi);
4362
+ case 'spirit':
4363
+ return some(dto.spirit.usi);
4364
+ case 'firstSuper':
4365
+ return some(dto.firstSuper.usi);
4366
+ case 'mercerMyChoice':
4367
+ return some(dto.mercerMyChoice.usi);
4368
+ default:
4369
+ return none;
4377
4370
  }
4378
4371
  }
4379
4372
  function getSuperChoiceUsi(dto) {
4380
- if ('promoted' in dto) {
4381
- return getPromotedFundUsi(dto.promoted);
4382
- }
4383
- else if ('myOwnFund' in dto) {
4384
- return some(dto.myOwnFund.usi);
4385
- }
4386
- else if ('smsf' in dto) {
4387
- return none;
4388
- }
4389
- else if ('default' in dto) {
4390
- return some(dto.default.usi);
4391
- }
4392
- else {
4393
- return none;
4373
+ switch (dto.kind) {
4374
+ case 'Promoted':
4375
+ return getPromotedFundUsi(dto.promoted);
4376
+ case 'MyOwnFund':
4377
+ return some(dto.myOwnFund.usi);
4378
+ case 'SMSF':
4379
+ return none;
4380
+ case 'Default':
4381
+ return some(dto.default.usi);
4382
+ case 'PromotedDefault':
4383
+ return some(dto.promotedDefault.usi);
4384
+ default:
4385
+ return none;
4394
4386
  }
4395
4387
  }
4396
4388
  function getPromotedFundMemberNumber(dto) {
4397
- if ('slate' in dto) {
4398
- return some(dto.slate.memberNumber);
4399
- }
4400
- else if ('australianRetirementTrust' in dto) {
4401
- return some(dto.australianRetirementTrust.memberNumber);
4402
- }
4403
- else if ('aware' in dto) {
4404
- return some(dto.aware.memberNumber);
4405
- }
4406
- else if ('active' in dto) {
4407
- return some(dto.active.memberNumber);
4408
- }
4409
- else if ('australianEthical' in dto) {
4410
- return some(dto.australianEthical.memberNumber);
4411
- }
4412
- else if ('virgin' in dto) {
4413
- return some(dto.virgin.memberNumber);
4414
- }
4415
- else if ('spirit' in dto) {
4416
- return some(dto.spirit.memberNumber);
4417
- }
4418
- else if ('firstSuper' in dto) {
4419
- return some(dto.firstSuper.memberNumber);
4420
- }
4421
- else if ('mercerMyChoice' in dto) {
4422
- return some(dto.mercerMyChoice.memberNumber);
4423
- }
4424
- else {
4425
- return none;
4389
+ switch (dto.kind) {
4390
+ case 'slate':
4391
+ return some(dto.slate.memberNumber);
4392
+ case 'australianRetirementTrust':
4393
+ return some(dto.australianRetirementTrust.memberNumber);
4394
+ case 'aware':
4395
+ return some(dto.aware.memberNumber);
4396
+ case 'active':
4397
+ return some(dto.active.memberNumber);
4398
+ case 'australianEthical':
4399
+ return some(dto.australianEthical.memberNumber);
4400
+ case 'virgin':
4401
+ return some(dto.virgin.memberNumber);
4402
+ case 'spirit':
4403
+ return some(dto.spirit.memberNumber);
4404
+ case 'firstSuper':
4405
+ return some(dto.firstSuper.memberNumber);
4406
+ case 'mercerMyChoice':
4407
+ return some(dto.mercerMyChoice.memberNumber);
4408
+ default:
4409
+ return none;
4426
4410
  }
4427
4411
  }
4428
4412
  function getSuperChoiceMemberNumber(dto) {
4429
- if ('promoted' in dto) {
4430
- return getPromotedFundMemberNumber(dto.promoted);
4431
- }
4432
- else if ('myOwnFund' in dto) {
4433
- return some(dto.myOwnFund.memberNumber);
4434
- }
4435
- else if ('smsf' in dto) {
4436
- return none;
4437
- }
4438
- else if ('default' in dto) {
4439
- return none;
4440
- }
4441
- else {
4442
- return none;
4413
+ switch (dto.kind) {
4414
+ case 'Promoted':
4415
+ return getPromotedFundMemberNumber(dto.promoted);
4416
+ case 'MyOwnFund':
4417
+ return some(dto.myOwnFund.memberNumber);
4418
+ case 'SMSF':
4419
+ case 'Default':
4420
+ case 'PromotedDefault':
4421
+ return none;
4422
+ default:
4423
+ return none;
4443
4424
  }
4444
4425
  }
4445
4426
 
@@ -4455,53 +4436,67 @@ class ExistingFundService {
4455
4436
  const dateSubmitted = choice.dateSubmitted == undefined ? none : some(new Date(choice.dateSubmitted));
4456
4437
  const usi = getSuperChoiceUsi(choiceDetails);
4457
4438
  const memberNumber = getSuperChoiceMemberNumber(choiceDetails);
4458
- if ('promoted' in choiceDetails) {
4459
- const dtoPropName = Object.keys(choiceDetails.promoted)[0];
4460
- const fund = getFundByDtoPropName(dtoPropName);
4461
- if (isNone(fund))
4439
+ switch (choiceDetails.kind) {
4440
+ case 'Promoted': {
4441
+ const dtoPropName = Object.keys(choiceDetails.promoted)[0];
4442
+ const fund = getFundByDtoPropName(dtoPropName);
4443
+ if (isNone(fund))
4444
+ return none;
4445
+ return some({
4446
+ type: 'Promoted Fund',
4447
+ id: fund.value.fundId,
4448
+ name: fund.value.name,
4449
+ usi: usi,
4450
+ valid: 'Active',
4451
+ memberNumber: memberNumber,
4452
+ lastNominatedAt: dateSubmitted
4453
+ });
4454
+ }
4455
+ case 'MyOwnFund': {
4456
+ const fundUsi = choiceDetails.myOwnFund.usi;
4457
+ const fund = await this.getFundByUsiAsync(fundUsi);
4458
+ return some({
4459
+ type: 'My Own Fund',
4460
+ name: isSome(fund) ? fund.value.productName : fundUsi,
4461
+ usi: usi,
4462
+ valid: this.toFundValidState(fund),
4463
+ memberNumber: memberNumber,
4464
+ lastNominatedAt: dateSubmitted
4465
+ });
4466
+ }
4467
+ case 'SMSF':
4468
+ return some({
4469
+ type: 'Self Managed Fund',
4470
+ name: choiceDetails.smsf.fundName,
4471
+ valid: 'Unknown',
4472
+ lastNominatedAt: dateSubmitted
4473
+ });
4474
+ case 'Default': {
4475
+ const defaultUsi = choiceDetails.default.usi;
4476
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4477
+ return some({
4478
+ type: 'Default Fund',
4479
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4480
+ usi: usi,
4481
+ valid: this.toFundValidState(defaultFund),
4482
+ lastNominatedAt: dateSubmitted
4483
+ });
4484
+ }
4485
+ case 'PromotedDefault': {
4486
+ const defaultUsi = choiceDetails.promotedDefault.usi;
4487
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4488
+ return some({
4489
+ type: 'Promoted Default Fund',
4490
+ id: choiceDetails.promotedDefault.fundId,
4491
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4492
+ usi: usi,
4493
+ valid: this.toFundValidState(defaultFund),
4494
+ lastNominatedAt: dateSubmitted
4495
+ });
4496
+ }
4497
+ default:
4462
4498
  return none;
4463
- return some({
4464
- type: 'Promoted Fund',
4465
- id: fund.value.fundId,
4466
- name: fund.value.name,
4467
- usi: usi,
4468
- valid: 'Active',
4469
- memberNumber: memberNumber,
4470
- lastNominatedAt: dateSubmitted
4471
- });
4472
- }
4473
- else if ('smsf' in choiceDetails) {
4474
- return some({
4475
- type: 'Self Managed Fund',
4476
- name: choiceDetails.smsf.fundName,
4477
- valid: 'Unknown',
4478
- lastNominatedAt: dateSubmitted
4479
- });
4480
- }
4481
- else if ('myOwnFund' in choiceDetails) {
4482
- const fundUsi = choiceDetails.myOwnFund.usi;
4483
- const fund = await this.getFundByUsiAsync(fundUsi);
4484
- return some({
4485
- type: 'My Own Fund',
4486
- name: isSome(fund) ? fund.value.productName : fundUsi,
4487
- usi: usi,
4488
- valid: this.toFundValidState(fund),
4489
- memberNumber: memberNumber,
4490
- lastNominatedAt: dateSubmitted
4491
- });
4492
- }
4493
- else if ('default' in choiceDetails) {
4494
- const defaultUsi = choiceDetails.default.usi;
4495
- const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4496
- return some({
4497
- type: 'Default Fund',
4498
- name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4499
- usi: usi,
4500
- valid: this.toFundValidState(defaultFund),
4501
- lastNominatedAt: dateSubmitted
4502
- });
4503
4499
  }
4504
- return none;
4505
4500
  }
4506
4501
  async submitRetainSuperFundAsync(dto) {
4507
4502
  return buildBackendApiClient()
@@ -1,99 +1,84 @@
1
1
  import { none, some } from 'fp-ts/Option';
2
+ import { assertExhaustive } from '../../../utils';
2
3
  function getPromotedFundUsi(dto) {
3
- if ('slate' in dto) {
4
- return none;
5
- }
6
- else if ('australianRetirementTrust' in dto) {
7
- return some(dto.australianRetirementTrust.usi);
8
- }
9
- else if ('aware' in dto) {
10
- return some(dto.aware.usi);
11
- }
12
- else if ('active' in dto) {
13
- return some(dto.active.usi);
14
- }
15
- else if ('australianEthical' in dto) {
16
- return some(dto.australianEthical.usi);
17
- }
18
- else if ('virgin' in dto) {
19
- return some(dto.virgin.usi);
20
- }
21
- else if ('spirit' in dto) {
22
- return some(dto.spirit.usi);
23
- }
24
- else if ('firstSuper' in dto) {
25
- return some(dto.firstSuper.usi);
26
- }
27
- else if ('mercerMyChoice' in dto) {
28
- return some(dto.mercerMyChoice.usi);
29
- }
30
- else {
31
- return none;
4
+ switch (dto.kind) {
5
+ case 'slate':
6
+ return none;
7
+ case 'australianRetirementTrust':
8
+ return some(dto.australianRetirementTrust.usi);
9
+ case 'aware':
10
+ return some(dto.aware.usi);
11
+ case 'active':
12
+ return some(dto.active.usi);
13
+ case 'australianEthical':
14
+ return some(dto.australianEthical.usi);
15
+ case 'virgin':
16
+ return some(dto.virgin.usi);
17
+ case 'spirit':
18
+ return some(dto.spirit.usi);
19
+ case 'firstSuper':
20
+ return some(dto.firstSuper.usi);
21
+ case 'mercerMyChoice':
22
+ return some(dto.mercerMyChoice.usi);
23
+ default:
24
+ assertExhaustive(dto);
25
+ return none;
32
26
  }
33
27
  }
34
28
  export function getSuperChoiceUsi(dto) {
35
- if ('promoted' in dto) {
36
- return getPromotedFundUsi(dto.promoted);
37
- }
38
- else if ('myOwnFund' in dto) {
39
- return some(dto.myOwnFund.usi);
40
- }
41
- else if ('smsf' in dto) {
42
- return none;
43
- }
44
- else if ('default' in dto) {
45
- return some(dto.default.usi);
46
- }
47
- else {
48
- return none;
29
+ switch (dto.kind) {
30
+ case 'Promoted':
31
+ return getPromotedFundUsi(dto.promoted);
32
+ case 'MyOwnFund':
33
+ return some(dto.myOwnFund.usi);
34
+ case 'SMSF':
35
+ return none;
36
+ case 'Default':
37
+ return some(dto.default.usi);
38
+ case 'PromotedDefault':
39
+ return some(dto.promotedDefault.usi);
40
+ default:
41
+ assertExhaustive(dto);
42
+ return none;
49
43
  }
50
44
  }
51
45
  function getPromotedFundMemberNumber(dto) {
52
- if ('slate' in dto) {
53
- return some(dto.slate.memberNumber);
54
- }
55
- else if ('australianRetirementTrust' in dto) {
56
- return some(dto.australianRetirementTrust.memberNumber);
57
- }
58
- else if ('aware' in dto) {
59
- return some(dto.aware.memberNumber);
60
- }
61
- else if ('active' in dto) {
62
- return some(dto.active.memberNumber);
63
- }
64
- else if ('australianEthical' in dto) {
65
- return some(dto.australianEthical.memberNumber);
66
- }
67
- else if ('virgin' in dto) {
68
- return some(dto.virgin.memberNumber);
69
- }
70
- else if ('spirit' in dto) {
71
- return some(dto.spirit.memberNumber);
72
- }
73
- else if ('firstSuper' in dto) {
74
- return some(dto.firstSuper.memberNumber);
75
- }
76
- else if ('mercerMyChoice' in dto) {
77
- return some(dto.mercerMyChoice.memberNumber);
78
- }
79
- else {
80
- return none;
46
+ switch (dto.kind) {
47
+ case 'slate':
48
+ return some(dto.slate.memberNumber);
49
+ case 'australianRetirementTrust':
50
+ return some(dto.australianRetirementTrust.memberNumber);
51
+ case 'aware':
52
+ return some(dto.aware.memberNumber);
53
+ case 'active':
54
+ return some(dto.active.memberNumber);
55
+ case 'australianEthical':
56
+ return some(dto.australianEthical.memberNumber);
57
+ case 'virgin':
58
+ return some(dto.virgin.memberNumber);
59
+ case 'spirit':
60
+ return some(dto.spirit.memberNumber);
61
+ case 'firstSuper':
62
+ return some(dto.firstSuper.memberNumber);
63
+ case 'mercerMyChoice':
64
+ return some(dto.mercerMyChoice.memberNumber);
65
+ default:
66
+ assertExhaustive(dto);
67
+ return none;
81
68
  }
82
69
  }
83
70
  export function getSuperChoiceMemberNumber(dto) {
84
- if ('promoted' in dto) {
85
- return getPromotedFundMemberNumber(dto.promoted);
86
- }
87
- else if ('myOwnFund' in dto) {
88
- return some(dto.myOwnFund.memberNumber);
89
- }
90
- else if ('smsf' in dto) {
91
- return none;
92
- }
93
- else if ('default' in dto) {
94
- return none;
95
- }
96
- else {
97
- return none;
71
+ switch (dto.kind) {
72
+ case 'Promoted':
73
+ return getPromotedFundMemberNumber(dto.promoted);
74
+ case 'MyOwnFund':
75
+ return some(dto.myOwnFund.memberNumber);
76
+ case 'SMSF':
77
+ case 'Default':
78
+ case 'PromotedDefault':
79
+ return none;
80
+ default:
81
+ assertExhaustive(dto);
82
+ return none;
98
83
  }
99
84
  }
@@ -30,7 +30,7 @@ export class SuperSelectionApi {
30
30
  }
31
31
  async getCampaignConnectAsync() {
32
32
  return buildBackendApiClient()
33
- .url('compaign-connect')
33
+ .url('campaign-connect')
34
34
  .get()
35
35
  .notFound(() => {
36
36
  throw new Error('Failed to fetch campaign connect.');
@@ -0,0 +1,23 @@
1
+ import { h } from '@stencil/core';
2
+ import { none } from 'fp-ts/lib/Option';
3
+ import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
4
+ const name = 'Hesta Super';
5
+ const fund = {
6
+ fundId: 'hesta-default',
7
+ name,
8
+ logo: 'logo-active.svg',
9
+ route: SuperSelectionAppRoutes.PromotedFundJoinV2,
10
+ features: [
11
+ h("p", null, "A top-performing super fund driving real-world impact*"),
12
+ h("p", null, "1+ million members"),
13
+ h("p", null, "Expert help whenever you need it to help face the future with confidence")
14
+ ],
15
+ featureSubText: (h("span", null, "*Superratings Median returns at 30 April 2023 comparing each investment option their relevant cohort measured by growth asset allocation.")),
16
+ disclaimer: (h("div", null,
17
+ h("p", null, "You should consider the Product Disclosure Statement and Target Market Determination before deciding to invest in or apply to become a member of the fund."),
18
+ h("br", null),
19
+ h("p", null, "Issued by Hesta Super ABN 64 971 749 321."))),
20
+ footnoteTextOverride: none,
21
+ isPromotedDefault: true
22
+ };
23
+ export default fund;
@@ -1,4 +1,5 @@
1
1
  import { isNone, isSome, none, some } from 'fp-ts/Option';
2
+ import { assertExhaustive } from '../../../utils';
2
3
  import { buildBackendApiClient } from '../api/api-client';
3
4
  import { getSuperChoiceMemberNumber, getSuperChoiceUsi } from '../api/super-selection.api.dto';
4
5
  import * as constants from '../funds/constants';
@@ -24,53 +25,68 @@ export class ExistingFundService {
24
25
  const dateSubmitted = choice.dateSubmitted == undefined ? none : some(new Date(choice.dateSubmitted));
25
26
  const usi = getSuperChoiceUsi(choiceDetails);
26
27
  const memberNumber = getSuperChoiceMemberNumber(choiceDetails);
27
- if ('promoted' in choiceDetails) {
28
- const dtoPropName = Object.keys(choiceDetails.promoted)[0];
29
- const fund = constants.getFundByDtoPropName(dtoPropName);
30
- if (isNone(fund))
28
+ switch (choiceDetails.kind) {
29
+ case 'Promoted': {
30
+ const dtoPropName = Object.keys(choiceDetails.promoted)[0];
31
+ const fund = constants.getFundByDtoPropName(dtoPropName);
32
+ if (isNone(fund))
33
+ return none;
34
+ return some({
35
+ type: 'Promoted Fund',
36
+ id: fund.value.fundId,
37
+ name: fund.value.name,
38
+ usi: usi,
39
+ valid: 'Active',
40
+ memberNumber: memberNumber,
41
+ lastNominatedAt: dateSubmitted
42
+ });
43
+ }
44
+ case 'MyOwnFund': {
45
+ const fundUsi = choiceDetails.myOwnFund.usi;
46
+ const fund = await this.getFundByUsiAsync(fundUsi);
47
+ return some({
48
+ type: 'My Own Fund',
49
+ name: isSome(fund) ? fund.value.productName : fundUsi,
50
+ usi: usi,
51
+ valid: this.toFundValidState(fund),
52
+ memberNumber: memberNumber,
53
+ lastNominatedAt: dateSubmitted
54
+ });
55
+ }
56
+ case 'SMSF':
57
+ return some({
58
+ type: 'Self Managed Fund',
59
+ name: choiceDetails.smsf.fundName,
60
+ valid: 'Unknown',
61
+ lastNominatedAt: dateSubmitted
62
+ });
63
+ case 'Default': {
64
+ const defaultUsi = choiceDetails.default.usi;
65
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
66
+ return some({
67
+ type: 'Default Fund',
68
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
69
+ usi: usi,
70
+ valid: this.toFundValidState(defaultFund),
71
+ lastNominatedAt: dateSubmitted
72
+ });
73
+ }
74
+ case 'PromotedDefault': {
75
+ const defaultUsi = choiceDetails.promotedDefault.usi;
76
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
77
+ return some({
78
+ type: 'Promoted Default Fund',
79
+ id: choiceDetails.promotedDefault.fundId,
80
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
81
+ usi: usi,
82
+ valid: this.toFundValidState(defaultFund),
83
+ lastNominatedAt: dateSubmitted
84
+ });
85
+ }
86
+ default:
87
+ assertExhaustive(choiceDetails);
31
88
  return none;
32
- return some({
33
- type: 'Promoted Fund',
34
- id: fund.value.fundId,
35
- name: fund.value.name,
36
- usi: usi,
37
- valid: 'Active',
38
- memberNumber: memberNumber,
39
- lastNominatedAt: dateSubmitted
40
- });
41
89
  }
42
- else if ('smsf' in choiceDetails) {
43
- return some({
44
- type: 'Self Managed Fund',
45
- name: choiceDetails.smsf.fundName,
46
- valid: 'Unknown',
47
- lastNominatedAt: dateSubmitted
48
- });
49
- }
50
- else if ('myOwnFund' in choiceDetails) {
51
- const fundUsi = choiceDetails.myOwnFund.usi;
52
- const fund = await this.getFundByUsiAsync(fundUsi);
53
- return some({
54
- type: 'My Own Fund',
55
- name: isSome(fund) ? fund.value.productName : fundUsi,
56
- usi: usi,
57
- valid: this.toFundValidState(fund),
58
- memberNumber: memberNumber,
59
- lastNominatedAt: dateSubmitted
60
- });
61
- }
62
- else if ('default' in choiceDetails) {
63
- const defaultUsi = choiceDetails.default.usi;
64
- const defaultFund = await this.getFundByUsiAsync(defaultUsi);
65
- return some({
66
- type: 'Default Fund',
67
- name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
68
- usi: usi,
69
- valid: this.toFundValidState(defaultFund),
70
- lastNominatedAt: dateSubmitted
71
- });
72
- }
73
- return none;
74
90
  }
75
91
  async submitRetainSuperFundAsync(dto) {
76
92
  return buildBackendApiClient()