0.1.0 #2

Merged
mfnefd merged 38 commits from dev into main 2024-12-09 04:27:05 +04:00
6 changed files with 68 additions and 0 deletions
Showing only changes of commit b35cd64e80 - Show all commits

View 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; }
}

View 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
};
}

View 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);
}

View File

@ -0,0 +1,6 @@
namespace Contracts.SearchModels;
public class SpendingPlanSearch
{
public Guid? Id { get; set; }
}

View 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);
}

View 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; }
}