namespace Adapters.Driving.Api.Types.Students;

using Domain.Entities;

[ObjectType<Student>]
public static partial class StudentType
{
    public static string GetEmail([Parent] Student student) => student.Email.Value;

    [GraphQLDescription("Total credits enrolled")]
    public static int GetTotalCredits([Parent] Student student) => student.TotalCredits;

    [GraphQLDescription("List of enrollments")]
    public static IEnumerable<Enrollment> GetEnrollments([Parent] Student student) =>
        student.Enrollments;
}
