bcgov / entity

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

Delete name in SOLR when an NR state changed to 'EXPIRED' #16896

Closed eve-git closed 12 months ago

eve-git commented 1 year ago

The name should be deleted from SOLR and Conflict Names when an NR state changed to 'EXPIRED'

Reference to https://github.com/bcgov-registries/ops-support/issues/1158 for more details

eve-git commented 1 year ago

It is ready to test in TEST environment.

Steps to test:

  1. request a name, make the name of the NR a unique word

  2. exam the name and approve it

  3. there are several ways to check if there are similar names. Once of them is go to namerequest again, input the name and click Check this Name

  4. wait a few minutes till the expiry date show up in name-examiniation

  5. edit the expiry date to next day.

  6. wait the NR expired (a day after expiry date)

  7. do steps 3 again. the name should NOT be in similar name list

oanyahuru commented 1 year ago

@eve-git I tested this with an NR that expired yesterday. The NR was created without any prompts for existing names. However, on NameX I got a "warning" saying "similar name approved recently": image.png I was able to approve it without errors

eve-git commented 1 year ago

a firm name will not be added to Name Conflicts when approved. You can try a limited company.

oanyahuru commented 1 year ago

@eve-git it was the same result when I tried a limited company. The NR was created without any prompts for existing names. However, on NameX I got the same message saying "similar name approved recently"

image.png

eve-git commented 1 year ago

What is the another NR number with the similar name asNR 2451504(EJIMA ENGINEERING AND SALES CORP.)

oanyahuru commented 1 year ago

NR 6157532 (Expired) NR 2451504 (Approved) Business name: EJIMA ENGINEERING AND SALES CORP

oanyahuru commented 1 year ago

@eve-git I ran the test again using NR 4518930 which I had created last week and set to expire on the next day.

image.png

eve-git commented 1 year ago

NR 4518930 is expired on July 15th. The name was removed from Conflict Names after expired. NR 5292285 is created on July 17th. It is expected that the name doesn't show in Conflict Names when creating the NR. I checked Solr by querying the name, it shows me one result from NR 5292285:

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"name:BERRABERRA INVESTMENT MANAGERS LTD.",
      "indent":"on",
      "wt":"json",
      "_":"1689716806031"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "id":"NR 5292285",
        "name":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "name_copy":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "name_with_synonyms":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "name_compressed":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "name_exact_match":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "cobrs_phonetic":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "dblmetaphone_name":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "contains_exact_phrase":"BERRABERRA INVESTMENT MANAGERS LTD.",
        "state_type_cd":"A",
        "source":"NR",
        "start_date":"2023-07-17T09:41:16Z",
        "jurisdiction":"BC",
        "_version_":1771687290815381504}]
  }}

It shows Exact Match in name-examination: image.png

The code change result is expected. Now, the name of expired NR has been removed from Conflict Names.

eve-git commented 1 year ago

The last_update_date of NR 4518930 is '2023-07-17 09:14' and probably the NR state updated to 'Expired' by the time. The submitted date of NR 5292285 is 2023-07-17 09:41', which is half hour later than NR 4518930 expiry. I am not sure what happened at the time. Consider the solr updater is executed from a queue, it looks like to me that solr updater hasn't run and cleaned the previous name when the second one created.

When I checked NR 5292285 today in name-examination, the banner 'Similar name previously approved' has gone. So I think the results you saw was a timing problem. Solr updater did remove the expired name.

I created another NR with the same name and approved, now the Exact Match list with the name has two NRs but not include the expired one: image.png It also approved that the expired NR name has been removed from Conflict Names.

@oanyahuru please let me know if any questions. Otherwise, it is ready to be released.