Validators - ita-social-projects/WhatBackend GitHub Wiki

AccountDTO

Not Empty Max Length Min Length Extra rule Example
Email 50 The string contains an “@” sign which is not at the beginning or the end of the string ✔️[email protected] ❌poll.baker.example ❌@poll.baker.example ❌poll.baker.example@
Password 30 8 At least one uppercase letter, one lowercase letter one number and special character (!@#$%^&*()_+-=) ✔️zhbzsbS_7 ✔️Ms_9FYIQ ❌пyопА23_2 ❌hdugns23 ❌YHANK!4 ❌Rsf_1
FirstName 30 ✔️Poll ✔️Вася
LastName 30 ✔️Baker ✔️Петров
URL 200

AttachmentDTO

Greater Than Extra rule Example
MentorId 0 ✔️2 ❌-3
CourseId 0 ✔️2 ❌-3
GroupId 0 ✔️2 ❌-3
StudentAccountID 0 ✔️2 ❌-3
FinishDate Not null FinishDate > StartDate or FinishDate = StartDate 2022-03-22T16:54:02.854Z

CourseDTO

Not Empty Max Length Example
Name 100 ✔️Programming for IoT

DashboardDto

Not Empty Greater Than Extra rule Example
StartDate 2022-03-21T16:54:02.854Z
FinishDate FinishDate > StartDate or FinishDate = StartDate 2022-03-22T16:54:02.854Z
IncludeAnalytics Not null 1
CourseId 0 ✔️2 ❌-3
StudentGroupId 0 ✔️2 ❌-3

HomeworkDto

Not Empty Greater Than Max Length Extra rule Example
GroupId 0 ✔️2 ❌-3
CourseId 0 ✔️2 ❌-3
ThemeId 0 ✔️2 ❌-3
FinishDate Not null FinishDate > StartDate or FinishDate = StartDate 2022-03-22T16:54:02.854Z
TaskText 65535 ✔️Explore a new topic
LessonId 0 ✔️2 ❌-3
AttachmentIds Not null 0 ✔️2 ❌-3

HomeworkStudentDto

Not Empty Greater Than Max Length Extra rule Example
HomeworkId 0 ✔️2 ❌-3
HomeworkText 65535 ✔️Explore a new topic
IsSent Must be true or false ✔️true ❌word
AttachmentIds 0 ✔️2 ❌-3
StudentHomeworkId 0 ✔️2 ❌-3
StudentMark >=0 <=100 ✔️90 ❌101

LessonDto

Not Empty Greater Than Max Length Example
MentorId 0 ✔️2 ❌-3
LessonId 0 ✔️2 ❌-3
ThemeName 100 ✔️C# Programming
StudentGroupId 0 ✔️2 ❌-3
LessonVisits Not null
LessonDate 2022-03-23T12:32:12.274Z

MentorDto

Not Empty Greater Than Max Length Extra rule Example
Email 50 The string contains an “@” sign which is not at the beginning or the end of the string ✔️[email protected] ❌poll.baker.example ❌@poll.baker.example ❌poll.baker.example@
FirstName 30 ✔️Poll ✔️Вася
LastName 30 ✔️Baker ✔️Петров
CourseIds 0 ✔️2 ❌-3
StudentGroupIds 0 ✔️2 ❌-3

ScheduledEventDTO

Greater Than Extra rule Example
StudentGroupId 0 ✔️2 ❌-3
ThemeId 0 ✔️2 ❌-3
MentorId 0 ✔️2 ❌-3
EventEnd Not null EventEnd > EventStart or EventEnd = EventStart 2022-03-23T12:32:12.274Z

ScheduledDTO

Not Empty Greater Than Extra rule Example
GroupID 0 ✔️2 ❌-3
ThemeID 0 ✔️2 ❌-3
MentorID 0 ✔️2 ❌-3
StartDate 2022-03-22T12:32:12.274Z
FinishDate Not null FinishDate > StartDate or FinishDate = StartDate 2022-03-23T12:32:12.274Z
Type Not null ✔️2 ❌-3
Interval 0 ✔️2 ❌-3
DaysOfWeek Not null ✔️2 ❌-3
Dates >=1 <=31 ✔️28 ❌32
CourseID 0 ✔️2 ❌-3
StudentAccountID 0 ✔️2 ❌-3
EventEnd Not null EventEnd > EventStart or EventEnd = EventStart 2022-03-23T12:32:12.274Z
LessonStart 2022-03-22T12:32:12.274Z
LessonEnd Not null LessonEnd >LessonStart or LessonEnd = LessonStart 2022-03-23T12:32:12.274Z
RepeatRate ✔️2 ❌-3
DayNumber >=1 <=31 ✔️28 ❌32

SecretaryDto

Max Length Extra rule Example
Email 50 The string contains an “@” sign which is not at the beginning or the end of the string ✔️[email protected] ❌poll.baker.example ❌@poll.baker.example ❌poll.baker.example@
FirstName 30 ✔️Poll ✔️Вася
LastName 30 ✔️Baker ✔️Петров

StudentDto

Max Length Extra rule Greater Than Not Empty Example
Email 50 The string contains an “@” sign which is not at the beginning or the end of the string ✔️[email protected] ❌poll.baker.example ❌@poll.baker.example ❌poll.baker.example@
FirstName 30 ✔️Poll ✔️Вася
LastName 30 ✔️Baker ✔️Петров
StudentGroupIds 0 ✔️2 ❌-3

StudentGroupDto

Not Empty Greater Than Max Length Extra rule Example
Name 100 ✔️SX-13
CourseId 0 ✔️2 ❌-3
StartDate 2022-03-22T12:32:12.274Z
FinishDate Not null FinishDate > StartDate or FinishDate = StartDate 2022-03-23T12:32:12.274Z
StudentIds 0 ✔️2 ❌-3
MentorIds 0 ✔️2 ❌-3
Id 0 ✔️2 ❌-3

ThemeDto

Not Empty Max Length Example
Name 100 ✔️Drying of flowers

VisitDto

Not Empty Greater Than Max Length Extra rule Example
StudentId 0 ✔️2 ❌-3
StudentMark <=0 >=100 ✔️90 ❌101
Presence Not null
Comment 1024 ✔️Explore a new topic
⚠️ **GitHub.com Fallback** ⚠️