namespace MyOffice.Web.Models.Motion;

using MyOffice.Services.Account.Domain;

public class MotionRequest
{
	public DateTime Date { get; set; }
	public string Item { get; set; } = null!;
	public string? Description { get; set; }
	public decimal? Plus { get; set; }
	public decimal? Minus { get; set; }
}

public static class MotionRequestExtension
{
	public static MotionAddUpdate FromModel(this MotionRequest input)
	{
		return new MotionAddUpdate
		{
			Date = input.Date,
			Item = input.Item,
			Minus = input.Minus ?? 0,
			Plus = input.Plus ?? 0,
			Description = input.Description,
		};
	}
}
