Utopia-Canteen-System/Models/ScanRecord.cs

50 lines
2.9 KiB
C#

namespace UtopiaCanteenSystem.Models;
/// <summary>
/// Represents a single RFID scan event. Used for local storage and sync.
/// </summary>
public class ScanRecord
{
public int Id { get; set; }
/// <summary>RFID card identifier at time of scan.</summary>
public string CardId { get; set; } = string.Empty;
/// <summary>UTC time when the scan occurred.</summary>
public DateTime ScanTime { get; set; }
/// <summary>True after record has been successfully sent / synced.</summary>
public bool IsSynced { get; set; }
/// <summary>Site identifier where the scan occurred (2-digit string, e.g. "02").</summary>
public string SiteId { get; set; } = string.Empty;
/// <summary>Stable device identifier that generated the scan (from config).</summary>
public string DeviceId { get; set; } = string.Empty;
/// <summary>IP address of the device at scan time.</summary>
public string IpAddress { get; set; } = string.Empty;
/// <summary>Meal session enum value at scan time (int cast of MealSession).</summary>
public int MealSessionCode { get; set; }
/// <summary>HRMS employee document id (employee.id) at scan time; used to load photo from hrms.employee_photo.</summary>
public string ParentDocumentId { get; set; } = string.Empty;
/// <summary>HRMS employee ID (serial_number) at scan time, when lookup succeeded.</summary>
public string EmployeeId { get; set; } = string.Empty;
/// <summary>uind_serial from employee_rfid_tag at scan time.</summary>
public string UindSerial { get; set; } = string.Empty;
/// <summary>function_id from employee_rfid_tag at scan time.</summary>
public int FunctionId { get; set; }
/// <summary>department_id from employee_rfid_tag at scan time.</summary>
public int DepartmentId { get; set; }
/// <summary>date_time_created from employee_rfid_tag (stored as DateTime; naming kept for clarity).</summary>
public DateTime? TagCreatedAtUtc { get; set; }
/// <summary>created_by from employee_rfid_tag.</summary>
public string TagCreatedBy { get; set; } = string.Empty;
/// <summary>Full name (first + middle) from HRMS at scan time, when lookup succeeded.</summary>
public string EmployeeName { get; set; } = string.Empty;
/// <summary>HRMS department title at scan time.</summary>
public string Department { get; set; } = string.Empty;
/// <summary>HRMS department type at scan time.</summary>
public string DepartmentType { get; set; } = string.Empty;
/// <summary>Meal/session label at scan time (e.g. Breakfast/Lunch/Tea/Dinner).</summary>
public string MealLabel { get; set; } = string.Empty;
/// <summary>Menu items string for this scan's meal (e.g. "Biryani + Nihari").</summary>
public string MealItems { get; set; } = string.Empty;
/// <summary>Total price for this scan's meal menu.</summary>
public double TotalPrice { get; set; }
}