openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
22 stars 2 forks source link

Signature - New organization owner should be able to sign documents #715

Closed jbpenrath closed 4 months ago

jbpenrath commented 5 months ago

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe. Currently, we are declaring all user able to sign a contract at the workflow creation. For the organization side, that means, we declare as signatories all users with owner access to the organization at this time.

But once the workflow has been created, if we add an owner to this organization, it will not be able to sign pending contracts but in its administration dashboard, it will be able to ask to sign those contracts but the request will fail...

Describe the solution you'd like All organization owner declared at any time should be able to sign contracts.

Describe alternatives you've considered New organization owners should not see previous pending contract that they will not be able to sign.

Discovery, Documentation, Adoption, Migration Strategy https://gip-fun-mooc.sentry.io/issues/4905277666/?environment=preproduction&project=6599941&query=is:unresolved&statsPeriod=7d&stream_index=12

jonathanreveille commented 5 months ago

According to the documentation of Lex Persona, we can add new recipient (signatories) even once the signature procedure has been launched.

It requires to build the payload that we've used to create the workflow, and add the new signatory member from the organization into the step reserved for organization members.

This will update the workflow with a new member to sign on the organization's side. I've observed that when I've launched a signature procedure with 2 person, once the student signed the progression was at 50%. Then, I used the endpoint to update the workflow with a new signatory member, and the progress updated to 33%.

The endpoint to update the workflow is straight forward : PATCH method + /api/workflows/<wfl_id>

Still need to check if we can get the invitation link to sign for that last new member.