From 374d2812c1fa5e500667e5cd456293e7c28428f1 Mon Sep 17 00:00:00 2001 From: MaxchilKH Date: Thu, 8 Oct 2020 21:56:53 +0200 Subject: [PATCH] Add hours to registration --- src/InternshipSystem.Api/Commands/UpdateRegistrationForm.cs | 1 + .../UseCases/UpdateInternshipRegistrationUseCase.cs | 1 + .../Entity/Internship/InternshipRegistration.cs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/InternshipSystem.Api/Commands/UpdateRegistrationForm.cs b/src/InternshipSystem.Api/Commands/UpdateRegistrationForm.cs index 5bcb1be..61a35af 100644 --- a/src/InternshipSystem.Api/Commands/UpdateRegistrationForm.cs +++ b/src/InternshipSystem.Api/Commands/UpdateRegistrationForm.cs @@ -13,6 +13,7 @@ namespace InternshipSystem.Api.Commands public DateTime? End { get; set; } public UpdateMentor? Mentor { get; set; } public List Subjects { get; set; } + public int? Hours { get; set; } public long? Type { get; set; } } diff --git a/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs b/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs index c3b49a5..a490cf4 100644 --- a/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs +++ b/src/InternshipSystem.Api/UseCases/UpdateInternshipRegistrationUseCase.cs @@ -36,6 +36,7 @@ namespace InternshipSystem.Api.UseCases { subjectRegistration.Start = registrationCommand.Start ?? subjectRegistration.Start; subjectRegistration.End = registrationCommand.End ?? subjectRegistration.End; + subjectRegistration.DeclaredHours = registrationCommand.Hours ?? subjectRegistration.DeclaredHours; if (registrationCommand.Type.HasValue) { diff --git a/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs index db6b877..d220a42 100644 --- a/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs +++ b/src/InternshipSystem.Core/Entity/Internship/InternshipRegistration.cs @@ -16,8 +16,10 @@ namespace InternshipSystem.Core.Entity.Internship public Mentor Mentor { get; set; } public List Subjects { get; set; } public InternshipType Type { get; set; } + + public int DeclaredHours { get; set; } public DocumentState State { get; set; } - + public static InternshipRegistration Create() { return new InternshipRegistration();