Refactor event assignment structure and introduce new models for assignment parameters and requirements
This commit removes the obsolete EventAssignment class from Core.Entities and introduces new models in Core.Models, including AssignmentParameters, AssignmentRequirement, PartialTeam, and StudentEventStatistics. The changes enhance the organization of assignment-related data and improve the overall structure of the codebase. Additionally, several files have been updated to include references to the new Core.Models namespace, ensuring consistency across the application.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Google.OrTools.Sat;
|
||||
|
||||
namespace Core.Calculation
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Core.Entities;
|
||||
|
||||
public class EventAssignment(EventDefinition eventDefinition, Student student)
|
||||
{
|
||||
public EventDefinition EventDefinition { get; } = eventDefinition;
|
||||
public Student Student { get; } = student;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Core.Models;
|
||||
|
||||
namespace Core.Entities;
|
||||
public class Team
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Core.Entities
|
||||
using Core.Entities;
|
||||
|
||||
namespace Core.Models
|
||||
{
|
||||
public class AssignmentParameters(
|
||||
int effortLowerBound = 6,
|
||||
@@ -28,4 +30,5 @@
|
||||
$"Effort Range: [{EffortLowerBound}-{EffortUpperBound}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
namespace Core.Entities;
|
||||
using Core.Entities;
|
||||
|
||||
namespace Core.Models;
|
||||
|
||||
public class AssignmentRequirement(EventDefinition eventDefinition, Student student, Requirement requirement)
|
||||
{
|
||||
public EventDefinition EventDefinition { get; } = eventDefinition;
|
||||
public Student Student { get; } = student;
|
||||
public Requirement Requirement { get; } = requirement;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Core.Entities;
|
||||
using Core.Entities;
|
||||
|
||||
namespace Core.Models;
|
||||
|
||||
public class PartialTeam : Team
|
||||
{
|
||||
@@ -10,4 +12,5 @@ public class PartialTeam : Team
|
||||
var omittedStudents = OmittedStudents.Union(Students.Where(studentsToOmit.Contains)).Distinct().ToList();
|
||||
return new PartialTeam{Identifier = Identifier, Event = Event, Students = remainingStudents, OmittedStudents = omittedStudents };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace Core.Entities;
|
||||
using Core.Entities;
|
||||
|
||||
namespace Core.Models;
|
||||
|
||||
public class StudentEventStatistics
|
||||
{
|
||||
@@ -29,4 +31,5 @@ public class StudentEventStatistics
|
||||
|
||||
return statistics.Values.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
|
||||
namespace Core.Parsers;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
|
||||
namespace Core.Validation.Rules.BaseRules;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
|
||||
namespace Core.Validation.Rules.BaseRules;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation.Rules.BaseRules;
|
||||
|
||||
namespace Core.Validation.Rules.StudentAssignmentRules;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation.Rules.BaseRules;
|
||||
|
||||
namespace Core.Validation.Rules.StudentAssignmentRules;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation.Rules.BaseRules;
|
||||
|
||||
namespace Core.Validation.Rules.StudentAssignmentRules;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation.Rules.BaseRules;
|
||||
|
||||
namespace Core.Validation.Rules.StudentAssignmentRules;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation.Rules.BaseRules;
|
||||
|
||||
namespace Core.Validation.Rules.StudentAssignmentRules;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Core.Validation;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Core.Validation;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
|
||||
namespace Tests.Builders;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Core.Calculation;
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Tests.Builders;
|
||||
using Tests.Fixtures;
|
||||
using EventAssignment = Core.Calculation.EventAssignment;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Parsers;
|
||||
using Core.Utility;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation;
|
||||
using Core.Validation.Rules.StudentAssignmentRules;
|
||||
using Tests.Builders;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation;
|
||||
using System.Text.Json;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core.Entities;
|
||||
using Core.Models;
|
||||
using Core.Validation;
|
||||
using Tests.Builders;
|
||||
|
||||
|
||||
@@ -25,5 +25,6 @@
|
||||
@using WebApp.Components.Features.Calendar
|
||||
@using MudBlazor
|
||||
@using Core.Entities
|
||||
@using Core.Models
|
||||
@using Data
|
||||
@using VisNetwork.Blazor
|
||||
|
||||
Reference in New Issue
Block a user