objectcomputing / check-ins

Other
7 stars 7 forks source link

Add API for managing volunteering #2490

Closed timyates closed 2 weeks ago

timyates commented 3 weeks ago

Volunteering Organization

Permissions

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

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

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}
mkimberlin commented 3 weeks ago

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 commented 2 weeks ago

@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