ecamp / ecamp/ecamp3

Adjust Camp creation endpoint to allow linking Hitobito events

Open
#10,387 4 comments 0 reactions 1 assignee Claimed by @eliaSchenker View on GitHub
Ready for implementation type: API
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.