MAJ update movement

This commit is contained in:
2026-04-21 10:27:00 +02:00
parent 2af5c1e015
commit 1dcb3c35f2
9 changed files with 66 additions and 38 deletions

View File

@@ -2,18 +2,42 @@
namespace PyroFetes.Models;
// 1. Définition des types possibles pour la logique métier
public enum MovementType
{
Entry, // Entrée (ex: Achat fournisseur)
Exit, // Sortie (ex: Vente, Casse)
Transfer, // Transfert entre deux entrepôts
Inventory // Ajustement manuel
}
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;}
public List<Product>? Products { get; set; }
public int? SourceWarehouseId {get; set;}
public Warehouse? SourceWarehouse {get; set;}
public int? DestinationWarehouseId {get; set;}
public Warehouse? DestinationWarehouse {get; set;}
[Key]
public int Id { get; set; }
[Required]
public DateTime Date { get; set; } = DateTime.Now;
public DateTime Start { get; set; }
public DateTime Arrival { get; set; }
[Required]
public int Quantity { get; set; }
[Required]
public MovementType Type { get; set; }
[Required]
public int ProductId { get; set; }
public Product? Product { get; set; }
public int? SourceWarehouseId { get; set; }
public Warehouse? SourceWarehouse { get; set; }
public int? DestinationWarehouseId { get; set; }
public Warehouse? DestinationWarehouse { get; set; }
[MaxLength(500)]
public string? Comment { get; set; }
}

View File

@@ -12,9 +12,9 @@ namespace PyroFetes.Models
[Required, MaxLength(100)] public string? ApprovalNumber { get; set; }
[Required] public decimal Weight { get; set; }
[Required] public decimal Nec { get; set; }
[Required] public string? Image { get; set; }
[Required, MaxLength(200)] public string? Link { get; set; }
[Required] public int MinimalQuantity { get; set; }
public string? Image { get; set; }
[MaxLength(200)] public string? Link { get; set; }
public int MinimalQuantity { get; set; }
// Relations
[Required] public int ClassificationId { get; set; }
@@ -23,8 +23,7 @@ namespace PyroFetes.Models
[Required] public int ProductCategoryId { get; set; }
public ProductCategory? ProductCategory { get; set; }
[Required] public int MovementId {get; set;}
public Movement? Movement {get; set;}
public List<Movement>? Movements { get; set; }
public List<ProductDelivery>? ProductDeliveries { get; set; }
public List<Brand>? Brands { get; set; }