using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;

namespace detect.gui.Models.Entities;

[Table("dat_task_progress")]
[Index(nameof(TaskId), IsUnique = false)]
public class DetectTaskProgressEntity
{
    [Key] 
    [JsonProperty(PropertyName = "id")]
    [Column("id")]
    public long? Id { get; set; }

    [StringLength(255), Comment("设备序列号")] 
    [JsonProperty(PropertyName = "deviceSn")]
    [Column("device_sn")]
    public string? DeviceSn { get; set; }
    
    [JsonProperty(PropertyName = "taskId")]
    [Column("task_id")]
    public long? TaskId { get; set; }
    
    [StringLength(255), Comment("过程数据")] 
    [JsonProperty(PropertyName = "taskDataJson")]
    [Column("task_data_json")]
    public string? TaskDataJson { get; set; }

    [Comment("创建时间")] 
    [JsonProperty(PropertyName = "createTime")]
    [Column("create_time")]
    public DateTime? CreateTime { get; set; }
}