Validators
Parent namespace: Backend
Classes
| Type | Description |
|---|---|
ActivityValidator | The ActivityValidator class provides static methods for validating and normalizing activity-related data transfer objects (DTOs) used in the creation and updating of activities. The ValidateRequest method checks the validity of the activity's time range, participant limit, and poster file if provided, as well as ensuring that only authorized users can create activities with certain features. The NormalizeCreateRequest method adjusts the DTO for creating an activity by setting the enrollment open date to null if the activity is marked as enrollable. The ParseCreateQuestions and ParseUpdateQuestions methods handle the deserialization of specification questions from JSON format, while the MapSpecificationQuestion method maps the properties of an UpdateSpecificationQuestionDTO to a SpecificationQuestion entity. These methods centralize the validation and normalization logic for activity-related operations, ensuring that incoming data is properly checked and formatted before being processed by the application. |
AnswerValidator | Provides validation helpers for checking whether specification answers match a question type. |
EnrollmentValidator | Provides validation helpers for enrollment requests and specification answers. |
ExtensionValidator | Provides file-extension and MIME-type validation for uploaded images. |
GroupValidator | Provides validation helpers for group-related fields. |
SpecificationAnswerValidator | Provides validation helpers for mutating specification answers. |
StateValidator | Provides object-state validation based on data-annotation attributes. |
StudyEnrollmentValidator | Provides validation methods for study enrollments. |