PaymentRestMapperImpl.java
package com.dmasone.identity.payment.interfaces.rest;
import com.dmasone.identity.payment.application.PaymentResult;
import com.dmasone.identity.payment.domain.PaymentStatus;
import java.time.Instant;
import java.util.UUID;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor"
)
@Component
public class PaymentRestMapperImpl implements PaymentRestMapper {
@Override
public PaymentDto toDto(PaymentResult paymentResult) {
if ( paymentResult == null ) {
return null;
}
UUID id = null;
UUID orderId = null;
PaymentStatus status = null;
Instant requestedAt = null;
id = paymentResult.id();
orderId = paymentResult.orderId();
status = paymentResult.status();
requestedAt = paymentResult.requestedAt();
PaymentDto paymentDto = new PaymentDto( id, orderId, status, requestedAt );
return paymentDto;
}
}