Resolve InternshipType List in Edition problem
This commit is contained in:
parent
296075a3b4
commit
655b084c96
@ -38,7 +38,7 @@ namespace InternshipSystem.Api.Controllers
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Get companies matching provided paginated query
|
||||
/// Get company branches matching provided paginated query
|
||||
/// </summary>
|
||||
/// <param name="searchQuery">Paginated query description</param>
|
||||
/// <param name="companyId"></param>
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||
|
||||
@ -14,7 +15,7 @@ namespace InternshipSystem.Core
|
||||
public Course Course { get; set; }
|
||||
public List<Internship> Internships { get; set; }
|
||||
public List<EditionSubject> AvailableSubjects { get; set; }
|
||||
public List<InternshipType> AvailableInternshipTypes { get; set; }
|
||||
public List<EditionInternshipType> AvailableInternshipTypes { get; set; }
|
||||
|
||||
public bool IsOpen => EditionFinish < DateTime.Today;
|
||||
|
||||
@ -30,7 +31,7 @@ namespace InternshipSystem.Core
|
||||
|
||||
public bool IsInternshipTypeAllowed(InternshipType registrationQueryType)
|
||||
{
|
||||
return AvailableInternshipTypes.Contains(registrationQueryType);
|
||||
return AvailableInternshipTypes.Select(it => it.InternshipType).Contains(registrationQueryType);
|
||||
}
|
||||
|
||||
public void RegisterInternship(Student student)
|
||||
|
@ -2,13 +2,13 @@
|
||||
{
|
||||
public enum InternshipType
|
||||
{
|
||||
FreeInternship,
|
||||
GraduateInternship,
|
||||
FreeApprenticeship,
|
||||
PaidApprenticeship,
|
||||
ForeignInternship,
|
||||
UOP,
|
||||
UD,
|
||||
UZ
|
||||
FreeInternship = 0,
|
||||
GraduateInternship = 1,
|
||||
FreeApprenticeship = 2,
|
||||
PaidApprenticeship = 3,
|
||||
ForeignInternship = 4,
|
||||
UOP = 5,
|
||||
UD = 6,
|
||||
UZ = 7,
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
|
||||
namespace InternshipSystem.Core.UglyOrmArtifacts
|
||||
{
|
||||
public class EditionInternshipType
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public InternshipType InternshipType { get; set; }
|
||||
}
|
||||
}
|
@ -139,12 +139,12 @@ namespace InternshipSystem.Repository
|
||||
{
|
||||
Name = "Informatyka",
|
||||
},
|
||||
AvailableInternshipTypes = new List<InternshipType>
|
||||
AvailableInternshipTypes = new List<EditionInternshipType>
|
||||
{
|
||||
InternshipType.UOP,
|
||||
InternshipType.UZ,
|
||||
InternshipType.UD,
|
||||
InternshipType.FreeInternship
|
||||
new EditionInternshipType() { InternshipType = InternshipType.UOP },
|
||||
new EditionInternshipType() { InternshipType = InternshipType.UZ },
|
||||
new EditionInternshipType() { InternshipType = InternshipType.UD },
|
||||
new EditionInternshipType() { InternshipType = InternshipType.FreeInternship },
|
||||
},
|
||||
Internships = new List<Internship>(),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user