Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate now for named companies after NR is approved #627

Conversation

JazzarKarim
Copy link
Collaborator

@JazzarKarim JazzarKarim commented Jul 18, 2023

Issue #: /bcgov/entity#16942

Description of changes:

  • Added incorporate now button for named companies after the NR has been approved.

I tested all the possible scenarios (BC, BEN, CC, ULC). I tried implementing the button as clean as possible with minimal code additions by building upon previous work.
UXPin: https://preview.uxpin.com/a86dccdd20ac62828f965c5eea10f81b828a9853#/pages/163136223/simulate/sitemap

Example for CC:

After NR is Approved:
NR approved

Redirect:
incorporate with NR

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namerequest license (Apache 2.0).

@JazzarKarim
Copy link
Collaborator Author

/gcbrun

@pwei1018
Copy link
Collaborator

Temporary Url for review: https://namerequest-dev--pr-627-58y7qy7d.web.app

* The alternate codes for entity types.
* Alternate codes are used in Entities UIs.
*/
entityTypeAlternateCode (entityType: EntityType): CorpTypeCd {
Copy link
Collaborator Author

@JazzarKarim JazzarKarim Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this function to CommonMixin. It makes sense since it'll come in handy for even further work later on.


<!-- incorporate button -->
<div class="mt-5 text-center" v-if="showIncorporateButton">
<v-btn id="INCORPORATE-btn" @click="handleButtonClick(NrAction.INCORPORATE)">
Copy link
Collaborator Author

@JazzarKarim JazzarKarim Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button is now in the NRApprovedGrayBoy component above. I'm following the UXPin. It has similar behavior as the Register Your Business button

this.isSupportedEntity(this.nr) &&
this.nr.request_action_cd &&
this.nr.request_action_cd === NrRequestActionCodes.NEW_BUSINESS &&
NrState.APPROVED === this.nr.state
Copy link
Collaborator Author

@JazzarKarim JazzarKarim Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be showing the button if the current entity type is supported (from FF), new business, and if the NR has been approved. The isSupportedEntity function is in the CommonMixin for usage as we like. It'll take the place of isBenefitCompany.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove line 416 since line 417 will cover it.

Where did you copy the "if approved" logic from? It may be complicated that this (ie, conditional approval). Not certain but asking if you've looked into it.

Copy link
Collaborator Author

@JazzarKarim JazzarKarim Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here is almost similar to the showRegisterButton on line 422 with the difference being instead of isFirm, it's isSupportedEntity.

I do agree with you on the first point. I was just using the similar condition to the existing one (showRegisterButton).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please call out for some extra testing on acceptable NR states to incorporate from (and/or confirm what's done in Auth Web for IA NRs).

Otherwise, my concerns are satisfied here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I took a look and this should be OK.

Keep in mind that the component takes a prop that disables the button when the NR was approved but still in processing (5 minutes or so).

const name = this.isBenefitCompany(nr) ? 'incorporationApplication' : 'registration'
const legalType = this.isBenefitCompany(nr) ? 'BEN' : nr.legalType
const name = this.isSupportedEntity(nr) ? 'incorporationApplication' : 'registration'
const legalType = this.isSupportedEntity(nr) ? this.entityTypeAlternateCode(nr.entity_type_cd) : nr.legalType
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll behave the same as before but now instead of a hard-coded 'BEN', we're checking for FF values.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the "if" is evaluated in both statements, would it look cleaner to combine these into a regular if-then-else? Not sure, let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your new code looks cleaner, for sure 👍

@JazzarKarim JazzarKarim self-assigned this Jul 18, 2023
@JazzarKarim
Copy link
Collaborator Author

/gcbrun

@pwei1018
Copy link
Collaborator

Temporary Url for review: https://namerequest-dev--pr-627-58y7qy7d.web.app

@JazzarKarim
Copy link
Collaborator Author

/gcbrun

@pwei1018
Copy link
Collaborator

Temporary Url for review: https://namerequest-dev--pr-627-58y7qy7d.web.app

Copy link
Collaborator

@severinbeauvais severinbeauvais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. As always, please get some other reviews before merging.

Copy link
Collaborator

@leodube-aot leodube-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Karim!

Copy link
Collaborator

@chenhongjing chenhongjing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐱

@JazzarKarim
Copy link
Collaborator Author

@severinbeauvais Sev, can you approve please? I need an approval from someone with write access to this repo to merge 😁

@JazzarKarim JazzarKarim merged commit 33d47f9 into bcgov:feature-way-of-navigating Jul 19, 2023
5 checks passed
JazzarKarim added a commit to JazzarKarim/namerequest that referenced this pull request Aug 24, 2023
* Package update

* Implemented incorporate now for named companies after NR submission

* Update in response to Sev's PR comments
JazzarKarim added a commit to JazzarKarim/namerequest that referenced this pull request Aug 24, 2023
* Package update

* Implemented incorporate now for named companies after NR submission

* Update in response to Sev's PR comments
JazzarKarim added a commit to JazzarKarim/namerequest that referenced this pull request Sep 8, 2023
* Package update

* Implemented incorporate now for named companies after NR submission

* Update in response to Sev's PR comments
JazzarKarim added a commit that referenced this pull request Sep 11, 2023
* Package update

* Implemented incorporate now for named companies after NR submission

* Update in response to Sev's PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants