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

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

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.bind.annotation.adapters.XmlJavaTypeAdapter;
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.jaxb.WrappedArrayListAdapter;
import com.enactor.core.utilities.Logger;	

/**
 * Add comments for the MessageBody entity implementation here
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MessageBody", namespace=com.enactor.training.PackageInfo.NSURI_TRAINING, propOrder = {
	"acquirementId",
	"amountDetail",
	"authCode",
	"authCodeType",
	"buyer",
	"createTime",
	"envInfo",
	"merchantId",
	"merchantTransId",
	"productCode",
	"order",
	"orderAmount",
	"orderTitle",
	"paidTime",
	"paymentViews",
	"resultInfo",
	"seller",
	"statusDetail",
	"timeDetail",
	"transactionid",
	"scannerInfo",
	"shopInfo"
})

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

	/** My logger instance */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(MessageBody.class);
	
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	/** Entity name. */
	public static final String ENTITY_NAME = "messageBody";
	
	/** 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.MessageBody";
	
	/** Entity application data type */
	public static final IApplicationProcessDataType ENTITY_DATA_TYPE = new ApplicationProcessDataType(ENTITY_DATA_TYPE_NAME, IMessageBody.class.getName());	
		
	/** The AcquirementId field */
	private String acquirementId = null;
	
	/** The AmountDetail field */
	private AmountDetail amountDetail = new AmountDetail();
	
	/** The AuthCode field */
	private String authCode = null;
	
	/** The AuthCodeType field */
	private String authCodeType = null;
	
	/** The Buyer field */
	@XmlElement(type=com.enactor.training.paymentService.service.messages.gcash.User.class)
	private com.enactor.training.paymentService.service.messages.gcash.User buyer = new com.enactor.training.paymentService.service.messages.gcash.User();
	
	/** The CreateTime field */
	private Date createTime = null;
	
	/** The EnvInfo field */
	@XmlElement(type = EnvInfo.class)
	private EnvInfo envInfo = new EnvInfo();
	
	/** The MerchantId field */
	private String merchantId = null;
	
	/** The MerchantTransId field */
	private String merchantTransId = null;
	
	/** The ProductCode field */
	private String productCode = null;
	
	/** The Order field */
	@XmlElement(type = com.enactor.training.paymentService.service.messages.gcash.Order.class)
	private com.enactor.training.paymentService.service.messages.gcash.Order order = new com.enactor.training.paymentService.service.messages.gcash.Order();
	
	/** The OrderAmount field */
	@XmlElement(type = CurrencyAmount.class)
	private CurrencyAmount orderAmount = new CurrencyAmount();
	
	/** The OrderTitle field */
	private String orderTitle = null;
	
	/** The PaidTime field */
	private Date paidTime = null;
	
	/** The PaymentViews field */
	@XmlElement(name = "paymentViews")
    @XmlJavaTypeAdapter(value = WrappedArrayListAdapter.class)
	private List<PaymentView> paymentViews = new ArrayList<PaymentView>();
	
	/** The ResultInfo field */
	@XmlElement(type = ResultInfo.class)
	private ResultInfo resultInfo = new ResultInfo();
	
	/** The Seller field */
	private User seller = new User();
	
	/** The StatusDetail field */
	@XmlElement(type = StatusDetail.class)
	private StatusDetail statusDetail = new StatusDetail();
	
	/** The TimeDetail field */
	@XmlElement(type = TimeDetail.class)
	private TimeDetail timeDetail = new TimeDetail();
	
	/** The Transactionid field */
	private String transactionid = null;
	
	/** The ScannerInfo field */
	@XmlElement(type = ScannerInfo.class)
	private ScannerInfo scannerInfo = new ScannerInfo();
	
	/** The ShopInfo field */
	@XmlElement(type = ShopInfo.class)
	private ShopInfo shopInfo = new ShopInfo();

	/**************************************************************************
	 * MessageBody Interface
	 **************************************************************************/
	
	@Override
	public void setAcquirementId(String acquirementId) throws PropertyValidationException {
		this.acquirementId = acquirementId;
	}
	
	@Override
	public String getAcquirementId() {
		return (acquirementId == null) ? "" : acquirementId;
	}
	
	@Override
	public void setAmountDetail(AmountDetail amountDetail) throws PropertyValidationException {
		this.amountDetail = amountDetail;
	}
	
	@Override
	public AmountDetail getAmountDetail() {
		return amountDetail;
	}
	
	@Override
	public void setAuthCode(String authCode) throws PropertyValidationException {
		this.authCode = authCode;
	}
	
	@Override
	public String getAuthCode() {
		return (authCode == null) ? "" : authCode;
	}
	
	@Override
	public void setAuthCodeType(String authCodeType) throws PropertyValidationException {
		this.authCodeType = authCodeType;
	}
	
	@Override
	public String getAuthCodeType() {
		return (authCodeType == null) ? "" : authCodeType;
	}
	
	@Override
	public void setBuyer(User buyer) throws PropertyValidationException {
		this.buyer = buyer;
	}
	
	@Override
	public User getBuyer() {
		return buyer;
	}
	
	@Override
	public void setCreateTime(Date createTime) throws PropertyValidationException {
		this.createTime = createTime;
	}
	
	@Override
	public Date getCreateTime() {
		return createTime;
	}
	
	@Override
	public void setEnvInfo(EnvInfo envInfo) throws PropertyValidationException {
		this.envInfo = envInfo;
	}
	
	@Override
	public EnvInfo getEnvInfo() {
		return envInfo;
	}
	
	@Override
	public void setMerchantId(String merchantId) throws PropertyValidationException {
		this.merchantId = merchantId;
	}
	
	@Override
	public String getMerchantId() {
		return (merchantId == null) ? "" : merchantId;
	}
	
	@Override
	public void setMerchantTransId(String merchantTransId) throws PropertyValidationException {
		this.merchantTransId = merchantTransId;
	}
	
	@Override
	public String getMerchantTransId() {
		return (merchantTransId == null) ? "" : merchantTransId;
	}
	
	@Override
	public String getProductCode() {
		return productCode;
	}

	@Override
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	
	@Override
	public void setOrder(Order order) throws PropertyValidationException {
		this.order = order;
	}
	
	@Override
	public Order getOrder() {
		return order;
	}
	
	@Override
	public void setOrderAmount(CurrencyAmount orderAmount) throws PropertyValidationException {
		this.orderAmount = orderAmount;
	}
	
	@Override
	public CurrencyAmount getOrderAmount() {
		return orderAmount;
	}
	
	@Override
	public void setOrderTitle(String orderTitle) throws PropertyValidationException {
		this.orderTitle = orderTitle;
	}
	
	@Override
	public String getOrderTitle() {
		return (orderTitle == null) ? "" : orderTitle;
	}
	
	@Override
	public void setPaidTime(Date paidTime) throws PropertyValidationException {
		this.paidTime = paidTime;
	}
	
	@Override
	public Date getPaidTime() {
		return paidTime;
	}
	
	@Override
	public void setPaymentViews(List<PaymentView> paymentViews) throws PropertyValidationException {
		this.paymentViews = paymentViews;
	}
	
	@Override
	public List<PaymentView> getPaymentViews() {
		return paymentViews;
	}
	
	@Override
	public void setResultInfo(ResultInfo resultInfo) throws PropertyValidationException {
		this.resultInfo = resultInfo;
	}
	
	@Override
	public ResultInfo getResultInfo() {
		return resultInfo;
	}
	
	@Override
	public void setSeller(User seller) throws PropertyValidationException {
		this.seller = seller;
	}
	
	@Override
	public User getSeller() {
		return seller;
	}
	
	@Override
	public void setStatusDetail(StatusDetail statusDetail) throws PropertyValidationException {
		this.statusDetail = statusDetail;
	}
	
	@Override
	public StatusDetail getStatusDetail() {
		return statusDetail;
	}
	
	@Override
	public void setTimeDetail(TimeDetail timeDetail) throws PropertyValidationException {
		this.timeDetail = timeDetail;
	}
	
	@Override
	public TimeDetail getTimeDetail() {
		return timeDetail;
	}
	
	@Override
	public void setTransactionid(String transactionid) throws PropertyValidationException {
		this.transactionid = transactionid;
	}
	
	@Override
	public String getTransactionid() {
		return (transactionid == null) ? "" : transactionid;
	}
	
	@Override
	public void setScannerInfo(ScannerInfo scannerInfo) throws PropertyValidationException {
		this.scannerInfo = scannerInfo;
	}
	
	@Override
	public ScannerInfo getScannerInfo() {
		return scannerInfo;
	}
	
	@Override
	public void setShopInfo(ShopInfo shopInfo) throws PropertyValidationException {
		this.shopInfo = shopInfo;
	}
	
	@Override
	public ShopInfo getShopInfo() {
		return shopInfo;
	}
	
	@Override
	public QName getEntityQName() {
		return ENTITY_QNAME;
	}

}
