From 102ec1feac2c6d4bc98a2338c7e1207dceaf9328 Mon Sep 17 00:00:00 2001
From: maxchil <m.w.bohdanowicz@gmail.com>
Date: Thu, 8 Oct 2020 21:57:20 +0200
Subject: [PATCH] add_hours (#62)

Add hours to registration

merge

add document scan endpoint

Co-authored-by: MaxchilKH <m.w.bohdanowicz@gmail.com>
---
 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<long> 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<ProgramSubject> 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();