bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 57 forks source link

Filings UI - Display "Not Entered" for missing data on address and prop/part components #12024

Closed lmcclung closed 2 years ago

lmcclung commented 2 years ago

When a user opens their entity dashboard for an SP/GP, if data is missing we need to:

severinbeauvais commented 2 years ago

@lmcclung Can you please confirm which data might be missing?

argush3 commented 2 years ago

@severinbeauvais @lewischenstudio @lmcclung I've done a bunch of digging and found that for SP/GPs that start with a registration filing a lot of times the office/party addresses will be missing street info. Another scenario are SP/GPs that start with a conversion registration filing. These ones have minimal info. Some of them have the business and party(proprietor/partner) info with no addresses. And the other scenario where you don't even have the party info, just the business.

I've loaded a mix of these SP/GPs with missing data into DEV. I've suffixed the legal name of these SP/GPs with " - MISSING_INFO_IMPORT_TEST". They've all been associated with my DEV account under user BCREG0018 (https://dev.bcregistry.ca/business/auth/account/2596/business?accountid=2596). From a quick test it would seem like the two(FM0272480, FM0272488) data loads for SP/GPs that had a conversion registration filing are unable to load. I have a pdf with overview of the lear data for each of the loaded firms. Will send via email.

image.png

FM0614946(SP) - incomplete office/party address (no street info)

FM0614924(SP DBA) - incomplete office/party address (no street info)

FM0613627 (GP) - incomplete office (no street info)

FM0613561(GP) - incomplete office/party address (no street info)

FM0272480 (SP) - this is a company that only has a conversion registration filing. the pipeline doesn’t really support this yet but I just modified the code for processing registration filings a bit to get it loaded into LEAR. only business, party(no addresses), and filing exists in db.

FM0272488 - this is a company that only has a conversion registration filing and conversion dissolution filing. just business and registration filing exists in the db

severinbeauvais commented 2 years ago

Thanks, Argus!

How odd that street address is missing.

By "unable to load", do you mean your import into LEAR? Or unable to load in Filings UI? If the latter then I'm not surprised because Filings UI (dashboard) expects to load full party and address data and throws an error otherwise. We may have to circumvent this for some filings, or change Legal API to return "something" anyway.

The question now is, what do we display in each case? An incomplete address may be hard to pass through the system. This is both a technical and a business question. cc: @lmcclung

argush3 commented 2 years ago

Unable to load in Filings UI is what I meant. Although I didn't check if the legal api errored out at all when trying to load the business from Filings UI>

lewischenstudio commented 2 years ago

@argush3 @severinbeauvais I did some reading from the data. It looks like that if the address table doesn't have the id for which the parties can link to, the delivery_address or mailing_address will be null in the parties table. This usually happens when the data during the registration or conversion process is incomplete (or other reasons), and the values for delivery_address or mailing_address will be null for the return data. As for this ticket, I am thinking to display "Not Entered" whenever either address is null.

argush3 commented 2 years ago

@lewischenstudio The incomplete data is expected. The legacy system has incomplete data and even though it's not ideal, we data load what is there into LEAR db. And the conversion filing we are working on right now is used to ensure the SP/GP provides the info that is required for the SP/GP.

severinbeauvais commented 2 years ago

Lewis, I'm not sure yet what the Filings UI needs to handle.

For example, if both addresses are missing in the db, what will the "get addresses" call return from the API? And how will Filings UI handle that?

Another example: what if a party is missing their address data?

I think a good way forward is to list out our test cases up front. Then Legal API and/or Filings UI can be updated accordingly. I'm open to other ideas too...

lewischenstudio commented 2 years ago

Quick note for UXA and future reference. If the filing is a draft, then it will display "Complete your filing..." not "Not Entered". When filing is not a draft, then the following scenarios will display "Not Entered": For SP

For GP

Note: This ticket is related to conversion filing from the legacy system. Data entered in our system most likely will be complete already during filing processes.

Here are some SP/GP data to test on dev: FM0614924, FM0613627, FM0613561, FM0614946, FM0272480, FM0272488.

lewischenstudio commented 2 years ago

Looking at the new design on wireframes, "Not Entered" will be "(Not Entered)" with parentheses. I will correct it in during my fix.

argush3 commented 2 years ago

@lewischenstudio when I try to load FM0272488 in DEV, I see the following. The address endpoint is returning a 404 which is expected as there are no addresses. I'm assuming it happens for FM0272480 as well.

image.png

lewischenstudio commented 2 years ago

@lewischenstudio when I try to load FM0272488 in DEV, I see the following. The address endpoint is returning a 404 which is expected as there are no addresses. I'm assuming it happens for FM0272480 as well.

@argush3 I got the SP/GP numbers from the PDF file. It seems that FM0272480 and FM0272488 do not have any related data in the database. Maybe that's why the backend returns 404 not found.

argush3 commented 2 years ago

Yes, all the SP/GPs in the pdf file were firms I data loaded from the legacy system into DEV. These are real world scenarios so the Filings UI will need to be able to handle scenarios like FM0272480 and FM0272488 where a lot of the data is missing.

severinbeauvais commented 2 years ago

@argush3 I'm hoping the API can return an empty address (whatever that looks like) so the UI doesn't need to handle a special case for businesses-that-need-conversion (whatever the business flag is).

Ditto for empty parties array (API may do this already).

lewischenstudio commented 2 years ago

@severinbeauvais @argush3 I agree with Severin. It is quite difficult to handle special cases in the client side, because 404 can be anything. Maybe the error message is the best option at this point.

argush3 commented 2 years ago

I don't think the addresses endpoint should actually be returning a 404. It should be doing what the parties endpoint does which is an empty array like below. From a REST API design standpoint, I don't think it makes sense that we would be returning empty addresses when there are no addresses. Will think on that one a bit more.

image.png

severinbeauvais commented 2 years ago

Thinking about this...

severinbeauvais commented 2 years ago

PS I think addresses response is an object, not an array.

argush3 commented 2 years ago

Ok, yeah I didn't realize that it was returning an object. So I guess a 404 does make sense I guess. Right now the endpoint does return something else when the business identifier is wrong. But yeah only way to really distinguish address 404 and business identifier 404 is through the message.

invalid business identifier for business address endpoint 404 response:

{'message': 'FMXXXXXX not found'}

no addresses for business addresses endpoint 404 response:

{'message': 'FMXXXXXX address not found'}
severinbeauvais commented 2 years ago

@argush3 It would be much cleaner in the UI if the addresses endpoint could simply return an empty object if the business has no addresses. Can that be done, instead of returning a 404?

argush3 commented 2 years ago

Touching base with Thor to see if he is ok with returning an empty object for business addresses endpoint when business has no addresses.

yuisotozaki commented 2 years ago

UXA Observations:

lewischenstudio commented 2 years ago

Completed UXA Observations:

argush3 commented 2 years ago

@lewischenstudio @severinbeauvais I talked with Thor and we decided the business address point should continue returning a 404 when there are no addresses. The UI will need to handle this scenario.

severinbeauvais commented 2 years ago

@lewischenstudio Do you want to handle this ^^ in this ticket or a new one?

If you don't have a design for this already, let's chat about this (I don't think there's a clean way).

lewischenstudio commented 2 years ago

@severinbeauvais @argush3 If missing identifier or business address are the only two cases we need to take into consideration, then I can handle them in this ticket. Correct me if I am wrong with the following logic:

  1. If 404 with {'message': 'FMXXXXXX address not found'}, then it is missing the business address, and we want to display "(Not Entered)" in the Filing UI.
  2. If 404 with {'message': 'FMXXXXXX not found'}, then it is missing the identifier, and we want to display the error message modal.

Once these are handled in my Filing UI, my concern is that these SP/GP filings will not open the Edit UI upon clicking on the button "Change" or "Record Conversion". FM0614924/FM0613561 cannot load Edit UI. FM0272480/FM0272488 may not load the Edit UI after we handle them.

severinbeauvais commented 2 years ago

Your design of looking at the messages is more generic than looking at the "conversion needed" flag, but it adds a dependency on the error message, which ~is not good~ I recommend against.

The other problem that I alluded to is the actual fetching of the data. It is done in App.vue::fetchBusinessData(). However, a 404 is a failed promise, so the Promise.all() statement, or the data check after it, will fail. This is why I was hoping we wouldn't get a 404 here (@argush3 I'd like to push a little more for this; please ask Thor again).

Once these special-case FMs load in Filings UI, I consider this ticket complete -- we will need another ticket for whatever is remaining to load these FMs into Edit UI << please create such a ticket with the details you are aware of.

lewischenstudio commented 2 years ago

@severinbeauvais Sure. Let me work on the Filing UI to handle the 404. We can make a ticket for the Edit UI to handle the cases for filings like FM0614924/FM0613561.

argush3 commented 2 years ago

I don't think scenario 2 is likely to happen. I've done a search against LEAR DEV db and the COLIN SP/GPs we will be data loading and everything has an identifier.

As for clicking change or record conversion in these scenarios where there is key pieces of missing data, it's a non-issue I think. Meaning that the Filings UI will be locked down and the user will need to do a conversion filing from the todo list before it can do anything else.

lewischenstudio commented 2 years ago

Completed UXA Observations:

404 Handler

New Ticket

yuisotozaki commented 2 years ago

Just one last UXA observation

lewischenstudio commented 2 years ago

image.png

@yuisotozaki For SP/GP FMs without Proprietor/Partners, the current implementation will display "(Not Entered)". If there is data for Proprietor/Partners, it will display Email/Delivery Address/Mailing Address with their associated data or "(Not Entered)". This ticket and #11886 are related to conversion filing, in which business addresses could be missing.

yuisotozaki commented 2 years ago

@lewischenstudio Sorry about my comments above. I think I was partway writing it, got interrupted, then just added the comments without completing the information.

What I meant is that the text colour of "(Not Entered)" in the Proprietor/Partner section if the proprietor/partner is completely missing, should be #212529.

yuisotozaki commented 2 years ago

@lewischenstudio Sorry about my comments above. I think I was partway writing it, got interrupted, then just added the comments without completing the information.

What I meant is that the text colour of "(Not Entered)" in the Proprietor/Partner section if the proprietor/partner is completely missing, should be #212529.

lewischenstudio commented 2 years ago

@yuisotozaki Thanks Yui. I'll correct it asap.

yuisotozaki commented 2 years ago

Ready for QA