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

Basic API endpoints for volunteer check in #178

Closed
itsrachelfish opened this issue Aug 7, 2019 · 1 comment · Fixed by #180
Closed

Basic API endpoints for volunteer check in #178

itsrachelfish opened this issue Aug 7, 2019 · 1 comment · Fixed by #180
Assignees

Comments

@itsrachelfish
Copy link
Member

itsrachelfish commented Aug 7, 2019

The volunteer check in project is a planned mobile app which integrates with the volunteer database. https://github.com/playasoft/voldb-check-in/wiki/Requirements

The app is already set up to connect to the volunteer database using standard laravel cookie based auth, so we only need the following endpoints with standard user authentication:

GET /v1/profile

Returns information about the current user account (if logged in). Otherwise returns a 401 error.

{
    "username": "rachel",
    "email": "[email protected]",
    "permissions": ["volunteer", "admin", "ranger"],
    "full_name": "Rachel Fish",
    "burner_name": "BlubBlub",
    "phone_number": "555-123-4567"
}

GET /v1/events

Returns an array of all events with basic information like the name, start, and end dates.

[
    {
        "id": "1",
        "name": "Apogaea 2017",
        "start_date": "2017-06-07",
        "end_date": "2017-06-12"
    },

    {
        "id": "2",
        "name": "Denver Decompression 2018",
        "start_date": "2018-10-12",
        "end_date": "2018-10-14"
    },

    {
        "id": "3",
        "name": "Apogaea 2019",
        "start_date": "2019-06-05",
        "end_date": "2019-06-10"
    }
]

GET /v1/event/[id]/departments

Returns an array of all departments within the specified event ID.

[
    {
        "id": "1",
        "name": "Acculturation"
    },

    {
        "id": "2",
        "name": "BAMF"
    },

    {
        "id": "3",
        "name": "Cat Herder"
    }
]

GET /v1/event/[id]/roles

Returns an array of all roles within the specified event ID. Each role belongs to a specific department. (Development note: Because issue #114 has not been addressed yet, we are calling these roles in the API but in the database they are called shifts.)

[
    {
        "id": "1",
        "department_id": "19",
        "name": "New Ranger"
    },

    {
        "id": "2",
        "department_id": "19",
        "name": "Returning Dirt Ranger"
    },

    {
        "id": "3",
        "department_id": "19",
        "name": "Ranger Khaki"
    }
]

GET /v1/event/[id]/shifts

Returns an array of all shifts within the specified event ID. Each shift belongs to a role and also belongs to a department. (Development note: Because issue #114 has not been addressed yet, we are calling these shifts in the API but in the database they are called slots.)

[
    {
        "id": "1",
        "department_id": "5",
        "role_id": "10",
        "start_date": "2017-06-09",
        "end_date": "2017-06-09",
        "start_time": "18:00:00",
        "end_time": "22:00:00",
        "user_id": "1",
        "email": "[email protected]",
        "full_name": "Volunteer McVolunteererson",
        "display_name": "Cool Volunteer",
        "status": null,
    },

    {
        "id": "2",
        "department_id": "5",
        "role_id": "10",
        "start_date": "2017-06-09",
        "end_date": "2017-06-09",
        "start_time": "18:00:00",
        "end_time": "22:00:00",
        "user_id": "2",
        "email": "[email protected]",
        "full_name": "Buddy Friendo",
        "display_name": "Friendo",
        "status": "flaked"
    },

    {
        "id": "3",
        "department_id": "5",
        "role_id": "10",
        "start_date": "2017-06-09",
        "end_date": "2017-06-09",
        "start_time": "18:00:00",
        "end_time": "22:00:00",
        "user_id": "3",
        "email": "[email protected]",
        "full_name": "Pelagia noctiluca",
        "display_name": "Jellyfish",
        "status": "ontime"
    }
]

POST /v1/shift/[id]

Submits the user's performance to the server for the specified shift.

{
    "status": "ontime"
}
@demogorgonzola
Copy link
Contributor

demogorgonzola commented Aug 9, 2019

So first pass at this, this seems straightforward. The only thing that seems to require work is the GET requests. We just copy whatever middleware each controller has to the api controllers and write some simple queries to pull in the concerning data which we pack to JSON.

I'll start with a first draft!

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 a pull request may close this issue.

2 participants