using System.Linq.Expressions;

using Monitoring.Core.Domain.OrganizationManagement;

namespace Monitoring.Models;

public record OrganizationModel(
	Guid Id,
	string Name,
	string Description
)
{
	public static readonly Expression<Func<Organization, OrganizationModel>> Projection =
		organization => new OrganizationModel(
			organization.Id.Value,
			organization.Name.Value,
			organization.Description.Value
		);

	public static readonly Func<Organization, OrganizationModel> FromEntity =
		organization => new OrganizationModel(
			organization.Id.Value,
			organization.Name.Value,
			organization.Description.Value
		);
}
