Merge branch 'feature/subject4' into develop

This commit is contained in:
2025-10-03 16:58:53 +01:00
14 changed files with 175 additions and 0 deletions

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 DateOnly DeliveryDate { get; set; }
[Required] public DateOnly ExpirationDate { get; set; }
[Required] public DateOnly RenewallDate { get; set; }
}

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
}

View File

@@ -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; }
}

View File

@@ -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; }
}

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; }
}

View File

@@ -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<Customer>? Customers { get; set; }
}

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; }
}

View File

@@ -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; }
}

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; }
}

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; }
}

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; }
}

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; }
}

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; }
}

View File

@@ -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; }
}