@flarehr/apollo-super-selection 1.2.30249 → 1.2.30304

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.
@@ -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-ba3ccc46.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(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-42b3a325.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)}))}}}));
@@ -264,7 +264,7 @@ class TapSubscriber extends datoramaAkita.Subscriber {
264
264
  }
265
265
  }
266
266
 
267
- const AppVersion = '1.2.30249';
267
+ const AppVersion = '1.2.30304';
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.');
@@ -4345,101 +4345,81 @@ const getFundUsiByFundId = (fundId) => fundId == fund$6.fundId ? some(slateUsi)
4345
4345
  const getLogoSrcByFundId = (fundId) => fundsById[fundId] != undefined ? some(index.getAssetPath(`assets/${fundsById[fundId].logo}`)) : none;
4346
4346
 
4347
4347
  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;
4348
+ switch (dto.kind) {
4349
+ case 'slate':
4350
+ return none;
4351
+ case 'australianRetirementTrust':
4352
+ return some(dto.australianRetirementTrust.usi);
4353
+ case 'aware':
4354
+ return some(dto.aware.usi);
4355
+ case 'active':
4356
+ return some(dto.active.usi);
4357
+ case 'australianEthical':
4358
+ return some(dto.australianEthical.usi);
4359
+ case 'virgin':
4360
+ return some(dto.virgin.usi);
4361
+ case 'spirit':
4362
+ return some(dto.spirit.usi);
4363
+ case 'firstSuper':
4364
+ return some(dto.firstSuper.usi);
4365
+ case 'mercerMyChoice':
4366
+ return some(dto.mercerMyChoice.usi);
4367
+ default:
4368
+ return none;
4377
4369
  }
4378
4370
  }
4379
4371
  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;
4372
+ switch (dto.kind) {
4373
+ case 'Promoted':
4374
+ return getPromotedFundUsi(dto.promoted);
4375
+ case 'MyOwnFund':
4376
+ return some(dto.myOwnFund.usi);
4377
+ case 'SMSF':
4378
+ return none;
4379
+ case 'Default':
4380
+ return some(dto.default.usi);
4381
+ case 'PromotedDefault':
4382
+ return some(dto.promotedDefault.usi);
4383
+ default:
4384
+ return none;
4394
4385
  }
4395
4386
  }
4396
4387
  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;
4388
+ switch (dto.kind) {
4389
+ case 'slate':
4390
+ return some(dto.slate.memberNumber);
4391
+ case 'australianRetirementTrust':
4392
+ return some(dto.australianRetirementTrust.memberNumber);
4393
+ case 'aware':
4394
+ return some(dto.aware.memberNumber);
4395
+ case 'active':
4396
+ return some(dto.active.memberNumber);
4397
+ case 'australianEthical':
4398
+ return some(dto.australianEthical.memberNumber);
4399
+ case 'virgin':
4400
+ return some(dto.virgin.memberNumber);
4401
+ case 'spirit':
4402
+ return some(dto.spirit.memberNumber);
4403
+ case 'firstSuper':
4404
+ return some(dto.firstSuper.memberNumber);
4405
+ case 'mercerMyChoice':
4406
+ return some(dto.mercerMyChoice.memberNumber);
4407
+ default:
4408
+ return none;
4426
4409
  }
4427
4410
  }
4428
4411
  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;
4412
+ switch (dto.kind) {
4413
+ case 'Promoted':
4414
+ return getPromotedFundMemberNumber(dto.promoted);
4415
+ case 'MyOwnFund':
4416
+ return some(dto.myOwnFund.memberNumber);
4417
+ case 'SMSF':
4418
+ case 'Default':
4419
+ case 'PromotedDefault':
4420
+ return none;
4421
+ default:
4422
+ return none;
4443
4423
  }
4444
4424
  }
4445
4425
 
@@ -4455,53 +4435,67 @@ class ExistingFundService {
4455
4435
  const dateSubmitted = choice.dateSubmitted == undefined ? none : some(new Date(choice.dateSubmitted));
4456
4436
  const usi = getSuperChoiceUsi(choiceDetails);
4457
4437
  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))
4438
+ switch (choiceDetails.kind) {
4439
+ case 'Promoted': {
4440
+ const dtoPropName = Object.keys(choiceDetails.promoted)[0];
4441
+ const fund = getFundByDtoPropName(dtoPropName);
4442
+ if (isNone(fund))
4443
+ return none;
4444
+ return some({
4445
+ type: 'Promoted Fund',
4446
+ id: fund.value.fundId,
4447
+ name: fund.value.name,
4448
+ usi: usi,
4449
+ valid: 'Active',
4450
+ memberNumber: memberNumber,
4451
+ lastNominatedAt: dateSubmitted
4452
+ });
4453
+ }
4454
+ case 'MyOwnFund': {
4455
+ const fundUsi = choiceDetails.myOwnFund.usi;
4456
+ const fund = await this.getFundByUsiAsync(fundUsi);
4457
+ return some({
4458
+ type: 'My Own Fund',
4459
+ name: isSome(fund) ? fund.value.productName : fundUsi,
4460
+ usi: usi,
4461
+ valid: this.toFundValidState(fund),
4462
+ memberNumber: memberNumber,
4463
+ lastNominatedAt: dateSubmitted
4464
+ });
4465
+ }
4466
+ case 'SMSF':
4467
+ return some({
4468
+ type: 'Self Managed Fund',
4469
+ name: choiceDetails.smsf.fundName,
4470
+ valid: 'Unknown',
4471
+ lastNominatedAt: dateSubmitted
4472
+ });
4473
+ case 'Default': {
4474
+ const defaultUsi = choiceDetails.default.usi;
4475
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4476
+ return some({
4477
+ type: 'Default Fund',
4478
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4479
+ usi: usi,
4480
+ valid: this.toFundValidState(defaultFund),
4481
+ lastNominatedAt: dateSubmitted
4482
+ });
4483
+ }
4484
+ case 'PromotedDefault': {
4485
+ const defaultUsi = choiceDetails.promotedDefault.usi;
4486
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4487
+ return some({
4488
+ type: 'Promoted Default Fund',
4489
+ id: choiceDetails.promotedDefault.fundId,
4490
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4491
+ usi: usi,
4492
+ valid: this.toFundValidState(defaultFund),
4493
+ lastNominatedAt: dateSubmitted
4494
+ });
4495
+ }
4496
+ default:
4462
4497
  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
4498
  }
4504
- return none;
4505
4499
  }
4506
4500
  async submitRetainSuperFundAsync(dto) {
4507
4501
  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()
@@ -6,3 +6,6 @@ export function addSlashToUrl() {
6
6
  history.pushState(history.state, '', url);
7
7
  }
8
8
  }
9
+ export function assertExhaustive(_value) {
10
+ return;
11
+ }