feat: подтянул занятость из Modeus
Backend CI / build-and-test (push) Successful in 53s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 7s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 6m26s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 14s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
Backend CI / build-and-test (push) Successful in 53s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 7s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 6m26s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 14s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
This commit is contained in:
@@ -29,11 +29,14 @@ public class ModeusEvent
|
||||
public string? TypeId { get; init; }
|
||||
public DateTime StartsAt { get; init; }
|
||||
public DateTime EndsAt { get; init; }
|
||||
public ModeusIctisStats? IctisStats { get; init; }
|
||||
|
||||
[JsonPropertyName("_links")]
|
||||
public ModeusEventLinks? Links { get; init; }
|
||||
}
|
||||
|
||||
public record ModeusIctisStats(int? StudentCount, int? TeacherCount);
|
||||
|
||||
public class ModeusEventLinks
|
||||
{
|
||||
[JsonPropertyName("course-unit-realization")]
|
||||
|
||||
@@ -13,6 +13,9 @@ namespace UniVerse.Application.Mappings;
|
||||
|
||||
public static class MappingExtensions
|
||||
{
|
||||
private static int OccupiedSeatsCount(this Lecture lecture) =>
|
||||
Math.Max(0, lecture.MandatoryAttendeesCount) + lecture.Enrollments.Count;
|
||||
|
||||
// --- User ---
|
||||
public static UserDto ToDto(this User user, int level) => new(
|
||||
user.Id, user.Email, user.DisplayName, user.AvatarUrl,
|
||||
@@ -57,7 +60,7 @@ public static class MappingExtensions
|
||||
lecture.LocationId, lecture.Location?.Name,
|
||||
lecture.Title, lecture.Description, lecture.Format,
|
||||
lecture.StartsAt, lecture.EndsAt, lecture.IsOpen,
|
||||
lecture.MaxEnrollments, lecture.Enrollments.Count,
|
||||
lecture.MaxEnrollments, lecture.OccupiedSeatsCount(),
|
||||
lecture.OnlineUrl, lecture.CreatedAt, isEnrolled
|
||||
);
|
||||
|
||||
@@ -67,7 +70,7 @@ public static class MappingExtensions
|
||||
lecture.LocationId, lecture.Location?.Name,
|
||||
lecture.Title, lecture.Description, lecture.Format,
|
||||
lecture.StartsAt, lecture.EndsAt, lecture.IsOpen,
|
||||
lecture.MaxEnrollments, lecture.Enrollments.Count,
|
||||
lecture.MaxEnrollments, lecture.OccupiedSeatsCount(),
|
||||
lecture.OnlineUrl, lecture.CreatedAt, isEnrolled
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user