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 Order entity implementation here
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Order", namespace=com.enactor.training.PackageInfo.NSURI_TRAINING, propOrder = {
	"merchantTransId",
	"orderAmount",
	"orderTitle"
})

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

	/** My logger instance */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(Order.class);
	
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	/** Entity name. */
	public static final String ENTITY_NAME = "order";
	
	/** 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.Order";
	
	/** Entity application data type */
	public static final IApplicationProcessDataType ENTITY_DATA_TYPE = new ApplicationProcessDataType(ENTITY_DATA_TYPE_NAME, IOrder.class.getName());	
		
	/** The MerchantTransId field */
	private String merchantTransId = null;
	
	/** The OrderAmount field */
	@XmlElement(type=com.enactor.training.paymentService.service.messages.gcash.CurrencyAmount .class)
	private com.enactor.training.paymentService.service.messages.gcash.CurrencyAmount orderAmount = new com.enactor.training.paymentService.service.messages.gcash.CurrencyAmount();
	
	/** The OrderTitle field */
	private String orderTitle = null;

	/**************************************************************************
	 * Order Interface
	 **************************************************************************/
	
	@Override
	public void setMerchantTransId(String merchantTransId) throws PropertyValidationException {
		this.merchantTransId = merchantTransId;
	}
	
	@Override
	public String getMerchantTransId() {
		return (merchantTransId == null) ? "" : merchantTransId;
	}
	
	@Override
	public void setOrderAmount(com.enactor.training.paymentService.service.messages.gcash.CurrencyAmount orderAmount) throws PropertyValidationException {
		this.orderAmount = orderAmount;
	}
	
	@Override
	public com.enactor.training.paymentService.service.messages.gcash.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 QName getEntityQName() {
		return ENTITY_QNAME;
	}

}
