package com.izouma.dingdong.domain.rider;

import com.izouma.dingdong.domain.BaseEntity;
import com.izouma.dingdong.enums.DeliveryType;
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 javax.persistence.EnumType;
import javax.persistence.Enumerated;

@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "配送费", description = "配送费")
@Where(clause = "enabled = 1")
public class DeliveryFee extends BaseEntity {

    //类型
    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "类型", name = "type")
    private DeliveryType type;
    //规则
    @ApiModelProperty(value = "规则", name = "rule")
    private String rule;

    @ApiModelProperty(value = "规则单位", name = "ruleUnit")
    private String ruleUnit;
    //值
    @ApiModelProperty(value = "值", name = "value")
    private Integer value;

    @ApiModelProperty(value = "值单位", name = "valueUnit")
    private String valueUnit;
    //描述
    @ApiModelProperty(value = "描述", name = "description")
    private String description;
    //多值
    @ApiModelProperty(value = "可多值", name = "multivalued")
    private Boolean multivalued;

    @Column(nullable = false)
    private Boolean enabled = true;
    /*
    基础费  基础距离  超出公里  添加费用  繁忙系数                 时间系数     配送件数
     10      1       1        10      时间 10分钟              8-23   1    几件+1
                                      订单量 10  繁忙系数 1     23-8   2
                                      订单量 20  繁忙系数 2
                                      订单量 30  繁忙系数 3
                                      ...
     */


}
