From b3db89edd4822d9a91a8b5b2011a390007dc8131 Mon Sep 17 00:00:00 2001
From: MaxKarme <91691525+MaxKarme@users.noreply.github.com>
Date: Fri, 24 Mar 2023 21:34:28 +0400
Subject: [PATCH] contracts layer
---
.../BindingModels/ReportBindingModel.cs | 9 +++++
.../BusinessLogicsContracts/IReportLogic.cs | 35 +++++++++++++++++++
.../SearchModels/OrderSearchModel.cs | 2 ++
.../ViewModels/ReportOrdersViewModel.cs | 10 ++++++
.../ReportPizzaComponentViewModel.cs | 9 +++++
.../PizzeriaContracts/ViewModels/WordInfo.cs | 12 +++++++
6 files changed, 77 insertions(+)
create mode 100644 Pizzeria/PizzeriaContracts/BindingModels/ReportBindingModel.cs
create mode 100644 Pizzeria/PizzeriaContracts/BusinessLogicsContracts/IReportLogic.cs
create mode 100644 Pizzeria/PizzeriaContracts/ViewModels/ReportOrdersViewModel.cs
create mode 100644 Pizzeria/PizzeriaContracts/ViewModels/ReportPizzaComponentViewModel.cs
create mode 100644 Pizzeria/PizzeriaContracts/ViewModels/WordInfo.cs
diff --git a/Pizzeria/PizzeriaContracts/BindingModels/ReportBindingModel.cs b/Pizzeria/PizzeriaContracts/BindingModels/ReportBindingModel.cs
new file mode 100644
index 0000000..3a6a68a
--- /dev/null
+++ b/Pizzeria/PizzeriaContracts/BindingModels/ReportBindingModel.cs
@@ -0,0 +1,9 @@
+namespace PizzeriaContracts.BindingModels
+{
+ public class ReportBindingModel
+ {
+ public string FileName { get; set; } = string.Empty;
+ public DateTime? DateFrom { get; set; }
+ public DateTime? DateTo { get; set; }
+ }
+}
diff --git a/Pizzeria/PizzeriaContracts/BusinessLogicsContracts/IReportLogic.cs b/Pizzeria/PizzeriaContracts/BusinessLogicsContracts/IReportLogic.cs
new file mode 100644
index 0000000..c09d455
--- /dev/null
+++ b/Pizzeria/PizzeriaContracts/BusinessLogicsContracts/IReportLogic.cs
@@ -0,0 +1,35 @@
+using PizzeriaContracts.BindingModels;
+using PizzeriaContracts.ViewModels;
+using System.Collections.Generic;
+namespace PizzeriaContracts.BusinessLogicsContracts
+{
+ public interface IReportLogic
+ {
+ ///
+ /// Получение списка компонент с указанием, в каких изделиях используются
+ ///
+ ///
+ List GetPizzaComponent();
+ ///
+ /// Получение списка заказов за определенный период
+ ///
+ ///
+ ///
+ List GetOrders(ReportBindingModel model);
+ ///
+ /// Сохранение компонент в файл-Word
+ ///
+ ///
+ void SaveComponentsToWordFile(ReportBindingModel model);
+ ///
+ /// Сохранение компонент с указаеним продуктов в файл-Excel
+ ///
+ ///
+ void SavePizzaComponentToExcelFile(ReportBindingModel model);
+ ///
+ /// Сохранение заказов в файл-Pdf
+ ///
+ ///
+ void SaveOrdersToPdfFile(ReportBindingModel model);
+ }
+}
diff --git a/Pizzeria/PizzeriaContracts/SearchModels/OrderSearchModel.cs b/Pizzeria/PizzeriaContracts/SearchModels/OrderSearchModel.cs
index 3695879..b2e6ddd 100644
--- a/Pizzeria/PizzeriaContracts/SearchModels/OrderSearchModel.cs
+++ b/Pizzeria/PizzeriaContracts/SearchModels/OrderSearchModel.cs
@@ -9,5 +9,7 @@ namespace PizzeriaContracts.SearchModels
public class OrderSearchModel
{
public int? Id { get; set; }
+ public DateTime? DateFrom { get; set; }
+ public DateTime? DateTo { get; set; }
}
}
diff --git a/Pizzeria/PizzeriaContracts/ViewModels/ReportOrdersViewModel.cs b/Pizzeria/PizzeriaContracts/ViewModels/ReportOrdersViewModel.cs
new file mode 100644
index 0000000..2b1f3c1
--- /dev/null
+++ b/Pizzeria/PizzeriaContracts/ViewModels/ReportOrdersViewModel.cs
@@ -0,0 +1,10 @@
+namespace PizzeriaContracts.ViewModels
+{
+ public class ReportOrdersViewModel
+ {
+ public int Id { get; set; }
+ public DateTime DateCreate { get; set; }
+ public string PizzaName { get; set; } = string.Empty;
+ public double Sum { get; set; }
+ }
+}
diff --git a/Pizzeria/PizzeriaContracts/ViewModels/ReportPizzaComponentViewModel.cs b/Pizzeria/PizzeriaContracts/ViewModels/ReportPizzaComponentViewModel.cs
new file mode 100644
index 0000000..e96bf04
--- /dev/null
+++ b/Pizzeria/PizzeriaContracts/ViewModels/ReportPizzaComponentViewModel.cs
@@ -0,0 +1,9 @@
+namespace PizzeriaContracts.ViewModels
+{
+ public class ReportPizzaComponentViewModel
+ {
+ public string ComponentName { get; set; } = string.Empty;
+ public int TotalCount { get; set; }
+ public List> Pizzas { get; set; } = new();
+ }
+}
diff --git a/Pizzeria/PizzeriaContracts/ViewModels/WordInfo.cs b/Pizzeria/PizzeriaContracts/ViewModels/WordInfo.cs
new file mode 100644
index 0000000..76306d2
--- /dev/null
+++ b/Pizzeria/PizzeriaContracts/ViewModels/WordInfo.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PizzeriaContracts.ViewModels
+{
+ internal class WordInfo
+ {
+ }
+}