Skip to content

Commit

Permalink
Refactored code to reduce redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespaologarcia committed Nov 29, 2023
1 parent 4a712a5 commit c978e6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/components/existing-request/existing-request-display.vue
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,6 @@ export default class ExistingRequestDisplay extends Mixins(
private async affiliateOrLogin (): Promise<any> {
if (this.isAuthenticated) {
await this.createAffiliation(this.nr)
if (this.isAmalgamation) {
await this.amalgamateNow(this.nr.entity_type_cd)
}
} else {
// persist NR in session for affiliation upon authentication via Signin component
sessionStorage.setItem('NR_DATA', JSON.stringify(this.nr))
Expand Down
14 changes: 13 additions & 1 deletion src/mixins/nr-affiliation-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export class NrAffiliationMixin extends Mixins(CommonMixin) {
let legalType = ''
let businessRequest = {} as BusinessRequest
const nrNumber = nr.nrNum

if (!this.isFirm(nr)) {
name = FilingTypes.INCORPORATION_APPLICATION
legalType = this.entityTypeToCorpType(nr.entity_type_cd)
Expand All @@ -153,6 +152,19 @@ export class NrAffiliationMixin extends Mixins(CommonMixin) {
}
}
}
} else if (nr.request_action_cd === 'AML') {
name = FilingTypes.AMALGAMATION
legalType = nr.legalType
businessRequest = {
filing: {
business: { legalType },
header: { accountId, name },
amalgamation: {
type: AmalgamationTypes.REGULAR,
nameRequest: { legalType, nrNumber }
}
}
}
} else {
name = FilingTypes.REGISTRATION
legalType = nr.legalType
Expand Down

0 comments on commit c978e6c

Please sign in to comment.