0.1.0 #2
8
back/Contracts/DTOs/SpendingGroupDto.cs
Normal file
8
back/Contracts/DTOs/SpendingGroupDto.cs
Normal 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; }
|
||||
}
|
14
back/Contracts/Mappers/SpendingGroupMapper.cs
Normal file
14
back/Contracts/Mappers/SpendingGroupMapper.cs
Normal 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
|
||||
};
|
||||
}
|
13
back/Contracts/Repositories/ISpendingGroupRepo.cs
Normal file
13
back/Contracts/Repositories/ISpendingGroupRepo.cs
Normal 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);
|
||||
}
|
7
back/Contracts/SearchModels/SpendingGroupSearch.cs
Normal file
7
back/Contracts/SearchModels/SpendingGroupSearch.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Contracts.SearchModels;
|
||||
|
||||
public class SpendingGroupSearch
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
}
|
14
back/Contracts/Services/ISpendingGroupService.cs
Normal file
14
back/Contracts/Services/ISpendingGroupService.cs
Normal 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);
|
||||
}
|
7
back/Contracts/ViewModels/SpendingGroupViewModel.cs
Normal file
7
back/Contracts/ViewModels/SpendingGroupViewModel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Contracts.ViewModels;
|
||||
|
||||
public class SpendingGroupViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
Loading…
Reference in New Issue
Block a user