package com.xinelu.manage.domain.nursestationitemprice;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 护理站护理项目价格对象 nurse_station_item_price
 *
 * @author ljh
 * @date 2022-09-02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "护理站护理项目价格对象", description = "nurse_station_item_price")
public class NurseStationItemPrice extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 4911452368843523048L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理站项目表id
     */
    @ApiModelProperty(value = "护理站项目表id")
    @Excel(name = "护理站项目表id")
    @NotNull(message = "护理站项目表id不能为空", groups = {Update.class})
    private Long nurseStationItemId;

    /**
     * 服务时长和单位
     */
    @ApiModelProperty(value = "服务时长和单位")
    @Excel(name = "服务时长和单位")
    @NotNull(message = "服务时长和单位不能为空", groups = {Insert.class, Update.class})
    @Length(max = 50, message = "服务时长和单位不能超过50个字符", groups = {Insert.class, Update.class})
    private String serveDurationUnit;

    /**
     * 价格
     */
    @ApiModelProperty(value = "价格")
    @Excel(name = "价格")
    @NotNull(message = "价格不能为空", groups = {Insert.class, Update.class})
    private BigDecimal price;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    @Excel(name = "描述")
    @NotNull(message = "描述不能为空", groups = {Insert.class, Update.class})
    @Length(max = 300, message = "描述不能超过300个字符", groups = {Insert.class, Update.class})
    private String description;

    /**
     * 护理项目佣金金额
     */
    private BigDecimal commissionAmount;

    /**
     * 护理项目佣金比例，此处存储比例数字，不存储比例单位
     */
    private BigDecimal commissionRate;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationItemId", getNurseStationItemId())
                .append("serveDurationUnit", getServeDurationUnit())
                .append("price", getPrice())
                .append("description", getDescription())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}