ποΈ Data Storage and Inter-Phase Communication
The PROMPT 2 platform provides a structured and flexible system for storing course data and enabling communication between course phases. Each course phase service can either rely on the core platform for data storage or use its own persistence layer. Additionally, a declarative communication model allows services to request and share data across phases via well-defined contracts.
π§± Data Storage Optionsβ
Course phase services can choose between:
1. πΉ Core Storageβ
The Course Phase component in the core system provides two data fields for each course phase and course phase participation:
-
restricted_data:- Writable by: Course Lecturers
- Readable by: Lecturers and Editors
-
student_readable_data:- Writable by: Course Lecturers
- Readable by: Students, Lecturers, and Editors
This model is suitable for lightweight, client-only services, such as the Matching phase.
2. πΈ Custom Storageβ
If a service requires:
- Students or Editors to write data
- Rich or phase-specific data schemas
- Performance-intensive access
β¦then it must implement its own persistent storage solution.
π Inter-Phase Communication Schemaβ
Some course phases require access to data from previous phasesβfor example, application forms, scores, or student profiles. This data may be needed at:
- The course phase level (data shared across all participants)
- The participation level (data per student per phase)
π DTO Definitions and Registrationβ
To enable structured communication, PROMPT 2 uses Data Transfer Objects (DTOs). Each course phase service must declare:
- What output data it provides
- What input data it requires
- Where each DTO is stored (core or custom service)
These declarations are submitted during Course Phase Type Registration.
π¦ Output DTO Schemaβ
The table below outlines the structure used to register output DTOs:
| Name | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the output DTO definition |
course_phase_type_id | UUID | References the course phase type |
name | String | Logical name of the DTO (e.g., Score, DeveloperProfile) |
version_number | Integer | Version of the DTO definition |
endpoint_url | String | Fragment for the service endpoint (e.g., /developerProfile/) |
specification | JSON | OpenAPI specification of the DTO structure |
π Note: Input DTOs follow the same schema but omit
version_numberandendpoint_url.
The core maintains these definitions per course phase and participation level.
π Data Flow Configurationβ
Course lecturers use the Course Configurator to define data flows between phases. This is done by linking:
- Output DTOs from one phase
- To Input DTOs of another
The core system stores these links in two data graphs:
- One for course phase-level data
- One for participation-level data
When a service or client requests a DTO:
- If the data is stored in the core, the core returns it directly.
- If stored in a course phase service, the core returns the DTOβs endpoint and
coursePhaseID.
π Required Service Endpointsβ
For each output DTO stored outside the core, the course phase service must expose fixed HTTP GET endpoints, structured as follows:
π Participation-Level DTOsβ
-
List all DTOs for all participations:
GET <coursePhaseServiceBaseURL>/course_phase/{coursePhaseID}/{endpoint_url}Response:
[
{
"courseParticipationID": "<courseParticipationID>",
"dtoName": "<dto>"
}
] -
Get a specific DTO by participation:
GET <coursePhaseServiceBaseURL>/course_phase/{coursePhaseID}/{endpoint_url}/{courseParticipationID}Response:
{
"dtoName": "<dto>"
}
π Course Phase-Level DTOsβ
-
Get the DTO for the course phase:
GET <coursePhaseServiceBaseURL>/course_phase/{coursePhaseID}/{endpoint_url}Response:
{
"dtoName": "<dto>"
}
The actual resolution is implemented in the Go SDK and does not have to be implemented by each course phase service.
π Access Control for DTO Endpointsβ
- All endpoints must be accessible to course lecturers
- Course phase services may implement additional access controls (e.g., editor or student access)
- Services decide whether DTOs are visible to students or restricted
β οΈ Availability and Responsibilityβ
The inter-phase communication schema defines a contract, but does not guarantee:
- That a service has stored the expected data
- That a service is available at the time of the request
Developers must ensure to handle missing or unreachable data gracefully.