thunder
thunder copied to clipboard
New Endpoint: Create List of Users
Describe the problem that this feature would solve
Right now you can POST to /users with a single User. You should also be able to POST to /users with a list of users to create. Thunder should then issue a batch create request to the database with those users.
Describe the solution you'd like
A new endpoint in the UserResource that is very similar to the current POST /users, but takes in a list of users.
The method should call into the UsersDao with that list of users, and the UsersDao should do a batch create.
Additional context
For Dynamo: Will probably have to do a batch get, check for existing primary keys, and then do the batch update. Dynamo doesn't support conditional put with batch requests
Questions:
- What do to if one of the user creations fail? Don't store any the DB or keep the ones that succeed? Maybe make that an optional query parameter?