academia/src/backend/Domain/Ports/Repositories/IEnrollmentRepository.cs

17 lines
863 B
C#
Raw Normal View History

namespace Domain.Ports.Repositories;
using Domain.Entities;
public interface IEnrollmentRepository
{
Task<Enrollment?> GetByIdAsync(int id, CancellationToken ct = default);
Task<Enrollment?> GetByStudentAndSubjectAsync(int studentId, int subjectId, CancellationToken ct = default);
Task<IReadOnlyList<Enrollment>> GetByStudentIdAsync(int studentId, CancellationToken ct = default);
Task<IReadOnlyList<Enrollment>> GetBySubjectIdAsync(int subjectId, CancellationToken ct = default);
Task<IReadOnlyList<Student>> GetClassmatesAsync(int studentId, int subjectId, CancellationToken ct = default);
Task<IReadOnlyDictionary<int, IReadOnlyList<Student>>> GetClassmatesBatchAsync(
int studentId, IEnumerable<int> subjectIds, CancellationToken ct = default);
void Add(Enrollment enrollment);
void Delete(Enrollment enrollment);
}