Project4 Adding entities

This commit is contained in:
2025-10-02 17:11:00 +02:00
parent d3a8ae593e
commit da468f2853
15 changed files with 182 additions and 0 deletions
+12
View File
@@ -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; }
}
+13
View File
@@ -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
}
+18
View File
@@ -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; }
}
+15
View File
@@ -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; }
}
+13
View File
@@ -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; }
}
+11
View File
@@ -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<Customer>? Customers { get; set; }
}
+9
View File
@@ -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; }
}
+10
View File
@@ -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; }
}
+14
View File
@@ -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; }
}
+12
View File
@@ -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; }
}
+9
View File
@@ -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; }
}
+10
View File
@@ -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; }
}
+12
View File
@@ -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; }
}
+12
View File
@@ -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; }
}
@@ -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; }
}