Merge pull request 'stage5_models_and_storages_contracts_nikita' (#1) from stage5_models_and_storages_contracts_nikita into stage5_models_and_storages_contracts

Reviewed-on: #1
This commit is contained in:
ekallin 2024-04-27 10:40:53 +04:00
commit 49c23cc933
30 changed files with 309 additions and 0 deletions

View File

@ -0,0 +1,14 @@
using PolyclinicDataModels.Models;
namespace PolyclinicContracts.BindingModels
{
public class CourseBindingModel : ICourseModel
{
public int DaysCount { get; set; }
public int PillsPerDay { get; set; }
public string Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnosisModel> CourseDiagnosis { get; set; } = new();
public Dictionary<int, IRecipeModel> CourseRecipes { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using PolyclinicDataModels.Models;
namespace PolyclinicContracts.BindingModels
{
public class DiagnosisBindingModel : IDiagnosisModel
{
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public int ExecutorId { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using PolyclinicDataModels.Models;
namespace PolyclinicContracts.BindingModels
{
public class ExecutorBindingModel : IExecutorModel
{
public string FIO { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using PolyclinicDataModels.Models;
namespace PolyclinicContracts.BindingModels
{
public class SymptomBindingModel : ISymptomModel
{
public string Name { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnosisModel> SymptomDiagnosis { get; set; } = new();
public Dictionary<int, IRecipeModel> SymptomRecipes { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.BusinessLogicsContracts
{
public interface ICourseLogic
{
List<CourseViewModel>? ReadList(CourseSearchModel? model);
CourseViewModel? ReadElement(CourseSearchModel model);
bool Create(CourseBindingModel model);
bool Update(CourseBindingModel model);
bool Delete(CourseBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.BusinessLogicsContracts
{
public interface IDiagnosisLogic
{
List<DiagnosisViewModel>? ReadList(DiagnosisSearchModel? model);
DiagnosisViewModel? ReadElement(DiagnosisSearchModel model);
bool Create(DiagnosisBindingModel model);
bool Update(DiagnosisBindingModel model);
bool Delete(DiagnosisBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.BusinessLogicsContracts
{
public interface IExecutorLogic
{
List<ExecutorViewModel>? ReadList(ExecutorSearchModel? model);
ExecutorViewModel? ReadElement(ExecutorSearchModel model);
bool Create(ExecutorBindingModel model);
bool Update(ExecutorBindingModel model);
bool Delete(ExecutorBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.BusinessLogicsContracts
{
public interface ISymptomLogic
{
List<SymptomViewModel>? ReadList(SymptomSearchModel? model);
SymptomViewModel? ReadElement(SymptomSearchModel model);
bool Create(SymptomBindingModel model);
bool Update(SymptomBindingModel model);
bool Delete(SymptomBindingModel model);
}
}

View File

@ -0,0 +1,7 @@
namespace PolyclinicContracts.SearchModels
{
public class CourseSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,8 @@
namespace PolyclinicContracts.SearchModels
{
public class DiagnosisSearchModel
{
public int? Id { get; set; }
public int? ExecutorId { get; set; }
}
}

View File

@ -0,0 +1,9 @@
namespace PolyclinicContracts.SearchModels
{
public class ExecutorSearchModel
{
public int? Id { get; set; }
public string? Email { get; set; }
public string? Password { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace PolyclinicContracts.SearchModels
{
public class SymptomSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.StoragesContracts
{
public interface ICourseStorage
{
List<CourseViewModel> GetFullList();
List<CourseViewModel> GetFilteredList(CourseSearchModel model);
CourseViewModel? GetElement(CourseSearchModel model);
CourseViewModel? Insert(CourseBindingModel model);
CourseViewModel? Update(CourseBindingModel model);
CourseViewModel? Delete(CourseBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.StoragesContracts
{
public interface IDiagnosisStorage
{
List<DiagnosisViewModel> GetFullList();
List<DiagnosisViewModel> GetFilteredList(DiagnosisSearchModel model);
DiagnosisViewModel? GetElement(DiagnosisSearchModel model);
DiagnosisViewModel? Insert(DiagnosisBindingModel model);
DiagnosisViewModel? Update(DiagnosisBindingModel model);
DiagnosisViewModel? Delete(DiagnosisBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.StoragesContracts
{
public interface IExecutorStorage
{
List<ExecutorViewModel> GetFullList();
List<ExecutorViewModel> GetFilteredList(ExecutorSearchModel model);
ExecutorViewModel? GetElement(ExecutorSearchModel model);
ExecutorViewModel? Insert(ExecutorBindingModel model);
ExecutorViewModel? Update(ExecutorBindingModel model);
ExecutorViewModel? Delete(ExecutorBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using PolyclinicContracts.BindingModels;
using PolyclinicContracts.SearchModels;
using PolyclinicContracts.ViewModels;
namespace PolyclinicContracts.StoragesContracts
{
public interface ISymptomStorage
{
List<SymptomViewModel> GetFullList();
List<SymptomViewModel> GetFilteredList(SymptomSearchModel model);
SymptomViewModel? GetElement(SymptomSearchModel model);
SymptomViewModel? Insert(SymptomBindingModel model);
SymptomViewModel? Update(SymptomBindingModel model);
SymptomViewModel? Delete(SymptomBindingModel model);
}
}

View File

@ -0,0 +1,18 @@
using PolyclinicDataModels.Models;
using System.ComponentModel;
namespace PolyclinicContracts.ViewModels
{
public class CourseViewModel : ICourseModel
{
[DisplayName("Количество дней курса")]
public int DaysCount { get; set; }
[DisplayName("Препарата в день")]
public int PillsPerDay { get; set; }
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnosisModel> CourseDiagnosis { get; set; } = new();
public Dictionary<int, IRecipeModel> CourseRecipes { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicDataModels.Models;
using System.ComponentModel;
namespace PolyclinicContracts.ViewModels
{
public class DiagnosisViewModel : IDiagnosisModel
{
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public int ExecutorId { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using PolyclinicDataModels.Models;
using System.ComponentModel;
namespace PolyclinicContracts.ViewModels
{
public class ExecutorViewModel : IExecutorModel
{
[DisplayName("ФИО исполнителя")]
public string FIO { get; set; } = string.Empty;
[DisplayName("Email исполнителя")]
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using PolyclinicDataModels.Models;
using System.ComponentModel;
namespace PolyclinicContracts.ViewModels
{
public class SymptomViewModel : ISymptomModel
{
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Комментарий")]
public string Comment { get; set; } = string.Empty;
public Dictionary<int, IDiagnosisModel> SymptomDiagnosis { get; set; } = new();
public Dictionary<int, IRecipeModel> SymptomRecipes { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,11 @@
namespace PolyclinicDataModels.Models
{
public interface ICourseModel : IId
{
int DaysCount { get; }
int PillsPerDay { get; }
string Comment { get; }
Dictionary<int, IDiagnosisModel> CourseDiagnosis { get; }
Dictionary<int, IRecipeModel> CourseRecipes { get; }
}
}

View File

@ -0,0 +1,9 @@
namespace PolyclinicDataModels.Models
{
public interface IDiagnosisModel : IId
{
string Name { get; }
string Comment { get; }
int ExecutorId { get; }
}
}

View File

@ -0,0 +1,9 @@
namespace PolyclinicDataModels.Models
{
public interface IExecutorModel : IId
{
string FIO { get; }
string Email { get; }
string Password { get; }
}
}

View File

@ -0,0 +1,10 @@
namespace PolyclinicDataModels.Models
{
public interface ISymptomModel : IId
{
string Name { get; }
string Comment { get; }
Dictionary<int, IDiagnosisModel> SymptomDiagnosis { get; }
Dictionary<int, IRecipeModel> SymptomRecipes { get; }
}
}