namespace EntKube.Web.Data;

/// <summary>
/// An app represents a software application owned by a customer. Apps can be
/// deployed to one or many environments via the AppEnvironment join entity.
/// </summary>
public class App
{
    public Guid Id { get; set; }

    public Guid CustomerId { get; set; }

    /// <summary>
    /// The application name. Must be unique within a customer.
    /// </summary>
    public required string Name { get; set; }

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

    // Navigation
    public Customer Customer { get; set; } = null!;
    public ICollection<AppEnvironment> AppEnvironments { get; set; } = [];
    public ICollection<VaultSecret> Secrets { get; set; } = [];
    public ICollection<AppDeployment> Deployments { get; set; } = [];
}
