Correction de toutes les erreurs de relations et d'écritures dans tous

This commit is contained in:
2025-10-07 23:46:57 +01:00
parent 89be35ecb0
commit 856d8e2733
7 changed files with 41 additions and 12 deletions

View File

@@ -11,9 +11,9 @@ public class Movement
[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;}
}

View File

@@ -5,20 +5,18 @@ namespace PyroFetes.Models;
public class Show
{
[Key] public int Id { get; set; }
[Required] public string? Name { get; set; }
[Required, MaxLength(100)] public string? Name { get; set; }
[Required, MaxLength(120)] public string? Place { get; set; }
[MaxLength(500)] public string? Description { get; set; }
public DateOnly? Date { get; set; }
// Link (path/URL/file name) to the pyrotechnic implementation plan
[Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; }
public DateOnly? Date { get; set; }
[Required] public int CityId { get; set; }
public City? City { get; set; }
public ICollection<Staff>? Staff { get; set; }
public ICollection<Truck>? Trucks { get; set; }
public List<ShowStaff>? ShowStaffs { get; set; }
public List<ShowTruck>? ShowTrucks { get; set; }
public List<SoundTimecode>? SoundTimecodes { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Models;
[PrimaryKey(nameof(StaffId), nameof(ShowId))]
public class ShowStaff
{
public Staff? Staff { get; set; }
[Required] public int StaffId { get; set; }
public Show? Show { get; set; }
[Required] public int ShowId { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Models;
[PrimaryKey(nameof(ShowId), nameof(TruckId))]
public class ShowTruck
{
public Show? Show { get; set; }
[Required] public int ShowId { get; set; }
public Truck? Truck { get; set; }
[Required] public int TruckId { get; set; }
}

View File

@@ -9,7 +9,8 @@ public class Staff
[Required, MaxLength(60)] public string LastName { get; set; } = null!;
[Required, MaxLength(100)] public string? Profession { get; set; }
[Required, MaxLength(120)] public string? Email { get; set; }
[Required] public string? F4T2NumberApproval { get; set; }
[Required, MaxLength(100)] public string? F4T2NumberApproval { get; set; }
[Required] public DateOnly F4T2ExpirationDate { get; set; }
public ICollection<Show>? Shows { get; set; }
public List<ShowStaff>? ShowStaffs { get; set; }
}

View File

@@ -6,9 +6,9 @@ public class Truck
{
[Key] public int Id { get; set; }
[Required, MaxLength(40)] public string Type { get; set; } = null!;
[Range(0, double.MaxValue)] public double? MaxExplosiveCapacity { get; set; }
[Required] public double? MaxExplosiveCapacity { get; set; }
[Required, MaxLength(80)] public string? Sizes { get; set; }
[Required, MaxLength(40)] public string? Status { get; set; }
[Required] public int ShowId { get; set; }
public Show? Show { get; set; }
public List<ShowTruck>? ShowTrucks { get; set; }
}

View File

@@ -14,6 +14,8 @@ public class Warehouse
[Required, MaxLength(100)] public string? City { get; set; }
public List<WarehouseProduct>? WarehouseProducts { get; set; }
public List<Material>? Materials {get; set;}
public List<Movement>? MovementsSource { get; set; }
public List<Movement>? MovementsDestination { get; set; }