eclipse-tractusx / portal-backend

Portal Backend
Apache License 2.0
9 stars 20 forks source link

API Create company account | Add invitation id and api for invitation details #834

Closed SanaSalem01 closed 1 month ago

SanaSalem01 commented 3 months ago

Change proposal: Add Company Id,application id in response of ExecuteInvitation api i.e POST: api/administration/invitation

Reason: In automation and CRM communication there was no reference id to track the Invitation.

Current Impact/limitations:

Change proposal impact: So now any system can use Application id and Company Id for reference after invitation.

jjeroch commented 3 months ago

@SanaCofinityX please update the ticket - this is a change proposal and not a bug (as it intends when reading the title" please use something like "API Create company account | adding "applicationID" in the response body" this makes it more open. Please also share the info if you want to contribute the code for it.

SanaSalem01 commented 3 months ago

@jjeroch Ticket summary has been updated.

tfjanjua commented 3 months ago

@jjeroch | @evegufy I would like to ask from which release branch I should checkout for this change! I am assuming it would be https://github.com/eclipse-tractusx/portal-backend/tree/release/v2.1.0-RC1 but please let me know if there is any other release to checkout.

Thanks

evegufy commented 3 months ago

@jjeroch | @evegufy I would like to ask from which release branch I should checkout for this change! I am assuming it would be https://github.com/eclipse-tractusx/portal-backend/tree/release/v2.1.0-RC1 but please let me know if there is any other release to checkout.

Thanks

Hi @tfjanjua sure, please check out from main, the open release branch is closed for improvement and features

dhiren-singh-007 commented 2 months ago

This api is creating the CompanyInvitation and it make sense to return the Id of CompanyInvitation only. Because the whole process of creating this invitation is in background process so even if we move the application creation in api itself then one have to still wait for the completion of whole process. So idea would be to use this invitation id to fetch the Company application Id and Company Id from a different new api (with same set of permissions as Invitation api have). So far there are two use cases for this

  1. Automation: Automation test need to check the status of company application so it requires application id , which it don't have access in Invitation. So by this change they will be able to get the application id and company id.
  2. CRM Communication : In this case CRM is unable to track the application as there is no reference Id so with this change they can use Invitation Id as reference and then they can call another api to get the application id and company id . As this is a background process so in order to get the application id one has to wait for scheduled cron job frequency (currently its 5 min). cc @MaximilianHauer @SanaCofinityX @ybidois @tfjanjua
dhiren-singh-007 commented 1 month ago

UPDATE: As Because of the issue #700 . Company and application creation is moved in api execution itself so now we no longer need an api to retrieve these ids. So I have updated the @Phil91 PR #960 with this change where Invite api will now return these ids .

MaximilianHauer commented 1 month ago

@dhiren-singh-007 i assume this solves the ticket ?

dhiren-singh-007 commented 1 month ago

@dhiren-singh-007 i assume this solves the ticket ?

Yes @MaximilianHauer , PR #960 will solve this once merged.