Skip to content

Conversation

@timyates
Copy link
Contributor

@timyates timyates commented Jun 7, 2024

Volunteering Organization

Permissions

  • Anyone can view organizations
  • Anyone can create an organization
  • Only users with the CAN_ADMINISTER_VOLUNTEERING_ORGANIZATIONS permission can update organizations
  • Organizations may be deactivated, but not deleted

Data format

  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "string",
    "description": "string",
    "website": "string",
    "active": true
  }

Note

active defaults to true if omitted

Endpoints

GET /services/volunteer/organization{?includeDeactivated}
POST /services/volunteer/organization
PUT /services/volunteer/organization/{id}

Volunteering Relationship

Permissions

  • Anyone can view relationships
  • Anyone can create or update a relationship for themselves
  • Only users with the CAN_ADMINISTER_VOLUNTEERING_RELATIONSHIPS permission can create or update relationships for other people
  • Relationships may be deactivated, but not deleted

Data format

  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "memberId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organizationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "startDate": "2024-06-11",
    "endDate": "2024-06-11",
    "active": true
  }

Note

endDate is optional and active defaults to true if omitted

Endpoints

GET /services/volunteer/relationship{?memberId,organizationId,includeDeactivated}
POST /services/volunteer/relationship
PUT /services/volunteer/relationship/{id}

Volunteering Event

Permissions

  • Anyone can view events
  • Anyone can create, update or delete an event for a relationship that they are the owner of
  • Only users with the CAN_ADMINISTER_VOLUNTEERING_EVENTS permission can create, update, or delete events for other people's relationships
  • Events can be deleted

Data format

  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "relationshipId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "eventDate": "2024-06-11",
    "hours": 0,
    "notes": "string"
  }

Note

hours may not be negative, and notes is optional

Endpoints

GET /services/volunteer/event{?memberId,organizationId,includeDeactivated}
POST /services/volunteer/event
PUT /services/volunteer/event/{id}
DELETE /services/volunteer/event/{id}

@timyates timyates added the server label Jun 7, 2024
@timyates timyates self-assigned this Jun 7, 2024
@mkimberlin
Copy link
Member

We should really put required permissions on these APIs. I'm ok with doing a follow up issue for that so this can be merged, if you prefer @mvolkmann @timyates I'll approve and leave that to the two of you.

@timyates timyates marked this pull request as ready for review June 11, 2024 16:41
@timyates timyates requested review from mkimberlin and mvolkmann June 11, 2024 16:44
@timyates
Copy link
Contributor Author

@mvolkmann I've updated the PR description to list the available endpoints and how the permissions work...

Please let me know if I've missed anything, or something could be changed to work better with the front end

Copy link
Contributor

@vhscom vhscom left a comment

Choose a reason for hiding this comment

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

Looks good to me. Left one nice to have.

VolunteeringRelationship sarahLiftForLife = createVolunteeringRelationship(sarah.getId(), liftForLife.getId(), LocalDate.now().minusDays(2));
VolunteeringRelationship timLiftForLife = createVolunteeringRelationship(tim.getId(), liftForLife.getId(), LocalDate.now());
VolunteeringRelationship timFoodbankInactive = createVolunteeringRelationship(tim.getId(), foodbank.getId(), LocalDate.now().minusDays(3), null, false);
VolunteeringRelationship sarahFoodbank = createVolunteeringRelationship(sarah.getId(), foodbank.getId(), LocalDate.now().minusDays(10), LocalDate.now());
Copy link
Contributor

Choose a reason for hiding this comment

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

The test fixtures make this nice and concise.

@timyates timyates merged commit bf06d6c into develop Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants