package com.app.entity.order;

import com.app.constant.OrderConstant;
import com.app.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
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 org.springframework.format.annotation.DateTimeFormat;

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

@ApiModel("开课 - 退费申请")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("t_open_course_refund")
public class OpenCourseRefund extends BaseEntity {

    @ApiModelProperty("机构id")
    @NotEmpty
    @TableField(value = "organ_id")
    private String organId;

    @ApiModelProperty("开课订单标识")
    @NotEmpty
    @TableField("open_course_order_id")
    private String openCourseOrderId;

    @ApiModelProperty("开课订单项标识")
    @NotEmpty
    @TableField("open_course_order_item_id")
    private String openCourseOrderItemId;

    @ApiModelProperty("开课标识")
    @NotEmpty
    @TableField("open_course_id")
    private String openCourseId;

    @ApiModelProperty("家长标识")
    @NotEmpty
    @TableField("guardian_id")
    private String guardianId;

    @ApiModelProperty("学年")
    @NotNull
    @TableField("school_year")
    private Integer schoolYear;

    @ApiModelProperty("学期")
    @NotNull
    @TableField("semester")
    private Integer semester;

    @ApiModelProperty("学校标识")
    @NotEmpty
    @TableField("school_id")
    private String schoolId;

    @ApiModelProperty("学校名称")
    @NotEmpty
    @TableField("school_name")
    private String schoolName;

    /**
     * @see com.app.constant.SchoolConstant#PRIMARY_SCHOOL
     * @see com.app.constant.SchoolConstant#MIDDLE_SCHOOL
     * @see com.app.constant.SchoolConstant#HIGH_SCHOOL
     */
    @ApiModelProperty("年级名称")
    @NotEmpty
    @TableField("grade_name")
    private Integer gradeName;

    /**
     * @see com.app.constant.SchoolConstant#CLASS_NAME_LIST
     */
    @ApiModelProperty("班级名称")
    @NotEmpty
    @TableField("class_name")
    private Integer className;

    @ApiModelProperty("小孩姓名")
    @NotEmpty
    @TableField("child_name")
    private String childName;

    @ApiModelProperty("手机号码")
    @NotEmpty
    @TableField("phone_number")
    private String phoneNumber;

    @ApiModelProperty("开课名称")
    @NotNull
    @TableField("open_course_name")
    private String openCourseName;

    @ApiModelProperty("开课价格")
    @NotNull
    @TableField("open_course_price")
    private Double openCoursePrice;

    @ApiModelProperty("开课星期")
    @NotNull
    @TableField("open_course_cycle")
    private String openCourseCycle;

    @ApiModelProperty("开课时间")
    @NotNull
    @TableField("open_course_hours")
    private String openCourseHours;

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

    @ApiModelProperty("微信退款单号")
    @TableField("refund_id")
    private String refundId;

    @ApiModelProperty("微信表单标识")
    @NotEmpty
    @TableField("wxmp_form_id")
    private String wxmpFormId;

    @ApiModelProperty("申请备注")
    @TableField("apply_remarks")
    private String applyRemarks;

    @ApiModelProperty("审核备注")
    @TableField("passed_remarks")
    private String passedRemarks;

    /**
     * @see OrderConstant.RefundState
     */
    @ApiModelProperty("订单退款审核状态")
    @TableField("state")
    private Integer state;

    @ApiModelProperty("审核人")
    @TableField("passed_by")
    private String passedBy;

    @ApiModelProperty("审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("passed_at")
    private Date passedAt;

}
