diff --git a/src/main/java/org/folio/domain/mapper/EcsTlrMapper.java b/src/main/java/org/folio/domain/mapper/EcsTlrMapper.java index ce394bc6..f4d97f9d 100644 --- a/src/main/java/org/folio/domain/mapper/EcsTlrMapper.java +++ b/src/main/java/org/folio/domain/mapper/EcsTlrMapper.java @@ -14,6 +14,10 @@ public interface EcsTlrMapper { @Mapping(target = "requestLevel", qualifiedByName = "StringToRequestLevel") @Mapping(target = "fulfillmentPreference", qualifiedByName = "StringToFulfillmentPreference") EcsTlr mapEntityToDto(EcsTlrEntity ecsTlrEntity); + + @Mapping(target = "requestType", qualifiedByName = "RequestTypeToString") + @Mapping(target = "requestLevel", qualifiedByName = "RequestLevelToString") + @Mapping(target = "fulfillmentPreference", qualifiedByName = "FulfillmentPreferenceToString") EcsTlrEntity mapDtoToEntity(EcsTlr ecsTlr); @Named("StringToRequestType") @@ -30,4 +34,19 @@ default EcsTlr.RequestLevelEnum mapRequestLevel(String requestLevel) { default EcsTlr.FulfillmentPreferenceEnum mapFulfillmentPreference(String fulfillmentPreference) { return fulfillmentPreference != null ? EcsTlr.FulfillmentPreferenceEnum.fromValue(fulfillmentPreference) : null; } + + @Named("RequestTypeToString") + default String mapRequestTypeToString(EcsTlr.RequestTypeEnum requestTypeEnum) { + return requestTypeEnum != null ? requestTypeEnum.getValue() : null; + } + + @Named("RequestLevelToString") + default String mapRequestLevelToString(EcsTlr.RequestLevelEnum requestLevelEnum) { + return requestLevelEnum != null ? requestLevelEnum.getValue() : null; + } + + @Named("FulfillmentPreferenceToString") + default String mapFulfillmentPreferenceToString(EcsTlr.FulfillmentPreferenceEnum fulfillmentPreferenceEnum) { + return fulfillmentPreferenceEnum != null ? fulfillmentPreferenceEnum.getValue() : null; + } }