diff --git a/src/Booking/Booking.Application/Appointments/Common/Extensions/MappingExtensions.cs b/src/Booking/Booking.Application/Appointments/Common/Extensions/MappingExtensions.cs index cead1e7..f0d1157 100644 --- a/src/Booking/Booking.Application/Appointments/Common/Extensions/MappingExtensions.cs +++ b/src/Booking/Booking.Application/Appointments/Common/Extensions/MappingExtensions.cs @@ -5,7 +5,8 @@ namespace Booking.Application.Appointments.Common.Extensions { public static class MappingExtensions { - public static List ToAttachmentDtos(this IEnumerable attachments) + public static List ToAttachmentDtos( + this IEnumerable attachments) { if (attachments == null) return []; diff --git a/src/Booking/Booking.Application/Appointments/Dtos/AppointmentBaseDto.cs b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentBaseDto.cs new file mode 100644 index 0000000..73aa44f --- /dev/null +++ b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentBaseDto.cs @@ -0,0 +1,22 @@ +namespace Booking.Application.Appointments.Dtos +{ + public record AppointmentBaseDto + { + public Guid Id { get; init; } + public Guid DoctorId { get; init; } + public Guid PatientId { get; init; } + + public string PatientName { get; set; } = string.Empty; + public string DoctorName { get; init; } = string.Empty; + public string Specialty { get; init; } = string.Empty; + + public string? DoctorPhotoUrl { get; init; } + public string? DoctorPhoneNumber { get; init; } + public decimal Price { get; init; } + + public string Status { get; init; } = string.Empty; + public string? MedicalNotes { get; init; } = string.Empty; + public DateTime StartTime { get; init; } + public DateTime EndTime { get; init; } + } +} diff --git a/src/Booking/Booking.Application/Appointments/Dtos/AppointmentDetailDto.cs b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentDetailDto.cs index 5f3041e..f119b0e 100644 --- a/src/Booking/Booking.Application/Appointments/Dtos/AppointmentDetailDto.cs +++ b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentDetailDto.cs @@ -1,24 +1,9 @@  namespace Booking.Application.Appointments.Dtos { - public record AppointmentDetailDto + public record AppointmentDetailDto : AppointmentBaseDto { - public Guid Id { get; init; } - public Guid DoctorId { get; init; } - public Guid PatientId { get; init; } - - public string PatientName { get; set; } = string.Empty; - public string DoctorName { get; init; } = string.Empty; - public string Specialty { get; init; } = string.Empty; - - public string? DoctorPhotoUrl { get; init; } - public string? DoctorPhoneNumber { get; init; } - public decimal Price { get; init; } - - public string Status { get; init; } = string.Empty; - public string? MedicalNotes { get; init; } = string.Empty; public List Attachments { get; init; } = []; - public DateTime StartTime { get; init; } - public DateTime EndTime { get; init; } + } } diff --git a/src/Booking/Booking.Application/Appointments/Dtos/AppointmentListDto.cs b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentListDto.cs index f2465ce..552632b 100644 --- a/src/Booking/Booking.Application/Appointments/Dtos/AppointmentListDto.cs +++ b/src/Booking/Booking.Application/Appointments/Dtos/AppointmentListDto.cs @@ -1,22 +1,4 @@ namespace Booking.Application.Appointments.Dtos { - public class AppointmentListDto - { - public Guid Id { get; init; } - public Guid DoctorId { get; init; } - public Guid PatientId { get; init; } - - public string PatientName { get; set; } = string.Empty; - public string DoctorName { get; init; } = string.Empty; - public string Specialty { get; init; } = string.Empty; - - public string? DoctorPhotoUrl { get; init; } - public string? DoctorPhoneNumber { get; init; } - public decimal Price { get; init; } - - public string Status { get; init; } = string.Empty; - public string? MedicalNotes { get; init; } = string.Empty; - public DateTime StartTime { get; init; } - public DateTime EndTime { get; init; } - } + public record AppointmentListDto : AppointmentBaseDto; }