namespace Monitoring.Core.Domain.CheckListManagement;

/// <summary>
/// Шаблон проверки.
/// </summary>
public class CheckListTemplate
{
	/// <summary>
	/// ИД шаблона проверки.
	/// </summary>
	public CheckListTemplateId Id { get; } = null!;

	/// <summary>
	/// Тип шаблона проверки.
	/// </summary>
	public CheckListType Type { get; private set; } = CheckListType.Unknown;

	/// <summary>
	/// Список пунктов проверки.
	/// </summary>
	public List<CheckListTemplateItem> Items { get; } = [];

	private CheckListTemplate(
		CheckListTemplateId id,
		CheckListType type,
		List<CheckListTemplateItem> items
	)
	{
		Id = id;
		Type = type;
		Items = items;
	}

	public static CheckListTemplate Create(CheckListType type)
	{
		return new CheckListTemplate(CheckListTemplateId.Create(Guid.CreateVersion7()), type, []);
	}

    public void Update(CheckListType type)
    {
        Type = type;
    }

	// For EF
	protected CheckListTemplate() { }
}
