bcgov / entity

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

SPIKE - Consume NR #3534

Closed sienna-oldaccountdontuse closed 4 years ago

sienna-oldaccountdontuse commented 4 years ago

Description

Research how to consume an NR upon effective date and time of an incorp application (if the filing is immediate or effective in the future)

Acceptance Criteria

Scenario 1 -

GIVEN WHEN THEN

Scenario 2 -

GIVEN WHEN THEN

lmcclung commented 4 years ago

I asked Steven Chen to see if he could find an NR consumption job. He said this is a cron job that runs every minute.

https://github.com/bcgov/namex/blob/master/docs/legacy/nro_datapump_pkg_body.sql Look starting from line 975 Line 1026 - looks in CPRD database, name_state table for states of Approved and Conditionally Approved l_corp_num := format_corp_num(p_corp_num);
l_message := l_unit_name || 'Updating name_instance.corp_num to ' || l_corp_num || ' for nr ' || p_nr_num; log_debug(l_message); UPDATE name_instance ni2 SET ni2.corp_num = l_corp_num WHERE ni2.name_instance_id IN (SELECT ni.name_instance_id FROM name_instance ni, name n, request r, name_state ns WHERE r.request_id = n.request_id AND n.name_id = ni.name_id AND ni.name_id = ns.name_id AND ns.name_state_type_cd IN ('A', 'C') AND ns.end_event_id IS NULL AND ni.end_event_id IS NULL AND r.nr_num = TRIM(p_nr_num)) AND ni2.end_event_id IS NULL; COMMIT;

I forwarded this to Lorna and she tells me

"This is the consume_request procedure. The comment on the procedure says it is for non-colin entities such as coops:

-- -- Consume requests for non-colin request types. Find -- approved name matching the supplied NR and update the -- corp number.

Its is missing the consumption_date so makes me think it isn’t the right thing but could be adapted. When a name is consumed consumption_date and corp_num are updated in the name_instance table.

I don’t believe this is used by any entities in COLIN. If COLIN application is updating the names consumption data directly than this procedure could be adapted to be used for BC.

I asked Bhuvan if COLIN is updating names on consumption. Maybe you could follow up with him."

lmcclung commented 4 years ago

Ody, do you think you could follow up with Bhuvan, from our hometeam, regarding this? Sounds like Lorna has also asked him the question and is waiting for an answer.

Bhuvanesh.PattanShetti@gov.bc.ca

sienna-oldaccountdontuse commented 4 years ago

From Lorna regarding her ticket #3401:

We have figured out the best pattern to manage the pending-consumption state (not really a state). We will have a pc_flag (pending_consumption) as well of course as the expiration_date. The system workflow will look like this, name is approved, expiration_date is set, incorporation filing, validates and retrieves the NR attributes(get), user indicates future effective_date, UI calls a namex PUT (nr, pc_flag, future_effective_date) and sends the pc_flag='Y'. Our PUT, updates the NR pc_flag and expiration_date to the effective_date. Because pc_flag-='Y', Namex displays the status as APPROVED-PENDING CONSUMPTION. This will also prevent users from doing anything except viewing the NR. I fthe filing is withdrawn, call the namex PUT(nr, pc_flag, null), Namex updates the pc_flag=N, this displays the state as APPROVED and all functionality is restored. If they do no consume the Name it will expire as usual.

ochiu commented 4 years ago

Update from Bhuvanesh:

COLIN does not update names DB directly. It uses NRO Web services to manage NR numbers. There are majorly 2 services from NRO-WS used in COLIN.

Get status – used to validate NR request types, expiry and other validation. Consume NR – called by COLIN post successful payment and filing. Consumption_date and corp_num are set by this service.

ochiu commented 4 years ago

Suggested updates after discussions specifically for NR consumption

1) Re-create consume nr call in NameX to allow for update to name_instance consumption_date and corp_number. We were looking at using the existing NRO Webservice but it is an internal service, which we cannot readily access via our openshift environment

Updates to components