diff --git a/src/backend/src/Randall.Domain/Reservations/Reservation.cs b/src/backend/src/Randall.Domain/Reservations/Reservation.cs index 7f4b322..16ec33f 100644 --- a/src/backend/src/Randall.Domain/Reservations/Reservation.cs +++ b/src/backend/src/Randall.Domain/Reservations/Reservation.cs @@ -13,12 +13,7 @@ public class Reservation : Entity public ReservationStatus Status { get; private set; } public DateTime CreatedAt { get; private set; } - public static Reservation Reconstitute( - Guid id, Guid workplaceId, string employeeEmail, string employeeName, - DateOnly date, ReservationStatus status, DateTime createdAt) => - new(id, workplaceId, employeeEmail, employeeName, date, status, createdAt); - - private Reservation( + internal Reservation( Guid id, Guid workplaceId, string employeeEmail, string employeeName, DateOnly date, ReservationStatus status, DateTime createdAt) : base(id) { diff --git a/src/backend/src/Randall.Domain/Reservations/ReservationFactory.cs b/src/backend/src/Randall.Domain/Reservations/ReservationFactory.cs new file mode 100644 index 0000000..887e45f --- /dev/null +++ b/src/backend/src/Randall.Domain/Reservations/ReservationFactory.cs @@ -0,0 +1,9 @@ +namespace Randall.Domain.Reservations; + +public static class ReservationFactory +{ + public static Reservation Reconstitute( + Guid id, Guid workplaceId, string employeeEmail, string employeeName, + DateOnly date, ReservationStatus status, DateTime createdAt) => + new(id, workplaceId, employeeEmail, employeeName, date, status, createdAt); +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/Mappers/ReservationMapper.cs b/src/backend/src/Randall.Infrastructure/Persistence/Mappers/ReservationMapper.cs index 621ce91..29026a9 100644 --- a/src/backend/src/Randall.Infrastructure/Persistence/Mappers/ReservationMapper.cs +++ b/src/backend/src/Randall.Infrastructure/Persistence/Mappers/ReservationMapper.cs @@ -6,7 +6,7 @@ namespace Randall.Infrastructure.Persistence.Mappers; public static class ReservationMapper { public static Reservation ToDomain(ReservationRecord record) => - Reservation.Reconstitute( + ReservationFactory.Reconstitute( record.Id, record.WorkplaceId, record.EmployeeEmail,