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]- Get and organizations owned and belonged to by the user for admin #428

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

lankiman
Copy link

@lankiman lankiman commented Feb 28, 2025

Description

Issue was to add features where admin can get organizations a user belongs to or owns by their user id

**Closes #418 *

What were you told to do?

implement two endpoints for admin to get users organization owned by a user and organization a user belongs to using the user's id

Implementaion of endpoints for admin to get user organiztion details

  • Implemented specified endpoints
  • Made sure there working and returning the proper responses
  • Added unit test
  • Member endpoint returns empty data if the user does not belong to any organiztion apart from the one he/she owns
  • The endpoints are desinged to return either organizations owned by a user or the ones a user belongs to.
  • A user belongs to an orgnzation he/she owns, but the member endpoint only returns organization strictly not owned by the user but the user belongs to them

No additional dependencies was installed, i changed only the admin controller file, the rest files where created to implment the enpont

Check List

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the dev branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots/Videos

  • screenshot of implemented endpoints
    screen shot of updated enpitns

  • Proper error on wrong user id
    proper_erro on invalid idi

  • screenshot of returning owend organizatons
    Screenshot from 2025-03-01 12-12-59

@lankiman lankiman changed the title ISSUE - 418 IMPLEMENTATION ISSUE - 418 [Feat}- Added Enpoints for admin to get orgnaztion owned by a user and orgnaizations belonged to by a user Feb 28, 2025
Copy link
Contributor

@Heba-WebDev Heba-WebDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove the unused service in GetUsersMemberOrganizationsByUserIdQueryHandler.cs, other than that the PR seems fine to me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field 'GetUsersMemberOrganizationsByUserIdQueryHandler._authenticationService' is never used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user is not found, you can return an empty list instead of the null.

@Heba-WebDev
Copy link
Contributor

Also, a PR title needs to be short and descriptive, ex "Feat: get an organization and its owner by an admin".

@Fabito97
Copy link
Contributor

Fabito97 commented Mar 1, 2025

Also, there are some misspelt words in your PR, you can also edit and correct them.

@lankiman lankiman changed the title ISSUE - 418 [Feat}- Added Enpoints for admin to get orgnaztion owned by a user and orgnaizations belonged to by a user ISSUE - 418 [Feat]- Get and organizations owned and belonged to by the user for admin Mar 1, 2025
@lankiman
Copy link
Author

lankiman commented Mar 1, 2025

Also, a PR title needs to be short and descriptive, ex "Feat: get an organization and its owner by an admin".

i have edited it, also fixed the typos

@Heba-WebDev
Copy link
Contributor

Also, a PR title needs to be short and descriptive, ex "Feat: get an organization and its owner by an admin".

i have edited it, also fixed the typos

Remove the issue and the number from the title. It's enough that you mention it in your PR (it will get linked to the issue automatically). You're title should be something like "Feat: user-owned organizations and their members for admin"

@lankiman lankiman changed the title ISSUE - 418 [Feat]- Get and organizations owned and belonged to by the user for admin [Feat]- Get and organizations owned and belonged to by the user for admin Mar 1, 2025
@lankiman
Copy link
Author

lankiman commented Mar 2, 2025

i Have added appropriate authorization policy to make sure the user is an admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] - ADMIN- implenent get organization owned by a user and organisations a user belongs to
3 participants