source: backend/src/main/java/com/finki/icare/mapper/ConsultationMapper.java

main
Last change on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package com.finki.icare.mapper;
2
3import com.finki.icare.dto.ConsultationDTO;
4import com.finki.icare.model.Consultation;
5import org.mapstruct.Mapper;
6import org.mapstruct.Mapping;
7import org.mapstruct.MappingConstants;
8
9@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, uses = {TherapyMapper.class})
10public interface ConsultationMapper {
11
12 @Mapping(target = "idConsultation", source = "idConsultation")
13 @Mapping(target = "patientId", source = "patient.idUser")
14 @Mapping(target = "patientName", expression = "java(consultation.getPatient().getName() + \" \" + consultation.getPatient().getSurname())")
15 @Mapping(target = "therapistId", source = "therapist.idUser")
16 @Mapping(target = "therapistName", expression = "java(consultation.getTherapist().getName() + \" \" + consultation.getTherapist().getSurname())")
17 @Mapping(target = "date", source = "date")
18 @Mapping(target = "dateOfPayment", source = "dateOfPayment")
19 @Mapping(target = "price", source = "price")
20 @Mapping(target = "advice", source = "advice")
21 @Mapping(target = "therapies", source = "therapies")
22 ConsultationDTO toDTO(Consultation consultation);
23}
Note: See TracBrowser for help on using the repository browser.