diff --git a/Contracts/BindingModels/MediaFileBindingModel.cs b/Contracts/BindingModels/MediaFileBindingModel.cs index 656354a..dfa6386 100644 --- a/Contracts/BindingModels/MediaFileBindingModel.cs +++ b/Contracts/BindingModels/MediaFileBindingModel.cs @@ -1,4 +1,5 @@ -using System; +using DataModels.Models; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,10 +7,11 @@ using System.Threading.Tasks; namespace Contracts.BindingModels { - public class MediaFileBindingModel + public class MediaFileBindingModel : IMediaFile { public Guid Id { get; set; } public Guid ProductId { get; set; } + public string Name { get; set; } = string.Empty; public string Location { get; set; } = string.Empty; } } diff --git a/Contracts/BindingModels/ProductBindingModel.cs b/Contracts/BindingModels/ProductBindingModel.cs index 6be324e..8f44dbd 100644 --- a/Contracts/BindingModels/ProductBindingModel.cs +++ b/Contracts/BindingModels/ProductBindingModel.cs @@ -1,4 +1,5 @@ -using System; +using DataModels.Models; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,11 +7,13 @@ using System.Threading.Tasks; namespace Contracts.BindingModels { - public class ProductBindingModel + public class ProductBindingModel : IProduct { public Guid Id { get; set; } public string Name { get; set; } = string.Empty; public double Price { get; set; } public int Amount { get; set; } + public bool IsBeingSold { get; set; } + public double Rate { get; set; } } } diff --git a/Contracts/BindingModels/SupplierBindingModel.cs b/Contracts/BindingModels/SupplierBindingModel.cs new file mode 100644 index 0000000..20c9701 --- /dev/null +++ b/Contracts/BindingModels/SupplierBindingModel.cs @@ -0,0 +1,17 @@ +using DataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModels +{ + public class SupplierBindingModel : ISupplier + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public Dictionary AvailibleProducts { get; set; } = new(); + public int Deals { get; set; } = 0; + } +} diff --git a/Contracts/BindingModels/SupplyBindingModel.cs b/Contracts/BindingModels/SupplyBindingModel.cs new file mode 100644 index 0000000..9611abc --- /dev/null +++ b/Contracts/BindingModels/SupplyBindingModel.cs @@ -0,0 +1,20 @@ +using DataModels.Enums; +using DataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModels +{ + internal class SupplyBindingModel : ISupply + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public DateTime Date { get; set; } + public double Price { get; set; } + public SupplyStatus Status { get; set; } + public Dictionary SupplyProducts { get; set; } = new(); + } +} diff --git a/Contracts/BindingModels/SupplyDocBindingModel.cs b/Contracts/BindingModels/SupplyDocBindingModel.cs new file mode 100644 index 0000000..8767a72 --- /dev/null +++ b/Contracts/BindingModels/SupplyDocBindingModel.cs @@ -0,0 +1,17 @@ +using DataModels.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Contracts.BindingModels +{ + public class SupplyDocBindingModel : ISupplyDoc + { + public Guid Id { get; set; } + public string Name { get; set; } = string.Empty; + public Guid SupplyId { get; set; } + + } +} diff --git a/DataModels/Enums/SupplyStatus.cs b/DataModels/Enums/SupplyStatus.cs new file mode 100644 index 0000000..fad035a --- /dev/null +++ b/DataModels/Enums/SupplyStatus.cs @@ -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 SupplyStatus + { + Pending = -1, + Arriving = 0, + Completed = 1 + } +} diff --git a/DataModels/Models/IMediaFile.cs b/DataModels/Models/IMediaFile.cs index 34eec99..d4db8bd 100644 --- a/DataModels/Models/IMediaFile.cs +++ b/DataModels/Models/IMediaFile.cs @@ -6,9 +6,10 @@ using System.Threading.Tasks; namespace DataModels.Models { - public interface IMediaFile + public interface IMediaFile : IId { string Name { get; } string Location { get; } + Guid ProductId { get; } } } diff --git a/DataModels/Models/IProduct.cs b/DataModels/Models/IProduct.cs index b263796..bfb12c0 100644 --- a/DataModels/Models/IProduct.cs +++ b/DataModels/Models/IProduct.cs @@ -10,8 +10,10 @@ namespace DataModels.Models { string Name { get; } double Price { get; } - bool IBeingSold { get; } + bool IsBeingSold { get; } public double Rate { get; } int Amount { get; } + // будут браться через mediafilestorage так что скорее всего это тут не надо + // List MediaFiles { get; } } } diff --git a/DataModels/Models/ISupplier.cs b/DataModels/Models/ISupplier.cs new file mode 100644 index 0000000..d2ac2e2 --- /dev/null +++ b/DataModels/Models/ISupplier.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataModels.Models +{ + public interface ISupplier : IId + { + string Name { get; } + Dictionary AvailibleProducts { get; } + int Deals { get; } + } +} diff --git a/DataModels/Models/ISupply.cs b/DataModels/Models/ISupply.cs new file mode 100644 index 0000000..a728595 --- /dev/null +++ b/DataModels/Models/ISupply.cs @@ -0,0 +1,18 @@ +using DataModels.Enums; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DataModels.Models +{ + public interface ISupply: IId + { + string Name { get; } + double Price { get; } + DateTime Date { get; } + SupplyStatus Status { get; } + Dictionary SupplyProducts { get; } + } +} diff --git a/DataModels/Models/ISupplyDoc.cs b/DataModels/Models/ISupplyDoc.cs index cb1f6c4..ca45699 100644 --- a/DataModels/Models/ISupplyDoc.cs +++ b/DataModels/Models/ISupplyDoc.cs @@ -9,5 +9,7 @@ namespace DataModels.Models public interface ISupplyDoc : IId { string Name { get; } - } + + Guid SupplyId { get; } + } } diff --git a/DatabaseImplement/Models/MediaFile.cs b/DatabaseImplement/Models/MediaFile.cs index 8c7e084..71eec3c 100644 --- a/DatabaseImplement/Models/MediaFile.cs +++ b/DatabaseImplement/Models/MediaFile.cs @@ -10,9 +10,13 @@ namespace DatabaseImplement.Models { public class MediaFile : IMediaFile { + [Required] + public Guid Id { get; set; } [Required] public string Name { get; set; } [Required] public string Location { get; set; } + [Required] + public Guid ProductId { get; set; } } } diff --git a/DatabaseImplement/Models/Product.cs b/DatabaseImplement/Models/Product.cs index 6f6a242..a615734 100644 --- a/DatabaseImplement/Models/Product.cs +++ b/DatabaseImplement/Models/Product.cs @@ -1,12 +1,26 @@ -using System; +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 Product + public class Product : IProduct { + [Required] + public Guid Id { get; set; } + [Required] + public string Name { get; set; } = string.Empty; + [Required] + public double Price { get; set; } + [Required] + public double Rate { get; set; } + [Required] + public bool IsBeingSold { get; set; } + [Required] + public int Amount { get; set; } } }