package com.r11.tools.mappers;

import com.r11.tools.model.RequestHistory;
import com.r11.tools.model.RequestHistoryDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
* Map between DTO and Entity
*
*  @author Mikołaj Widła
*
 */

@Mapper
public interface RequestHistoryMapper {

    @Mapping(target = "clientUUID", expression = "java(requestHistoryDTO.getClientUUID().toString())")
    RequestHistory requestHistoryDTOToRequestHistory(RequestHistoryDTO requestHistoryDTO);
    @Mapping(target = "clientUUID", expression = "java(java.util.UUID.fromString(requestHistory.getClientUUID()))")
    RequestHistoryDTO requestHistoryToRequestHistoryDTO(RequestHistory requestHistory);

}
