package com.izouma.dingdong.domain.backstage;

import com.izouma.dingdong.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.math.BigDecimal;

@Data
//@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Where(clause = "enabled = 1")
@ApiModel(value = "退款申请", description = "退款申请")
public class RefundApply extends BaseEntity {
    @ApiModelProperty(value = "订单ID", name = "orderId")
    private Long orderId;

    @ApiModelProperty(value = "用户ID", name = "userId")
    private Long userId;

    @ApiModelProperty(value = "骑手工号", name = "jobNumber")
    private String jobNumber;

    @ApiModelProperty(value = "退款金额", name = "amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "客户缘由", name = "userReason")
    private String userReason;

    @ApiModelProperty(value = "商家缘由", name = "merchantReason")
    private String merchantReason;

    @ApiModelProperty(value = "商家是否同意", name = "isAgree")
    private Boolean isAgree;

    @Builder.Default
    @Column(nullable = false)
    @ApiModelProperty(value = "取消退款", name = "cancel")
    private Boolean cancel = false;

    @ApiModelProperty(value = "退款是否成功", name = "isPass")
    private Boolean isPass;

    @ApiModelProperty(value = "商家责任", name = "merchantLiability")
    private BigDecimal merchantLiability;

    @ApiModelProperty(value = "骑手责任", name = "riderLiability")
    private BigDecimal riderLiability;

    @ApiModelProperty(value = "平台责任", name = "platformLiability")
    private BigDecimal platformLiability;

    @Builder.Default
    @Column(nullable = false)
    private Boolean enabled = true;
}
