diff --git a/back/Contracts/DTOs/SpendingGroupDto.cs b/back/Contracts/DTOs/SpendingGroupDto.cs new file mode 100644 index 0000000..cf03704 --- /dev/null +++ b/back/Contracts/DTOs/SpendingGroupDto.cs @@ -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; } +} \ No newline at end of file diff --git a/back/Contracts/Mappers/SpendingGroupMapper.cs b/back/Contracts/Mappers/SpendingGroupMapper.cs new file mode 100644 index 0000000..7eca2d3 --- /dev/null +++ b/back/Contracts/Mappers/SpendingGroupMapper.cs @@ -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 + }; +} \ No newline at end of file diff --git a/back/Contracts/Repositories/ISpendingGroupRepo.cs b/back/Contracts/Repositories/ISpendingGroupRepo.cs new file mode 100644 index 0000000..f8f7999 --- /dev/null +++ b/back/Contracts/Repositories/ISpendingGroupRepo.cs @@ -0,0 +1,13 @@ +using Contracts.DTO; +using Contracts.SearchModels; + +namespace Contracts.Repositories; + +public interface ISpendingGroupRepo +{ + Task Get(SpendingGroupSearch search); + Task> GetList(SpendingGroupSearch? search = null); + Task Create(SpendingGroupDto spendingGroup); + Task Delete(SpendingGroupSearch search); + Task Update(SpendingGroupDto spendingGroup); +} diff --git a/back/Contracts/SearchModels/SpendingGroupSearch.cs b/back/Contracts/SearchModels/SpendingGroupSearch.cs new file mode 100644 index 0000000..927a206 --- /dev/null +++ b/back/Contracts/SearchModels/SpendingGroupSearch.cs @@ -0,0 +1,7 @@ +namespace Contracts.SearchModels; + +public class SpendingGroupSearch +{ + public Guid? Id { get; set; } + public string? Name { get; set; } +} \ No newline at end of file diff --git a/back/Contracts/Services/ISpendingGroupService.cs b/back/Contracts/Services/ISpendingGroupService.cs new file mode 100644 index 0000000..e6664ee --- /dev/null +++ b/back/Contracts/Services/ISpendingGroupService.cs @@ -0,0 +1,14 @@ +using Contracts.DTO; +using Contracts.SearchModels; +using Contracts.ViewModels; + +namespace Contracts.Services; + +public interface ISpendingGroupService +{ + Task GetDetails(SpendingGroupSearch search); + Task> GetList(SpendingGroupSearch search); + Task Create(SpendingGroupDto model); + Task Update(SpendingGroupDto model); + Task Delete(SpendingGroupSearch search); +} \ No newline at end of file diff --git a/back/Contracts/ViewModels/SpendingGroupViewModel.cs b/back/Contracts/ViewModels/SpendingGroupViewModel.cs new file mode 100644 index 0000000..12cba2d --- /dev/null +++ b/back/Contracts/ViewModels/SpendingGroupViewModel.cs @@ -0,0 +1,7 @@ +namespace Contracts.ViewModels; + +public class SpendingGroupViewModel +{ + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; +} \ No newline at end of file