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 PaymentView entity implementation here
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PaymentView", namespace=com.enactor.training.PackageInfo.NSURI_TRAINING, propOrder = {
	"cashierRequestId",
	"extendInfo",
	"paidTime",
	"payOptionInfos",
	"payRequestExtendInfo"
})

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

	/** My logger instance */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(PaymentView.class);
	
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	/** Entity name. */
	public static final String ENTITY_NAME = "paymentView";
	
	/** 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.PaymentView";
	
	/** Entity application data type */
	public static final IApplicationProcessDataType ENTITY_DATA_TYPE = new ApplicationProcessDataType(ENTITY_DATA_TYPE_NAME, IPaymentView.class.getName());	
		
	/** The CashierRequestId field */
	private String cashierRequestId = null;
	
	/** The ExtendInfo field */
	private String extendInfo = null;
	
	/** The PaidTime field */
	private Date paidTime = null;
	
	/** The PayOptionInfos field */
	@XmlElement(name = "payOptionInfos")
    @XmlJavaTypeAdapter(value = WrappedArrayListAdapter.class)
	private List<PayOptionInfo> payOptionInfos = new ArrayList<PayOptionInfo>();
	
	/** The PayRequestExtendInfo field */
	private String payRequestExtendInfo = null;

	/**************************************************************************
	 * PaymentView Interface
	 **************************************************************************/
	
	@Override
	public void setCashierRequestId(String cashierRequestId) throws PropertyValidationException {
		this.cashierRequestId = cashierRequestId;
	}
	
	@Override
	public String getCashierRequestId() {
		return (cashierRequestId == null) ? "" : cashierRequestId;
	}
	
	@Override
	public void setExtendInfo(String extendInfo) throws PropertyValidationException {
		this.extendInfo = extendInfo;
	}
	
	@Override
	public String getExtendInfo() {
		return (extendInfo == null) ? "" : extendInfo;
	}
	
	@Override
	public void setPaidTime(Date paidTime) throws PropertyValidationException {
		this.paidTime = paidTime;
	}
	
	@Override
	public Date getPaidTime() {
		return paidTime;
	}
	
	@Override
	public void setPayOptionInfos(List<PayOptionInfo> payOptionInfos) throws PropertyValidationException {
		this.payOptionInfos = payOptionInfos;
	}
	
	@Override
	public List<PayOptionInfo> getPayOptionInfos() {
		return payOptionInfos;
	}
	
	@Override
	public void setPayRequestExtendInfo(String payRequestExtendInfo) throws PropertyValidationException {
		this.payRequestExtendInfo = payRequestExtendInfo;
	}
	
	@Override
	public String getPayRequestExtendInfo() {
		return (payRequestExtendInfo == null) ? "" : payRequestExtendInfo;
	}
	
	@Override
	public QName getEntityQName() {
		return ENTITY_QNAME;
	}

}
