From 765933f1de19ff413768dcee9b6b3df990f4fbcf Mon Sep 17 00:00:00 2001 From: Ivan Gutorov Date: Sun, 16 Feb 2025 05:17:18 +0400 Subject: [PATCH] add storages --- .../IComponentStorageContract.cs | 20 +++++++++++++++++ .../IEmployeeStorageContract.cs | 22 +++++++++++++++++++ .../IInstallationStorageContract.cs | 15 +++++++++++++ .../StoragesContracts/IPostStorageContract.cs | 22 +++++++++++++++++++ .../ISalaryStorageContract.cs | 11 ++++++++++ 5 files changed, 90 insertions(+) create mode 100644 TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IComponentStorageContract.cs create mode 100644 TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IEmployeeStorageContract.cs create mode 100644 TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IInstallationStorageContract.cs create mode 100644 TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IPostStorageContract.cs create mode 100644 TheCyclopsProject/TheCyclopsContracts/StoragesContracts/ISalaryStorageContract.cs diff --git a/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IComponentStorageContract.cs b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IComponentStorageContract.cs new file mode 100644 index 0000000..27c37e0 --- /dev/null +++ b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IComponentStorageContract.cs @@ -0,0 +1,20 @@ +using TheCyclopsContracts.DataModels; + +namespace TheCyclopsContracts.StoragesContracts; + +public interface IComponentStorageContract +{ + List GetList(bool onlyActive = true); + + List GetHistoryByProductId(string componentId); + + ComponentDataModel? GetElementById(string id); + + ComponentDataModel? GetElementByName(string name); + + void AddElement(ComponentDataModel componentDataModel); + + void UpdElement(ComponentDataModel componentDataModel); + + void DelElement(string id); +} diff --git a/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IEmployeeStorageContract.cs b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IEmployeeStorageContract.cs new file mode 100644 index 0000000..8922357 --- /dev/null +++ b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IEmployeeStorageContract.cs @@ -0,0 +1,22 @@ +using TheCyclopsContracts.DataModels; + +namespace TheCyclopsContracts.StoragesContracts; + +public interface IEmployeeStorageContract +{ + List GetList(bool onlyActive = true, string? postId = null, + DateTime? fromBirthDate = null, DateTime? toBirthDate = null, + DateTime? fromEmploymentDate = null, DateTime? toEmploymentDate = null); + + EmployeeDataModel? GetElementById(string id); + + EmployeeDataModel? GetElementByFIO(string fio); + + EmployeeDataModel? GetElementByEmail(string email); + + void AddElement(EmployeeDataModel employeeDataModel); + + void UpdElement(EmployeeDataModel employeeDataModel); + + void DelElement(string id); +} diff --git a/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IInstallationStorageContract.cs b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IInstallationStorageContract.cs new file mode 100644 index 0000000..041ee26 --- /dev/null +++ b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IInstallationStorageContract.cs @@ -0,0 +1,15 @@ +using TheCyclopsContracts.DataModels; + +namespace TheCyclopsContracts.StoragesContracts; + +public interface IInstallationStorageContract +{ + List GetList(DateTime? startDate = null, DateTime? endDate = null, + string? employeeId = null, string? productId = null); + + InstallationDataModel? GetElementById(string id); + + void AddElement(InstallationDataModel installationDataModel); + + void DelElement(string id); +} diff --git a/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IPostStorageContract.cs b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IPostStorageContract.cs new file mode 100644 index 0000000..38db2ef --- /dev/null +++ b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/IPostStorageContract.cs @@ -0,0 +1,22 @@ +using TheCyclopsContracts.DataModels; + +namespace TheCyclopsContracts.StoragesContracts; + +public interface IPostStorageContract +{ + List GetList(bool onlyActual = true); + + List GetPostWithHistory(string postId); + + PostDataModel? GetElementById(string id); + + PostDataModel? GetElementByName(string name); + + void AddElement(PostDataModel postDataModel); + + void UpdElement(PostDataModel postDataModel); + + void DelElement(string id); + + void ResElement(string id); +} diff --git a/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/ISalaryStorageContract.cs b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/ISalaryStorageContract.cs new file mode 100644 index 0000000..402ea53 --- /dev/null +++ b/TheCyclopsProject/TheCyclopsContracts/StoragesContracts/ISalaryStorageContract.cs @@ -0,0 +1,11 @@ +using TheCyclopsContracts.DataModels; + +namespace TheCyclopsContracts.StoragesContracts; + +public interface ISalaryStorageContract +{ + List GetList(DateTime startDate, DateTime endDate, + string? employeeId = null); + + void AddElement(SalaryDataModel salaryDataModel); +}