package com.ruoyi.info.service.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.filepathsplicing.FilePathValue;
import com.ruoyi.info.service.enums.ServiceUnit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 服务业务对象 tb_service_product
 *
 * @author ruoyi
 * @date 2025-09-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("服务业务对象")
public class ServiceProductBo extends BaseEntity {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID", required = true)
    private Long id;

    /**
     * 服务名称
     */
    @ApiModelProperty(value = "服务名称", required = true)
    @NotBlank(message = "服务名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 服务分类
     */
    @ApiModelProperty(value = "服务分类", required = true)
    private Long serviceCategorizeId;

    /**
     * 服务图片
     */
    @FilePathValue
    @ApiModelProperty(value = "服务图片", required = true)
    private String image;

    /**
     * 销售价
     */
    @ApiModelProperty(value = "销售价", required = true)
    @NotNull(message = "销售价不能为空", groups = { AddGroup.class, EditGroup.class })
    @DecimalMax(value = "99999999.99", message = "销售价不能大于99999999.99")
    private BigDecimal sellingPrice;

    /**
     * 原价
     */
    @ApiModelProperty(value = "原价", required = true)
    @NotNull(message = "原价不能为空", groups = { AddGroup.class, EditGroup.class })
    @DecimalMax(value = "99999999.99", message = "原价不能大于99999999.99")
    private BigDecimal originalPrice;

    /**
     * 成本价
     */
    @ApiModelProperty(value = "成本价", required = true)
    @NotNull(message = "成本价不能为空", groups = { AddGroup.class, EditGroup.class })
    @DecimalMax(value = "99999999.99", message = "成本价不能大于99999999.99")
    private BigDecimal costPrice;

    /**
     * 服务单位
     */
    @ApiModelProperty(value = "服务单位", required = true)
    @NotNull(message = "服务单位不能为空", groups = { AddGroup.class, EditGroup.class })
    private ServiceUnit serviceUnit;

    /**
     * 服务单位时长
     */
    @ApiModelProperty("服务单位时长")
    @NotNull(message = "服务单位时长不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer serviceUnitDuration;

    /**
     * 服务说明
     */
    @ApiModelProperty(value = "服务说明", required = true)
    @NotBlank(message = "服务说明不能为空", groups = { AddGroup.class, EditGroup.class })
    private String serviceDescription;

    /**
     * 服务须知
     */
    @ApiModelProperty(value = "服务须知", required = true)
    private String serviceNotice;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态", required = true)
    private Boolean status;

    /**
     * 开始日期(查询用)
     */
    @ApiModelProperty(value = "开始日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束日期(查询用)
     */
    @ApiModelProperty(value = "结束日期(查询用)", required = true)
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;
}
