forked from sanchezvem/PyroFetes
Correcting errors on Entities
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Brand
|
public class Brand
|
||||||
{
|
{
|
||||||
[Key] public int Id { get; set; }
|
[Key] public int Id { get; set; }
|
||||||
[Required, MaxLength(100)] public string Name { get; set; }
|
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||||
|
|
||||||
[Required] public int ProductId { get; set; }
|
[Required] public int ProductId { get; set; }
|
||||||
[Required] public Product Product { get; set; }
|
[Required] public Product? Product { get; set; }
|
||||||
}
|
}
|
@@ -1,12 +1,12 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Classification
|
public class Classification
|
||||||
{
|
{
|
||||||
[Key] public int Id { get; set; }
|
[Key] public int Id { get; set; }
|
||||||
[Required] public string Label { get; set; }
|
[Required] public string? Label { get; set; }
|
||||||
|
|
||||||
[Required] public List<Product> Products { get; set; }
|
[Required] public List<Product>? Products { get; set; }
|
||||||
}
|
}
|
@@ -1,11 +1,10 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Color
|
public class Color
|
||||||
{
|
{
|
||||||
[Key] public int Id { get; set; }
|
[Key] public int Id { get; set; }
|
||||||
[Required] public string Label { get; set; }
|
[Required] public string? Label { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@@ -1,11 +1,9 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Effect
|
public class Effect
|
||||||
{
|
{
|
||||||
[Key] public int Id { get; set; }
|
[Key] public int Id { get; set; }
|
||||||
[Required] public string Label { get; set; }
|
[Required] public string? Label { get; set; }
|
||||||
|
|
||||||
}
|
}
|
@@ -1,14 +1,13 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Material
|
public class Material
|
||||||
{
|
{
|
||||||
[Key] public int Id {get; set;}
|
[Key] public int Id {get; set;}
|
||||||
[Required, MaxLength(100)] public string Name {get; set;}
|
[Required, MaxLength(100)] public string? Name {get; set;}
|
||||||
[Required] public int Quantity {get; set;}
|
[Required] public int Quantity {get; set;}
|
||||||
|
|
||||||
[Required] public int WarehouseId {get; set;}
|
[Required] public int WarehouseId {get; set;}
|
||||||
[Required] public Warehouse Warehouse {get; set;}
|
[Required] public Warehouse? Warehouse {get; set;}
|
||||||
}
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Movement
|
public class Movement
|
||||||
{
|
{
|
||||||
@@ -12,11 +12,11 @@ public class Movement
|
|||||||
[Required] public int Quantity {get; set;}
|
[Required] public int Quantity {get; set;}
|
||||||
|
|
||||||
[Required] public int ProductId {get; set;}
|
[Required] public int ProductId {get; set;}
|
||||||
[Required] public Product Product {get; set;}
|
[Required] public Product? Product {get; set;}
|
||||||
|
|
||||||
[Required] public int? SourceWarehouseId {get; set;}
|
[Required] public int? SourceWarehouseId {get; set;}
|
||||||
[Required] public Warehouse SourceWarehouse {get; set;}
|
[Required] public Warehouse? SourceWarehouse {get; set;}
|
||||||
|
|
||||||
[Required] public int? DestinationWarehouseId {get; set;}
|
[Required] public int? DestinationWarehouseId {get; set;}
|
||||||
[Required] public Warehouse DestinationWarehouse {get; set;}
|
[Required] public Warehouse? DestinationWarehouse {get; set;}
|
||||||
}
|
}
|
@@ -1,17 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using API.Class;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace API.Models;
|
|
||||||
|
|
||||||
[PrimaryKey(nameof(SupplierId), nameof(ProductId))]
|
|
||||||
public class Price
|
|
||||||
{
|
|
||||||
[Required] public decimal Label { get; set; }
|
|
||||||
|
|
||||||
[Required] public int SupplierId { get; set; }
|
|
||||||
[Required] public Supplier Supplier { get; set; }
|
|
||||||
|
|
||||||
[Required] public int ProductId { get; set; }
|
|
||||||
[Required] public Product Product { get; set; }
|
|
||||||
}
|
|
@@ -1,5 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using PyroFetes.Models;
|
||||||
|
|
||||||
namespace API.Models
|
namespace API.Models
|
||||||
{
|
{
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class ProductCategory
|
public class ProductCategory
|
||||||
{
|
{
|
||||||
[Key] public int Id { get; set; }
|
[Key] public int Id { get; set; }
|
||||||
[Required] public string Label { get; set; }
|
[Required] public string? Label { get; set; }
|
||||||
|
|
||||||
[Required] public List<Product> Products { get; set; }
|
[Required] public List<Product>? Products { get; set; }
|
||||||
}
|
}
|
@@ -1,7 +1,8 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using API.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
[PrimaryKey(nameof(ProductId), nameof(ColorId))]
|
||||||
public class ProductColor
|
public class ProductColor
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
|
[PrimaryKey(nameof(ProductId), nameof(EffectId))]
|
||||||
public class ProductEffect
|
public class ProductEffect
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using API.Models;
|
|
||||||
|
|
||||||
namespace API.Class;
|
|
||||||
|
|
||||||
public class Supplier
|
|
||||||
{
|
|
||||||
[Key] public int Id { get; set; }
|
|
||||||
[Required, MaxLength(100)] public string Name { get; set; }
|
|
||||||
[Required] public string Email { get; set; }
|
|
||||||
[Required] public string PhoneNumber { get; set; }
|
|
||||||
[Required] public string Adress { get; set; }
|
|
||||||
[Required] public int ZipCode { get; set; }
|
|
||||||
[Required] public string City { get; set; }
|
|
||||||
|
|
||||||
}
|
|
@@ -1,23 +1,22 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Models;
|
|
||||||
|
|
||||||
namespace API.Class;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class Warehouse
|
public class Warehouse
|
||||||
{
|
{
|
||||||
[Key] public int Id {get; set;}
|
[Key] public int Id {get; set;}
|
||||||
[Required, MaxLength(100)] public string Name {get; set;}
|
[Required, MaxLength(100)] public string? Name {get; set;}
|
||||||
[Required] public int MaxWeight {get; set;}
|
[Required] public int MaxWeight {get; set;}
|
||||||
[Required] public int Current {get; set;}
|
[Required] public int Current {get; set;}
|
||||||
[Required] public int MinWeight {get; set;}
|
[Required] public int MinWeight {get; set;}
|
||||||
[Required] public string Adress { get; set; }
|
[Required] public string? Address { get; set; }
|
||||||
[Required] public int ZipCode { get; set; }
|
[Required] public int ZipCode { get; set; }
|
||||||
[Required] public string City { get; set; }
|
[Required] public string? City { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[Required] public List<Material> Materials {get; set;}
|
[Required] public List<Material>? Materials {get; set;}
|
||||||
|
|
||||||
|
|
||||||
[Required] public List<Movement> MovementsSource { get; set; }
|
[Required] public List<Movement>? MovementsSource { get; set; }
|
||||||
[Required] public List<Movement> MovementsDestination { get; set; }
|
[Required] public List<Movement>? MovementsDestination { get; set; }
|
||||||
}
|
}
|
@@ -1,15 +1,15 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using API.Class;
|
using API.Models;
|
||||||
|
|
||||||
namespace API.Models;
|
namespace PyroFetes.Models;
|
||||||
|
|
||||||
public class WarehouseProduct
|
public class WarehouseProduct
|
||||||
{
|
{
|
||||||
[Key] public int Quantity { get; set; }
|
[Key] public int Quantity { get; set; }
|
||||||
|
|
||||||
[Required] public int ProductId { get; set; }
|
[Required] public int ProductId { get; set; }
|
||||||
[Required] public Product Product { get; set; }
|
[Required] public Product? Product { get; set; }
|
||||||
|
|
||||||
[Required] public int WarehouseId { get; set; }
|
[Required] public int WarehouseId { get; set; }
|
||||||
[Required] public Warehouse Warehouse { get; set; }
|
[Required] public Warehouse? Warehouse { get; set; }
|
||||||
}
|
}
|
Reference in New Issue
Block a user