Adjust Camp creation endpoint to allow linking Hitobito events
- Dominant language
- PHP
- Stars
- 156
- Forks
- 72
- Avg merge
- 12h 43m
- Merged PRs (30d)
- 203
Description
Adjust the camp creation endpoint with the following two properties:
```jsonc
// POST /api/camps
{
// ...
"hitobitoProvider": "pbsmidata",
"hitobitoEventId": "1234"
}
// Response
//
```
## Implementation
1. If the `hitobitoProvider` and `hitobitoEventId` are set, continue
1. If either one is set (but not both), respond with `422 Unprocessable Content`
2. If none is set, do not perform the Hitobito-related steps
2. Retrieve / verify access token
- See https://github.com/ecamp/ecamp3/issues/10400
3. Check that the user has access to the specified event
1. See https://github.com/ecamp/ecamp3/issues/10419
4. Query the database for a camp with the `hitobitoeventid = AND hitobitoprovider = `
1. If a camp already exists, return `409 Conflict`
5. Create the camp with the provided data and `hitobitoeventid` / `hitobitoprovider` set to the given values
Contributor guide
Assessment
This issue has not been assessed yet.