namespace MyOffice.Web.Models.AccountMotion; using Data.Models.Accounts; using Services.Account.Domain; public class AccountMotionViewModel { public string? Id { get; set; } public DateTime Date { get; set; } public string Motion { get; set; } = null!; public string? Description { get; set; } public decimal Plus { get; set; } public decimal Minus { get; set; } } public class AccountMotionRequest { public DateTime Date { get; set; } public string Motion { get; set; } = null!; public string? Description { get; set; } public decimal? Plus { get; set; } public decimal? Minus { get; set; } } public static class AccountMotionViewModelExtension { } public static class AccountMotionRequestExtension { public static AccountMotionAdd FromModel(this AccountMotionRequest input) { return new AccountMotionAdd { Date = input.Date, Motion = input.Motion, Minus = input.Minus ?? 0, Plus = input.Plus ?? 0, Description = input.Description, }; } }