Половина контрактов

This commit is contained in:
Artyom_Yashin 2024-04-25 21:31:07 +04:00
parent 474d2f91be
commit 2b05baa78a
23 changed files with 406 additions and 11 deletions

View File

@ -7,11 +7,7 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="BindingModels\" />
<Folder Include="ViewModels\" />
<Folder Include="SearchModels\" />
<Folder Include="BusinessLogicsContracts\" />
<Folder Include="StoragesContracts\" />
<ProjectReference Include="..\BankDataModels\BankDataModels.csproj" />
</ItemGroup>
</Project>

View 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; }
}
}

View 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;
}
}

View 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; }
}
}

View 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; }
}
}

View 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);
}
}

View 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);
}
}

View 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 IOperationLogic
{
List<OperationViewModel>? ReadList(OperationSearchModel? model);
OperationViewModel? ReadElement(OperationSearchModel model);
bool Create(OperationBindingModel model);
bool Update(OperationBindingModel model);
bool Delete(OperationBindingModel model);
}
}

View 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);
}
}

View 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; }
}
}

View 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; }
}
}

View 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; }
}
}

View 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; }
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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; }
}
}

View File

@ -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; }
}
}

View File

@ -6,11 +6,11 @@ using System.Threading.Tasks;
namespace BankDataModels.Models
{
public interface IOperationModel
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; }
}
}