package com.app.dto.order;

import com.app.entity.order.OpenCourseOrderItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@ApiModel("开课 - 订单Dto")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OpenCourseOrderDto {

    @ApiModelProperty("标识")
    private String id;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;

    @ApiModelProperty("账号标识")
    private String accountId;

    @ApiModelProperty("应付价格")
    @NotNull
    private Double payablePrice;

    @ApiModelProperty("退款")
    @NotNull
    private Double refund;

    @ApiModelProperty("实付价格")
    @NotNull
    private Double paidPrice;

    /**
     * @see com.app.constant.OrderConstant.OrderState
     */
    @ApiModelProperty("状态")
    private Integer state;

    @ApiModelProperty("订单过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderExpireTime;

    @ApiModelProperty("支付完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payEndTime;

    @ApiModelProperty("微信支付订单号")
    private String transactionId;

    @ApiModelProperty("订单项")
    List<OpenCourseOrderItem> openCourseOrderItemList;

}
