From da468f28531f0852db786a386951e9f827b28e34 Mon Sep 17 00:00:00 2001 From: carteronm Date: Thu, 2 Oct 2025 17:11:00 +0200 Subject: [PATCH] Project4 Adding entities --- PyroFetes/Models/Availability.cs | 12 ++++++++++++ PyroFetes/Models/Communication.cs | 13 +++++++++++++ PyroFetes/Models/Contact.cs | 18 ++++++++++++++++++ PyroFetes/Models/Customer.cs | 15 +++++++++++++++ PyroFetes/Models/CustomerContact.cs | 13 +++++++++++++ PyroFetes/Models/CustomerType.cs | 11 +++++++++++ PyroFetes/Models/ExperienceLevel.cs | 9 +++++++++ PyroFetes/Models/HistoryOfApproval.cs | 10 ++++++++++ PyroFetes/Models/Provider.cs | 14 ++++++++++++++ PyroFetes/Models/ProviderContact.cs | 12 ++++++++++++ PyroFetes/Models/ProviderType.cs | 9 +++++++++ PyroFetes/Models/Staff.cs | 10 ++++++++++ PyroFetes/Models/StaffAvailability.cs | 12 ++++++++++++ PyroFetes/Models/StaffContact.cs | 12 ++++++++++++ PyroFetes/Models/StaffHistoryOfApproval.cs | 12 ++++++++++++ 15 files changed, 182 insertions(+) create mode 100644 PyroFetes/Models/Availability.cs create mode 100644 PyroFetes/Models/Communication.cs create mode 100644 PyroFetes/Models/Contact.cs create mode 100644 PyroFetes/Models/Customer.cs create mode 100644 PyroFetes/Models/CustomerContact.cs create mode 100644 PyroFetes/Models/CustomerType.cs create mode 100644 PyroFetes/Models/ExperienceLevel.cs create mode 100644 PyroFetes/Models/HistoryOfApproval.cs create mode 100644 PyroFetes/Models/Provider.cs create mode 100644 PyroFetes/Models/ProviderContact.cs create mode 100644 PyroFetes/Models/ProviderType.cs create mode 100644 PyroFetes/Models/Staff.cs create mode 100644 PyroFetes/Models/StaffAvailability.cs create mode 100644 PyroFetes/Models/StaffContact.cs create mode 100644 PyroFetes/Models/StaffHistoryOfApproval.cs diff --git a/PyroFetes/Models/Availability.cs b/PyroFetes/Models/Availability.cs new file mode 100644 index 0000000..a727c3a --- /dev/null +++ b/PyroFetes/Models/Availability.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Availability +{ + [Key] public int Id { get; set; } + [Required] public string AvailabilityDate { get; set; } + [Required] public string DeliveryDate { get; set; } + [Required] public string ExpirationDate { get; set; } + [Required] public string RenewallDate { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Communication.cs b/PyroFetes/Models/Communication.cs new file mode 100644 index 0000000..7c3e284 --- /dev/null +++ b/PyroFetes/Models/Communication.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Communication +{ + [Key] public int Id { get; set; } + [Required] public string Calling { get; set; } + [Required] public string Email { get; set; } + [Required] public string Meeting { get; set; } + + //REL +} \ No newline at end of file diff --git a/PyroFetes/Models/Contact.cs b/PyroFetes/Models/Contact.cs new file mode 100644 index 0000000..87385bc --- /dev/null +++ b/PyroFetes/Models/Contact.cs @@ -0,0 +1,18 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Contact +{ + [Key] public int Id { get; set; } + [Required] public string LastName { get; set; } + [Required] public string FirstName { get; set; } + [Required] public string Email { get; set; } + [Required] public string PhoneNumber { get; set; } + [Required] public string Address { get; set; } + [Required] public string Role { get; set; } + + //RELATIONS DE CON LA + public int CommunicationID { get; set; } + public Communication? Communication { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Customer.cs b/PyroFetes/Models/Customer.cs new file mode 100644 index 0000000..3e7139a --- /dev/null +++ b/PyroFetes/Models/Customer.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Customer +{ + [Key] public int Id { get; set; } + [Required] public string? Note { get; set; } + //Les relations + public int CustomerTypeId { get; set; } + public CustomerType? CustomerType { get; set; } + + public int ContactId { get; set; } + public Contact? Contact { get; set; } +} diff --git a/PyroFetes/Models/CustomerContact.cs b/PyroFetes/Models/CustomerContact.cs new file mode 100644 index 0000000..dff5fb2 --- /dev/null +++ b/PyroFetes/Models/CustomerContact.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ContactId), nameof(CustomerId))] +public class CustomerContact +{ + public int CustomerId { get; set; } + public Customer? Customer { get; set; } + public int ContactId { get; set; } + public Contact? Contact { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/CustomerType.cs b/PyroFetes/Models/CustomerType.cs new file mode 100644 index 0000000..28fc14d --- /dev/null +++ b/PyroFetes/Models/CustomerType.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class CustomerType +{ + [Key] public int Id { get; set; } + [Required] public string? Price { get; set; } + //RELATIONS PTN + public List? Customers { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/ExperienceLevel.cs b/PyroFetes/Models/ExperienceLevel.cs new file mode 100644 index 0000000..8a2bb93 --- /dev/null +++ b/PyroFetes/Models/ExperienceLevel.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class ExperienceLevel +{ + [Key] public int Id { get; set; } + [Required] public string Label { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/HistoryOfApproval.cs b/PyroFetes/Models/HistoryOfApproval.cs new file mode 100644 index 0000000..4e05886 --- /dev/null +++ b/PyroFetes/Models/HistoryOfApproval.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class HistoryOfApproval +{ + [Key] public int Id { get; set; } + [Required] public string ExpirationDate { get; set; } + [Required] public string DeliveryDate { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Provider.cs b/PyroFetes/Models/Provider.cs new file mode 100644 index 0000000..fdfc566 --- /dev/null +++ b/PyroFetes/Models/Provider.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Provider +{ + [Key] public int Id { get; set; } + [Required] public decimal Price { get; set; } + + //Relations + + public int ProviderID { get; set; } + public ProviderType? ProviderType { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/ProviderContact.cs b/PyroFetes/Models/ProviderContact.cs new file mode 100644 index 0000000..cdfefb3 --- /dev/null +++ b/PyroFetes/Models/ProviderContact.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ContactId), nameof(ProviderId))] +public class ProviderContact +{ + public int ProviderId { get; set; } + public Provider? Provider { get; set; } + public int ContactId { get; set; } + public Contact? Contact { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/ProviderType.cs b/PyroFetes/Models/ProviderType.cs new file mode 100644 index 0000000..ac620c9 --- /dev/null +++ b/PyroFetes/Models/ProviderType.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class ProviderType +{ + [Key] public int Id { get; set; } + [Required] public string Label { 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..fef94d9 --- /dev/null +++ b/PyroFetes/Models/Staff.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Staff +{ + [Key] public int Id { get; set; } + [Required] public string F4T2NumberApproval { get; set; } + [Required] public string F4T2ExpirationDate { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/StaffAvailability.cs b/PyroFetes/Models/StaffAvailability.cs new file mode 100644 index 0000000..3ba0732 --- /dev/null +++ b/PyroFetes/Models/StaffAvailability.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(AvailabilityId), nameof(StaffId))] +public class StaffAvailability +{ + public int StaffId { get; set; } + public Staff? Staff { get; set; } + public int AvailabilityId { get; set; } + public Availability? Availability { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/StaffContact.cs b/PyroFetes/Models/StaffContact.cs new file mode 100644 index 0000000..3fb3f87 --- /dev/null +++ b/PyroFetes/Models/StaffContact.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ContactId), nameof(StaffId))] +public class StaffContact +{ + public int StaffId { get; set; } + public Staff? Staff { get; set; } + public int ContactId { get; set; } + public Contact? Contact { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/StaffHistoryOfApproval.cs b/PyroFetes/Models/StaffHistoryOfApproval.cs new file mode 100644 index 0000000..3937064 --- /dev/null +++ b/PyroFetes/Models/StaffHistoryOfApproval.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(HistoryOfApprovalId), nameof(StaffId))] +public class StaffHistoryOfApproval +{ + public int StaffId { get; set; } + public Staff? Staff { get; set; } + public int HistoryOfApprovalId { get; set; } + public HistoryOfApproval? HistoryOfApproval { get; set; } +} \ No newline at end of file