From 21d3480b19038e6016f33b6d3aea709999557cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9?= Date: Thu, 2 Oct 2025 14:53:55 +0200 Subject: [PATCH 1/7] =?UTF-8?q?Entit=C3=A9=20du=20sujet=203=20avec=20conne?= =?UTF-8?q?ctions=20et=20cardinalit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PyroFetes/Models/Show.cs | 24 ++++++++++++++++++++++ PyroFetes/Models/Sound.cs | 34 +++++++++++++++++++++++++++++++ PyroFetes/Models/SoundCategory.cs | 13 ++++++++++++ PyroFetes/Models/SoundTimecode.cs | 22 ++++++++++++++++++++ PyroFetes/Models/Staff.cs | 22 ++++++++++++++++++++ PyroFetes/Models/Truck.cs | 24 ++++++++++++++++++++++ 6 files changed, 139 insertions(+) create mode 100644 PyroFetes/Models/Show.cs create mode 100644 PyroFetes/Models/Sound.cs create mode 100644 PyroFetes/Models/SoundCategory.cs create mode 100644 PyroFetes/Models/SoundTimecode.cs create mode 100644 PyroFetes/Models/Staff.cs create mode 100644 PyroFetes/Models/Truck.cs diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs new file mode 100644 index 0000000..5d4e794 --- /dev/null +++ b/PyroFetes/Models/Show.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Show +{ + [Key] public int Id { get; set; } + + [MaxLength(120)] + public string? Place { get; set; } + + [MaxLength(500)] + public string? Description { get; set; } + + // Lien (chemin/URL/nom de fichier) vers le plan d’implémentation pyrotechnique + [MaxLength(500)] + public string? PyrotechnicImplementationPlan { get; set; } + + public DateTime? Date { get; set; } + + public ICollection Staff { get; set; } = new List(); + public ICollection Trucks { get; set; } = new List(); + public ICollection SoundCues { get; set; } = new List(); +} \ No newline at end of file diff --git a/PyroFetes/Models/Sound.cs b/PyroFetes/Models/Sound.cs new file mode 100644 index 0000000..4bde6bf --- /dev/null +++ b/PyroFetes/Models/Sound.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Sound +{ + [Key] public int Id { get; set; } + + [Required, MaxLength(120)] + public string Name { get; set; } = null!; + + [MaxLength(60)] + public string? Type { get; set; } + + [MaxLength(120)] + public string? Artist { get; set; } + + [Range(0, int.MaxValue)] + public int? Duration { get; set; } + + [MaxLength(40)] + public string? Kind { get; set; } + + [MaxLength(40)] + public string? Format { get; set; } + + public DateTime? CreationDate { get; set; } + + [Required] + public int SoundCategoryId { get; set; } + public SoundCategory? Category { get; set; } + + public ICollection ShowPlacements { get; set; } = new List(); +} \ No newline at end of file diff --git a/PyroFetes/Models/SoundCategory.cs b/PyroFetes/Models/SoundCategory.cs new file mode 100644 index 0000000..17b5120 --- /dev/null +++ b/PyroFetes/Models/SoundCategory.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class SoundCategory +{ + [Key] public int Id { get; set; } + + [Required, MaxLength(60)] + public string Name { get; set; } = null!; + + public ICollection Sounds { get; set; } = new List(); +} \ No newline at end of file diff --git a/PyroFetes/Models/SoundTimecode.cs b/PyroFetes/Models/SoundTimecode.cs new file mode 100644 index 0000000..0492073 --- /dev/null +++ b/PyroFetes/Models/SoundTimecode.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class SoundTimecode +{ + [Key] public int Id { get; set; } + + [Required] + public int ShowId { get; set; } + public Show? Show { get; set; } + + [Required] + public int SoundId { get; set; } + public Sound? Sound { get; set; } + + [Required, Range(0, int.MaxValue)] + public int Start { get; set; } + + [Required, Range(0, int.MaxValue)] + public int End { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Staff.cs b/PyroFetes/Models/Staff.cs new file mode 100644 index 0000000..fd6d846 --- /dev/null +++ b/PyroFetes/Models/Staff.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Staff +{ + [Key] public int Id { get; set; } + + [Required, MaxLength(60)] + public string FirstName { get; set; } = null!; + + [Required, MaxLength(60)] + public string LastName { get; set; } = null!; + + [MaxLength(100)] + public string? Profession { get; set; } + + [EmailAddress, MaxLength(120)] + public string? Email { get; set; } + + public ICollection Shows { get; set; } = new List(); +} \ No newline at end of file diff --git a/PyroFetes/Models/Truck.cs b/PyroFetes/Models/Truck.cs new file mode 100644 index 0000000..31b05e2 --- /dev/null +++ b/PyroFetes/Models/Truck.cs @@ -0,0 +1,24 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +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; } + + [MaxLength(80)] + public string? Sizes { get; set; } + + [MaxLength(40)] + public string? Statut { get; set; } + + [Required] + public int ShowId { get; set; } + public Show? Show { get; set; } +} \ No newline at end of file From bb02df63234584faf2cfb3655274daba36ebac72 Mon Sep 17 00:00:00 2001 From: cernont Date: Thu, 2 Oct 2025 15:00:09 +0200 Subject: [PATCH 2/7] Actualiser PyroFetes/Models/Show.cs --- PyroFetes/Models/Show.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index 5d4e794..0173665 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -6,14 +6,14 @@ public class Show { [Key] public int Id { get; set; } - [MaxLength(120)] + [Required, MaxLength(120)] public string? Place { get; set; } [MaxLength(500)] public string? Description { get; set; } // Lien (chemin/URL/nom de fichier) vers le plan d’implémentation pyrotechnique - [MaxLength(500)] + [Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; } public DateTime? Date { get; set; } From c0ee31f4a7dd89fad1d0e9c6802a4608e7f00118 Mon Sep 17 00:00:00 2001 From: cernont Date: Thu, 2 Oct 2025 15:00:58 +0200 Subject: [PATCH 3/7] Actualiser PyroFetes/Models/Sound.cs --- PyroFetes/Models/Sound.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PyroFetes/Models/Sound.cs b/PyroFetes/Models/Sound.cs index 4bde6bf..7ba2f64 100644 --- a/PyroFetes/Models/Sound.cs +++ b/PyroFetes/Models/Sound.cs @@ -9,19 +9,19 @@ public class Sound [Required, MaxLength(120)] public string Name { get; set; } = null!; - [MaxLength(60)] + [Required, MaxLength(60)] public string? Type { get; set; } - [MaxLength(120)] + [Required, MaxLength(120)] public string? Artist { get; set; } - [Range(0, int.MaxValue)] + [Required, Range(0, int.MaxValue)] public int? Duration { get; set; } - [MaxLength(40)] + [Required, MaxLength(40)] public string? Kind { get; set; } - [MaxLength(40)] + [Required, MaxLength(40)] public string? Format { get; set; } public DateTime? CreationDate { get; set; } From 2bbb6c6e7807382daf40515caf43a27a65912c2e Mon Sep 17 00:00:00 2001 From: cernont Date: Thu, 2 Oct 2025 15:01:30 +0200 Subject: [PATCH 4/7] Actualiser PyroFetes/Models/Staff.cs --- PyroFetes/Models/Staff.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyroFetes/Models/Staff.cs b/PyroFetes/Models/Staff.cs index fd6d846..0c829d8 100644 --- a/PyroFetes/Models/Staff.cs +++ b/PyroFetes/Models/Staff.cs @@ -12,10 +12,10 @@ public class Staff [Required, MaxLength(60)] public string LastName { get; set; } = null!; - [MaxLength(100)] + [Required, MaxLength(100)] public string? Profession { get; set; } - [EmailAddress, MaxLength(120)] + [Required, MaxLength(120)] public string? Email { get; set; } public ICollection Shows { get; set; } = new List(); From 788ad933272efa3307794456da9b5ccf1d493667 Mon Sep 17 00:00:00 2001 From: cernont Date: Thu, 2 Oct 2025 15:01:46 +0200 Subject: [PATCH 5/7] Actualiser PyroFetes/Models/Truck.cs --- PyroFetes/Models/Truck.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyroFetes/Models/Truck.cs b/PyroFetes/Models/Truck.cs index 31b05e2..b711a34 100644 --- a/PyroFetes/Models/Truck.cs +++ b/PyroFetes/Models/Truck.cs @@ -12,10 +12,10 @@ public class Truck [Range(0, double.MaxValue)] public double? MaxExplosiveCapacity { get; set; } - [MaxLength(80)] + [Required, MaxLength(80)] public string? Sizes { get; set; } - [MaxLength(40)] + [Required, MaxLength(40)] public string? Statut { get; set; } [Required] From 6bb86c0ce9ed1bbca88335f9de4d54581f98ec64 Mon Sep 17 00:00:00 2001 From: cernont Date: Thu, 2 Oct 2025 15:19:38 +0200 Subject: [PATCH 6/7] Actualiser PyroFetes/Models/Show.cs --- PyroFetes/Models/Show.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index 0173665..6fdc7d2 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -6,6 +6,9 @@ public class Show { [Key] public int Id { get; set; } + [Required] + public string? Name { get; set; } + [Required, MaxLength(120)] public string? Place { get; set; } From df919bf943be1586abd8d85b908405cd0a224fd5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 3 Oct 2025 14:54:25 +0100 Subject: [PATCH 7/7] Correcting Entities --- PyroFetes/Models/Show.cs | 21 +++++++------------- PyroFetes/Models/Sound.cs | 32 ++++++++----------------------- PyroFetes/Models/SoundCategory.cs | 7 ++----- PyroFetes/Models/SoundTimecode.cs | 16 ++++------------ PyroFetes/Models/Staff.cs | 19 +++++------------- PyroFetes/Models/Truck.cs | 20 +++++-------------- 6 files changed, 31 insertions(+), 84 deletions(-) diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index 6fdc7d2..5ec1804 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -5,23 +5,16 @@ namespace PyroFetes.Models; public class Show { [Key] public int Id { get; set; } - - [Required] - public string? Name { get; set; } - - [Required, MaxLength(120)] - public string? Place { get; set; } - - [MaxLength(500)] - public string? Description { get; set; } - + [Required] public string? Name { get; set; } + [Required, MaxLength(120)] public string? Place { get; set; } + [MaxLength(500)] public string? Description { get; set; } + // Lien (chemin/URL/nom de fichier) vers le plan d’implémentation pyrotechnique [Required, MaxLength(500)] public string? PyrotechnicImplementationPlan { get; set; } public DateTime? Date { get; set; } - - public ICollection Staff { get; set; } = new List(); - public ICollection Trucks { get; set; } = new List(); - public ICollection SoundCues { get; set; } = new List(); + public ICollection? Staff { get; set; } + public ICollection? Trucks { get; set; } + public ICollection? SoundCues { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Sound.cs b/PyroFetes/Models/Sound.cs index 7ba2f64..361d3e5 100644 --- a/PyroFetes/Models/Sound.cs +++ b/PyroFetes/Models/Sound.cs @@ -5,30 +5,14 @@ namespace PyroFetes.Models; public class Sound { [Key] public int Id { get; set; } - - [Required, MaxLength(120)] - public string Name { get; set; } = null!; - - [Required, MaxLength(60)] - public string? Type { get; set; } - - [Required, MaxLength(120)] - public string? Artist { get; set; } - - [Required, Range(0, int.MaxValue)] - public int? Duration { get; set; } - - [Required, MaxLength(40)] - public string? Kind { get; set; } - - [Required, MaxLength(40)] - public string? Format { get; set; } - + [Required, MaxLength(120)] public string Name { get; set; } = null!; + [Required, MaxLength(60)] public string? Type { get; set; } + [Required, MaxLength(120)] public string? Artist { get; set; } + [Required, Range(0, int.MaxValue)] public int? Duration { get; set; } + [Required, MaxLength(40)] public string? Kind { get; set; } + [Required, MaxLength(40)] public string? Format { get; set; } public DateTime? CreationDate { get; set; } - - [Required] - public int SoundCategoryId { get; set; } + [Required] public int SoundCategoryId { get; set; } public SoundCategory? Category { get; set; } - - public ICollection ShowPlacements { get; set; } = new List(); + public ICollection? ShowPlacements { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundCategory.cs b/PyroFetes/Models/SoundCategory.cs index 17b5120..3cabd6d 100644 --- a/PyroFetes/Models/SoundCategory.cs +++ b/PyroFetes/Models/SoundCategory.cs @@ -5,9 +5,6 @@ namespace PyroFetes.Models; public class SoundCategory { [Key] public int Id { get; set; } - - [Required, MaxLength(60)] - public string Name { get; set; } = null!; - - public ICollection Sounds { get; set; } = new List(); + [Required, MaxLength(60)] public string Name { get; set; } = null!; + public ICollection? Sounds { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/SoundTimecode.cs b/PyroFetes/Models/SoundTimecode.cs index 0492073..7537699 100644 --- a/PyroFetes/Models/SoundTimecode.cs +++ b/PyroFetes/Models/SoundTimecode.cs @@ -5,18 +5,10 @@ namespace PyroFetes.Models; public class SoundTimecode { [Key] public int Id { get; set; } - - [Required] - public int ShowId { get; set; } + [Required] public int ShowId { get; set; } public Show? Show { get; set; } - - [Required] - public int SoundId { get; set; } + [Required] public int SoundId { get; set; } public Sound? Sound { get; set; } - - [Required, Range(0, int.MaxValue)] - public int Start { get; set; } - - [Required, Range(0, int.MaxValue)] - public int End { get; set; } + [Required, Range(0, int.MaxValue)] public int Start { get; set; } + [Required, Range(0, int.MaxValue)] public int End { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Staff.cs b/PyroFetes/Models/Staff.cs index 0c829d8..60f4850 100644 --- a/PyroFetes/Models/Staff.cs +++ b/PyroFetes/Models/Staff.cs @@ -5,18 +5,9 @@ namespace PyroFetes.Models; public class Staff { [Key] public int Id { get; set; } - - [Required, MaxLength(60)] - public string FirstName { get; set; } = null!; - - [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; } - - public ICollection Shows { get; set; } = new List(); + [Required, MaxLength(60)] public string FirstName { get; set; } = null!; + [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; } + public ICollection? Shows { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Truck.cs b/PyroFetes/Models/Truck.cs index b711a34..b0a55f8 100644 --- a/PyroFetes/Models/Truck.cs +++ b/PyroFetes/Models/Truck.cs @@ -5,20 +5,10 @@ namespace PyroFetes.Models; 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, MaxLength(80)] - public string? Sizes { get; set; } - - [Required, MaxLength(40)] - public string? Statut { get; set; } - - [Required] - public int ShowId { get; set; } + [Required, MaxLength(40)] public string Type { get; set; } = null!; + [Range(0, double.MaxValue)] 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; } } \ No newline at end of file