@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
@@ -98,6 +98,7 @@ export class SuperSelectionAppService {
98
98
  this._state.profileConfiguration = O.fromNullable(appStateResponse.profileConfiguration);
99
99
  this._state.superBuyer = O.fromNullable(appStateResponse.superBuyer);
100
100
  this._state.promotedFunds = O.fromNullable(appStateResponse.promotedFunds);
101
+ this._state.campaignConnectEnabled = appStateResponse.campaignConnectEnabled;
101
102
  if (this._state.campaignConnectEnabled) {
102
103
  this._state.campaignConnectPromise = O.fromNullable(superSelectionApi.getCampaignConnectAsync());
103
104
  }
@@ -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
+ }
@@ -260,7 +260,7 @@ class TapSubscriber extends Subscriber {
260
260
  }
261
261
  }
262
262
 
263
- const AppVersion = '1.2.30260';
263
+ const AppVersion = '1.2.30309';
264
264
 
265
265
  // -------------------------------------------------------------------------------------
266
266
  // guards
@@ -3303,7 +3303,7 @@ class SuperSelectionApi {
3303
3303
  }
3304
3304
  async getCampaignConnectAsync() {
3305
3305
  return buildBackendApiClient()
3306
- .url('compaign-connect')
3306
+ .url('campaign-connect')
3307
3307
  .get()
3308
3308
  .notFound(() => {
3309
3309
  throw new Error('Failed to fetch campaign connect.');
@@ -3436,6 +3436,7 @@ class SuperSelectionAppService {
3436
3436
  this._state.profileConfiguration = Option.fromNullable(appStateResponse.profileConfiguration);
3437
3437
  this._state.superBuyer = Option.fromNullable(appStateResponse.superBuyer);
3438
3438
  this._state.promotedFunds = Option.fromNullable(appStateResponse.promotedFunds);
3439
+ this._state.campaignConnectEnabled = appStateResponse.campaignConnectEnabled;
3439
3440
  if (this._state.campaignConnectEnabled) {
3440
3441
  this._state.campaignConnectPromise = Option.fromNullable(superSelectionApi.getCampaignConnectAsync());
3441
3442
  }
@@ -4341,101 +4342,81 @@ const getFundUsiByFundId = (fundId) => fundId == fund$6.fundId ? some(slateUsi)
4341
4342
  const getLogoSrcByFundId = (fundId) => fundsById[fundId] != undefined ? some(getAssetPath(`assets/${fundsById[fundId].logo}`)) : none;
4342
4343
 
4343
4344
  function getPromotedFundUsi(dto) {
4344
- if ('slate' in dto) {
4345
- return none;
4346
- }
4347
- else if ('australianRetirementTrust' in dto) {
4348
- return some(dto.australianRetirementTrust.usi);
4349
- }
4350
- else if ('aware' in dto) {
4351
- return some(dto.aware.usi);
4352
- }
4353
- else if ('active' in dto) {
4354
- return some(dto.active.usi);
4355
- }
4356
- else if ('australianEthical' in dto) {
4357
- return some(dto.australianEthical.usi);
4358
- }
4359
- else if ('virgin' in dto) {
4360
- return some(dto.virgin.usi);
4361
- }
4362
- else if ('spirit' in dto) {
4363
- return some(dto.spirit.usi);
4364
- }
4365
- else if ('firstSuper' in dto) {
4366
- return some(dto.firstSuper.usi);
4367
- }
4368
- else if ('mercerMyChoice' in dto) {
4369
- return some(dto.mercerMyChoice.usi);
4370
- }
4371
- else {
4372
- return none;
4345
+ switch (dto.kind) {
4346
+ case 'slate':
4347
+ return none;
4348
+ case 'australianRetirementTrust':
4349
+ return some(dto.australianRetirementTrust.usi);
4350
+ case 'aware':
4351
+ return some(dto.aware.usi);
4352
+ case 'active':
4353
+ return some(dto.active.usi);
4354
+ case 'australianEthical':
4355
+ return some(dto.australianEthical.usi);
4356
+ case 'virgin':
4357
+ return some(dto.virgin.usi);
4358
+ case 'spirit':
4359
+ return some(dto.spirit.usi);
4360
+ case 'firstSuper':
4361
+ return some(dto.firstSuper.usi);
4362
+ case 'mercerMyChoice':
4363
+ return some(dto.mercerMyChoice.usi);
4364
+ default:
4365
+ return none;
4373
4366
  }
4374
4367
  }
4375
4368
  function getSuperChoiceUsi(dto) {
4376
- if ('promoted' in dto) {
4377
- return getPromotedFundUsi(dto.promoted);
4378
- }
4379
- else if ('myOwnFund' in dto) {
4380
- return some(dto.myOwnFund.usi);
4381
- }
4382
- else if ('smsf' in dto) {
4383
- return none;
4384
- }
4385
- else if ('default' in dto) {
4386
- return some(dto.default.usi);
4387
- }
4388
- else {
4389
- return none;
4369
+ switch (dto.kind) {
4370
+ case 'Promoted':
4371
+ return getPromotedFundUsi(dto.promoted);
4372
+ case 'MyOwnFund':
4373
+ return some(dto.myOwnFund.usi);
4374
+ case 'SMSF':
4375
+ return none;
4376
+ case 'Default':
4377
+ return some(dto.default.usi);
4378
+ case 'PromotedDefault':
4379
+ return some(dto.promotedDefault.usi);
4380
+ default:
4381
+ return none;
4390
4382
  }
4391
4383
  }
4392
4384
  function getPromotedFundMemberNumber(dto) {
4393
- if ('slate' in dto) {
4394
- return some(dto.slate.memberNumber);
4395
- }
4396
- else if ('australianRetirementTrust' in dto) {
4397
- return some(dto.australianRetirementTrust.memberNumber);
4398
- }
4399
- else if ('aware' in dto) {
4400
- return some(dto.aware.memberNumber);
4401
- }
4402
- else if ('active' in dto) {
4403
- return some(dto.active.memberNumber);
4404
- }
4405
- else if ('australianEthical' in dto) {
4406
- return some(dto.australianEthical.memberNumber);
4407
- }
4408
- else if ('virgin' in dto) {
4409
- return some(dto.virgin.memberNumber);
4410
- }
4411
- else if ('spirit' in dto) {
4412
- return some(dto.spirit.memberNumber);
4413
- }
4414
- else if ('firstSuper' in dto) {
4415
- return some(dto.firstSuper.memberNumber);
4416
- }
4417
- else if ('mercerMyChoice' in dto) {
4418
- return some(dto.mercerMyChoice.memberNumber);
4419
- }
4420
- else {
4421
- return none;
4385
+ switch (dto.kind) {
4386
+ case 'slate':
4387
+ return some(dto.slate.memberNumber);
4388
+ case 'australianRetirementTrust':
4389
+ return some(dto.australianRetirementTrust.memberNumber);
4390
+ case 'aware':
4391
+ return some(dto.aware.memberNumber);
4392
+ case 'active':
4393
+ return some(dto.active.memberNumber);
4394
+ case 'australianEthical':
4395
+ return some(dto.australianEthical.memberNumber);
4396
+ case 'virgin':
4397
+ return some(dto.virgin.memberNumber);
4398
+ case 'spirit':
4399
+ return some(dto.spirit.memberNumber);
4400
+ case 'firstSuper':
4401
+ return some(dto.firstSuper.memberNumber);
4402
+ case 'mercerMyChoice':
4403
+ return some(dto.mercerMyChoice.memberNumber);
4404
+ default:
4405
+ return none;
4422
4406
  }
4423
4407
  }
4424
4408
  function getSuperChoiceMemberNumber(dto) {
4425
- if ('promoted' in dto) {
4426
- return getPromotedFundMemberNumber(dto.promoted);
4427
- }
4428
- else if ('myOwnFund' in dto) {
4429
- return some(dto.myOwnFund.memberNumber);
4430
- }
4431
- else if ('smsf' in dto) {
4432
- return none;
4433
- }
4434
- else if ('default' in dto) {
4435
- return none;
4436
- }
4437
- else {
4438
- return none;
4409
+ switch (dto.kind) {
4410
+ case 'Promoted':
4411
+ return getPromotedFundMemberNumber(dto.promoted);
4412
+ case 'MyOwnFund':
4413
+ return some(dto.myOwnFund.memberNumber);
4414
+ case 'SMSF':
4415
+ case 'Default':
4416
+ case 'PromotedDefault':
4417
+ return none;
4418
+ default:
4419
+ return none;
4439
4420
  }
4440
4421
  }
4441
4422
 
@@ -4451,53 +4432,67 @@ class ExistingFundService {
4451
4432
  const dateSubmitted = choice.dateSubmitted == undefined ? none : some(new Date(choice.dateSubmitted));
4452
4433
  const usi = getSuperChoiceUsi(choiceDetails);
4453
4434
  const memberNumber = getSuperChoiceMemberNumber(choiceDetails);
4454
- if ('promoted' in choiceDetails) {
4455
- const dtoPropName = Object.keys(choiceDetails.promoted)[0];
4456
- const fund = getFundByDtoPropName(dtoPropName);
4457
- if (isNone(fund))
4435
+ switch (choiceDetails.kind) {
4436
+ case 'Promoted': {
4437
+ const dtoPropName = Object.keys(choiceDetails.promoted)[0];
4438
+ const fund = getFundByDtoPropName(dtoPropName);
4439
+ if (isNone(fund))
4440
+ return none;
4441
+ return some({
4442
+ type: 'Promoted Fund',
4443
+ id: fund.value.fundId,
4444
+ name: fund.value.name,
4445
+ usi: usi,
4446
+ valid: 'Active',
4447
+ memberNumber: memberNumber,
4448
+ lastNominatedAt: dateSubmitted
4449
+ });
4450
+ }
4451
+ case 'MyOwnFund': {
4452
+ const fundUsi = choiceDetails.myOwnFund.usi;
4453
+ const fund = await this.getFundByUsiAsync(fundUsi);
4454
+ return some({
4455
+ type: 'My Own Fund',
4456
+ name: isSome(fund) ? fund.value.productName : fundUsi,
4457
+ usi: usi,
4458
+ valid: this.toFundValidState(fund),
4459
+ memberNumber: memberNumber,
4460
+ lastNominatedAt: dateSubmitted
4461
+ });
4462
+ }
4463
+ case 'SMSF':
4464
+ return some({
4465
+ type: 'Self Managed Fund',
4466
+ name: choiceDetails.smsf.fundName,
4467
+ valid: 'Unknown',
4468
+ lastNominatedAt: dateSubmitted
4469
+ });
4470
+ case 'Default': {
4471
+ const defaultUsi = choiceDetails.default.usi;
4472
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4473
+ return some({
4474
+ type: 'Default Fund',
4475
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4476
+ usi: usi,
4477
+ valid: this.toFundValidState(defaultFund),
4478
+ lastNominatedAt: dateSubmitted
4479
+ });
4480
+ }
4481
+ case 'PromotedDefault': {
4482
+ const defaultUsi = choiceDetails.promotedDefault.usi;
4483
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4484
+ return some({
4485
+ type: 'Promoted Default Fund',
4486
+ id: choiceDetails.promotedDefault.fundId,
4487
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4488
+ usi: usi,
4489
+ valid: this.toFundValidState(defaultFund),
4490
+ lastNominatedAt: dateSubmitted
4491
+ });
4492
+ }
4493
+ default:
4458
4494
  return none;
4459
- return some({
4460
- type: 'Promoted Fund',
4461
- id: fund.value.fundId,
4462
- name: fund.value.name,
4463
- usi: usi,
4464
- valid: 'Active',
4465
- memberNumber: memberNumber,
4466
- lastNominatedAt: dateSubmitted
4467
- });
4468
- }
4469
- else if ('smsf' in choiceDetails) {
4470
- return some({
4471
- type: 'Self Managed Fund',
4472
- name: choiceDetails.smsf.fundName,
4473
- valid: 'Unknown',
4474
- lastNominatedAt: dateSubmitted
4475
- });
4476
- }
4477
- else if ('myOwnFund' in choiceDetails) {
4478
- const fundUsi = choiceDetails.myOwnFund.usi;
4479
- const fund = await this.getFundByUsiAsync(fundUsi);
4480
- return some({
4481
- type: 'My Own Fund',
4482
- name: isSome(fund) ? fund.value.productName : fundUsi,
4483
- usi: usi,
4484
- valid: this.toFundValidState(fund),
4485
- memberNumber: memberNumber,
4486
- lastNominatedAt: dateSubmitted
4487
- });
4488
- }
4489
- else if ('default' in choiceDetails) {
4490
- const defaultUsi = choiceDetails.default.usi;
4491
- const defaultFund = await this.getFundByUsiAsync(defaultUsi);
4492
- return some({
4493
- type: 'Default Fund',
4494
- name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
4495
- usi: usi,
4496
- valid: this.toFundValidState(defaultFund),
4497
- lastNominatedAt: dateSubmitted
4498
- });
4499
4495
  }
4500
- return none;
4501
4496
  }
4502
4497
  async submitRetainSuperFundAsync(dto) {
4503
4498
  return buildBackendApiClient()