package org.dromara.work.domain.bo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.work.domain.TpOrderRecord;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 操作历史业务对象 tp_order_record
 *
 * @author Maosw
 * @date 2024-08-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@AutoMapper(target = TpOrderRecord.class, reverseConvertGenerate = false)
public class TpOrderRecordBo {

    /**
     *
     */
    @NotNull(message = "不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 所属订单
     */
    @NotNull(message = "所属订单不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long oid;

    /**
     * 操作类型
     */
    @NotBlank(message = "操作类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String type;

    /**
     * 操作内容
     */
    @NotBlank(message = "操作内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String content;

    /**
     * 操作人
     */
    @NotNull(message = "操作人不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long addUser;

    /**
     * 操作时间
     */
    @NotNull(message = "操作时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date addTime;

    /**
     * 操作状态（1=记录，2=节点）
     */
    @NotNull(message = "操作状态（1=记录，2=节点）不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long state;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();

}
