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 63 additions and 0 deletions
Showing only changes of commit 08a3b74d58 - Show all commits

View File

@ -0,0 +1,8 @@
namespace Contracts.DTO;
public class SpendingGroupDto
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public Guid UserId { get; set; }
}

View File

@ -0,0 +1,14 @@
using Contracts.DTO;
using Contracts.ViewModels;
namespace Contracts.Mappers;
public static class SpendingGroupMapper
{
public static SpendingGroupViewModel ToView(this SpendingGroupDto spendingGroup)
=> new()
{
Id = spendingGroup.Id,
Name = spendingGroup.Name
};
}

View File

@ -0,0 +1,13 @@
using Contracts.DTO;
using Contracts.SearchModels;
namespace Contracts.Repositories;
public interface ISpendingGroupRepo
{
Task<SpendingGroupDto?> Get(SpendingGroupSearch search);
Task<IEnumerable<SpendingGroupDto>> GetList(SpendingGroupSearch? search = null);
Task<SpendingGroupDto> Create(SpendingGroupDto spendingGroup);
Task<SpendingGroupDto?> Delete(SpendingGroupSearch search);
Task<SpendingGroupDto?> Update(SpendingGroupDto spendingGroup);
}

View File

@ -0,0 +1,7 @@
namespace Contracts.SearchModels;
public class SpendingGroupSearch
{
public Guid? Id { get; set; }
public string? Name { get; set; }
}

View File

@ -0,0 +1,14 @@
using Contracts.DTO;
using Contracts.SearchModels;
using Contracts.ViewModels;
namespace Contracts.Services;
public interface ISpendingGroupService
{
Task<SpendingGroupViewModel> GetDetails(SpendingGroupSearch search);
Task<IEnumerable<SpendingGroupViewModel>> GetList(SpendingGroupSearch search);
Task<SpendingGroupViewModel> Create(SpendingGroupDto model);
Task<SpendingGroupViewModel> Update(SpendingGroupDto model);
Task<SpendingGroupViewModel> Delete(SpendingGroupSearch search);
}

View File

@ -0,0 +1,7 @@
namespace Contracts.ViewModels;
public class SpendingGroupViewModel
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
}