package com.ghy.order.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ghy.common.enums.PayStatus;
import com.ghy.common.enums.PayTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单追加扣减
 */
@Data
@Accessors(chain = true)
public class OrderAddSubtract {

    private Long id;
    private Long orderMasterId;
    private Long orderDetailId;

    /**
     * 金额
     */
    @NotNull(message = "金额不能为空")
    @Max(value = 50000, message = "金额过大")
    @Min(value = -50000, message = "金额过小")
    private BigDecimal money;

    /**
     * 备注
     */
    private String remark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    private String createBy;

    /**
     * 支付方式
     *
     * @see PayTypeEnum
     */
    private Integer payType;

    /**
     * 支付状态
     *
     * @see PayStatus
     */
    private Integer payStatus;

    /**
     * 付款时间
     */
    private LocalDateTime payTime;

    /**
     * Adapay的唯一支付ID
     */
    private String paymentId;

    /**
     * Adapay的撤销支付ID
     */
    private String reverseId;

}
