add: контракты плана расходов
This commit is contained in:
parent
ba8c4a76d8
commit
b35cd64e80
10
back/Contracts/DTOs/SpendingPlanDto.cs
Normal file
10
back/Contracts/DTOs/SpendingPlanDto.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Contracts.DTO;
|
||||||
|
|
||||||
|
public class SpendingPlanDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public Guid SpendingGroupId { get; set; }
|
||||||
|
public decimal Sum { get; set; }
|
||||||
|
public DateTime StartAt { get; set; }
|
||||||
|
public DateTime EndAt { get; set; }
|
||||||
|
}
|
16
back/Contracts/Mappers/SpendingPlanMapper.cs
Normal file
16
back/Contracts/Mappers/SpendingPlanMapper.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Contracts.DTO;
|
||||||
|
using Contracts.ViewModels;
|
||||||
|
|
||||||
|
namespace Contracts.Mappers;
|
||||||
|
|
||||||
|
public static class SpendingPlanMapper
|
||||||
|
{
|
||||||
|
public static SpendingPlanView ToView(this SpendingPlanDto dto)
|
||||||
|
=> new()
|
||||||
|
{
|
||||||
|
Id = dto.Id,
|
||||||
|
StartAt = dto.StartAt,
|
||||||
|
EndAt = dto.EndAt,
|
||||||
|
Sum = dto.Sum
|
||||||
|
};
|
||||||
|
}
|
13
back/Contracts/Repositories/ISpendingPlanRepo.cs
Normal file
13
back/Contracts/Repositories/ISpendingPlanRepo.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using Contracts.DTO;
|
||||||
|
using Contracts.SearchModels;
|
||||||
|
|
||||||
|
namespace Contracts.Repositories;
|
||||||
|
|
||||||
|
public interface ISpendingPlanRepo
|
||||||
|
{
|
||||||
|
Task<SpendingPlanDto> Create(SpendingPlanDto dto);
|
||||||
|
Task<SpendingPlanDto?> Update(SpendingPlanDto dto);
|
||||||
|
Task<SpendingPlanDto?> Delete(SpendingPlanSearch search);
|
||||||
|
Task<SpendingPlanDto?> GetDetails(SpendingPlanSearch search);
|
||||||
|
Task<IEnumerable<SpendingPlanDto>> GetList(SpendingGroupSearch? search = null);
|
||||||
|
}
|
6
back/Contracts/SearchModels/SpendingPlanSearch.cs
Normal file
6
back/Contracts/SearchModels/SpendingPlanSearch.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace Contracts.SearchModels;
|
||||||
|
|
||||||
|
public class SpendingPlanSearch
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
}
|
14
back/Contracts/Services/ISpendingPlan.cs
Normal file
14
back/Contracts/Services/ISpendingPlan.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Contracts.DTO;
|
||||||
|
using Contracts.SearchModels;
|
||||||
|
using Contracts.ViewModels;
|
||||||
|
|
||||||
|
namespace Contracts.Services;
|
||||||
|
|
||||||
|
public interface ISpendingPlan
|
||||||
|
{
|
||||||
|
Task<SpendingPlanView?> GetDetails(SpendingPlanSearch search);
|
||||||
|
Task<IEnumerable<SpendingPlanView>> GetList(SpendingPlanSearch? search = null);
|
||||||
|
Task<SpendingPlanView> Create(SpendingPlanDto spendingPlan);
|
||||||
|
Task<SpendingPlanView?> Delete(SpendingPlanSearch search);
|
||||||
|
Task<SpendingPlanView> Update(SpendingPlanDto spendingPlan);
|
||||||
|
}
|
9
back/Contracts/ViewModels/SpendingPlanView.cs
Normal file
9
back/Contracts/ViewModels/SpendingPlanView.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace Contracts.ViewModels;
|
||||||
|
|
||||||
|
public class SpendingPlanView
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public DateTime StartAt { get; set; }
|
||||||
|
public DateTime EndAt { get; set; }
|
||||||
|
public decimal Sum { get; set; }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user