Correcting all type and relations in all entities

This commit is contained in:
2025-10-08 00:03:52 +01:00
parent 856d8e2733
commit af92cdc524
9 changed files with 25 additions and 10 deletions

View File

@@ -4,9 +4,11 @@ namespace PyroFetes.Models;
public class Availability
{
[Key] public int Id { get; set; }
[Required] public string? AvailabilityDate { get; set; }
[Key] public int Id { get; set; }
[Required] public DateOnly AvailabilityDate { get; set; }
[Required] public DateOnly DeliveryDate { get; set; }
[Required] public DateOnly ExpirationDate { get; set; }
[Required] public DateOnly RenewallDate { get; set; }
public List<StaffAvailability>? StaffAvailabilities { get; set; }
}

View File

@@ -18,4 +18,5 @@ public class Contact
[Required] public int CustomerId { get; set; }
public List<Communication>? Communications { get; set; }
public List<StaffContact>? StaffContacts { get; set; }
}

View File

@@ -5,7 +5,7 @@ namespace PyroFetes.Models;
public class CustomerType
{
[Key] public int Id { get; set; }
[Required] public decimal Price { get; set; }
[Required, MaxLength(100)] public string? Label { get; set; }
public List<Customer>? Customers { get; set; }
}

View File

@@ -4,6 +4,9 @@ namespace PyroFetes.Models;
public class ExperienceLevel
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
[Key] public int Id { get; set; }
[Required, MaxLength(100)] public string? Label { get; set; }
public Staff? Staff { get; set; }
[Required] public int StaffId { get; set; }
}

View File

@@ -5,6 +5,8 @@ namespace PyroFetes.Models;
public class HistoryOfApproval
{
[Key] public int Id { get; set; }
[Required] public DateOnly ExpirationDate { get; set; }
[Required] public DateOnly DeliveryDate { get; set; }
[Required] public DateOnly ExpirationDate { get; set; }
public List<StaffHistoryOfApproval>? StaffHistoryOfApprovals { get; set; }
}

View File

@@ -5,5 +5,7 @@ namespace PyroFetes.Models;
public class ProviderType
{
[Key] public int Id { get; set; }
[Required] public string? Label { get; set; }
[Required, MaxLength(100)] public string? Label { get; set; }
public List<ServiceProvider>? ServiceProviders { get; set; }
}

View File

@@ -8,6 +8,6 @@ public class ServiceProvider
[Required] public decimal Price { get; set; }
//Relations
public int ProviderTypeId { get; set; }
[Required] public int ProviderTypeId { get; set; }
public ProviderType? ProviderType { get; set; }
}

View File

@@ -13,4 +13,8 @@ public class Staff
[Required] public DateOnly F4T2ExpirationDate { get; set; }
public List<ShowStaff>? ShowStaffs { get; set; }
public List<ExperienceLevel>? ExperienceLevels { get; set; }
public List<StaffAvailability>? StaffAvailabilities { get; set; }
public List<StaffHistoryOfApproval>? StaffHistoryOfApprovals { get; set; }
public List<StaffContact>? StaffContacts { get; set; }
}

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace PyroFetes.Models;
@@ -5,8 +6,8 @@ namespace PyroFetes.Models;
[PrimaryKey(nameof(ContactId), nameof(StaffId))]
public class StaffContact
{
public int StaffId { get; set; }
[Required] public int StaffId { get; set; }
public Staff? Staff { get; set; }
public int ContactId { get; set; }
[Required] public int ContactId { get; set; }
public Contact? Contact { get; set; }
}