using RobotNet.VDA5050.Order;
namespace RobotNet10.FleetManager.Services.TrafficControl.Models;
///
/// Represents a segment in a robot route (either a node or an edge)
/// Uses VDA5050.Order.Node and VDA5050.Order.Edge to store full information
///
public class RouteSegment
{
// Internal properties needed for traffic control logic
///
/// Node ID (Guid from database) - for conflict detection and edge reservation
///
public Guid NodeId { get; set; }
///
/// Edge ID (Guid from database) - Null if this is a node-only segment
///
public Guid? EdgeId { get; set; }
///
/// Start Node ID of the edge (Guid from database) - for conflict detection
///
public Guid? StartNodeId { get; set; }
///
/// End Node ID of the edge (Guid from database) - for conflict detection
///
public Guid? EndNodeId { get; set; }
///
/// Whether this segment has been released into base
///
public bool Released { get; set; }
///
/// Time until which this edge is reserved
///
public DateTime? ReservedUntil { get; set; }
// VDA5050 Order objects containing full information from MapEditor
///
/// VDA5050 Node with full information (NodeId, NodeDescription, NodePosition, Actions, etc.)
///
public Node? VdaNode { get; set; }
///
/// VDA5050 Edge with full information (EdgeId, EdgeDescription, MaxSpeed, Trajectory, Actions, etc.)
/// Null if this is a node-only segment
///
public Edge? VdaEdge { get; set; }
///
/// Get SequenceId from VdaNode or VdaEdge
///
public int SequenceId => VdaNode?.SequenceId ?? VdaEdge?.SequenceId ?? 0;
///
/// Check if this segment is a node segment
///
public bool IsNode => VdaNode != null;
///
/// Check if this segment is an edge segment
///
public bool IsEdge => VdaEdge != null;
}