scroogie models update
This commit is contained in:
parent
3ac33fa276
commit
c7e0c3823a
15
Contracts/BindingModels/MediaFileBindingModel.cs
Normal file
15
Contracts/BindingModels/MediaFileBindingModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BindingModels
|
||||
{
|
||||
public class MediaFileBindingModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public string Location { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
16
Contracts/BindingModels/ProductBindingModel.cs
Normal file
16
Contracts/BindingModels/ProductBindingModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BindingModels
|
||||
{
|
||||
public class ProductBindingModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public double Price { get; set; }
|
||||
public int Amount { get; set; }
|
||||
}
|
||||
}
|
14
Contracts/BindingModels/PurchaseBindingModel.cs
Normal file
14
Contracts/BindingModels/PurchaseBindingModel.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BindingModels
|
||||
{
|
||||
public class PurchaseBindingModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTime DatePurchase { get; set; }
|
||||
}
|
||||
}
|
13
Contracts/BindingModels/SellBindingModel.cs
Normal file
13
Contracts/BindingModels/SellBindingModel.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BindingModels
|
||||
{
|
||||
public class SellBindingModel
|
||||
{
|
||||
public DateTime DateSell { get; set; }
|
||||
}
|
||||
}
|
24
Contracts/BusinessLogicContracts/IEmployeeProductLogic.cs
Normal file
24
Contracts/BusinessLogicContracts/IEmployeeProductLogic.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using Contracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IEmployeeProductLogic
|
||||
{
|
||||
EmployeeProductViewModel Create(ProductBindingModel model);
|
||||
|
||||
EmployeeProductViewModel Update(ProductBindingModel model);
|
||||
|
||||
EmployeeProductViewModel ReadElement(ProductSearchModel model);
|
||||
|
||||
IEnumerable<EmployeeProductViewModel> ReadElements(ProductSearchModel? model);
|
||||
|
||||
EmployeeProductViewModel Delete(ProductSearchModel model);
|
||||
}
|
||||
}
|
24
Contracts/BusinessLogicContracts/IPurchaseLogic.cs
Normal file
24
Contracts/BusinessLogicContracts/IPurchaseLogic.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using Contracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IPurchaseLogic
|
||||
{
|
||||
PurchaseViewModel Create(PurchaseBindingModel model);
|
||||
|
||||
PurchaseViewModel Update(PurchaseBindingModel model);
|
||||
|
||||
PurchaseViewModel ReadElement(PurchaseSearchModel model);
|
||||
|
||||
IEnumerable<PurchaseViewModel> ReadElements(PurchaseSearchModel? model);
|
||||
|
||||
PurchaseViewModel Delete(PurchaseSearchModel model);
|
||||
}
|
||||
}
|
24
Contracts/BusinessLogicContracts/ISellLogic.cs
Normal file
24
Contracts/BusinessLogicContracts/ISellLogic.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using Contracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BusinessLogicContracts
|
||||
{
|
||||
public interface ISellLogic
|
||||
{
|
||||
SellViewModel Create(SellBindingModel model);
|
||||
|
||||
SellViewModel Update(SellBindingModel model);
|
||||
|
||||
SellViewModel ReadElement(SellSearchModel model);
|
||||
|
||||
IEnumerable<SellViewModel> ReadElements(SellSearchModel? model);
|
||||
|
||||
SellViewModel Delete(SellSearchModel model);
|
||||
}
|
||||
}
|
21
Contracts/BusinessLogicContracts/IUserProductLogic.cs
Normal file
21
Contracts/BusinessLogicContracts/IUserProductLogic.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using Contracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IUserProductLogic
|
||||
{
|
||||
|
||||
UserProductViewModel ReadElement(ProductSearchModel model);
|
||||
|
||||
IEnumerable<UserProductViewModel> ReadElements(ProductSearchModel? model);
|
||||
|
||||
UserProductViewModel Delete(ProductSearchModel model);
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DataModels\DataModels.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
16
Contracts/SearchModels/ProductSearchModel.cs
Normal file
16
Contracts/SearchModels/ProductSearchModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.SearchModels
|
||||
{
|
||||
public class ProductSearchModel
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public double? Price { get; set; }
|
||||
public double? Rate { get; set; }
|
||||
}
|
||||
}
|
20
Contracts/SearchModels/PurchaseSearchModel.cs
Normal file
20
Contracts/SearchModels/PurchaseSearchModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using DataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace Contracts.SearchModels
|
||||
{
|
||||
public class PurchaseSearchModel
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
public double? PriceFrom { get; set; }
|
||||
public double? PriceTo { get; set; }
|
||||
public PurchaseStatus? Status { get; set; }
|
||||
}
|
||||
}
|
16
Contracts/SearchModels/SellSearchModel.cs
Normal file
16
Contracts/SearchModels/SellSearchModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.SearchModels
|
||||
{
|
||||
public class SellSearchModel
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
public Guid? SupplyDocId { get; set; }
|
||||
}
|
||||
}
|
23
Contracts/StorageContracts/IProductStorage.cs
Normal file
23
Contracts/StorageContracts/IProductStorage.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.StorageContracts
|
||||
{
|
||||
public interface IProductStorage
|
||||
{
|
||||
ProductBindingModel? Insert(ProductBindingModel model);
|
||||
|
||||
IEnumerable<ProductBindingModel> GetList(ProductSearchModel? model);
|
||||
|
||||
ProductBindingModel? GetElement(ProductSearchModel model);
|
||||
|
||||
ProductBindingModel? Update(ProductBindingModel model);
|
||||
|
||||
ProductBindingModel? Delete(ProductSearchModel model);
|
||||
}
|
||||
}
|
23
Contracts/StorageContracts/IPurchaseStorage.cs
Normal file
23
Contracts/StorageContracts/IPurchaseStorage.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.StorageContracts
|
||||
{
|
||||
public interface IPurchaseStorage
|
||||
{
|
||||
PurchaseBindingModel? Insert(PurchaseBindingModel model);
|
||||
|
||||
IEnumerable<PurchaseBindingModel> GetList(PurchaseSearchModel? model);
|
||||
|
||||
PurchaseBindingModel? GetElement(PurchaseSearchModel model);
|
||||
|
||||
PurchaseBindingModel? Update(PurchaseBindingModel model);
|
||||
|
||||
PurchaseBindingModel? Delete(PurchaseSearchModel model);
|
||||
}
|
||||
}
|
23
Contracts/StorageContracts/ISellStorage.cs
Normal file
23
Contracts/StorageContracts/ISellStorage.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Contracts.BindingModels;
|
||||
using Contracts.SearchModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.StorageContracts
|
||||
{
|
||||
public interface ISellStorage
|
||||
{
|
||||
SellBindingModel? Insert(SellBindingModel model);
|
||||
|
||||
IEnumerable<SellBindingModel> GetList(SellSearchModel? model);
|
||||
|
||||
SellBindingModel? GetElement(SellSearchModel model);
|
||||
|
||||
SellBindingModel? Update(SellBindingModel model);
|
||||
|
||||
SellBindingModel? Delete(SellSearchModel model);
|
||||
}
|
||||
}
|
15
Contracts/ViewModels/EmployeeProductViewModel.cs
Normal file
15
Contracts/ViewModels/EmployeeProductViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.ViewModels
|
||||
{
|
||||
public class EmployeeProductViewModel
|
||||
{
|
||||
public Guid Guid { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public double Price { get; set; }
|
||||
}
|
||||
}
|
19
Contracts/ViewModels/PurchaseViewModel.cs
Normal file
19
Contracts/ViewModels/PurchaseViewModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using DataModels.Enums;
|
||||
using DataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.ViewModels
|
||||
{
|
||||
public class PurchaseViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public required IUser User { get; set; }
|
||||
public required List<IProduct> Products { get; set; }
|
||||
public PurchaseStatus Status { get; set; }
|
||||
}
|
||||
}
|
16
Contracts/ViewModels/SellViewModel.cs
Normal file
16
Contracts/ViewModels/SellViewModel.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using DataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.ViewModels
|
||||
{
|
||||
public class SellViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public DateTime SellDate { get; set; }
|
||||
public ISupplyDoc? SupplyDoc { get; set; }
|
||||
}
|
||||
}
|
15
Contracts/ViewModels/UserProductViewModel.cs
Normal file
15
Contracts/ViewModels/UserProductViewModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Contracts.ViewModels
|
||||
{
|
||||
public class UserProductViewModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public double Price { get; set; }
|
||||
public double Rate { get; set; }
|
||||
}
|
||||
}
|
15
DataModels/Enums/PurchaseStatus.cs
Normal file
15
DataModels/Enums/PurchaseStatus.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Enums
|
||||
{
|
||||
public enum PurchaseStatus
|
||||
{
|
||||
Unknown = -1,
|
||||
Processing = 0,
|
||||
Complited = 1
|
||||
}
|
||||
}
|
14
DataModels/Models/IMediaFile.cs
Normal file
14
DataModels/Models/IMediaFile.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Models
|
||||
{
|
||||
public interface IMediaFile
|
||||
{
|
||||
string Name { get; }
|
||||
string Location { get; }
|
||||
}
|
||||
}
|
17
DataModels/Models/IProduct.cs
Normal file
17
DataModels/Models/IProduct.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Models
|
||||
{
|
||||
public interface IProduct : IId
|
||||
{
|
||||
string Name { get; }
|
||||
double Price { get; }
|
||||
bool IBeingSold { get; }
|
||||
public double Rate { get; }
|
||||
int Amount { get; }
|
||||
}
|
||||
}
|
15
DataModels/Models/IPurchase.cs
Normal file
15
DataModels/Models/IPurchase.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using DataModels.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Models
|
||||
{
|
||||
public interface IPurchase : IId
|
||||
{
|
||||
DateTime DatePurchase { get; }
|
||||
PurchaseStatus Status { get; }
|
||||
}
|
||||
}
|
13
DataModels/Models/ISell.cs
Normal file
13
DataModels/Models/ISell.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Models
|
||||
{
|
||||
public interface ISell : IId
|
||||
{
|
||||
DateTime DateSell { get; }
|
||||
}
|
||||
}
|
13
DataModels/Models/ISupplyDoc.cs
Normal file
13
DataModels/Models/ISupplyDoc.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DataModels.Models
|
||||
{
|
||||
public interface ISupplyDoc : IId
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
18
DatabaseImplement/Models/MediaFile.cs
Normal file
18
DatabaseImplement/Models/MediaFile.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using DataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatabaseImplement.Models
|
||||
{
|
||||
public class MediaFile : IMediaFile
|
||||
{
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public string Location { get; set; }
|
||||
}
|
||||
}
|
12
DatabaseImplement/Models/Product.cs
Normal file
12
DatabaseImplement/Models/Product.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatabaseImplement.Models
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
}
|
||||
}
|
21
DatabaseImplement/Models/Purchase.cs
Normal file
21
DatabaseImplement/Models/Purchase.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using DataModels.Enums;
|
||||
using DataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatabaseImplement.Models
|
||||
{
|
||||
public class Purchase : IPurchase
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[Required]
|
||||
public DateTime DatePurchase { get; set; }
|
||||
[Required]
|
||||
public PurchaseStatus Status { get; private set; } = PurchaseStatus.Unknown;
|
||||
|
||||
}
|
||||
}
|
12
DatabaseImplement/Models/Sell.cs
Normal file
12
DatabaseImplement/Models/Sell.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DatabaseImplement.Models
|
||||
{
|
||||
internal class Sell
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user