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

21977 Refactored Entity Status to support more bootstrap filing states cleanly #682

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

severinbeauvais
Copy link
Collaborator

@severinbeauvais severinbeauvais commented Jul 15, 2024

Issue #: bcgov/entity#21977

This is another "small" PR to do some refactoring in preparation for future changes. This change should not affect current functionality.

Description of changes:

  • app version = 7.3.13
  • refactored Entity Status into Bootstrap Filing Status and Bootstrap Filing Type
  • refactored getters as above
  • deleted obsolete enum file entityStatus.ts
  • deleted obsolete store file state.ts
  • updated unit tests

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

- refactored Entity Status into Bootstrap Filing Status and Bootstrap Filing Type
- refactored getters as above
- deleted obsolete file entityStatus.ts
- deleted obsolete file state.ts
- updated unit tests
@@ -240,7 +234,8 @@ export default class App extends Mixins(
// root store references
@Getter(useRootStore) getKeycloakRoles!: Array<string>
@Getter(useRootStore) isBootstrapFiling!: boolean
@Getter(useRootStore) isBootstrapTask!: boolean
@Getter(useRootStore) isBootstrapPending!: boolean
@Getter(useRootStore) isBootstrapTodo!: boolean
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jul 15, 2024

Choose a reason for hiding this comment

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

There are now 3 getters for the bootstrap filings:

  • does it belong in Filing History List?
  • does it belong in Pending List?
  • does it belong in Todo List?

else if (isIncorporationApplication) entityStatus = EntityStatus.FILED_INCORP_APP
else if (isRegistration) entityStatus = EntityStatus.FILED_REGISTRATION
else throw new Error(`Invalid status ${status} for ${filingName} filing`)
break
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jul 15, 2024

Choose a reason for hiding this comment

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

I moved all of this ^^ into the root store as getters.

}

// store business info
this.setEntityStatus(entityStatus)
this.setBootstrapFilingStatus(status)
this.setBootstrapFilingType(filingName)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now we save individual status and type instead of a combined type value (which was getting messy).

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 is the combined status/type enum that I deleted in favour of separate values.

state.bootstrapFilingStatus === FilingStatus.COMPLETED ||
state.bootstrapFilingStatus === FilingStatus.PAID
)
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So this ^^ is the new logic. It's more verbose but I think it's easier to understand and it's easier to extend if needed.

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 file hasn't been used for a while. It dates back to when we use VueX for the store. Now, with Pinia, the state is an object at the top of the store file.

Copy link
Collaborator

@ArwenQin ArwenQin left a comment

Choose a reason for hiding this comment

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

LGTM

@severinbeauvais
Copy link
Collaborator Author

/gcbrun

@bcregistry-sre
Copy link
Collaborator

bcregistry-sre commented Jul 16, 2024

Temporary Url for review: https://business-filings-dev--pr-682-gtb4b6a0.web.app

SB says, try these:

(*) the view for awaiting review continuation applications is still WIP

/** Stores bootstrap filing in the Filing History List. */
/** Stores bootstrap item in the Pending List. */
storeBootstrapPending (response: any): void {
this.storeBootstrapFiling(response) // *** TODO: implement this
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Temporary code while I continue implementing this feature.

@severinbeauvais severinbeauvais merged commit e02d301 into bcgov:main Jul 16, 2024
4 of 5 checks passed
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.

3 participants