diff --git a/PyroFetes/Models/Availability.cs b/PyroFetes/Models/Availability.cs new file mode 100644 index 0000000..5d85e0d --- /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 DateOnly DeliveryDate { get; set; } + [Required] public DateOnly ExpirationDate { get; set; } + [Required] public DateOnly 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..6faa91a --- /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..8b6a6cf --- /dev/null +++ b/PyroFetes/Models/Contact.cs @@ -0,0 +1,20 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class Contact +{ + [Key] public int Id { get; set; } + [Required, MaxLength(100)] public string? LastName { get; set; } + [Required, MaxLength(100)] 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? ZipCode { get; set; } + [Required] public string? City { 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..31f0203 --- /dev/null +++ b/PyroFetes/Models/Customer.cs @@ -0,0 +1,16 @@ +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..3e24483 --- /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 decimal Price { get; set; } + + 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..41a1879 --- /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..8c85ef8 --- /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 DateOnly ExpirationDate { get; set; } + [Required] public DateOnly 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..f48e2c3 --- /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..4c8f70c --- /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/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