/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.finance.vo;

import io.swagger.annotations.ApiModelProperty;
import org.springblade.common.enums.OrderStateEnum;
import org.springblade.common.enums.PaymentTypeEnum;
import org.springblade.modules.finance.entity.OrderGoods;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 商品订单表视图实体类
 *
 * @author BladeX
 * @since 2024-07-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "OrderGoodsVO对象", description = "商品订单表")
public class OrderGoodsVO extends OrderGoods {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "订单状态")
	private Integer orderState;

	@ApiModelProperty(value = "订单状态描述")
	private String orderStateDesc;

	@ApiModelProperty(value = "订单编号")
	private String orderNo;

	@ApiModelProperty(value = "客户电话")
	private String phone;

	@ApiModelProperty(value = "客户昵称")
	private String nickname;

	@ApiModelProperty(value = "开始时间")
	private Date startTime;

	@ApiModelProperty(value = "结束时间")
	private Date endTime;

	@ApiModelProperty(value = "支付方式")
	private String payModeDesc;

	@ApiModelProperty(value = "支付金额")
	private BigDecimal paymentAmount;

	@ApiModelProperty(value = "支付方式")
	private String paymentMode;

	@ApiModelProperty(value = "支付时间")
	private Date paymentTime;

	@ApiModelProperty(value = "支付状态;1-未支付 2-已支付 3-已退款")
	private Integer paymentState;

	@ApiModelProperty(value = "总金额")
	private BigDecimal totalAmount;

	@ApiModelProperty(value = "优惠金额")
	private BigDecimal discountAmount;

	public String getPayModeDesc() {
		return PaymentTypeEnum.getNameByValue(paymentMode);
	}

	public String getOrderStateDesc() {
		return OrderStateEnum.getNameByValue(orderState);
	}

}
