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 Volunteer Leaderboard, linking Volunteer/Groups/Membership & Integrated with Action Items #2615

Merged
merged 26 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
abed7ea
restructure eventVolunteer & volunteerGroup Models
GlenDsza Oct 5, 2024
54a1128
Support for Volunteer Membership
GlenDsza Oct 19, 2024
c00646d
Add mark action item and add hours volunteered
GlenDsza Oct 19, 2024
b3cd516
Merge branch 'develop' of https://github.com/GlenDsza/talawa-api into…
GlenDsza Oct 19, 2024
8909698
fix testcases 75
GlenDsza Oct 19, 2024
847598f
Add support for Volunteer leaderboard
GlenDsza Oct 25, 2024
562006b
Merge branch 'develop' of https://github.com/GlenDsza/talawa-api into…
GlenDsza Oct 25, 2024
4652e41
Add tests for query resolvers 100
GlenDsza Oct 27, 2024
19bbbb9
Add tests for checks
GlenDsza Oct 27, 2024
2f2f45d
Fix lints issues & add tests for helper funcs
GlenDsza Oct 27, 2024
844b10e
Fix failing tests for removeOrganization & updateEventVolunteerGroup
GlenDsza Oct 27, 2024
415877c
fix failing test for actionItem
GlenDsza Oct 27, 2024
8a38c07
Add test coverage
GlenDsza Oct 27, 2024
6abbe87
Add test coverage for updateActionItem
GlenDsza Oct 27, 2024
493977c
coderabbit suggesstions
GlenDsza Oct 27, 2024
eceffc2
remove session changes
GlenDsza Oct 27, 2024
bb76968
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
GlenDsza Oct 27, 2024
ee54d23
add support for filtering upcoming events & getVolunteerMembership re…
GlenDsza Nov 1, 2024
f914093
Merge branch 'develop' of https://github.com/GlenDsza/talawa-api into…
GlenDsza Nov 1, 2024
2bdeb0b
codeRabbit suggestions
GlenDsza Nov 1, 2024
028d2dd
Add inputs.ts in countlint exclusion
GlenDsza Nov 1, 2024
b3b5100
change allotedHours to allottedHours
GlenDsza Nov 1, 2024
55c48b5
coderabbit suggestions
GlenDsza Nov 2, 2024
d35ee3b
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
GlenDsza Nov 2, 2024
f634d1b
coderabbit suggestion
GlenDsza Nov 2, 2024
b41d77e
Merge branch 'develop' of https://github.com/PalisadoesFoundation/tal…
GlenDsza Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Count number of lines
run: |
chmod +x ./.github/workflows/countline.py
./.github/workflows/countline.py --lines 600 --exclude_files src/types/generatedGraphQLTypes.ts tests src/typeDefs/types.ts src/constants.ts
./.github/workflows/countline.py --lines 600 --exclude_files src/types/generatedGraphQLTypes.ts tests src/typeDefs/types.ts src/constants.ts src/typeDefs/inputs.ts
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved

- name: Check for TSDoc comments
run: npm run check-tsdoc # Run the TSDoc check script
Expand Down
3 changes: 3 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ const config: CodegenConfig = {
User: "../models/User#InterfaceUser",

Venue: "../models/Venue#InterfaceVenue",

VolunteerMembership:
"../models/VolunteerMembership#InterfaceVolunteerMembership",
},

useTypeImports: true,
Expand Down
134 changes: 114 additions & 20 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ directive @role(requires: UserType) on FIELD_DEFINITION
type ActionItem {
_id: ID!
actionItemCategory: ActionItemCategory
allotedHours: Float
assignee: User
allottedHours: Float
assignee: EventVolunteer
assigneeGroup: EventVolunteerGroup
assigneeType: String!
assigneeUser: User
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
assigner: User
assignmentDate: Date!
completionDate: Date!
Expand Down Expand Up @@ -41,6 +44,7 @@ input ActionItemWhereInput {
categoryName: String
event_id: ID
is_completed: Boolean
orgId: ID
}

enum ActionItemsOrderByInput {
Expand Down Expand Up @@ -310,8 +314,9 @@ interface ConnectionPageInfo {
scalar CountryCode

input CreateActionItemInput {
allotedHours: Float
allottedHours: Float
assigneeId: ID!
assigneeType: String!
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
dueDate: Date
eventId: ID
preCompletionNotes: String
Expand Down Expand Up @@ -675,6 +680,8 @@ type Event {
startTime: Time
title: String!
updatedAt: DateTime!
volunteerGroups: [EventVolunteerGroup]
volunteers: [EventVolunteer]
}

type EventAttendee {
Expand Down Expand Up @@ -739,21 +746,25 @@ enum EventOrderByInput {

type EventVolunteer {
_id: ID!
assignments: [ActionItem]
createdAt: DateTime!
creator: User
event: Event
group: EventVolunteerGroup
isAssigned: Boolean
isInvited: Boolean
response: String
groups: [EventVolunteerGroup]
hasAccepted: Boolean!
hoursHistory: [HoursHistory]
hoursVolunteered: Float!
isPublic: Boolean!
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
updatedAt: DateTime!
user: User!
}

type EventVolunteerGroup {
_id: ID!
assignments: [ActionItem]
createdAt: DateTime!
creator: User
description: String
event: Event
leader: User!
name: String
Expand All @@ -763,20 +774,32 @@ type EventVolunteerGroup {
}

input EventVolunteerGroupInput {
description: String
eventId: ID!
name: String
leaderId: ID!
name: String!
volunteerUserIds: [ID!]!
volunteersRequired: Int
}

enum EventVolunteerGroupOrderByInput {
assignments_ASC
assignments_DESC
volunteers_ASC
volunteers_DESC
}

input EventVolunteerGroupWhereInput {
eventId: ID
leaderName: String
name_contains: String
volunteerId: ID
orgId: ID
userId: ID
}

input EventVolunteerInput {
eventId: ID!
groupId: ID!
groupId: ID
userId: ID!
}

Expand All @@ -785,6 +808,19 @@ enum EventVolunteerResponse {
YES
}

input EventVolunteerWhereInput {
eventId: ID
groupId: ID
hasAccepted: Boolean
id: ID
name_contains: String
}

enum EventVolunteersOrderByInput {
hoursVolunteered_ASC
hoursVolunteered_DESC
}

input EventWhereInput {
description: String
description_contains: String
Expand Down Expand Up @@ -942,6 +978,11 @@ type Group {
updatedAt: DateTime!
}

type HoursHistory {
date: Date!
hours: Float!
}

type InvalidCursor implements FieldError {
message: String!
path: [String!]!
Expand Down Expand Up @@ -1093,6 +1134,7 @@ type Mutation {
createUserFamily(data: createUserFamilyInput!): UserFamily!
createUserTag(input: CreateUserTagInput!): UserTag
createVenue(data: VenueInput!): Venue
createVolunteerMembership(data: VolunteerMembershipInput!): VolunteerMembership!
deleteAdvertisement(id: ID!): DeleteAdvertisementPayload
deleteAgendaCategory(id: ID!): ID!
deleteDonationById(id: ID!): DeletePayload!
Expand Down Expand Up @@ -1157,7 +1199,7 @@ type Mutation {
updateCommunity(data: UpdateCommunityInput!): Boolean!
updateEvent(data: UpdateEventInput!, id: ID!, recurrenceRuleData: RecurrenceRuleInput, recurringEventUpdateType: RecurringEventMutationType): Event!
updateEventVolunteer(data: UpdateEventVolunteerInput, id: ID!): EventVolunteer!
updateEventVolunteerGroup(data: UpdateEventVolunteerGroupInput, id: ID!): EventVolunteerGroup!
updateEventVolunteerGroup(data: UpdateEventVolunteerGroupInput!, id: ID!): EventVolunteerGroup!
updateFund(data: UpdateFundInput!, id: ID!): Fund!
updateFundraisingCampaign(data: UpdateFundCampaignInput!, id: ID!): FundraisingCampaign!
updateFundraisingCampaignPledge(data: UpdateFundCampaignPledgeInput!, id: ID!): FundraisingCampaignPledge!
Expand All @@ -1171,6 +1213,7 @@ type Mutation {
updateUserProfile(data: UpdateUserInput, file: String): User!
updateUserRoleInOrganization(organizationId: ID!, role: String!, userId: ID!): Organization!
updateUserTag(input: UpdateUserTagInput!): UserTag
updateVolunteerMembership(id: ID!, status: String!): VolunteerMembership!
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
}

type Note {
Expand Down Expand Up @@ -1462,6 +1505,7 @@ type Query {
actionItemCategoriesByOrganization(orderBy: ActionItemsOrderByInput, organizationId: ID!, where: ActionItemCategoryWhereInput): [ActionItemCategory]
actionItemsByEvent(eventId: ID!): [ActionItem]
actionItemsByOrganization(eventId: ID, orderBy: ActionItemsOrderByInput, organizationId: ID!, where: ActionItemWhereInput): [ActionItem]
actionItemsByUser(orderBy: ActionItemsOrderByInput, userId: ID!, where: ActionItemWhereInput): [ActionItem]
adminPlugin(orgId: ID!): [Plugin]
advertisementsConnection(after: String, before: String, first: PositiveInt, last: PositiveInt): AdvertisementsConnection
agendaCategory(id: ID!): AgendaCategory!
Expand All @@ -1474,9 +1518,8 @@ type Query {
customDataByOrganization(organizationId: ID!): [UserCustomData!]!
customFieldsByOrganization(id: ID!): [OrganizationCustomField]
event(id: ID!): Event
eventVolunteersByEvent(id: ID!): [EventVolunteer]
eventsByOrganization(id: ID, orderBy: EventOrderByInput): [Event]
eventsByOrganizationConnection(first: Int, orderBy: EventOrderByInput, skip: Int, where: EventWhereInput): [Event!]!
eventsByOrganizationConnection(first: Int, orderBy: EventOrderByInput, skip: Int, upcomingOnly: Boolean, where: EventWhereInput): [Event!]!
fundsByOrganization(orderBy: FundOrderByInput, organizationId: ID!, where: FundWhereInput): [Fund]
getAgendaItem(id: ID!): AgendaItem
getAgendaSection(id: ID!): AgendaSection
Expand All @@ -1489,7 +1532,8 @@ type Query {
getEventAttendee(eventId: ID!, userId: ID!): EventAttendee
getEventAttendeesByEventId(eventId: ID!): [EventAttendee]
getEventInvitesByUserId(userId: ID!): [EventAttendee!]!
getEventVolunteerGroups(where: EventVolunteerGroupWhereInput): [EventVolunteerGroup]!
getEventVolunteerGroups(orderBy: EventVolunteerGroupOrderByInput, where: EventVolunteerGroupWhereInput!): [EventVolunteerGroup]!
getEventVolunteers(orderBy: EventVolunteersOrderByInput, where: EventVolunteerWhereInput!): [EventVolunteer]!
getFundById(id: ID!, orderBy: CampaignOrderByInput, where: CampaignWhereInput): Fund!
getFundraisingCampaignPledgeById(id: ID!): FundraisingCampaignPledge!
getFundraisingCampaigns(campaignOrderby: CampaignOrderByInput, pledgeOrderBy: PledgeOrderByInput, where: CampaignWhereInput): [FundraisingCampaign]!
Expand All @@ -1498,6 +1542,8 @@ type Query {
getPlugins: [Plugin]
getUserTag(id: ID!): UserTag
getVenueByOrgId(first: Int, orderBy: VenueOrderByInput, orgId: ID!, skip: Int, where: VenueWhereInput): [Venue]
getVolunteerMembership(orderBy: VolunteerMembershipOrderByInput, where: VolunteerMembershipWhereInput!): [VolunteerMembership]!
getVolunteerRanks(orgId: ID!, where: VolunteerRankWhereInput!): [VolunteerRank]!
getlanguage(lang_code: String!): [Translation]
hasSubmittedFeedback(eventId: ID!, userId: ID!): Boolean
isSampleOrganization(id: ID!): Boolean!
Expand Down Expand Up @@ -1643,8 +1689,9 @@ input UpdateActionItemCategoryInput {
}

input UpdateActionItemInput {
allotedHours: Float
allottedHours: Float
assigneeId: ID
assigneeType: String
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved
completionDate: Date
dueDate: Date
isCompleted: Boolean
Expand Down Expand Up @@ -1714,16 +1761,16 @@ input UpdateEventInput {
}

input UpdateEventVolunteerGroupInput {
eventId: ID
description: String
eventId: ID!
name: String
volunteersRequired: Int
}

input UpdateEventVolunteerInput {
eventId: ID
isAssigned: Boolean
isInvited: Boolean
response: EventVolunteerResponse
assignments: [ID]
hasAccepted: Boolean
isPublic: Boolean
}

input UpdateFundCampaignInput {
Expand Down Expand Up @@ -2050,6 +2097,53 @@ input VenueWhereInput {
name_starts_with: String
}

type VolunteerMembership {
_id: ID!
createdAt: DateTime!
createdBy: User
event: Event!
group: EventVolunteerGroup
status: String!
updatedAt: DateTime!
updatedBy: User
volunteer: EventVolunteer!
}

input VolunteerMembershipInput {
event: ID!
group: ID
status: String!
userId: ID!
}

enum VolunteerMembershipOrderByInput {
createdAt_ASC
createdAt_DESC
}

input VolunteerMembershipWhereInput {
eventId: ID
eventTitle: String
filter: String
groupId: ID
status: String
userId: ID
userName: String
}
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved

type VolunteerRank {
hoursVolunteered: Float!
rank: Int!
user: User!
}

input VolunteerRankWhereInput {
limit: Int
nameContains: String
orderBy: String!
timeFrame: String!
}
GlenDsza marked this conversation as resolved.
Show resolved Hide resolved

enum WeekDays {
FRIDAY
MONDAY
Expand Down
7 changes: 7 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,13 @@ export const EVENT_VOLUNTEER_INVITE_USER_MISTMATCH = Object.freeze({
PARAM: "eventVolunteers",
});

export const EVENT_VOLUNTEER_MEMBERSHIP_NOT_FOUND_ERROR = Object.freeze({
DESC: "Volunteer membership not found",
CODE: "volunteerMembership.notFound",
MESSAGE: "volunteerMembership.notFound",
PARAM: "volunteerMemberships",
});

export const USER_ALREADY_CHECKED_IN = Object.freeze({
MESSAGE: "The user has already been checked in for this event.",
CODE: "user.alreadyCheckedIn",
Expand Down
Loading
Loading