Open
Conversation
Author
|
@hrideshmg Could you review this please ? |
d9d2ffe to
f7b758b
Compare
hrideshmg
reviewed
Feb 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces leave tracking functionality to support the amD Discord bot by creating a Leave table in the database and adding corresponding GraphQL mutation and query operations. The changes enable tracking member leaves with approval workflows and querying leave counts within date ranges.
Changes:
- Created a Leave database table with foreign key references to Member via discord_id, including constraints for leave approval validation
- Added
mark_leavemutation to record new leave entries with discord_id, reason, duration, and optional approver - Added
leave_countquery method to Member type for calculating total leave duration within a date range - Extended the
memberquery to accept discord_id as an optional parameter alongside existing member_id and email options
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| migrations/20260214152404_create_leave_table.sql | Creates Leave table schema with foreign keys, defaults, and constraints including self-approval prevention |
| src/models/attendance.rs | Defines MarkLeaveInput, MarkLeaveOutput, and LeaveCountOutput structs for GraphQL API |
| src/graphql/mutations/attendance_mutations.rs | Implements mark_leave mutation to insert leave records with current timestamp |
| src/graphql/queries/member_queries.rs | Adds discord_id parameter to member query and implements leave_count resolver on Member type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hrideshmg
reviewed
Feb 22, 2026
hrideshmg
reviewed
Feb 22, 2026
hrideshmg
reviewed
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
Leaveformark_ leaveleave_countdiscord_idoptional param forMemberobject so amD can query using discord_id itselfThese are currently meant only to be accessed by amD for marking and fetching leaves