namespace NexusShell.Agent.Models;

public sealed class NexusAgentStatusResponse
{
    public bool Connected { get; init; } = true;
    public required string AgentVersion { get; init; }
    public required string ShellVersion { get; init; }
    public DateTimeOffset? LastHeartbeatUtc { get; init; }
    public required string LocalApiUrl { get; init; }
}

public sealed class NexusAgentDeviceResponse
{
    public required string DeviceId { get; init; }
    public bool IsRegistered { get; init; }
    public DateTimeOffset? RegisteredAtUtc { get; init; }
    public required string BackendUrl { get; init; }
    public required string ComputerName { get; init; }
}

public sealed class NexusAgentInventoryResponse
{
    public DateTimeOffset CapturedAtUtc { get; init; }
    public required string ComputerName { get; init; }
    public required string Os { get; init; }
    public required string Cpu { get; init; }
    public required string Ram { get; init; }
    public required string Storage { get; init; }
    public required string Gpu { get; init; }
    public IReadOnlyList<NexusAgentNetworkAdapterInfo> NetworkAdapters { get; init; } = [];
    public IReadOnlyList<NexusAgentDisplayInfo> Displays { get; init; } = [];
    public IReadOnlyList<NexusAgentPrinterInfo> Printers { get; init; } = [];
    public IReadOnlyList<NexusAgentUsbInfo> UsbDevices { get; init; } = [];
    public required string BluetoothStatus { get; init; }
    public IReadOnlyList<string> BluetoothDevices { get; init; } = [];
    public required string SystemManufacturer { get; init; }
    public required string SystemModel { get; init; }
    public required string BiosVersion { get; init; }
}

public sealed class NexusAgentNetworkAdapterInfo
{
    public required string Name { get; init; }
    public required string Type { get; init; }
    public required string Status { get; init; }
    public string IpAddress { get; init; } = "—";
}

public sealed class NexusAgentDisplayInfo
{
    public required string Name { get; init; }
    public required string Resolution { get; init; }
    public int RefreshRate { get; init; }
    public bool IsPrimary { get; init; }
}

public sealed class NexusAgentPrinterInfo
{
    public required string Name { get; init; }
}

public sealed class NexusAgentUsbInfo
{
    public required string Name { get; init; }
    public required string DeviceType { get; init; }
    public required string Manufacturer { get; init; }
}

public sealed class NexusAgentHealthResponse
{
    public DateTimeOffset CapturedAtUtc { get; init; }
    public required string Overall { get; init; }
    public int HealthPercent { get; init; }
    public required string Cpu { get; init; }
    public required string Ram { get; init; }
    public required string Disk { get; init; }
    public required string Network { get; init; }
    public string? Temperature { get; init; }
}

public sealed class NexusAgentIdentityResponse
{
    public required string DeviceId { get; init; }
    public required string User { get; init; }
    public required string Organization { get; init; }
    public required string TrustStatus { get; init; }
    public required string EnrollmentStatus { get; init; }
    public DateTimeOffset? EnrollmentDate { get; init; }
    public DateTimeOffset? LastSeen { get; init; }
    public bool IsEnrolled { get; init; }
}

public sealed class NexusAgentDeviceProfileResponse
{
    public required string DeviceId { get; init; }
    public required string ComputerName { get; init; }
    public required string FriendlyName { get; init; }
    public required string Owner { get; init; }
    public required string Organization { get; init; }
    public required string AgentVersion { get; init; }
    public required string ShellVersion { get; init; }
    public DateTimeOffset? EnrollmentDate { get; init; }
    public DateTimeOffset? LastSeen { get; init; }
    public required string Status { get; init; }
    public NexusAgentInventoryResponse? Inventory { get; init; }
    public NexusAgentHealthResponse? Health { get; init; }
}

public sealed class NexusAgentTrustResponse
{
    public required string DeviceId { get; init; }
    public required string Status { get; init; }
    public DateTimeOffset? EvaluatedAtUtc { get; init; }
    public string? Reason { get; init; }
}

public sealed class NexusAgentPoliciesResponse
{
    public required string Role { get; init; }
    public required string PolicyId { get; init; }
    public required string PolicyName { get; init; }
    public required string PolicyVersion { get; init; }
    public required string SourcePath { get; init; }
    public required DateTimeOffset EvaluatedAtUtc { get; init; }
    public IReadOnlyList<string> AllowApps { get; init; } = [];
    public IReadOnlyList<string> DenyApps { get; init; } = [];
    public IReadOnlyList<string> AllowFeatures { get; init; } = [];
    public IReadOnlyList<string> DenyFeatures { get; init; } = [];
    public IReadOnlyList<string> AllowCommands { get; init; } = [];
    public IReadOnlyList<string> DenyCommands { get; init; } = [];
    public IReadOnlyList<string> DenySettingsSections { get; init; } = [];
    public bool ConsoleAccess { get; init; }
    public bool StoreAccess { get; init; }
    public string EvaluationMode { get; init; } = "read-only";
}
