Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(users): Add transfer org ownership API #3603

Merged
merged 7 commits into from
Feb 9, 2024
Merged

Conversation

ThisIsMani
Copy link
Contributor

@ThisIsMani ThisIsMani commented Feb 8, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR will add a new api to transfer ownership of an organization to other.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

To allow users to change the ownership of an organization.

How did you test it?

Postman

curl --location 'http://localhost:8080/user/user/transfer_ownership' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer JWT of org_admin user' \
--data-raw '{
    "email": "email of the user who is not org_admin"
}'

If the api is successful, it will return the following response.

{
    "token": "JWT",
    "merchant_id": "merchant_id",
    "name": "name of old org_admin",
    "email": "email of old org_admin",
    "verification_days_left": null,
    "user_role": "merchant_admin"
}

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@ThisIsMani ThisIsMani added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed M-api-contract-changes Metadata: This PR involves API contract changes A-users Area: Users labels Feb 8, 2024
@ThisIsMani ThisIsMani self-assigned this Feb 8, 2024
@ThisIsMani ThisIsMani requested review from a team as code owners February 8, 2024 13:34
@ThisIsMani ThisIsMani linked an issue Feb 8, 2024 that may be closed by this pull request
@ThisIsMani ThisIsMani requested a review from dracarys18 February 9, 2024 06:26
apoorvdixit88
apoorvdixit88 previously approved these changes Feb 9, 2024
dracarys18
dracarys18 previously approved these changes Feb 9, 2024
racnan
racnan previously approved these changes Feb 9, 2024
ivor11
ivor11 previously approved these changes Feb 9, 2024
@ThisIsMani ThisIsMani requested a review from ivor11 February 9, 2024 10:43
@likhinbopanna likhinbopanna added this pull request to the merge queue Feb 9, 2024
Merged via the queue into main with commit b9c29e7 Feb 9, 2024
10 of 12 checks passed
@likhinbopanna likhinbopanna deleted the transfer-ownership branch February 9, 2024 12:12
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-feature Category: Feature request or enhancement M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(user_role): Transfer ownership api
7 participants