using System.ComponentModel.DataAnnotations;

namespace OTSSignsOrchestrator.Core.Models.Entities;

public enum OperationType
{
    Create,
    Update,
    Delete,
    TestXibo,
    TestIdP,
    DeploymentStatus,
    Other
}

public enum OperationStatus
{
    Pending,
    Success,
    Failure
}

public class OperationLog
{
    [Key]
    public Guid Id { get; set; } = Guid.NewGuid();

    public OperationType Operation { get; set; }

    /// <summary>Name of the Docker stack this operation relates to (e.g. "acm-cms-stack").</summary>
    [MaxLength(150)]
    public string? StackName { get; set; }

    [MaxLength(200)]
    public string? UserId { get; set; }

    public OperationStatus Status { get; set; } = OperationStatus.Pending;

    /// <summary>Human-readable message. NEVER includes secret values.</summary>
    [MaxLength(2000)]
    public string? Message { get; set; }

    public long? DurationMs { get; set; }

    public DateTime Timestamp { get; set; } = DateTime.UtcNow;
}
