package com.enactor.training.paymentService.service.messages.gcash;


import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

import com.enactor.core.application.process.ApplicationProcessDataType;
import com.enactor.core.application.process.IApplicationProcessDataType;
import com.enactor.core.entities.PropertyValidationException;
import com.enactor.core.utilities.Logger;	

/**
 * Add comments for the PayOptionInfo entity implementation here
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PayOptionInfo", namespace=com.enactor.training.PackageInfo.NSURI_TRAINING, propOrder = {
	"chargeAmount",
	"payAmount",
	"payMethod",
	"transAmount"
})

@XmlRootElement(name = PayOptionInfo.ENTITY_NAME, namespace=com.enactor.training.PackageInfo.NSURI_TRAINING)
public class PayOptionInfo implements IPayOptionInfo {

	/** My logger instance */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(PayOptionInfo.class);
	
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	/** Entity name. */
	public static final String ENTITY_NAME = "payOptionInfo";
	
	/** Entity QName */
	public static final QName ENTITY_QNAME = new QName(com.enactor.training.PackageInfo.NSURI_TRAINING, ENTITY_NAME, com.enactor.training.PackageInfo.PREFIX_TRAINING);

	/** Entity application data type name */
	public static final String ENTITY_DATA_TYPE_NAME = "enactor.gcash.messages.PayOptionInfo";
	
	/** Entity application data type */
	public static final IApplicationProcessDataType ENTITY_DATA_TYPE = new ApplicationProcessDataType(ENTITY_DATA_TYPE_NAME, IPayOptionInfo.class.getName());	
		
	/** The ChargeAmount field */
	@XmlElement(type=CurrencyAmount.class)
	private CurrencyAmount chargeAmount = new CurrencyAmount();
	
	/** The PayAmount field */
	@XmlElement(type=CurrencyAmount.class)
	private CurrencyAmount payAmount = new CurrencyAmount();
	
	/** The PayMethod field */
	private String payMethod = null;
	
	/** The TransAmount field */
	@XmlElement(type=CurrencyAmount.class)
	private CurrencyAmount transAmount = new CurrencyAmount();

	/**************************************************************************
	 * PayOptionInfo Interface
	 **************************************************************************/
	
	@Override
	public void setChargeAmount(CurrencyAmount chargeAmount) throws PropertyValidationException {
		this.chargeAmount = chargeAmount;
	}
	
	@Override
	public CurrencyAmount getChargeAmount() {
		return chargeAmount;
	}
	
	@Override
	public void setPayAmount(CurrencyAmount payAmount) throws PropertyValidationException {
		this.payAmount = payAmount;
	}
	
	@Override
	public CurrencyAmount getPayAmount() {
		return payAmount;
	}
	
	@Override
	public void setPayMethod(String payMethod) throws PropertyValidationException {
		this.payMethod = payMethod;
	}
	
	@Override
	public String getPayMethod() {
		return (payMethod == null) ? "" : payMethod;
	}
	
	@Override
	public void setTransAmount(CurrencyAmount transAmount) throws PropertyValidationException {
		this.transAmount = transAmount;
	}
	
	@Override
	public CurrencyAmount getTransAmount() {
		return transAmount;
	}
	
	@Override
	public QName getEntityQName() {
		return ENTITY_QNAME;
	}

}
