diff --git a/PyroFetes/Models/.idea/.gitignore b/PyroFetes/Models/.idea/.gitignore new file mode 100644 index 0000000..516c578 --- /dev/null +++ b/PyroFetes/Models/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/.idea.Models.iml +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/PyroFetes/Models/.idea/encodings.xml b/PyroFetes/Models/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/PyroFetes/Models/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/PyroFetes/Models/.idea/indexLayout.xml b/PyroFetes/Models/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/PyroFetes/Models/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/PyroFetes/Models/Brand.cs b/PyroFetes/Models/Brand.cs new file mode 100644 index 0000000..7278cec --- /dev/null +++ b/PyroFetes/Models/Brand.cs @@ -0,0 +1,12 @@ +using API.Class; + +namespace API.Models; + +public class Brand +{ + public int Id { get; set; } + public string Name { get; set; } + + public int ProductId { get; set; } + public Product Product { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Classification.cs b/PyroFetes/Models/Classification.cs new file mode 100644 index 0000000..bdc57b2 --- /dev/null +++ b/PyroFetes/Models/Classification.cs @@ -0,0 +1,11 @@ +using API.Class; + +namespace API.Models; + +public class Classification +{ + public int Id { get; set; } + public string Label { get; set; } + + public List Products { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Color.cs b/PyroFetes/Models/Color.cs new file mode 100644 index 0000000..2654725 --- /dev/null +++ b/PyroFetes/Models/Color.cs @@ -0,0 +1,10 @@ +using API.Class; + +namespace API.Models; + +public class Color +{ + public int Id { get; set; } + public string Label { get; set; } + +} \ No newline at end of file diff --git a/PyroFetes/Models/Effect.cs b/PyroFetes/Models/Effect.cs new file mode 100644 index 0000000..7643d4b --- /dev/null +++ b/PyroFetes/Models/Effect.cs @@ -0,0 +1,10 @@ +using API.Class; + +namespace API.Models; + +public class Effect +{ + public int Id { get; set; } + public string Label { get; set; } + +} \ No newline at end of file diff --git a/PyroFetes/Models/Material.cs b/PyroFetes/Models/Material.cs new file mode 100644 index 0000000..872c1c9 --- /dev/null +++ b/PyroFetes/Models/Material.cs @@ -0,0 +1,13 @@ +using API.Class; + +namespace API.Models; + +public class Material +{ + public int Id {get; set;} + public string Name {get; set;} + public int Quantity {get; set;} + + public int WarehouseId {get; set;} + public Warehouse Warehouse {get; set;} +} \ No newline at end of file diff --git a/PyroFetes/Models/Movement.cs b/PyroFetes/Models/Movement.cs new file mode 100644 index 0000000..436a1ad --- /dev/null +++ b/PyroFetes/Models/Movement.cs @@ -0,0 +1,21 @@ +using API.Class; + +namespace API.Models; + +public class Movement +{ + public int Id { get; set; } + public DateTime Date { get; set; } + public DateTime Start {get; set;} + public DateTime Arrival {get; set;} + public int Quantity {get; set;} + + public int ProductId {get; set;} + public Product Product {get; set;} + + public int? sourceWarehouse {get; set;} + public Warehouse SourceWarehouse {get; set;} + + public int? destinationWarehouse {get; set;} + public Warehouse DestinationWarehouse {get; set;} +} \ No newline at end of file diff --git a/PyroFetes/Models/Price.cs b/PyroFetes/Models/Price.cs new file mode 100644 index 0000000..6f28e60 --- /dev/null +++ b/PyroFetes/Models/Price.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using API.Class; +using Microsoft.EntityFrameworkCore; + +namespace API.Models; + +[PrimaryKey(nameof(SupplierId), nameof(ProductId))] +public class Price +{ + public decimal Label { get; set; } + + public int SupplierId { get; set; } + [Required] public Supplier Supplier { get; set; } + + public int ProductId { get; set; } + [Required] public Product Product { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Product.cs b/PyroFetes/Models/Product.cs new file mode 100644 index 0000000..0399afb --- /dev/null +++ b/PyroFetes/Models/Product.cs @@ -0,0 +1,31 @@ +using API.Class; + +namespace API.Models +{ + public class Product + { + public int Id { get; set; } + public int References { get; set; } + public string Name { get; set; } + public decimal Duration {get; set;} + public decimal Caliber { get; set; } + public int ApprovalNumber { get; set; } + public decimal Weight { get; set; } + public decimal Nec { get; set; } + public decimal SellingPrice { get; set; } + public string Image { get; set; } + public string Link { get; set; } + + // Relations + public int ClassificationId { get; set; } + public Classification Classification { get; set; } + + public int ProductCategoryId { get; set; } + public ProductCategory ProductCategory { get; set; } + + public List Brands { get; set; } + + public List Movements { get; set; } + + } +} \ No newline at end of file diff --git a/PyroFetes/Models/ProductCategory.cs b/PyroFetes/Models/ProductCategory.cs new file mode 100644 index 0000000..ca4bacd --- /dev/null +++ b/PyroFetes/Models/ProductCategory.cs @@ -0,0 +1,11 @@ +using API.Class; + +namespace API.Models; + +public class ProductCategory +{ + public int Id { get; set; } + public string Label { get; set; } + + public List Products { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/ProductColor.cs b/PyroFetes/Models/ProductColor.cs new file mode 100644 index 0000000..58d17bf --- /dev/null +++ b/PyroFetes/Models/ProductColor.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace API.Models; + +[PrimaryKey(nameof(ProductId), nameof(ColorId))] +public class ProductColor +{ + public Product? Product { get; set; } + [Required] public int ProductId { get; set; } + + public Color? Color { get; set; } + [Required] public int ColorId { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/ProductEffect.cs b/PyroFetes/Models/ProductEffect.cs new file mode 100644 index 0000000..bc6b33c --- /dev/null +++ b/PyroFetes/Models/ProductEffect.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace API.Models; + +[PrimaryKey(nameof(ProductId), nameof(EffectId))] +public class ProductEffect +{ + public Product? Product { get; set; } + [Required] public int ProductId { get; set; } + + public Effect? Effect { get; set; } + [Required] public int EffectId { get; set; } + +} \ No newline at end of file diff --git a/PyroFetes/Models/Supplier.cs b/PyroFetes/Models/Supplier.cs new file mode 100644 index 0000000..b519e1f --- /dev/null +++ b/PyroFetes/Models/Supplier.cs @@ -0,0 +1,15 @@ +using API.Models; + +namespace API.Class; + +public class Supplier +{ + public int Id { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string PhoneNumber { get; set; } + public string Adress { get; set; } + public int ZipCode { get; set; } + public string City { get; set; } + +} \ No newline at end of file diff --git a/PyroFetes/Models/Warehouse.cs b/PyroFetes/Models/Warehouse.cs new file mode 100644 index 0000000..3145ac4 --- /dev/null +++ b/PyroFetes/Models/Warehouse.cs @@ -0,0 +1,22 @@ +using API.Models; + +namespace API.Class; + +public class Warehouse +{ + public int Id {get; set;} + public string Name {get; set;} + public int MaxWeight {get; set;} + public int Current {get; set;} + public int MinWeight {get; set;} + public string Adress { get; set; } + public int ZipCode { get; set; } + public string City { get; set; } + + + public List Materials {get; set;} + + + public List MovementsSource { get; set; } + public List MovementsDestination { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/WarehouseProduct.cs b/PyroFetes/Models/WarehouseProduct.cs new file mode 100644 index 0000000..7aeb873 --- /dev/null +++ b/PyroFetes/Models/WarehouseProduct.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using API.Class; + +namespace API.Models; + +public class WarehouseProduct +{ + public int Quantity { get; set; } + + public int ProductId { get; set; } + [Required] public Product Product { get; set; } + + public int WarehouseId { get; set; } + [Required] public Warehouse Warehouse { get; set; } +} \ No newline at end of file