contracts layer

This commit is contained in:
MaxKarme 2023-03-24 21:34:28 +04:00
parent 49e5b6634d
commit b3db89edd4
6 changed files with 77 additions and 0 deletions

View File

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

View File

@ -0,0 +1,35 @@
using PizzeriaContracts.BindingModels;
using PizzeriaContracts.ViewModels;
using System.Collections.Generic;
namespace PizzeriaContracts.BusinessLogicsContracts
{
public interface IReportLogic
{
/// <summary>
/// Получение списка компонент с указанием, в каких изделиях используются
/// </summary>
/// <returns></returns>
List<ReportPizzaComponentViewModel> GetPizzaComponent();
/// <summary>
/// Получение списка заказов за определенный период
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
List<ReportOrdersViewModel> GetOrders(ReportBindingModel model);
/// <summary>
/// Сохранение компонент в файл-Word
/// </summary>
/// <param name="model"></param>
void SaveComponentsToWordFile(ReportBindingModel model);
/// <summary>
/// Сохранение компонент с указаеним продуктов в файл-Excel
/// </summary>
/// <param name="model"></param>
void SavePizzaComponentToExcelFile(ReportBindingModel model);
/// <summary>
/// Сохранение заказов в файл-Pdf
/// </summary>
/// <param name="model"></param>
void SaveOrdersToPdfFile(ReportBindingModel model);
}
}

View File

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

View File

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

View File

@ -0,0 +1,9 @@
namespace PizzeriaContracts.ViewModels
{
public class ReportPizzaComponentViewModel
{
public string ComponentName { get; set; } = string.Empty;
public int TotalCount { get; set; }
public List<Tuple<string, int>> Pizzas { get; set; } = new();
}
}

View File

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