forked from sanchezvem/PyroFetes
Project4 Adding entities
This commit is contained in:
12
PyroFetes/Models/Availability.cs
Normal file
12
PyroFetes/Models/Availability.cs
Normal 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
PyroFetes/Models/Communication.cs
Normal file
13
PyroFetes/Models/Communication.cs
Normal 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
PyroFetes/Models/Contact.cs
Normal file
18
PyroFetes/Models/Contact.cs
Normal 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
PyroFetes/Models/Customer.cs
Normal file
15
PyroFetes/Models/Customer.cs
Normal 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
PyroFetes/Models/CustomerContact.cs
Normal file
13
PyroFetes/Models/CustomerContact.cs
Normal 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
PyroFetes/Models/CustomerType.cs
Normal file
11
PyroFetes/Models/CustomerType.cs
Normal 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
PyroFetes/Models/ExperienceLevel.cs
Normal file
9
PyroFetes/Models/ExperienceLevel.cs
Normal 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
PyroFetes/Models/HistoryOfApproval.cs
Normal file
10
PyroFetes/Models/HistoryOfApproval.cs
Normal 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
PyroFetes/Models/Provider.cs
Normal file
14
PyroFetes/Models/Provider.cs
Normal 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
PyroFetes/Models/ProviderContact.cs
Normal file
12
PyroFetes/Models/ProviderContact.cs
Normal 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
PyroFetes/Models/ProviderType.cs
Normal file
9
PyroFetes/Models/ProviderType.cs
Normal 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
PyroFetes/Models/Staff.cs
Normal file
10
PyroFetes/Models/Staff.cs
Normal 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
PyroFetes/Models/StaffAvailability.cs
Normal file
12
PyroFetes/Models/StaffAvailability.cs
Normal 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
PyroFetes/Models/StaffContact.cs
Normal file
12
PyroFetes/Models/StaffContact.cs
Normal 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; }
|
||||
}
|
12
PyroFetes/Models/StaffHistoryOfApproval.cs
Normal file
12
PyroFetes/Models/StaffHistoryOfApproval.cs
Normal 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; }
|
||||
}
|
Reference in New Issue
Block a user