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

Create backend table update API endpoints #5

Open
cloudui opened this issue Mar 12, 2024 · 0 comments
Open

Create backend table update API endpoints #5

cloudui opened this issue Mar 12, 2024 · 0 comments
Assignees

Comments

@cloudui
Copy link
Member

cloudui commented Mar 12, 2024

Objective

Similar to in portal, you should make an API call to update the backend table with the data generated from the output of the scheduling algorithm.

Essentially, the output of the scheduling algorithm will look something like this:

[
{
    "name": "Best Hack Ever",
    "table": "A",
    "prizes": [
        {
            "category": "Bitcamp People's Choice"
        },
        {
            "category": "Bloomgberg Best Booty Hack",
            "time-start": "2024-03-05T12:30:45Z",
            "time-end": "2024-03-05T3:30:45Z"
        }
    ]
},
{...}
]

For now, assume the output is in the form of a Python dictionary. Jsonify this output by calling this imaginary function (you can call it generate_schedule for now), and make a post request path at /update-schedule (you don't really hace to worry about the paths) where DynamoDB is populated with this information. This involves setting the entire table.

  • For now, delete all entries in table before updating it with the new info. I am aware this is a bit inefficient, but we're not dealing with much data so it's okay.

This should be done in Python! This means you can't just copy the JavaScript file from portal.

Details

  • Put it in backend/src
  • Make the method names reasonable
  • Be careful with headers (first resource)

Resources

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

No branches or pull requests

2 participants