Merge branch 'feature/Sujet1' into develop

This commit is contained in:
2025-10-03 14:44:25 +01:00
15 changed files with 207 additions and 0 deletions

13
PyroFetes/Models/.idea/.gitignore generated vendored Normal file
View File

@@ -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

4
PyroFetes/Models/.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

8
PyroFetes/Models/.idea/indexLayout.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

12
PyroFetes/Models/Brand.cs Normal file
View File

@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Brand
{
[Key] public int Id { get; set; }
[Required, MaxLength(100)] public string? Name { get; set; }
[Required] public int ProductId { get; set; }
[Required] public Product? Product { get; set; }
}

View File

@@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Classification
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
[Required] public List<Product>? Products { get; set; }
}

10
PyroFetes/Models/Color.cs Normal file
View File

@@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Color
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
}

View File

@@ -0,0 +1,9 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Effect
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
}

View File

@@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Material
{
[Key] public int Id {get; set;}
[Required, MaxLength(100)] public string? Name {get; set;}
[Required] public int Quantity {get; set;}
[Required] public int WarehouseId {get; set;}
[Required] public Warehouse? Warehouse {get; set;}
}

View File

@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Movement
{
[Key] public int Id { get; set; }
[Required] public DateTime Date { get; set; }
[Required] public DateTime Start {get; set;}
[Required] public DateTime Arrival {get; set;}
[Required] public int Quantity {get; set;}
[Required] public int ProductId {get; set;}
[Required] public Product? Product {get; set;}
[Required] public int? SourceWarehouseId {get; set;}
[Required] public Warehouse? SourceWarehouse {get; set;}
[Required] public int? DestinationWarehouseId {get; set;}
[Required] public Warehouse? DestinationWarehouse {get; set;}
}

View File

@@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models
{
public class Product
{
[Key] public int Id { get; set; }
[Required] public int References { get; set; }
[Required, MaxLength(100)] public string? Name { get; set; }
[Required] public decimal Duration {get; set;}
[Required] public decimal Caliber { get; set; }
[Required] public int ApprovalNumber { get; set; }
[Required] public decimal Weight { get; set; }
[Required] public decimal Nec { get; set; }
[Required] public decimal SellingPrice { get; set; }
[Required] public string? Image { get; set; }
[Required] public string? Link { get; set; }
// Relations
[Required] public int ClassificationId { get; set; }
[Required] public Classification? Classification { get; set; }
[Required] public int ProductCategoryId { get; set; }
[Required] public ProductCategory? ProductCategory { get; set; }
[Required] public List<Brand>? Brands { get; set; }
[Required] public List<Movement>? Movements { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class ProductCategory
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
[Required] public List<Product>? Products { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Models;
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
public class ProductColor
{
[Required] public Product? Product { get; set; }
[Required] public int ProductId { get; set; }
[Required] public Color? Color { get; set; }
[Required] public int ColorId { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
public class ProductEffect
{
[Required] public Product? Product { get; set; }
[Required] public int ProductId { get; set; }
[Required] public Effect? Effect { get; set; }
[Required] public int EffectId { get; set; }
}

View File

@@ -0,0 +1,22 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class Warehouse
{
[Key] public int Id {get; set;}
[Required, MaxLength(100)] public string? Name {get; set;}
[Required] public int MaxWeight {get; set;}
[Required] public int Current {get; set;}
[Required] public int MinWeight {get; set;}
[Required] public string? Address { get; set; }
[Required] public int ZipCode { get; set; }
[Required] public string? City { get; set; }
[Required] public List<Material>? Materials {get; set;}
[Required] public List<Movement>? MovementsSource { get; set; }
[Required] public List<Movement>? MovementsDestination { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace PyroFetes.Models;
public class WarehouseProduct
{
[Key] public int Quantity { get; set; }
[Required] public int ProductId { get; set; }
[Required] public Product? Product { get; set; }
[Required] public int WarehouseId { get; set; }
[Required] public Warehouse? Warehouse { get; set; }
}