using System.Linq.Expressions;
using Monitoring.Core.Domain.CallManagement;

namespace Monitoring.Features.Calls;

public record CallModel(
	Guid Id,
	Guid AlarmId,
	Guid CallerId,
	DateTime StartedAt,
	Guid ResponsiblePersonId,
	bool IsConfirmedRealAlarm,
	CallResult Result,
	string Commentary
)
{
	public static readonly Expression<Func<Call, CallModel>> FromEntity = entity => new CallModel(
		entity.Id.Value,
		entity.AlarmScopeId.Value,
		entity.CallerId.Value,
		entity.StartedAt,
		entity.ResponsiblePersonId,
		entity.IsConfirmedRealAlarm,
		entity.Result,
		entity.Commentary.Value
	);
}
