using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MiAssessment.Model.Entities;
///
/// 测评记录表
///
[Table("assessment_records")]
public class AssessmentRecord
{
///
/// 主键ID
///
[Key]
public long Id { get; set; }
///
/// 用户ID
///
public long UserId { get; set; }
///
/// 订单ID
///
public long OrderId { get; set; }
///
/// 测评类型ID
///
public long AssessmentTypeId { get; set; }
///
/// 测评人姓名
///
[Required]
[MaxLength(50)]
public string Name { get; set; } = null!;
///
/// 手机号
///
[Required]
[MaxLength(20)]
public string Phone { get; set; } = null!;
///
/// 性别:1男 2女
///
public int Gender { get; set; }
///
/// 年龄
///
public int Age { get; set; }
///
/// 学业阶段:1小学及以下 2初中 3高中 4大专 5本科 6研究生及以上
///
public int EducationStage { get; set; }
///
/// 省份
///
[Required]
[MaxLength(50)]
public string Province { get; set; } = null!;
///
/// 城市
///
[Required]
[MaxLength(50)]
public string City { get; set; } = null!;
///
/// 区县
///
[Required]
[MaxLength(50)]
public string District { get; set; } = null!;
///
/// 状态:0待支付 1待测评 2测评中 3生成中 4已完成
///
public int Status { get; set; }
///
/// 开始答题时间
///
public DateTime? StartTime { get; set; }
///
/// 提交答题时间
///
public DateTime? SubmitTime { get; set; }
///
/// 报告生成完成时间
///
public DateTime? CompleteTime { get; set; }
///
/// 创建时间
///
public DateTime CreateTime { get; set; }
///
/// 更新时间
///
public DateTime UpdateTime { get; set; }
///
/// 软删除标记
///
public bool IsDeleted { get; set; }
///
/// PDF 报告文件访问 URL
///
[MaxLength(500)]
public string? ReportUrl { get; set; }
// Note: Navigation property to User removed due to type mismatch (User.Id is int, UserId is long)
// The relationship is maintained at the database level but not enforced by EF Core
///
/// 关联的测评类型
///
[ForeignKey(nameof(AssessmentTypeId))]
public virtual AssessmentType? AssessmentType { get; set; }
}