Correcting all errors of types, writed, and entities.

This commit is contained in:
2025-10-08 11:10:27 +01:00
parent af92cdc524
commit 0ddf5d380a
13 changed files with 90 additions and 3 deletions

View File

@@ -19,4 +19,5 @@ public class Contact
public List<Communication>? Communications { get; set; }
public List<StaffContact>? StaffContacts { get; set; }
public List<ContactServiceProvider>? ContactServiceProviders { get; set; }
}

View File

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

View File

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

View File

@@ -12,4 +12,5 @@ public class Customer
public CustomerType? CustomerType { get; set; }
public List<Contact>? Contacts { get; set; }
public List<Quotation>? Quotations { get; set; }
}

View File

@@ -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<ShowMaterial>? ShowMaterials {get; set;}
public List<MaterialWarehouse>? MaterialWarehouses {get; set;}
}

View File

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

View File

@@ -36,6 +36,7 @@ namespace PyroFetes.Models
public List<Price>? Prices { get; set; }
public List<QuotationProduct>? QuotationProducts { get; set; }
public List<WarehouseProduct>? WarehouseProducts { get; set; }
public List<ProductTimecode>? ProductTimecodes { get; set; }
}

View File

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

View File

@@ -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<QuotationProduct>? QuotationProducts { get; set; }
}

View File

@@ -10,4 +10,7 @@ public class ServiceProvider
//Relations
[Required] public int ProviderTypeId { get; set; }
public ProviderType? ProviderType { get; set; }
public List<Contract>? Contracts { get; set; }
public List<ContactServiceProvider>? ContactServiceProviders { get; set; }
}

View File

@@ -19,4 +19,7 @@ public class Show
public List<ShowStaff>? ShowStaffs { get; set; }
public List<ShowTruck>? ShowTrucks { get; set; }
public List<SoundTimecode>? SoundTimecodes { get; set; }
public List<ProductTimecode>? ProductTimecodes { get; set; }
public List<Contract>? Contracts { get; set; }
public List<ShowMaterial>? ShowMaterials { get; set; }
}

View File

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

View File

@@ -15,8 +15,7 @@ public class Warehouse
public List<WarehouseProduct>? WarehouseProducts { get; set; }
public List<Material>? Materials {get; set;}
public List<MaterialWarehouse>? MaterialWarehouses {get; set;}
public List<Movement>? MovementsSource { get; set; }
public List<Movement>? MovementsDestination { get; set; }
}