package com.haha.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 补货员-设备关联实体
 * 支持设备级绑定粒度
 */
@Data
@TableName("t_replenisher_device")
public class ReplenisherDevice implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 补货员ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long replenisherId;

    /**
     * 设备SN号
     */
    private String deviceId;

    /**
     * 绑定来源：MANUAL-手动，QR-扫码绑定，SHOP_INHERIT-门店继承
     */
    private String source;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime createTime;
}
