using Monitoring.Core.Domain.AssetGroupManagement;
using Monitoring.Core.Domain.AssetManagement;
using Monitoring.Core.Domain.TokenManagement;

namespace Monitoring.Core.Domain.OrganizationManagement;

/// <summary>
/// Организация
/// </summary>
public class Organization
{
	/// <summary>
	/// ИД
	/// </summary>
	public OrganizationId Id { get; } = default!;

	/// <summary>
	/// Название организации
	/// </summary>
	public OrganizationName Name { get; set; } = default!;

	/// <summary>
	/// Описание организации
	/// </summary>
	public OrganizationDescription Description { get; set; } = default!;

	/// <summary>
	/// Токены для доступа к API
	/// </summary>
	public List<Token> Tokens { get; } = [];

	/// <summary>
	/// Члены организации.
	/// </summary>
	public List<Member> Members { get; } = [];

	/// <summary>
	/// Активы (объекты, автомобили и т.п.)
	/// </summary>
	public List<Asset> Assets { get; } = [];

	/// <summary>
	/// Группы активов
	/// </summary>
	public List<AssetGroup> AssetGroups { get; } = [];

	public List<AlarmResetComment> AlarmResetComments { get; } = [];

	public static Organization Create(
		OrganizationName name,
		OrganizationDescription description)
	{
		return new(
			new(Guid.NewGuid()),
			name,
			description);
	}

	private Organization(
		OrganizationId id,
		OrganizationName name,
		OrganizationDescription description
	)
	{
		Id = id;
		Name = name;
		Description = description;
	}

	protected Organization() { }
}
