diff --git a/Bank/BankContracts/BankContracts.csproj b/Bank/BankContracts/BankContracts.csproj index c49df50..0a7820b 100644 --- a/Bank/BankContracts/BankContracts.csproj +++ b/Bank/BankContracts/BankContracts.csproj @@ -7,6 +7,7 @@ + diff --git a/Bank/BankContracts/BindingModels/CardBindingModel.cs b/Bank/BankContracts/BindingModels/CardBindingModel.cs new file mode 100644 index 0000000..f3f40c2 --- /dev/null +++ b/Bank/BankContracts/BindingModels/CardBindingModel.cs @@ -0,0 +1,21 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BindingModels +{ + public class CardBindingModel : ICardModel + { + public int Id { get; set; } + public string Number { get; set; } = string.Empty; + public string Cvv { get; set; } = string.Empty; + public string Pin { get; set; } = string.Empty; + public DateOnly ReleaseDate { get; set; } + public DateOnly ExpirationDate { get; set; } + public int ClientId { get; set; } + public int? AccountId { get; set; } + } +} diff --git a/Bank/BankContracts/BindingModels/ClientBindingModel.cs b/Bank/BankContracts/BindingModels/ClientBindingModel.cs new file mode 100644 index 0000000..b715793 --- /dev/null +++ b/Bank/BankContracts/BindingModels/ClientBindingModel.cs @@ -0,0 +1,17 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BindingModels +{ + public class ClientBindingModel : IClientModel + { + public int Id { get; set; } + public string Fio { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; + public string Password { get; set; } = string.Empty; + } +} diff --git a/Bank/BankContracts/BindingModels/OperationBindingModel.cs b/Bank/BankContracts/BindingModels/OperationBindingModel.cs new file mode 100644 index 0000000..683e6ad --- /dev/null +++ b/Bank/BankContracts/BindingModels/OperationBindingModel.cs @@ -0,0 +1,18 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BindingModels +{ + public class OperationBindingModel : IOperationModel + { + public int Id { get; set; } + public int Sum { get; set; } + public DateTime OperationTime { get; set; } + public int? SenderCardId { get; set; } + public int RecipientCardId { get; set; } + } +} diff --git a/Bank/BankContracts/BindingModels/RequestBindingModel.cs b/Bank/BankContracts/BindingModels/RequestBindingModel.cs new file mode 100644 index 0000000..c923f68 --- /dev/null +++ b/Bank/BankContracts/BindingModels/RequestBindingModel.cs @@ -0,0 +1,17 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BindingModels +{ + public class RequestBindingModel : IRequestModel + { + public int Id { get; set; } + public int Sum { get; set; } + public DateTime RequestTime { get; set; } + public RequestStatus Status { get; set; } + } +} diff --git a/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs new file mode 100644 index 0000000..b53ce91 --- /dev/null +++ b/Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs @@ -0,0 +1,20 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BusinessLogicsContracts +{ + public interface ICardLogic + { + List? ReadList(CardSearchModel? model); + CardViewModel? ReadElement(CardSearchModel model); + bool Create(CardBindingModel model); + bool Update(CardBindingModel model); + bool Delete(CardBindingModel model); + } +} diff --git a/Bank/BankContracts/BusinessLogicsContracts/IClientLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/IClientLogic.cs new file mode 100644 index 0000000..7ddda2d --- /dev/null +++ b/Bank/BankContracts/BusinessLogicsContracts/IClientLogic.cs @@ -0,0 +1,20 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BusinessLogicsContracts +{ + public interface IClientLogic + { + List? ReadList(ClientSearchModel? model); + ClientViewModel? ReadElement(ClientSearchModel model); + bool Create(ClientBindingModel model); + bool Update(ClientBindingModel model); + bool Delete(ClientBindingModel model); + } +} diff --git a/Bank/BankContracts/BusinessLogicsContracts/IOperationLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/IOperationLogic.cs new file mode 100644 index 0000000..f46604e --- /dev/null +++ b/Bank/BankContracts/BusinessLogicsContracts/IOperationLogic.cs @@ -0,0 +1,20 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BusinessLogicsContracts +{ + public interface IOperationLogic + { + List? ReadList(OperationSearchModel? model); + OperationViewModel? ReadElement(OperationSearchModel model); + bool Create(OperationBindingModel model); + bool Update(OperationBindingModel model); + bool Delete(OperationBindingModel model); + } +} diff --git a/Bank/BankContracts/BusinessLogicsContracts/IRequestLogic.cs b/Bank/BankContracts/BusinessLogicsContracts/IRequestLogic.cs new file mode 100644 index 0000000..0207741 --- /dev/null +++ b/Bank/BankContracts/BusinessLogicsContracts/IRequestLogic.cs @@ -0,0 +1,22 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.BusinessLogicsContracts +{ + public interface IRequestLogic + { + List? ReadList(RequestSearchModel? model); + RequestViewModel? ReadElement(RequestSearchModel model); + bool Create(RequestBindingModel model); + bool Update(RequestBindingModel model); + bool Delete(RequestBindingModel model); + bool DeclineRequest(RequestBindingModel model); + bool SatisfyRequest(RequestBindingModel model); + } +} diff --git a/Bank/BankContracts/SearchModels/CardSearchModel.cs b/Bank/BankContracts/SearchModels/CardSearchModel.cs new file mode 100644 index 0000000..e154736 --- /dev/null +++ b/Bank/BankContracts/SearchModels/CardSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.SearchModels +{ + public class CardSearchModel + { + public int? Id { get; set; } + public string? Number { get; set; } + public int? ClientId { get; set; } + } +} diff --git a/Bank/BankContracts/SearchModels/ClientSearchModel.cs b/Bank/BankContracts/SearchModels/ClientSearchModel.cs new file mode 100644 index 0000000..d61b2ae --- /dev/null +++ b/Bank/BankContracts/SearchModels/ClientSearchModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.SearchModels +{ + public class ClientSearchModel + { + public int? Id { get; set; } + public string? Fio { get; set; } + public string? Email { get; set; } + public string? Password { get; set; } + } +} diff --git a/Bank/BankContracts/SearchModels/OperationSearchModel.cs b/Bank/BankContracts/SearchModels/OperationSearchModel.cs new file mode 100644 index 0000000..f532a3d --- /dev/null +++ b/Bank/BankContracts/SearchModels/OperationSearchModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.SearchModels +{ + public class OperationSearchModel + { + public int? Id { get; set; } + public DateTime? OperationTime { get; set; } + public int? RecipientCardId { get; set; } + } +} diff --git a/Bank/BankContracts/SearchModels/RequestSearchModel.cs b/Bank/BankContracts/SearchModels/RequestSearchModel.cs new file mode 100644 index 0000000..7812db3 --- /dev/null +++ b/Bank/BankContracts/SearchModels/RequestSearchModel.cs @@ -0,0 +1,16 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.SearchModels +{ + public class RequestSearchModel + { + public int? Id { get; set; } + public DateTime? RequestTime { get; set; } + public string? CardNumber { get; set; } + } +} diff --git a/Bank/BankContracts/StoragesContracts/ICardStorage.cs b/Bank/BankContracts/StoragesContracts/ICardStorage.cs new file mode 100644 index 0000000..3f1fce7 --- /dev/null +++ b/Bank/BankContracts/StoragesContracts/ICardStorage.cs @@ -0,0 +1,21 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.StoragesContracts +{ + public interface ICardStorage + { + List GetFullList(); + List GetFilteredList(CardSearchModel model); + CardViewModel? GetElement(CardSearchModel model); + CardViewModel? Insert(CardBindingModel model); + CardViewModel? Update(CardBindingModel model); + CardViewModel? Delete(CardBindingModel model); + } +} diff --git a/Bank/BankContracts/StoragesContracts/IClientStorage.cs b/Bank/BankContracts/StoragesContracts/IClientStorage.cs new file mode 100644 index 0000000..9e8f762 --- /dev/null +++ b/Bank/BankContracts/StoragesContracts/IClientStorage.cs @@ -0,0 +1,21 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.StoragesContracts +{ + public interface IClientStorage + { + List GetFullList(); + List GetFilteredList(ClientSearchModel model); + ClientViewModel? GetElement(ClientSearchModel model); + ClientViewModel? Insert(ClientBindingModel model); + ClientViewModel? Update(ClientBindingModel model); + ClientViewModel? Delete(ClientBindingModel model); + } +} diff --git a/Bank/BankContracts/StoragesContracts/IOperationStorage.cs b/Bank/BankContracts/StoragesContracts/IOperationStorage.cs new file mode 100644 index 0000000..cd47eec --- /dev/null +++ b/Bank/BankContracts/StoragesContracts/IOperationStorage.cs @@ -0,0 +1,21 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.StoragesContracts +{ + public interface IOperationStorage + { + List GetFullList(); + List GetFilteredList(OperationSearchModel model); + OperationViewModel? GetElement(OperationSearchModel model); + OperationViewModel? Insert(OperationBindingModel model); + OperationViewModel? Update(OperationBindingModel model); + OperationViewModel? Delete(OperationBindingModel model); + } +} diff --git a/Bank/BankContracts/StoragesContracts/IRequestStorage.cs b/Bank/BankContracts/StoragesContracts/IRequestStorage.cs new file mode 100644 index 0000000..aa96562 --- /dev/null +++ b/Bank/BankContracts/StoragesContracts/IRequestStorage.cs @@ -0,0 +1,21 @@ +using BankContracts.BindingModels; +using BankContracts.SearchModels; +using BankContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.StoragesContracts +{ + public interface IRequestStorage + { + List GetFullList(); + List GetFilteredList(RequestSearchModel model); + RequestViewModel? GetElement(RequestSearchModel model); + RequestViewModel? Insert(RequestBindingModel model); + RequestViewModel? Update(RequestBindingModel model); + RequestViewModel? Delete(RequestBindingModel model); + } +} diff --git a/Bank/BankContracts/ViewModels/CardViewModel.cs b/Bank/BankContracts/ViewModels/CardViewModel.cs new file mode 100644 index 0000000..41e77a3 --- /dev/null +++ b/Bank/BankContracts/ViewModels/CardViewModel.cs @@ -0,0 +1,31 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels +{ + public class CardViewModel : ICardModel + { + public int Id { get; set; } + [DisplayName("Номер карты")] + public string Number { get; set; } = string.Empty; + [DisplayName("CVV-код")] + public string Cvv { get; set; } = string.Empty; + [DisplayName("PIN-код")] + public string Pin { get; set; } = string.Empty; + [DisplayName("Дата выпуска")] + public DateOnly ReleaseDate { get; set; } + [DisplayName("Дата окончания действия")] + public DateOnly ExpirationDate { get; set; } + public int ClientId { get; set; } + [DisplayName("Держатель карты")] + public string ClientName { get; set; } = string.Empty; + public int? AccountId { get; set; } + [DisplayName("")] + public string AccountNumber { get; set; } = string.Empty; + } +} diff --git a/Bank/BankContracts/ViewModels/ClientViewModel.cs b/Bank/BankContracts/ViewModels/ClientViewModel.cs new file mode 100644 index 0000000..75365dc --- /dev/null +++ b/Bank/BankContracts/ViewModels/ClientViewModel.cs @@ -0,0 +1,21 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels +{ + public class ClientViewModel : IClientModel + { + public int Id { get; set; } + [DisplayName("ФИО")] + public string Fio { get; set; } = string.Empty; + [DisplayName("Почта")] + public string Email { get; set; } = string.Empty; + [DisplayName("Пароль")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/Bank/BankContracts/ViewModels/OperationViewModel.cs b/Bank/BankContracts/ViewModels/OperationViewModel.cs new file mode 100644 index 0000000..b979b39 --- /dev/null +++ b/Bank/BankContracts/ViewModels/OperationViewModel.cs @@ -0,0 +1,25 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels +{ + public class OperationViewModel : IOperationModel + { + public int Id { get; set; } + [DisplayName("Сумма пополнения")] + public int Sum { get; set; } + [DisplayName("Время выполнения")] + public DateTime OperationTime { get; set; } + public int? SenderCardId { get; set; } + [DisplayName("Номер карты отправителя")] + public string SenderCardNumber { get; set; } = string.Empty; + public int RecipientCardId { get; set; } + [DisplayName("Номер карты получателя")] + public string RecipientCardNumber { get; set; } = string.Empty; + } +} diff --git a/Bank/BankContracts/ViewModels/RequestViewModel.cs b/Bank/BankContracts/ViewModels/RequestViewModel.cs new file mode 100644 index 0000000..22a022f --- /dev/null +++ b/Bank/BankContracts/ViewModels/RequestViewModel.cs @@ -0,0 +1,21 @@ +using BankDataModels.Models; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BankContracts.ViewModels +{ + public class RequestViewModel : IRequestModel + { + public int Id { get; set; } + [DisplayName("Сумма заявки")] + public int Sum { get; set; } + [DisplayName("Время создания заявки")] + public DateTime RequestTime { get; set; } + [DisplayName("Статус заявки")] + public RequestStatus Status { get; set; } + } +} diff --git a/Bank/BankDataModels/Models/IClientModel.cs b/Bank/BankDataModels/Models/IClientModel.cs index 35cab4a..a97d51b 100644 --- a/Bank/BankDataModels/Models/IClientModel.cs +++ b/Bank/BankDataModels/Models/IClientModel.cs @@ -8,8 +8,8 @@ namespace BankDataModels.Models { public interface IClientModel : IId { - string Fio { get; } - string Email { get; } - string Password { get; } + string Fio { get; set; } + string Email { get; set; } + string Password { get; set; } } } diff --git a/Bank/BankDataModels/Models/IOperationModel.cs b/Bank/BankDataModels/Models/IOperationModel.cs index a8efd01..d3870f8 100644 --- a/Bank/BankDataModels/Models/IOperationModel.cs +++ b/Bank/BankDataModels/Models/IOperationModel.cs @@ -8,9 +8,9 @@ namespace BankDataModels.Models { public interface IOperationModel : IId { - int sum { get; set; } + int Sum { get; set; } DateTime OperationTime { get; set; } - int SenderCardId { get; set; } + int? SenderCardId { get; set; } int RecipientCardId { get; set; } } }