feat/report (#92)

XD

Co-authored-by: Michal Bohdanowicz <m.w.bohdanowicz@gmail.com>
This commit is contained in:
maxchil 2021-01-10 21:34:12 +01:00
parent b68a8480bd
commit de1cb296d3
3 changed files with 21 additions and 2 deletions

View File

@ -34,7 +34,8 @@ namespace InternshipSystem.Api.Controllers
.SingleAsync(i => i.Student.Id == user.PersonNumber, ct); .SingleAsync(i => i.Student.Id == user.PersonNumber, ct);
internship.Report.UpdateReport(reportValue.ToString(Formatting.None)); internship.Report.UpdateReport(reportValue.ToString(Formatting.None));
internship.AddInternshipEvaluation();
await _context.SaveChangesAsync(ct); await _context.SaveChangesAsync(ct);
return Ok(); return Ok();

View File

@ -53,5 +53,22 @@ namespace InternshipSystem.Core.Entity.Internship
// document.Scan = documentScan; // document.Scan = documentScan;
// document.State = DocumentState.Submitted; // document.State = DocumentState.Submitted;
} }
public void AddInternshipEvaluation()
{
if (Documentation.Any(d => d.Type == DocumentType.InternshipEvaluation))
{
return;
}
var document = new Document
{
Description = "",
Type = DocumentType.InternshipEvaluation,
State = DocumentState.Draft
};
Documentation.Add(document);
}
} }
} }

View File

@ -4,6 +4,7 @@
{ {
IppScan, IppScan,
DeanConsent, DeanConsent,
NnwIsurance NnwIsurance,
InternshipEvaluation
} }
} }