-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBedReservationResponseDtoMapper.java
More file actions
32 lines (28 loc) · 1.23 KB
/
BedReservationResponseDtoMapper.java
File metadata and controls
32 lines (28 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.swyth.emergencyservice.dto;
import com.swyth.emergencyservice.entity.BedReservation;
/**
* This class provides mapping functionality to convert a {@code BedReservation} entity
* into a {@code BedReservationResponseDTO}.
*
* The purpose of the {@code BedReservationResponseDtoMapper} is to extract
* relevant fields from the {@code BedReservation} entity and package them
* into a data transfer object ({@code BedReservationResponseDTO})
* for use in external layers such as APIs or client responses.
*
* The mapper ensures consistency and reduces the complexity of
* transforming domain objects into DTOs by providing a dedicated method
* for the transformation process.
*/
public class BedReservationResponseDtoMapper {
public static BedReservationResponseDTO convertToDTO(BedReservation reservation) {
return new BedReservationResponseDTO(
reservation.getId(),
reservation.getHospitalId(),
reservation.getMedicalSpecializationId(),
reservation.getReservationFirstName(),
reservation.getReservationLastName(),
reservation.getReservationEmail(),
reservation.getReservationPhoneNumber()
);
}
}