bcgov / entity

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

Legal API: tell Auth API about new NR #22171

Open severinbeauvais opened 3 months ago

severinbeauvais commented 3 months ago

Auth API/db has the affiliation between an NR and draft application. This needs to be updated when a draft application uses a new NR. (Note: A continuation in application may also be in CHANGE_REQUESTED state (not DRAFT) for resubmit.)

I think what's needed is for Legal API to make an updated call to Auth API to update the NR number of a draft application (or vice-versa: update the application affiliated with a NR). There may also be work needed in Auth API.

I'm not sure what the trigger for Legal API will be. There must already be a trigger to make the initial NR/application affiliation but maybe that's in Auth API itself (when the draft is created?), and the new trigger has to come from Legal API side.

@vysakh-menon-aot Please update description if you have updated information. Thx!

vysakh-menon-aot commented 3 months ago

If there is a change in NR delete and recreate the affiliation. auth-api doesn't support option to update. Currently we create an affiliation when a draft filing is created (for a new business). ref: https://github.com/bcgov/lear/blob/main/legal-api/src/legal_api/resources/v2/business/business.py#L136

We have to handle this is in save filings https://github.com/bcgov/lear/blob/main/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py#L98