package bank.acquirer.dto;

import java.math.BigDecimal;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import bank.acquirer.domain.AcquirerInfo;
import bank.acquirer.domain.CardInfo;

public final class TransactionRequestDTO {
	
	public static final int MIN_TRANSACTION_AMOUNT = 100;
	
	@NotNull
	@Valid
	private CardInfo cardInfo;
	
	@NotNull
	@Valid
	private AcquirerInfo acquirerInfo;
	
	@NotNull
	@Min(value = MIN_TRANSACTION_AMOUNT)
	private BigDecimal transactionAmount;

	public TransactionRequestDTO() {

	}

	public TransactionRequestDTO(CardInfo cardInfo, AcquirerInfo acquirerInfo,
			BigDecimal transactionAmount) {
		super();
		this.cardInfo = cardInfo;
		this.acquirerInfo = acquirerInfo;
		this.transactionAmount = transactionAmount;
	}

	public CardInfo getCardInfo() {
		return cardInfo;
	}

	public void setCardInfo(CardInfo cardInfo) {
		this.cardInfo = cardInfo;
	}

	public AcquirerInfo getAcquirerInfo() {
		return acquirerInfo;
	}

	public void setAcquirerInfo(AcquirerInfo acquirerInfo) {
		this.acquirerInfo = acquirerInfo;
	}

	public BigDecimal getTransactionAmount() {
		return transactionAmount;
	}

	public void setTransactionAmount(BigDecimal transactionAmount) {
		this.transactionAmount = transactionAmount;
	}

	@Override
	public String toString() {
		return "TransactionRequest [cardInfo=" + cardInfo + ", acquirerInfo="
				+ acquirerInfo + ", transactionAmount=" + transactionAmount
				+ "]";
	}

}

@@ -86,49 +86,8 @@
 id;%0A
-import javax.validation.constraints.Min;%0A
 impo
@@ -127,16 +127,16 @@
 otNull;%0A
+
 %0Aimport 
@@ -258,65 +258,8 @@
 %7B%0A%09%0A
-%09public static final int MIN_TRANSACTION_AMOUNT = 100;%0A%09%0A
 %09@No
@@ -350,32 +350,32 @@
 acquirerInfo;%0A%09%0A
+
 %09@NotNull%0A%09@Min(
@@ -372,46 +372,8 @@
 ull%0A
-%09@Min(value = MIN_TRANSACTION_AMOUNT)%0A
 %09pri

Fix transaction validation