Skip to content

Commit

Permalink
Merge pull request #605 from Rajandeep98/24945_Correction_Filing_Button
Browse files Browse the repository at this point in the history
Enabling Fee Reciept and File Pay button for minimal changes in the f…
  • Loading branch information
Rajandeep98 authored Dec 24, 2024
2 parents fdeb299 + ef03e38 commit fa38f6e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 59 deletions.
3 changes: 1 addition & 2 deletions src/components/common/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export default class Actions extends Mixins(DateMixin, FilingTemplateMixin, Name
@Getter(useStore) getFilingId!: number
// @Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) hasAlterationDataChanged!: boolean // for testing state-getters
@Getter(useStore) hasCorrectionDataChanged!: boolean
@Getter(useStore) havePeopleAndRolesChanged!: boolean // for testing state-getters
@Getter(useStore) isBusySaving!: boolean
@Getter(useStore) isCorrectionEditing!: boolean
Expand All @@ -103,7 +102,7 @@ export default class Actions extends Mixins(DateMixin, FilingTemplateMixin, Name
/** True if the File and Pay button should be disabled. */
get isFilePayButtonDisabled (): boolean {
return (!this.hasCorrectionDataChanged || this.isBusySaving || !this.isCorrectionValid || this.isCorrectionEditing)
return (this.isBusySaving || !this.isCorrectionValid || this.isCorrectionEditing)
}
/**
Expand Down
81 changes: 41 additions & 40 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,51 +558,52 @@ export const useStore = defineStore('store', {
},

/**
* Commenting out for now, might be used in future.
* Whether any correction data has changed (for the purpose of showing the
* fee summary), ie, does not include:
* - completing party
* - detail
* - certify
* - staff payment
*/
hasCorrectionDataChanged (): boolean {
if (this.isBaseCorrectionFiling) {
return (
this.hasBusinessNameChanged ||
this.hasBusinessTypeChanged ||
this.haveNameTranslationsChanged ||
this.haveOfficeAddressesChanged ||
this.havePeopleAndRolesChanged ||
this.hasShareStructureChanged ||
this.areProvisionsRemoved ||
this.haveNewResolutionDates
)
}

if (this.isFirmCorrectionFiling) {
return (
this.hasBusinessNameChanged ||
this.hasBusinessStartDateChanged ||
this.hasNaicsChanged ||
this.haveOfficeAddressesChanged ||
this.havePeopleAndRolesChanged
)
}

if (this.isCoopCorrectionFiling) {
return (
this.hasBusinessNameChanged ||
this.hasAssociationTypeChanged ||
this.hasSpecialResolutionMemorandumChanged ||
this.haveOfficeAddressesChanged ||
this.havePeopleAndRolesChanged ||
this.hasSpecialResolutionRulesChanged ||
this.hasSpecialResolutionResolutionChanged
)
}

return false // should never happen
},
// hasCorrectionDataChanged (): boolean {
// if (this.isBaseCorrectionFiling) {
// return (
// this.hasBusinessNameChanged ||
// this.hasBusinessTypeChanged ||
// this.haveNameTranslationsChanged ||
// this.haveOfficeAddressesChanged ||
// this.havePeopleAndRolesChanged ||
// this.hasShareStructureChanged ||
// this.areProvisionsRemoved ||
// this.haveNewResolutionDates
// )
// }

// if (this.isFirmCorrectionFiling) {
// return (
// this.hasBusinessNameChanged ||
// this.hasBusinessStartDateChanged ||
// this.hasNaicsChanged ||
// this.haveOfficeAddressesChanged ||
// this.havePeopleAndRolesChanged
// )
// }

// if (this.isCoopCorrectionFiling) {
// return (
// this.hasBusinessNameChanged ||
// this.hasAssociationTypeChanged ||
// this.hasSpecialResolutionMemorandumChanged ||
// this.haveOfficeAddressesChanged ||
// this.havePeopleAndRolesChanged ||
// this.hasSpecialResolutionRulesChanged ||
// this.hasSpecialResolutionResolutionChanged
// )
// }

// return false // should never happen
// },

/**
* Whether any alteration data has changed (for the purpose of showing the
Expand Down Expand Up @@ -1193,7 +1194,7 @@ export const useStore = defineStore('store', {
},

/**
* Whether to show the fee summary.
* Whether to show the fee summary [show fee summary in all cases].
* This is a safety check to ensure that fee summary component is not loaded
* until there is a valid filing type and entity code.
*/
Expand All @@ -1205,7 +1206,7 @@ export const useStore = defineStore('store', {
waiveFees: false
}]
const haveFilingChange = (
(this.isCorrectionFiling && this.hasCorrectionDataChanged) ||
(this.isCorrectionFiling) ||
(this.isAlterationFiling && this.hasAlterationDataChanged) ||
(this.isFirmChangeFiling && this.hasChangeDataChanged) ||
(this.isFirmConversionFiling && this.hasConversionDataChanged) ||
Expand Down
6 changes: 1 addition & 5 deletions tests/unit/CoopCorrection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ describe('Coop Correction component', () => {
expect(store.isCorrectionEditing).toBe(true)
})

it('isCorrectionValid and hasCorrectionDataChanged', async () => {
it('isCorrectionValid', async () => {
store.stateModel.correctionInformation.type = CorrectionErrorTypes.CLIENT
await Vue.nextTick()

Expand All @@ -473,7 +473,6 @@ describe('Coop Correction component', () => {
// These validation flags plus more make up isCorrectionValid
// This property is used enable/disable the file and pay button.
expect(store.isCorrectionValid).toBe(false)
expect(store.hasCorrectionDataChanged).toBe(false)

store.stateModel.nameRequestLegalName = 'SUPER SUPER COOP 2'
expect(store.hasBusinessNameChanged).toBe(true)
Expand All @@ -485,8 +484,5 @@ describe('Coop Correction component', () => {
expect(store.hasSpecialResolutionRulesChanged).toBe(true)
store.stateModel.specialResolution.resolution = 'NEW RESOLUTION'
expect(store.hasSpecialResolutionResolutionChanged).toBe(true)
// These change flags make up hasCorrectionDataChanged
// This property is used to enable/disable the file and pay button.
expect(store.hasCorrectionDataChanged).toBe(true)
})
})
12 changes: 0 additions & 12 deletions tests/unit/state-getters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,6 @@ describe('BEN correction getters', () => {
})

it('returns correct values for "Has Correction Changed" getter', async () => {
// initially, this getter should be false (default value)
expect(vm.hasCorrectionDataChanged).toBe(false)

// verify that business name changes are detected
store.stateModel.nameRequestLegalName = 'MyLegalName2'
expect(vm.hasBusinessNameChanged).toBe(true)
Expand Down Expand Up @@ -394,9 +391,6 @@ describe('BEN correction getters', () => {
expect(vm.hasShareStructureChanged).toBe(true)
store.stateModel.shareStructureStep.shareClasses = []
expect(vm.hasShareStructureChanged).toBe(false)

// finally, this getter should be false
expect(vm.hasCorrectionDataChanged).toBe(false)
})
})

Expand Down Expand Up @@ -459,9 +453,6 @@ describe('SP/GP correction getters - with easy legal name fix', () => {
})

it('returns correct values for "Has Correction Changed" getter', async () => {
// initially, this getter should be false (default value)
expect(vm.hasCorrectionDataChanged).toBe(false)

// verify that business name changes are detected
store.stateModel.nameRequestLegalName = 'MyLegalName2'
expect(vm.hasBusinessNameChanged).toBe(true)
Expand Down Expand Up @@ -537,9 +528,6 @@ describe('SP/GP correction getters - with easy legal name fix', () => {
expect(vm.hasNaicsChanged).toBe(true)
store.stateModel.businessInformation = naics as any
expect(vm.hasNaicsChanged).toBe(false)

// finally, this getter should be false
expect(vm.hasCorrectionDataChanged).toBe(false)
})
})

Expand Down

0 comments on commit fa38f6e

Please sign in to comment.