@flarehr/cars-calculator 2.9.7 → 2.9.13

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.
@@ -185,7 +185,8 @@ function createInitialState() {
185
185
  annualKms: none,
186
186
  paymentPeriod: none,
187
187
  state: none,
188
- term: none
188
+ term: none,
189
+ employmentType: none
189
190
  },
190
191
  quote: {
191
192
  afterTaxEffectPerPayCycle: none,
@@ -232,7 +233,7 @@ let SessionStore = class SessionStore extends Store {
232
233
  this.update((state) => (Object.assign(Object.assign({}, state), { refLists: Object.assign(Object.assign({}, state.refLists), { [name]: some(value) }) })));
233
234
  }
234
235
  setDistinctUserId(userId) {
235
- _function.pipe(userId, fold(() => ({}), distinctUserId => this.update((state) => (Object.assign(Object.assign({}, state), { distinctUserId })))));
236
+ _function.pipe(userId, fold(() => ({}), (distinctUserId) => this.update((state) => (Object.assign(Object.assign({}, state), { distinctUserId })))));
236
237
  }
237
238
  };
238
239
  SessionStore = __decorate([
@@ -2997,7 +2998,8 @@ class CarsCalculatorService {
2997
2998
  payPeriod: getOrError(user.paymentPeriod),
2998
2999
  annualKm: getOrError(user.annualKms),
2999
3000
  state: getOrError(user.state),
3000
- leaseTermInYears: getOrError(user.term)
3001
+ leaseTermInYears: getOrError(user.term),
3002
+ employmentType: getOrError(user.employmentType)
3001
3003
  },
3002
3004
  websiteQuote: {
3003
3005
  afterTaxEffectPerPayCycle: getOrError(result.afterTaxEffectPerPayCycle),
@@ -3025,6 +3027,7 @@ class CarsCalculatorService {
3025
3027
  isSome(user.paymentPeriod) &&
3026
3028
  isSome(user.state) &&
3027
3029
  isSome(user.term) &&
3030
+ isSome(user.employmentType) &&
3028
3031
  isSome(vehicle.selectedVariant);
3029
3032
  if (!isAllInformationAvailable) {
3030
3033
  return;
@@ -3054,7 +3057,8 @@ class CarsCalculatorService {
3054
3057
  payPeriod: getOrError(user.paymentPeriod),
3055
3058
  annualKm: getOrError(user.annualKms),
3056
3059
  state: getOrError(user.state),
3057
- leaseTermInYears: getOrError(user.term)
3060
+ leaseTermInYears: getOrError(user.term),
3061
+ employmentType: getOrError(user.employmentType)
3058
3062
  };
3059
3063
  const response = await backendApi.postCarsQuoteResult(req);
3060
3064
  const quoteResult = {
@@ -3170,6 +3174,13 @@ const PersonalInfoSection = class {
3170
3174
  this.terms = generateTermsOptionsArray(5);
3171
3175
  this.states = ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA'];
3172
3176
  this.paymentPeriods = ['Monthly', 'Fortnightly', 'Weekly'];
3177
+ this.employmentTypes = [
3178
+ 'Full-time',
3179
+ 'Part-time',
3180
+ 'Casual',
3181
+ 'Contractor',
3182
+ 'Other'
3183
+ ];
3173
3184
  sessionQuery.user$.subscribe((state) => (this.userInfo = state));
3174
3185
  }
3175
3186
  render() {
@@ -3191,7 +3202,7 @@ const PersonalInfoSection = class {
3191
3202
  }, onBlur: (e) => {
3192
3203
  const el = e.target;
3193
3204
  el.value += ' km';
3194
- }, onChange: (ev) => this.updateUserInfo('annualKms', parseInt(ev.target.value.trim())) })), h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" }, h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I live in"), h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: toSelectInputOptionsArray(this.states), requiredValidationMessage: "Select an option", placeholder: "select state", value: this.getUserInfo('state'), onValueChanged: (e) => this.updateUserInfo('state', e.detail.value) })), h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" }, h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I want my lease term to be"), h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: this.terms, requiredValidationMessage: "Select an option", placeholder: "Select...", value: this.getUserInfo('term'), onValueChanged: (e) => this.updateUserInfo('term', e.detail.value) }))));
3205
+ }, onChange: (ev) => this.updateUserInfo('annualKms', parseInt(ev.target.value.trim())) })), h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" }, h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I live in"), h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: toSelectInputOptionsArray(this.states), requiredValidationMessage: "Select an option", placeholder: "select state", value: this.getUserInfo('state'), onValueChanged: (e) => this.updateUserInfo('state', e.detail.value) })), h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" }, h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "I want my lease term to be"), h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: this.terms, requiredValidationMessage: "Select an option", placeholder: "Select...", value: this.getUserInfo('term'), onValueChanged: (e) => this.updateUserInfo('term', e.detail.value) })), h("div", { class: "d-flex flex-column flex-lg-row align-items-start align-items-lg-center justify-content-center mt-4 h4" }, h("span", { class: "pr-0 pr-sm-2 d-flex text-center" }, "Employment Type"), h("fl-dropdown", { class: "d-flex my-2 my-lg-0", options: toSelectInputOptionsArray(this.employmentTypes), requiredValidationMessage: "Select an option", placeholder: "Select...", value: this.getUserInfo('employmentType'), onValueChanged: (e) => this.updateUserInfo('employmentType', e.detail.value) }))));
3195
3206
  }
3196
3207
  updateUserInfo(key, value) {
3197
3208
  sessionStore.update({ user: Object.assign(Object.assign({}, this.userInfo), { [key]: some(value) }) });