Реализованны модели для роли "Работник", также добавлен пользователь, в качестве ролей пользователя используется перечисления (возможно потом будет что-то другое)
This commit is contained in:
parent
796038e7e3
commit
995cc92189
11
HardwareShop/HardwareShopDataModels/Enums/PurchaseStatus.cs
Normal file
11
HardwareShop/HardwareShopDataModels/Enums/PurchaseStatus.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace FoodOrdersDataModels.Enums
|
||||
{
|
||||
public enum PurchaseStatus
|
||||
{
|
||||
Неизвестен = -1,
|
||||
Принят = 0,
|
||||
Выполняется = 1,
|
||||
Готов = 2,
|
||||
Выдан = 3
|
||||
}
|
||||
}
|
14
HardwareShop/HardwareShopDataModels/Enums/UserRole.cs
Normal file
14
HardwareShop/HardwareShopDataModels/Enums/UserRole.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HardwareShopDataModels.Enums
|
||||
{
|
||||
public enum UserRole
|
||||
{
|
||||
Работник = 1,
|
||||
Кладовщик = 2,
|
||||
}
|
||||
}
|
7
HardwareShop/HardwareShopDataModels/IId.cs
Normal file
7
HardwareShop/HardwareShopDataModels/IId.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace HardwareShopDataModels
|
||||
{
|
||||
public interface IId
|
||||
{
|
||||
int Id { get; }
|
||||
}
|
||||
}
|
18
HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs
Normal file
18
HardwareShop/HardwareShopDataModels/Models/IBuildModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using FoodOrdersDataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface IBuildModel
|
||||
{
|
||||
decimal Price { get; }
|
||||
|
||||
string BuildName { get; }
|
||||
|
||||
int UserID { get; }
|
||||
}
|
||||
}
|
16
HardwareShop/HardwareShopDataModels/Models/IClientModel.cs
Normal file
16
HardwareShop/HardwareShopDataModels/Models/IClientModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using HardwareShopDataModels;
|
||||
using HardwareShopDataModels.Enums;
|
||||
|
||||
namespace FoodOrdersDataModels.Models
|
||||
{
|
||||
public interface IClientModel : IId
|
||||
{
|
||||
string Login { get; }
|
||||
|
||||
string Email { get; }
|
||||
|
||||
string Password { get; }
|
||||
|
||||
UserRole Role { get; }
|
||||
}
|
||||
}
|
15
HardwareShop/HardwareShopDataModels/Models/ICommentModel.cs
Normal file
15
HardwareShop/HardwareShopDataModels/Models/ICommentModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface ICommentModel
|
||||
{
|
||||
string Text { get; }
|
||||
|
||||
int BuildID { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface IComponentModel
|
||||
{
|
||||
}
|
||||
}
|
12
HardwareShop/HardwareShopDataModels/Models/IGoodModel.cs
Normal file
12
HardwareShop/HardwareShopDataModels/Models/IGoodModel.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface IGoodModel
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface IOrderModel : IId
|
||||
{
|
||||
}
|
||||
}
|
20
HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs
Normal file
20
HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using FoodOrdersDataModels.Enums;
|
||||
|
||||
namespace HardwareShopDataModels.Models
|
||||
{
|
||||
public interface IPurchaseModel : IId
|
||||
{
|
||||
decimal Sum { get; }
|
||||
|
||||
PurchaseStatus Status { get; }
|
||||
|
||||
//через "?" обозначается что поле может быть null
|
||||
DateTime? DatePurchase { get; }
|
||||
|
||||
int UserID { get; }
|
||||
|
||||
Dictionary<int, (IBuildModel, int)>? PurchaseBuilds { get; }
|
||||
|
||||
Dictionary<int, (IGoodModel, int)> PurchaseGoods { get; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user