feat: add seating plans for learning groups
This commit is contained in:
@@ -60,6 +60,20 @@ public class FakeMemberships(List<GroupMembership> all) : IGroupMembershipReposi
|
||||
public void Delete(Guid id) => all.RemoveAll(m => m.Id == id);
|
||||
}
|
||||
|
||||
public class FakeSeatingPlans(List<SeatingPlan>? initial = null) : ISeatingPlanRepository
|
||||
{
|
||||
private readonly List<SeatingPlan> _all = initial ?? [];
|
||||
public SeatingPlan? GetById(Guid id) => _all.FirstOrDefault(p => p.Id == id);
|
||||
public List<SeatingPlan> GetByGroup(Guid groupId) =>
|
||||
_all.Where(p => p.GroupId == groupId).OrderBy(p => p.Name).ToList();
|
||||
public void Save(SeatingPlan plan)
|
||||
{
|
||||
_all.RemoveAll(p => p.Id == plan.Id);
|
||||
_all.Add(plan);
|
||||
}
|
||||
public void Delete(Guid id) => _all.RemoveAll(p => p.Id == id);
|
||||
}
|
||||
|
||||
public class FakeSessions(List<ParticipationSession> all) : IParticipationSessionRepository
|
||||
{
|
||||
public List<ParticipationSession> GetByGroup(Guid groupId) => all.Where(s => s.GroupId == groupId).ToList();
|
||||
|
||||
Reference in New Issue
Block a user