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

Add support for linking Volunteer/Groups/Membership & Integrated with Action Items #2602

Closed
wants to merge 5 commits into from

Conversation

GlenDsza
Copy link

@GlenDsza GlenDsza commented Oct 19, 2024

What kind of change does this PR introduce?

feature, refactoring

Issue Number:

Fixes #2585

Did you add tests for your changes?

Yes

Summary

  • Added VolunteerMembership Model to handle request/invitation for volunteer groups
  • Added relevant resolver (query+mutation) to get membership details for admin and user
  • Updated Action Item to be integrated with Volunteers & Groups
  • Added Search/Sort/Filter functionalities

Does this PR introduce a breaking change?

No

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced VolunteerMembership model for managing volunteer memberships.
    • Added new queries: getEventVolunteers, getVolunteerMembership, and actionItemsByUser.
    • Enhanced action item functionality to support both individual volunteers and groups.
  • Improvements

    • Updated GraphQL schema to include new fields and types for better handling of volunteer data.
    • Improved filtering and sorting capabilities in various queries.
  • Bug Fixes

    • Resolved issues related to user and event validations in mutation resolvers.
  • Tests

    • Expanded test coverage for new and updated functionalities, ensuring robust error handling and data integrity.

Copy link

coderabbitai bot commented Oct 19, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes in this pull request enhance the GraphQL schema and related models to support volunteer, group, and membership functionalities. Key modifications include the addition of new types, input types, and enums for managing volunteer memberships, as well as updates to existing types and resolvers to accommodate these changes. Several resolvers and queries have been refactored to improve filtering and sorting capabilities. Additionally, new utility functions have been introduced for checking the existence of users and volunteers, and various test files have been updated to align with the new data structures and functionalities.

Changes

File Path Change Summary
codegen.ts Added mapping for VolunteerMembership type in GraphQL code generation configuration.
schema.graphql Modified types (ActionItem, Event, EventVolunteer, EventVolunteerGroup), added new types (VolunteerMembership, VolunteerMembershipInput), and updated queries.
src/models/ActionItem.ts Updated InterfaceActionItem and Mongoose schema to reflect new assignee types and properties.
src/models/Event.ts Added volunteers property to InterfaceEvent and schema.
src/models/EventVolunteer.ts Restructured InterfaceEventVolunteer with new properties and updated schema.
src/models/EventVolunteerGroup.ts Renamed properties and added description and assignments fields in both interface and schema.
src/models/VolunteerMembership.ts Introduced new file with schema and model for volunteer memberships.
src/models/index.ts Added export for VolunteerMembership.
src/resolvers/EventVolunteer/creator.ts Deleted resolver file.
src/resolvers/EventVolunteer/event.ts Deleted resolver file.
src/resolvers/EventVolunteer/group.ts Deleted resolver file.
src/resolvers/EventVolunteer/index.ts Deleted resolver file.
src/resolvers/EventVolunteer/user.ts Deleted resolver file.
src/resolvers/EventVolunteerGroup/creator.ts Modified query to use updated property for fetching creator.
src/resolvers/EventVolunteerGroup/event.ts Modified query to use updated property for fetching event.
src/resolvers/EventVolunteerGroup/leader.ts Modified query to use updated property for fetching leader.
src/resolvers/Mutation/createActionItem.ts Enhanced function to handle new assignee types and simplified user existence checks.
src/resolvers/Mutation/createEventVolunteer.ts Streamlined user verification and updated volunteer creation logic.
src/resolvers/Mutation/createEventVolunteerGroup.ts Updated to include new parameters and enhanced volunteer handling logic.
src/resolvers/Mutation/createVolunteerMembership.ts New resolver for creating volunteer memberships.
src/resolvers/Mutation/updateVolunteerMembership.ts New resolver for updating volunteer memberships.
src/resolvers/Query/actionItemsByOrganization.ts Enhanced filtering and population logic for action items.
src/resolvers/Query/actionItemsByUser.ts New query for fetching action items by user.
src/resolvers/Query/getEventVolunteers.ts New query for fetching volunteers associated with an event.
src/resolvers/Query/getVolunteerMembership.ts New query for fetching volunteer memberships.
src/typeDefs/enums.ts Added new enums for sorting volunteer-related data.
src/typeDefs/inputs.ts Updated input types to reflect new properties and added new input types.
src/typeDefs/mutations.ts Added new mutations for creating and updating volunteer memberships.
src/typeDefs/queries.ts Updated existing queries and added new ones for fetching volunteer memberships.
src/typeDefs/types.ts Modified existing types and added new types related to volunteer management.
src/types/generatedGraphQLTypes.ts Added new types and updated existing ones for volunteer memberships and event volunteers.
src/utilities/checks.ts Introduced new utility functions for checking existence of users and volunteers.
tests/helpers/actionItem.ts Updated test helpers to include new assigneeType property.
tests/helpers/events.ts Modified event-related test helpers to reflect new property names.
tests/helpers/volunteers.ts New file for creating test volunteers and groups.
tests/resolvers/Mutation/createActionItem.spec.ts Updated tests to reflect new volunteer-related logic.
tests/resolvers/Mutation/createEventVolunteer.spec.ts Modified tests to align with new property names in EventVolunteerGroup.
tests/resolvers/Mutation/createVolunteerMembership.spec.ts New test suite for createVolunteerMembership mutation.
tests/resolvers/Mutation/removeEventVolunteer.spec.ts Updated tests to reflect new data model properties.
tests/resolvers/Mutation/updateActionItem.spec.ts Enhanced tests to validate new error handling and volunteer logic.
tests/resolvers/Query/getEventVolunteers.spec.ts Updated tests to reflect new function for fetching event volunteers.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Resolver
    participant Database

    Client->>Resolver: createVolunteerMembership(args)
    Resolver->>Database: checkUserExists(userId)
    Database-->>Resolver: User found
    Resolver->>Database: checkEventExists(eventId)
    Database-->>Resolver: Event found
    Resolver->>Database: createVolunteerMembership(args)
    Database-->>Resolver: Membership created
    Resolver-->>Client: Return membership
Loading

Assessment against linked issues

Objective Addressed Explanation
Add support for Volunteer, Groups, and memberships (2585)
Refactor existing queries & mutations for search/sort functionalities (2585)
Integrate with organization action items (2585)

🐇 In the fields where we play,
New memberships come out to play.
With volunteers and groups in sight,
Our actions bloom, oh what delight!
Hopping through code, with joy we sing,
For every change, new hope they bring! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold
  3. Merge conflicts

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

@GlenDsza GlenDsza closed this Oct 19, 2024
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.

1 participant