Closed karthmoh closed 2 years ago
@karthmoh I've regroomed this.
Hi @duncancasemore , There is no option to create a record in User with APIs We need to create a new action Invite a user to ApplaudHR which sends a mail to invite the User.
Tried to use APIs /api/users/invite to invite users, /api/role-grants to fetch all the roles in tenant. But API keys don't have access to call these APIs. Without access to these APIs we are blocked here.
@GangamRitesh see here for API: https://github.com/ApplaudSolutions/applaud-cloud/issues/3779
I guess this action will need to have 2 internal API calls: 1 API call to invite and then a second to PATCH the custom user. Not sure about roles...
@duncancasemore , @lewie6 As a part of git https://github.com/ApplaudSolutions/applaud-cloud/issues/3779, role grants are added to the Users model so we have access to /api/users/invite. Currently, we don't have access to /api/role-grants. Can we include this as a part of git https://github.com/ApplaudSolutions/applaud-cloud/issues/3779 or create a new git for this.
then a second to PATCH the custom user.
When an invite is sent to the user, a user record is created in both seeded as well as custom user models. Do we need patch request?
@GangamRitesh why don't we leave roles out of this story for now then. I think roles can be assigned automatically using workflow in Applaud, which is probably a better solution anyway.
I figured you'd need a PATCH on custom user to update it with the custom fields (eg, personId, countryOfWork, whatever). If you can do that in the initial invite, fine.
@GangamRitesh why don't we leave roles out of this story for now then. I think roles can be assigned automatically using workflow in Applaud, which is probably a better solution anyway.
Sure @duncancasemore. Roles are assigned in worflow.
I figured you'd need a PATCH on custom user to update it with the custom fields (eg, personId, countryOfWork, whatever). If you can do that in the initial invite, fine.
Similar to roles, custom user details (personId, countryOfWork, phoneNumber) are updated as part of workflows. Can we avoid this one for now as well?
@GangamRitesh happy to break it out. Do we use 'Create an instance' action and pick the model 'User' to invite (with special fields)? I think it would be neater to use the same action, then we can use 'Update an instance' action for patching a user and 'Delete an instance' to grant a user the deleted role. We'd have to think about bulk as well...
Sure @duncancasemore , will try to include in the create instance action.
@duncancasemore , Build create user instance action. Steps involved in create user action :
This has been handled as part of Create instance action. Now we can choose User model and fill the details to send create and invite.
Summary
Acceptance Criteria
Wireframes and mockups
Create a model action with User selected
Notes
Developer Testing
Requestor: leave this section blank Developer: complete this section during commit/pull request
Positive testing:
Add all the things that you have checked whilst completing this story here, it should be written in a non-technical way, and a lot of this can probably be taken from the acceptance criteria, here are two different examples:
Negative testing:
Here you list the things you have checked where your code needs to show an error, handle unusual/bad input/config gracefully, or may impact separate features that use or depend on the same code. Pause and think -- they may not be obvious! Examples:
e2e test links and description: