bcgov / entity

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

Error occurred when entering a long Extra provincial Corp name in NR #14923

Closed eve-git closed 1 year ago

eve-git commented 1 year ago

Error occurred when submitting a NR for extra-provincial corp with long corp name.

Steps to reproduce the error: login a Visual Service Card Request a name: a. filling the request form: Extraprovincial, Limited Company, Alberta b. don't check "I don't have a corporate number" c. enter a extra-provincial corp name, whose length is over 50 characters, in corporation number field d. click the link "Submit this Name without checking" under "Check this Name" button e. In the "Corporate Number Not found" window, input the corp name and click "Search" button" f. continue the NR Error occurred when client Review and Confirm button and "Name Request encountered an error" popup shows.

The error message in Dev Tools:

Error: Request failed with status code 500 [ Error saving request.<br><br>(psycopg2.errors.StringDataRightTruncation) value too long for type character varying(40)<br><br>[SQL: INSERT INTO requests (id, submitted_date, last_update, nr_num, request_type_cd, priority_cd, priority_date, expiration_date, consent_flag, additional_info, nature_business_info, xpro_jurisdiction, corp_num, submitter_userid, furnished, has_been_reset, user_id, request_id, previous_request_id, submit_count, nro_last_update, state_cd, prev_state_cd, request_action_cd, entity_type_cd, consent_dt, source, trade_mark, checked_out_by, checked_out_dt, home_juris_num, name_search, notified_before_expiry, notified_expiry) VALUES (%(id)s, %(submitted_date)s, %(last_update)s, %(nr_num)s, %(request_type_cd)s, %(priority_cd)s, %(priority_date)s, %(expiration_date)s, %(consent_flag)s, %(additional_info)s, %(nature_business_info)s, %(xpro_jurisdiction)s, %(corp_num)s, %(submitter_userid)s, %(furnished)s, %(has_been_reset)s, %(user_id)s, %(request_id)s, %(previous_request_id)s, %(submit_count)s, %(nro_last_update)s, %(state_cd)s, %(prev_state_cd)s, %(request_action_cd)s, %(entity_type_cd)s, %(consent_dt)s, %(source)s, %(trade_mark)s, %(checked_out_by)s, %(checked_out_dt)s, %(home_juris_num)s, %(name_search)s, %(notified_before_expiry)s, %(notified_expiry)s)]<br>[parameters: {'id': 2265460, 'submitted_date': datetime.datetime(2023, 1, 11, 17, 5, 18, 982285), 'last_update': datetime.datetime(2023, 1, 11, 17, 5, 18, 984742), 'nr_num': 'NR L004979', 'request_type_cd': 'XCR', 'priority_cd': 'N', 'priority_date': None, 'expiration_date': None, 'consent_flag': None, 'additional_info': '*** New Request ***', 'nature_business_info': 'test', 'xpro_jurisdiction': 'Alberta', 'corp_num': '', 'submitter_userid': 86, 'furnished': 'N', 'has_been_reset': False, 'user_id': 86, 'request_id': None, 'previous_request_id': None, 'submit_count': None, 'nro_last_update': None, 'state_cd': 'DRAFT', 'prev_state_cd': None, 'request_action_cd': 'NEW', 'entity_type_cd': 'XCR', 'consent_dt': None, 'source': 'NAMEREQUEST', 'trade_mark': '', 'checked_out_by': None, 'checked_out_dt': None, 'home_juris_num': 'EVE TEST LONG CORPORATE NAME LOOOOOOOOOOOOOOOOOOOOOOOONG', 'name_search': None, 'notified_before_expiry': False, 'notified_expiry': False}]<br>(Background on this error at: http://sqlalche.me/e/14/9h9h) ]
eve-git commented 1 year ago

related ticket: https://github.com/bcgov/entity/issues/11380 https://github.com/bcgov/entity/issues/11716

eve-git commented 1 year ago

It may need to consider UI changes. Currently, there is no a DB field to hold the corp name in home jurisdiction.

pwei1018 commented 1 year ago

image

oanyahuru commented 1 year ago

error on NR.PNGI took a look at this and noticed that if I dont check the "I don't have a corporate number", the corporation number field remains a numeric field. Otherwise, the field reads "Business's full legal name in home jurisdiction" and allows alphanumeric characters. The option to "submit without checking" does not exist on the test. The error popped up at the point of submission. See below

PCC199 commented 1 year ago

@pwei1018 we need to determine next steps.

ozamani9gh commented 1 year ago

@lmcclung please give us direction on how you would like the UI/UX to handle extra provincial CORP NUMS and NAMES

Here is the PROD Data for CORP NAMES that start with Character: select * from requests where home_juris_num is not null and home_juris_num > 'A'

and

select * from requests where home_juris_num is not null and home_juris_num LIKE '% %'

includes spaces

ozamani9gh commented 1 year ago

has a space in the name https://app.zenhub.com/files/157936592/72f07125-814a-4299-878d-ebb2afd98307/download

starts with alphanumeric character may not contain space https://app.zenhub.com/files/157936592/6e651923-8eee-4e58-a556-8e8c248ab086/download

ozamani9gh commented 1 year ago

@davemck513 do you have time to discuss how you want to handle this issue

davemck513 commented 1 year ago

@ozamani9gh cannot reproduce this in test with the new changes to the UI. Please advise if I'm missing something.

Madhavkapoor28 commented 1 year ago

@davemck513 @ozamani9gh confirmed by patrick, rather than proceeding with a UI change, we should change the database column size and maybe backend model for a reliable solution. I can start working on this ticket once i finish up a couple of modernization tasks.

ozamani9gh commented 1 year ago

@Madhavkapoor28 confirm with Patrick we want this fix to go into Repo and if so, perhaps we can work on it next week, this will give you backend development experience as well