-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Judge model and DTO, update CompetitiveEvent model, modify servic…
…e and controller to support updated model
- Loading branch information
Showing
13 changed files
with
447 additions
and
93 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
OutOfSchool/OutOfSchool.BusinessLogic/Models/CompetitiveEvent/CompetitiveEventCreateDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
//using OutOfSchool.Common.Enums; | ||
using OutOfSchool.Common.Enums; | ||
using OutOfSchool.Services.Enums; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace OutOfSchool.BusinessLogic.Models.CompetitiveEvent; | ||
public class CompetitiveEventCreateDto | ||
{ | ||
public Guid Id { get; set; } | ||
|
||
public bool IsDeleted { get; set; } | ||
|
||
[DataType(DataType.Text)] | ||
[MaxLength(250)] | ||
[MinLength(1)] | ||
public string Title { get; set; } | ||
|
||
[Required(ErrorMessage = "ShortTitle is required")] | ||
[DataType(DataType.Text)] | ||
[MaxLength(100)] | ||
[MinLength(1)] | ||
public string ShortTitle { get; set; } | ||
|
||
[Required] | ||
[EnumDataType(typeof(CompetitiveEventStates), ErrorMessage = Constants.EnumErrorMessage)] | ||
public CompetitiveEventStates State { get; set; } = CompetitiveEventStates.Draft; | ||
|
||
public DateTimeOffset RegistrationStartTime { get; set; } | ||
|
||
public DateTimeOffset RegistrationEndTime { get; set; } | ||
|
||
public Guid? ParentId { get; set; } = null; | ||
|
||
public Guid BuildingHoldingId { get; set; } | ||
|
||
public Guid ChildParticipantId { get; set; } | ||
|
||
public List<CompetitiveEventDescriptionItemDto> CompetitiveEventDescriptionItems { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string AdditionalDescription { get; set; } | ||
|
||
[Required] | ||
public DateTimeOffset ScheduledStartTime { get; set; } | ||
|
||
[Required] | ||
public DateTimeOffset ScheduledEndTime { get; set; } | ||
|
||
[Required] | ||
public uint NumberOfSeats { get; set; } = uint.MaxValue; | ||
|
||
[Required] | ||
//public List<Guid> AccountingTypeOfEvent { get; set; } | ||
public int AccountingTypeOfEventId { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string Description { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string DescriptionOfTheEnrollmentProcedure { get; set; } | ||
|
||
[Required] | ||
public Guid OrganizerOfTheEventId { get; set; } | ||
|
||
[EnumDataType(typeof(FormOfLearning), ErrorMessage = Constants.EnumErrorMessage)] | ||
public FormOfLearning PlannedFormatOfClasses { get; set; } | ||
|
||
public Guid VenueId { get; set; } | ||
|
||
public string VenueName { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string PreferentialTermsOfParticipation { get; set; } | ||
|
||
public List<JudgeDto> Judges { get; set; } | ||
|
||
public List<Guid> ParticipantsOfTheEvent { get; set; } // guid ? | ||
|
||
public bool AreThereBenefits { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string Benefits { get; set; } | ||
|
||
public uint Rating { get; set; } | ||
|
||
public uint NumberOfRatings { get; set; } | ||
|
||
public bool OptionsForPeopleWithDisabilities { get; set; } | ||
|
||
[MaxLength(2000)] | ||
public string DescriptionOfOptionsForPeopleWithDisabilities { get; set; } | ||
|
||
public long CategoryId { get; set; } | ||
|
||
[MaxLength(250)] | ||
public string Subcategory { get; set; } | ||
|
||
[Range(0, 120, ErrorMessage = "Min age should be a number from 0 to 120")] | ||
public int MinimumAge { get; set; } | ||
|
||
[Range(0, 120, ErrorMessage = "Max age should be a number from 0 to 120")] | ||
public int MaximumAge { get; set; } | ||
|
||
public List<Guid> Coverage { get; set; } | ||
|
||
[Range(0, 100000, ErrorMessage = "Field value should be in a range from 1 to 100 000")] | ||
public int Price { get; set; } = default; | ||
|
||
public bool CompetitiveSelection { get; set; } | ||
public uint NumberOfOccupiedSeats { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
OutOfSchool/OutOfSchool.BusinessLogic/Models/CompetitiveEvent/JudgeDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using OutOfSchool.Common.Validators; | ||
using OutOfSchool.Services.Enums; | ||
namespace OutOfSchool.BusinessLogic.Models.CompetitiveEvent; | ||
|
||
public class JudgeDto | ||
{ | ||
public Guid Id { get; set; } | ||
|
||
[Required(ErrorMessage = Constants.RequiredFirstNameErrorMessage)] | ||
[DataType(DataType.Text)] | ||
[MaxLength(Constants.NameMaxLength)] | ||
[CustomUkrainianName(ErrorMessage = Constants.InvalidFirstNameErrorMessage)] | ||
public string FirstName { get; set; } = string.Empty; | ||
|
||
[Required(ErrorMessage = Constants.RequiredFirstNameErrorMessage)] | ||
[DataType(DataType.Text)] | ||
[MaxLength(Constants.NameMaxLength)] | ||
[CustomUkrainianName(ErrorMessage = Constants.InvalidLastNameErrorMessage)] | ||
public string LastName { get; set; } = string.Empty; | ||
|
||
[DataType(DataType.Text)] | ||
[MaxLength(Constants.NameMaxLength)] | ||
[CustomUkrainianName(ErrorMessage = Constants.InvalidMiddleNameErrorMessage)] | ||
public string MiddleName { get; set; } = string.Empty; | ||
|
||
[Required(ErrorMessage = "Gender is required")] | ||
[EnumDataType(typeof(Gender), ErrorMessage = Constants.EnumErrorMessage)] | ||
public Gender Gender { get; set; } | ||
|
||
[Required(ErrorMessage = "Date of birth is required")] | ||
[DataType(DataType.Date)] | ||
public DateTime DateOfBirth { get; set; } | ||
|
||
public bool IsChiefJudge { get; set; } | ||
|
||
[MaxLength(300)] | ||
public string Description { get; set; } = string.Empty; | ||
|
||
public string CoverImageId { get; set; } = string.Empty; | ||
|
||
public Guid CompetetiveEventId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.