Switch product to sushi

This commit is contained in:
Viltskaa 2023-01-30 18:27:32 +04:00
parent a87d95c92b
commit 3e25205bf6
13 changed files with 61 additions and 61 deletions

View File

@ -6,7 +6,7 @@ namespace SushiBarContracts.BindingModels
public class OrderBindingModel : IOrderModel
{
public int Id { get; set; }
public int ProductId { get; set; }
public int SushiId { get; set; }
public int Count { get; set; }
public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Unknown;

View File

@ -1,12 +0,0 @@
using SushiBarDataModels.Models;
namespace SushiBarContracts.BindingModels
{
public class ProductBindingModel : IProductModel
{
public int Id { get; set; }
public string ProductName { get; set; } = string.Empty;
public double Price { get; set; }
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
}
}

View File

@ -0,0 +1,12 @@
using SushiBarDataModels.Models;
namespace SushiBarContracts.BindingModels
{
public class SushiBindingModel : ISushiModel
{
public int Id { get; set; }
public string SushiName { get; set; } = string.Empty;
public double Price { get; set; }
public Dictionary<int, (IComponentModel, int)> SushiComponents { get; set; } = new();
}
}

View File

@ -1,15 +0,0 @@
using SushiBarContracts.BindingModels;
using SushiBarContracts.SearchModels;
using SushiBarContracts.ViewModels;
namespace SushiBarContracts.BusinessLogicsContracts
{
public interface IProductLogic
{
List<ProductViewModel>? ReadList(ProductSearchModel? model);
ProductViewModel? ReadElement(ProductSearchModel model);
bool Create(ProductBindingModel model);
bool Update(ProductBindingModel model);
bool Delete(ProductBindingModel model);
}
}

View File

@ -0,0 +1,15 @@
using SushiBarContracts.BindingModels;
using SushiBarContracts.SearchModels;
using SushiBarContracts.ViewModels;
namespace SushiBarContracts.BusinessLogicsContracts
{
public interface ISushiLogic
{
List<SushiViewModel>? ReadList(SushiSearchModel? model);
SushiViewModel? ReadElement(SushiSearchModel model);
bool Create(SushiBindingModel model);
bool Update(SushiBindingModel model);
bool Delete(SushiBindingModel model);
}
}

View File

@ -1,8 +1,8 @@
namespace SushiBarContracts.SearchModels
{
public class ProductSearchModel
public class SushiSearchModel
{
public int? Id { get; set; }
public string? ProductName { get; set; }
public string? SushiName { get; set; }
}
}

View File

@ -1,16 +0,0 @@
using SushiBarContracts.BindingModels;
using SushiBarContracts.SearchModels;
using SushiBarContracts.ViewModels;
namespace SushiBarContracts.StoragesContracts
{
public interface IProductStorage
{
List<ProductViewModel> GetFullList();
List<ProductViewModel> GetFilteredList(ProductSearchModel model);
ProductViewModel? GetElement(ProductSearchModel model);
ProductViewModel? Insert(ProductBindingModel model);
ProductViewModel? Update(ProductBindingModel model);
ProductViewModel? Delete(ProductBindingModel model);
}
}

View File

@ -0,0 +1,16 @@
using SushiBarContracts.BindingModels;
using SushiBarContracts.SearchModels;
using SushiBarContracts.ViewModels;
namespace SushiBarContracts.StoragesContracts
{
public interface ISushiStorage
{
List<SushiViewModel> GetFullList();
List<SushiViewModel> GetFilteredList(SushiSearchModel model);
SushiViewModel? GetElement(SushiSearchModel model);
SushiViewModel? Insert(SushiBindingModel model);
SushiViewModel? Update(SushiBindingModel model);
SushiViewModel? Delete(SushiBindingModel model);
}
}

View File

@ -8,10 +8,10 @@ namespace SushiBarContracts.ViewModels
{
[DisplayName("Number")]
public int Id { get; set; }
public int ProductId { get; set; }
public int SushiId { get; set; }
[DisplayName("Product")]
public string ProductName { get; set; } = string.Empty;
public string SushiName { get; set; } = string.Empty;
[DisplayName("Count")]
public int Count { get; set; }

View File

@ -3,15 +3,15 @@ using System.ComponentModel;
namespace SushiBarContracts.ViewModels
{
public class ProductViewModel : IProductModel
public class SushiViewModel : ISushiModel
{
public int Id { get; set; }
[DisplayName("Name of Product")]
public string ProductName { get; set; } = string.Empty;
public string SushiName { get; set; } = string.Empty;
[DisplayName("Cost")]
public double Price { get; set; }
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
public Dictionary<int, (IComponentModel, int)> SushiComponents { get; set; } = new();
}
}

View File

@ -4,7 +4,7 @@ namespace SushiBarDataModels.Models
{
public interface IOrderModel : IId
{
int ProductId { get; }
int SushiId { get; }
int Count { get; }
double Sum { get; }
OrderStatus Status { get; }

View File

@ -1,9 +0,0 @@
namespace SushiBarDataModels.Models
{
public interface IProductModel : IId
{
string ProductName { get; }
double Price { get; }
Dictionary<int, (IComponentModel, int)> ProductComponents { get; }
}
}

View File

@ -0,0 +1,9 @@
namespace SushiBarDataModels.Models
{
public interface ISushiModel : IId
{
string SushiName { get; }
double Price { get; }
Dictionary<int, (IComponentModel, int)> SushiComponents { get; }
}
}