refactoring
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace MyOffice.Web.Models.Motion;
|
||||
|
||||
using MyOffice.Services.Account.Domain;
|
||||
|
||||
public class MotionRequest
|
||||
{
|
||||
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 MotionRequestExtension
|
||||
{
|
||||
public static MotionAdd FromModel(this MotionRequest input)
|
||||
{
|
||||
return new MotionAdd
|
||||
{
|
||||
Date = input.Date,
|
||||
Motion = input.Motion,
|
||||
Minus = input.Minus ?? 0,
|
||||
Plus = input.Plus ?? 0,
|
||||
Description = input.Description,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user