newjersey / navigator.business.nj.gov

NJ Office of Innovation is building a one-stop dashboard to better help New Jerseyans with starting and managing a business
https://business.nj.gov
16 stars 1 forks source link

Reintroduce automatic check for license data #8518

Closed jphechter closed 2 months ago

jphechter commented 2 months ago

Description

If a license check was last performed over an hour ago, or if a user has provided a business name and address automatically query the DCA databases for license information.

Ticket

This pull request resolves #186879778.

Approach

All updates are made to the userRouter. When a user requests data from the backend, if conditions are correct the check is performed. The check is dependent on either having previously performed a successful license check or providing the information necessary to conduct a check via the profile.

Steps to Test

Using information from a previous license check

Using information provided in the Business Profile

Notes

The auto-check only fires for the current business. This could be changed to hit all businesses in the userData object, but I'm operating under the assumption that we want to minimize the number of requests we're making to the DCA databases. The fetch will also automatically fire when the user switches businesses so I don't think the user will notice any perceived difference in their experience.

Code author checklist