ecamp / ecamp/ecamp3

Adjust Camp Model to include Hitobito properties

Open
#10,398 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

With the MiData integration feature we need to adjust the camp entity to include properties that indicate the corresponding linked Hitobito event, and which Hitobito provider (such as MiData) was used.
## Implementation
Adjust the `Camp` model (used in such endpoints such as `/camps`) to include the new properties `hitobitoProvider` and `hitobitoEventId`.

Example Response:
```jsonc
// GET /api/camps

{
"_links": {
"self": {
"href": "/api/camps"
},
"items": [
{
"href": "/api/camps/0969e3c95dfc"
},
]
},
"totalItems": 1,
"_embedded": {
"items": [
{
"_links": {
// ...
},
"isShared": false,
"sharedSince": null,
"isPrototype": false,
"shortTitle": "Sola 2025",
"title": "Star Wars",
// ...
"hitobitoProvider": "pbsmidata",
"hitobitoEventId": 1234
}
]
}
}
```

## DB Schema Changes

The following fields are added to the `camp` table:

| Field | Type | Description |
| ---------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `hitobitoprovider` | `VARCHAR(16) NULL` | Hitobito provider this camp was created from (currently only MiData)
Note: No ENUM, to keep consistent with other similar fields (such as `camp_collaboration.status`). Allowed values should be controlled over the PHP model class. |
| `hitobitoeventid` | `VARCHAR(255) NULL` | Event id of the corresponding event in Hitobito |

`hitobitoprovider` and `hitobitoeventid` have a combined unique index, so that the same event of the same provider cannot be imported twice.

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.