package com.erp.dashboard.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 拉取记录实体 - 用于Dashboard API调用统计
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("pull_records")
public class PullRecord {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String platformType;
    private Long platformShopId;
    private String pullType;
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private Integer pulledCount;
    private String pullStatus;
    private String errorMsg;

    @TableLogic
    private LocalDateTime deletedAt;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    // 拉取状态常量
    public static final String STATUS_SUCCESS = "success";
    public static final String STATUS_FAILED = "failed";
}
