openBackhaul / ApplicationPattern

Pattern for REST servers
Apache License 2.0
6 stars 16 forks source link

To make /v1/register-yourself to trigger either one of PromptForRegisteringCausesRegistrationRequest or PromptForRegisteringCausesRegistrationRequest2 #983

Closed PrathibaJee closed 1 month ago

PrathibaJee commented 2 months ago

As of now , /v1/register-yourself will trigger the callback PromptForRegisteringCausesRegistrationRequest first then , PromptForRegisteringCausesRegistrationRequest2 will be executed regardless of the respective HTTP response codes.

Problem : If an already approved application triggeres register-yourself , then both the callbacks PromptForRegisteringCausesRegistrationRequest PromptForRegisteringCausesRegistrationRequest2 will be executed

As a result TAR will send regard-updated-approval-status twice immediately. And the whole process of /regard-application to the TAC is happening twice. Since the regard-application involves multiple sub processes , performing it immediately for two times is making the process more heavy.

Proposal : So proposing the following , callbacks shall be executed in this order , PromptForRegisteringCausesRegistrationRequest2 if PromptForRegisteringCausesRegistrationRequest2 fails(means RO is less than 2.1.1) then PromptForRegisteringCausesRegistrationRequest will be initiated This results in a side effect for the preapproved application.

Also need to create OAS issue