Feature: MiData Integration
- Dominant language
- PHP
- Stars
- 156
- Forks
- 72
- Avg merge
- 12h 43m
- Merged PRs (30d)
- 203
Description
This issue is based on the following specification: [Richtpreisanfrage.pdf](https://github.com/user-attachments/files/30503801/Richtpreisanfrage-1.pdf)
## Introduction
eCamp is used by members of the Pfadibewegung Schweiz (PBS) to plan / manage their camps. The member database of the PBS (MiData) also offers the ability to manage camps.
The goal of this feature is to integrate MiData into eCamp, so that camp organizers can easily import existing camp data from MiData, improving efficiency and eliminating redundancy.
Since MiData uses Hitobito and eCamp also provides OAuth integration with other Hitobito-based apps (CeviDB, Jungwacht Blauring), this feature is conceptualized to work with any Hitobito instance, not just MiData. In a first step only MiData is integrated, with the design facilitating the integration of other providers in the future.
The following is a brief overview of all functionality implemented as part of this feature. Sub-Issues with concrete specification will be linked in each section as soon as they are created.
General adjustments (used by multiple features):
- https://github.com/ecamp/ecamp3/issues/10400
- https://github.com/ecamp/ecamp3/issues/10398
- https://github.com/ecamp/ecamp3/issues/10419
## Creating a camp from a Hitobito event
A user with Hitobito OAuth enabled can create a camp from a Hitobito event by selecting the event from a list of events where they the leader (have a specified role, for MiData `Event::Camp::Role::Leader`
The creation process creates a new camp with all data from the Hitobito event. If any data is incompatible / incomplete, a corresponding error is shown to the user (no camp is persisted).
Imported camps are managed independently in eCamp (data and user/role management) and are not automatically synced with Hitobito.
Issues:
- https://github.com/ecamp/ecamp3/issues/10386
- https://github.com/ecamp/ecamp3/issues/10387
- https://github.com/ecamp/ecamp3/issues/10401
## Manual Synchronisation of a Hitobito event into eCamp
A manager of a camp that is linked to Hitobito can trigger manual synchronization of the camp. New data will be retrieved from Hitobito (this requires that the user has Hitobito OAuth enabled and has access to the corresponding event). The data is mapped with the same logic as in the creation workflow.
To avoid data loss the user is first shown the changes that will be applied. The changes are only saved to the database after they are confirmed by the user.
If an error occurs during synchronization (incompatible data, conflicts), the process is cancelled and no data is persisted.
If the Hitobito event does not exist anymore or the user doesn’t have access to it, a corresponding error message is shown.
Issues:
- https://github.com/ecamp/ecamp3/issues/10423
- https://github.com/ecamp/ecamp3/issues/10438
## Invitation of Hitobito users into eCamp
A manager of a camp that is linked with Hitobito can trigger the automatic invitation of Hitobito users to eCamp. All Hitobito users with non-participant event roles of the corresponding event will be invited to eCamp with the role `member`.
Similarly to the current eCamp invitation logic (CampCollaboration):
- If a user does not yet have an account one is created for them
- If a user already has an open invitation, a new one will not be created
- If a user already has an eCamp account, they will simply be added to the camp
- If a user was removed from the Hitobito event but exists at eCamp, they will **not** be deleted
This action is idempotent and may be executed multiple times. Users are mapped over their email address.
As with the synchronization flow, if the Hitobito event does not exist anymore or the user doesn’t have access to it, a corresponding error message is shown.
Issues:
- https://github.com/ecamp/ecamp3/issues/10424
- https://github.com/ecamp/ecamp3/issues/10437
## Deep-Link with Hitobito id
eCamp offers a deep link that allows navigating to a camp by a Hitobito id (`https://app.ecamp3.ch/camps/hitobito//`). The logic is as follows:
- If the user is not authenticated, they are redirected to the login screen. After the login flow completes, they are redirected back to the deep link.
- If a corresponding camp exists and the user does not have access to it, they are shown an error message, asking them to contact the camp administrator.
- If a corresponding camp exists and the user has access to it, they are redirected to the camp detail page.
- If no corresponding camp exists, the user has Hitobito OAuth enabled and is leader of the Hitobito event (as described above), they are prompted to create it.
Issues:
- https://github.com/ecamp/ecamp3/issues/10425
- https://github.com/ecamp/ecamp3/issues/10435
## Future Improvements
The following additional improvements can be implemented in the future:
- Using the deep link mentioned above, MiData can be adjusted so that MiData users can open the corresponding eCamp event directly from MiData through a link on the camp detail page.
- As described above CeviDB ([Cevi](https://www.cevi.ch/home/)) and JublaDB ([Jungwacht Blauring](https://www.jubla.ch/)), which both use Hitobito, may be integrated in the future.
- Manual decoupling of camps linked to Hitobito
- May be done by any user with the manager role
- Manual synchronization / user invitation from Hitobito is no longer possible after decoupling the camp. All data previously imported from Hitobito remains unaffected.
- Allow users to select which camp data should be synced
(these improvements are out-of-scope for the planned implementation of this feature)
## Attachments
Original Price Inquiry / Requirements:
[Richtpreisanfrage.pdf](https://github.com/user-attachments/files/30465994/Richtpreisanfrage.pdf)
Contributor guide
Assessment
This issue has not been assessed yet.