AccountQueryMapperImpl.java
package com.github.jenkaby.bikerental.finance.web.query.mapper;
import com.github.jenkaby.bikerental.finance.application.usecase.GetCustomerAccountBalancesUseCase;
import com.github.jenkaby.bikerental.finance.web.query.dto.CustomerAccountBalancesResponse;
import java.math.BigDecimal;
import java.time.Instant;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
comments = "version: 1.6.3, compiler: IncrementalProcessingEnvironment from gradle-language-java-9.4.1.jar, environment: Java 21.0.10 (Amazon.com Inc.)"
)
@Component
public class AccountQueryMapperImpl implements AccountQueryMapper {
@Override
public CustomerAccountBalancesResponse toResponse(GetCustomerAccountBalancesUseCase.CustomerAccountBalances domain) {
if ( domain == null ) {
return null;
}
BigDecimal walletBalance = null;
BigDecimal holdBalance = null;
Instant lastUpdatedAt = null;
walletBalance = domain.walletBalance();
holdBalance = domain.holdBalance();
lastUpdatedAt = domain.lastUpdatedAt();
CustomerAccountBalancesResponse customerAccountBalancesResponse = new CustomerAccountBalancesResponse( walletBalance, holdBalance, lastUpdatedAt );
return customerAccountBalancesResponse;
}
}