59 lines
1.4 KiB
C#
59 lines
1.4 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace RobotNet10.FleetManager.Data;
|
|
|
|
/// <summary>
|
|
/// Robot entity - Individual robot information
|
|
/// </summary>
|
|
[Table("Robots")]
|
|
public class Robot
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Robot identifier (serial number or unique identifier)
|
|
/// </summary>
|
|
[Required]
|
|
[StringLength(64)]
|
|
public string RobotId { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Display name of the robot
|
|
/// </summary>
|
|
[Required]
|
|
[StringLength(256)]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Foreign key to RobotModel
|
|
/// </summary>
|
|
[Required]
|
|
public Guid ModelId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Foreign key to Map (optional)
|
|
/// </summary>
|
|
public Guid? MapId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Created date
|
|
/// </summary>
|
|
[Required]
|
|
public DateTime CreatedDate { get; set; } = DateTime.UtcNow;
|
|
|
|
/// <summary>
|
|
/// Updated date
|
|
/// </summary>
|
|
public DateTime? UpdatedDate { get; set; }
|
|
|
|
// Navigation properties
|
|
/// <summary>
|
|
/// Robot model this robot belongs to
|
|
/// </summary>
|
|
[ForeignKey(nameof(ModelId))]
|
|
public virtual RobotModel? Model { get; set; }
|
|
}
|