diff --git a/PyroFetes/Models/Contact.cs b/PyroFetes/Models/Contact.cs index 88ef5a4..e1573ad 100644 --- a/PyroFetes/Models/Contact.cs +++ b/PyroFetes/Models/Contact.cs @@ -19,4 +19,5 @@ public class Contact public List? Communications { get; set; } public List? StaffContacts { get; set; } + public List? ContactServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ContactServiceProvider.cs b/PyroFetes/Models/ContactServiceProvider.cs new file mode 100644 index 0000000..dc310d8 --- /dev/null +++ b/PyroFetes/Models/ContactServiceProvider.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ContactId), nameof(ServiceProviderId))] +public class ContactServiceProvider +{ + [Required] public int ContactId { get; set; } + [Required] public int ServiceProviderId { get; set; } + + public Product? Contact { get; set; } + public DeliveryNote? ServiceProvider { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Contract.cs b/PyroFetes/Models/Contract.cs new file mode 100644 index 0000000..97cd821 --- /dev/null +++ b/PyroFetes/Models/Contract.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ShowId), nameof(ServiceProviderId))] +public class Contract +{ + [Required] public int ShowId { get; set; } + [Required] public int ServiceProviderId { get; set; } + [Required] public string? TermsAndConditions { get; set; } + + public Show? Show { get; set; } + public ServiceProvider? ServiceProvider { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Customer.cs b/PyroFetes/Models/Customer.cs index 545bca4..da6dbba 100644 --- a/PyroFetes/Models/Customer.cs +++ b/PyroFetes/Models/Customer.cs @@ -12,4 +12,5 @@ public class Customer public CustomerType? CustomerType { get; set; } public List? Contacts { get; set; } + public List? Quotations { get; set; } } diff --git a/PyroFetes/Models/Material.cs b/PyroFetes/Models/Material.cs index d1ad0a9..224e5d5 100644 --- a/PyroFetes/Models/Material.cs +++ b/PyroFetes/Models/Material.cs @@ -9,5 +9,8 @@ public class Material [Required] public int Quantity {get; set;} [Required] public int WarehouseId {get; set;} - [Required] public Warehouse? Warehouse {get; set;} + public Warehouse? Warehouse {get; set;} + + public List? ShowMaterials {get; set;} + public List? MaterialWarehouses {get; set;} } \ No newline at end of file diff --git a/PyroFetes/Models/MaterialWarehouse.cs b/PyroFetes/Models/MaterialWarehouse.cs new file mode 100644 index 0000000..6f797b9 --- /dev/null +++ b/PyroFetes/Models/MaterialWarehouse.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace PyroFetes.Models; + +public class MaterialWarehouse +{ + [Required] public int MaterialId { get; set; } + [Required] public int WarehouseId { get; set; } + + public Material? Material { get; set; } + public Warehouse? Warehouse { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Product.cs b/PyroFetes/Models/Product.cs index 525195a..04c8fc3 100644 --- a/PyroFetes/Models/Product.cs +++ b/PyroFetes/Models/Product.cs @@ -36,6 +36,7 @@ namespace PyroFetes.Models public List? Prices { get; set; } public List? QuotationProducts { get; set; } public List? WarehouseProducts { get; set; } + public List? ProductTimecodes { get; set; } } diff --git a/PyroFetes/Models/ProductTimecode.cs b/PyroFetes/Models/ProductTimecode.cs new file mode 100644 index 0000000..a4ad826 --- /dev/null +++ b/PyroFetes/Models/ProductTimecode.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ProductId), nameof(ShowId))] +public class ProductTimecode +{ + public Product? Product { get; set; } + [Required] public int ProductId { get; set; } + + public Show? Show { get; set; } + [Required] public int ShowId { get; set; } + + [Required] public decimal Start { get; set; } + [Required] public decimal End { get; set; } +} \ No newline at end of file diff --git a/PyroFetes/Models/Quotation.cs b/PyroFetes/Models/Quotation.cs index f1288ce..569c271 100644 --- a/PyroFetes/Models/Quotation.cs +++ b/PyroFetes/Models/Quotation.cs @@ -8,5 +8,8 @@ public class Quotation [Required, MaxLength(200)] public string? Message { get; set; } [Required, MaxLength(300)] public string? ConditionsSale { get; set; } + [Required] public int CustomerId { get; set; } + public Customer? Customer { get; set; } + public List? QuotationProducts { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ServiceProvider.cs b/PyroFetes/Models/ServiceProvider.cs index 80b101b..b91e0d7 100644 --- a/PyroFetes/Models/ServiceProvider.cs +++ b/PyroFetes/Models/ServiceProvider.cs @@ -10,4 +10,7 @@ public class ServiceProvider //Relations [Required] public int ProviderTypeId { get; set; } public ProviderType? ProviderType { get; set; } + + public List? Contracts { get; set; } + public List? ContactServiceProviders { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/Show.cs b/PyroFetes/Models/Show.cs index 21514d7..bc425dd 100644 --- a/PyroFetes/Models/Show.cs +++ b/PyroFetes/Models/Show.cs @@ -19,4 +19,7 @@ public class Show public List? ShowStaffs { get; set; } public List? ShowTrucks { get; set; } public List? SoundTimecodes { get; set; } + public List? ProductTimecodes { get; set; } + public List? Contracts { get; set; } + public List? ShowMaterials { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Models/ShowMaterial.cs b/PyroFetes/Models/ShowMaterial.cs new file mode 100644 index 0000000..81cc82a --- /dev/null +++ b/PyroFetes/Models/ShowMaterial.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using Microsoft.EntityFrameworkCore; + +namespace PyroFetes.Models; + +[PrimaryKey(nameof(ShowId), nameof(MaterialId))] +public class ShowMaterial +{ + [Required] public Show? Show { get; set; } + [Required] public int ShowId { get; set; } + + public Material? Material { get; set; } + [Required] public int MaterialId { get; set; } + +} \ No newline at end of file diff --git a/PyroFetes/Models/Warehouse.cs b/PyroFetes/Models/Warehouse.cs index c91b24e..1307dbc 100644 --- a/PyroFetes/Models/Warehouse.cs +++ b/PyroFetes/Models/Warehouse.cs @@ -15,8 +15,7 @@ public class Warehouse public List? WarehouseProducts { get; set; } - - public List? Materials {get; set;} + public List? MaterialWarehouses {get; set;} public List? MovementsSource { get; set; } public List? MovementsDestination { get; set; } } \ No newline at end of file