// Path: src/main/java/br/fatea/simplebank/soap/payment/v1/PaymentStatus.java
// @XmlType(name = "paymentStatus")
// @XmlEnum
// public enum PaymentStatus {
// 
//     OPENED,
//     CONFIRMED,
//     REVERSED,
//     CANCELED;
// 
//     public String value() {
//         return name();
//     }
// 
//     public static PaymentStatus fromValue(String v) {
//         return valueOf(v);
//     }
// 
// }
// 
// Path: src/main/java/br/fatea/simplebank/utils/DatetimeUtil.java
// public class DatetimeUtil {
// 	public static final String PATTERN_SOAP_DATETIME = "yyyy-MM-dd HH:mm:ss";
// 	private static final Map<String, DateFormat> patterns = new HashMap<String, DateFormat>();
// 
// 	public static String now(String pattern) {
// 		DateFormat dateFormat = getFormat(pattern);
// 		return dateFormat.format(new Date());
// 	}
// 
// 	private static DateFormat getFormat(String pattern) {
// 		DateFormat dateFormat;
// 		if (!patterns.containsKey(pattern)) {
// 			dateFormat = new SimpleDateFormat(pattern);
// 			patterns.put(pattern, dateFormat);
// 		}
// 		dateFormat = patterns.get(pattern);
// 		return dateFormat;
// 	}
// 
// 	public static Calendar asCalendar(String date, String pattern) {
// 		DateFormat dateFormat = getFormat(pattern);
// 		
// 		Calendar calendar = Calendar.getInstance();
// 		try {
// 			calendar.setTime(dateFormat.parse(date));
// 			return calendar;
// 			
// 		} catch (ParseException e) {
// 			return null;
// 			
// 		}
// 	}
// }


import br.fatea.simplebank.soap.payment.v1.PaymentStatus;
import br.fatea.simplebank.utils.DatetimeUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
package br.fatea.simplebank.model.jms.messages;



@JsonTypeName("payment_message")
public class PaymentMessage {
	
	@JsonProperty(required = true)
	private String order;
	
	@JsonProperty(required = true)
	private PaymentStatus status;
	
	@JsonProperty(required = true, value = "generated_datetime")
	private String generatedDatetime;
	
	@JsonProperty(required = false, value = "detail")
	private String detail;

	public PaymentMessage() {
	}

	public PaymentMessage(String order, PaymentStatus status, String detail) {
		super();
		this.order = order;
		this.status = status;
		this.generatedDatetime = detail;
// Path: src/main/java/br/fatea/simplebank/soap/payment/v1/PaymentStatus.java
// @XmlType(name = "paymentStatus")
// @XmlEnum
// public enum PaymentStatus {
// 
//     OPENED,
//     CONFIRMED,
//     REVERSED,
//     CANCELED;
// 
//     public String value() {
//         return name();
//     }
// 
//     public static PaymentStatus fromValue(String v) {
//         return valueOf(v);
//     }
// 
// }
// 
// Path: src/main/java/br/fatea/simplebank/utils/DatetimeUtil.java
// public class DatetimeUtil {
// 	public static final String PATTERN_SOAP_DATETIME = "yyyy-MM-dd HH:mm:ss";
// 	private static final Map<String, DateFormat> patterns = new HashMap<String, DateFormat>();
// 
// 	public static String now(String pattern) {
// 		DateFormat dateFormat = getFormat(pattern);
// 		return dateFormat.format(new Date());
// 	}
// 
// 	private static DateFormat getFormat(String pattern) {
// 		DateFormat dateFormat;
// 		if (!patterns.containsKey(pattern)) {
// 			dateFormat = new SimpleDateFormat(pattern);
// 			patterns.put(pattern, dateFormat);
// 		}
// 		dateFormat = patterns.get(pattern);
// 		return dateFormat;
// 	}
// 
// 	public static Calendar asCalendar(String date, String pattern) {
// 		DateFormat dateFormat = getFormat(pattern);
// 		
// 		Calendar calendar = Calendar.getInstance();
// 		try {
// 			calendar.setTime(dateFormat.parse(date));
// 			return calendar;
// 			
// 		} catch (ParseException e) {
// 			return null;
// 			
// 		}
// 	}
// }


// Path: src/main/java/br/fatea/simplebank/model/jms/messages/PaymentMessage.java
import br.fatea.simplebank.soap.payment.v1.PaymentStatus;
import br.fatea.simplebank.utils.DatetimeUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;

package br.fatea.simplebank.model.jms.messages;



@JsonTypeName("payment_message")
public class PaymentMessage {
	
	@JsonProperty(required = true)
	private String order;
	
	@JsonProperty(required = true)
	private PaymentStatus status;
	
	@JsonProperty(required = true, value = "generated_datetime")
	private String generatedDatetime;
	
	@JsonProperty(required = false, value = "detail")
	private String detail;

	public PaymentMessage() {
	}

	public PaymentMessage(String order, PaymentStatus status, String detail) {
		super();
		this.order = order;
		this.status = status;
		this.generatedDatetime = detail;
		this.generatedDatetime = DatetimeUtil.now(DatetimeUtil.PATTERN_SOAP_DATETIME);