?
This commit is contained in:
commit
dc975e0bd4
@ -7,6 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BankDataModels\BankDataModels.csproj" />
|
||||
<Folder Include="BisnessLogicsContracts\" />
|
||||
<Folder Include="StoragesContracts\" />
|
||||
</ItemGroup>
|
||||
|
21
Bank/BankContracts/BindingModels/CardBindingModel.cs
Normal file
21
Bank/BankContracts/BindingModels/CardBindingModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
17
Bank/BankContracts/BindingModels/ClientBindingModel.cs
Normal file
17
Bank/BankContracts/BindingModels/ClientBindingModel.cs
Normal file
@ -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;
|
||||
}
|
||||
}
|
18
Bank/BankContracts/BindingModels/OperationBindingModel.cs
Normal file
18
Bank/BankContracts/BindingModels/OperationBindingModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
17
Bank/BankContracts/BindingModels/RequestBindingModel.cs
Normal file
17
Bank/BankContracts/BindingModels/RequestBindingModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
20
Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs
Normal file
20
Bank/BankContracts/BusinessLogicsContracts/ICardLogic.cs
Normal file
@ -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<CardViewModel>? ReadList(CardSearchModel? model);
|
||||
CardViewModel? ReadElement(CardSearchModel model);
|
||||
bool Create(CardBindingModel model);
|
||||
bool Update(CardBindingModel model);
|
||||
bool Delete(CardBindingModel model);
|
||||
}
|
||||
}
|
20
Bank/BankContracts/BusinessLogicsContracts/IClientLogic.cs
Normal file
20
Bank/BankContracts/BusinessLogicsContracts/IClientLogic.cs
Normal file
@ -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<ClientViewModel>? ReadList(ClientSearchModel? model);
|
||||
ClientViewModel? ReadElement(ClientSearchModel model);
|
||||
bool Create(ClientBindingModel model);
|
||||
bool Update(ClientBindingModel model);
|
||||
bool Delete(ClientBindingModel model);
|
||||
}
|
||||
}
|
@ -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<OperationViewModel>? ReadList(OperationSearchModel? model);
|
||||
OperationViewModel? ReadElement(OperationSearchModel model);
|
||||
bool Create(OperationBindingModel model);
|
||||
bool Update(OperationBindingModel model);
|
||||
bool Delete(OperationBindingModel model);
|
||||
}
|
||||
}
|
22
Bank/BankContracts/BusinessLogicsContracts/IRequestLogic.cs
Normal file
22
Bank/BankContracts/BusinessLogicsContracts/IRequestLogic.cs
Normal file
@ -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<RequestViewModel>? 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);
|
||||
}
|
||||
}
|
15
Bank/BankContracts/SearchModels/CardSearchModel.cs
Normal file
15
Bank/BankContracts/SearchModels/CardSearchModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
16
Bank/BankContracts/SearchModels/ClientSearchModel.cs
Normal file
16
Bank/BankContracts/SearchModels/ClientSearchModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
15
Bank/BankContracts/SearchModels/OperationSearchModel.cs
Normal file
15
Bank/BankContracts/SearchModels/OperationSearchModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
16
Bank/BankContracts/SearchModels/RequestSearchModel.cs
Normal file
16
Bank/BankContracts/SearchModels/RequestSearchModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
21
Bank/BankContracts/StoragesContracts/ICardStorage.cs
Normal file
21
Bank/BankContracts/StoragesContracts/ICardStorage.cs
Normal file
@ -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<CardViewModel> GetFullList();
|
||||
List<CardViewModel> GetFilteredList(CardSearchModel model);
|
||||
CardViewModel? GetElement(CardSearchModel model);
|
||||
CardViewModel? Insert(CardBindingModel model);
|
||||
CardViewModel? Update(CardBindingModel model);
|
||||
CardViewModel? Delete(CardBindingModel model);
|
||||
}
|
||||
}
|
21
Bank/BankContracts/StoragesContracts/IClientStorage.cs
Normal file
21
Bank/BankContracts/StoragesContracts/IClientStorage.cs
Normal file
@ -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<ClientViewModel> GetFullList();
|
||||
List<ClientViewModel> GetFilteredList(ClientSearchModel model);
|
||||
ClientViewModel? GetElement(ClientSearchModel model);
|
||||
ClientViewModel? Insert(ClientBindingModel model);
|
||||
ClientViewModel? Update(ClientBindingModel model);
|
||||
ClientViewModel? Delete(ClientBindingModel model);
|
||||
}
|
||||
}
|
21
Bank/BankContracts/StoragesContracts/IOperationStorage.cs
Normal file
21
Bank/BankContracts/StoragesContracts/IOperationStorage.cs
Normal file
@ -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<OperationViewModel> GetFullList();
|
||||
List<OperationViewModel> GetFilteredList(OperationSearchModel model);
|
||||
OperationViewModel? GetElement(OperationSearchModel model);
|
||||
OperationViewModel? Insert(OperationBindingModel model);
|
||||
OperationViewModel? Update(OperationBindingModel model);
|
||||
OperationViewModel? Delete(OperationBindingModel model);
|
||||
}
|
||||
}
|
21
Bank/BankContracts/StoragesContracts/IRequestStorage.cs
Normal file
21
Bank/BankContracts/StoragesContracts/IRequestStorage.cs
Normal file
@ -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<RequestViewModel> GetFullList();
|
||||
List<RequestViewModel> GetFilteredList(RequestSearchModel model);
|
||||
RequestViewModel? GetElement(RequestSearchModel model);
|
||||
RequestViewModel? Insert(RequestBindingModel model);
|
||||
RequestViewModel? Update(RequestBindingModel model);
|
||||
RequestViewModel? Delete(RequestBindingModel model);
|
||||
}
|
||||
}
|
31
Bank/BankContracts/ViewModels/CardViewModel.cs
Normal file
31
Bank/BankContracts/ViewModels/CardViewModel.cs
Normal file
@ -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;
|
||||
}
|
||||
}
|
21
Bank/BankContracts/ViewModels/ClientViewModel.cs
Normal file
21
Bank/BankContracts/ViewModels/ClientViewModel.cs
Normal file
@ -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;
|
||||
}
|
||||
}
|
25
Bank/BankContracts/ViewModels/OperationViewModel.cs
Normal file
25
Bank/BankContracts/ViewModels/OperationViewModel.cs
Normal file
@ -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;
|
||||
}
|
||||
}
|
21
Bank/BankContracts/ViewModels/RequestViewModel.cs
Normal file
21
Bank/BankContracts/ViewModels/RequestViewModel.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user