forked from sanchezvem/PyroFetes
Creating all entities for subject 2
This commit is contained in:
11
PyroFetes/Models/Deliverer.cs
Normal file
11
PyroFetes/Models/Deliverer.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Deliverer
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? Transporter { get; set; }
|
||||
|
||||
public List<DeliveryNote>? DeliveryNotes { get; set; }
|
||||
}
|
15
PyroFetes/Models/DeliveryNote.cs
Normal file
15
PyroFetes/Models/DeliveryNote.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class DeliveryNote
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? TrackingNumber { get; set; }
|
||||
public int DelivererId { get; set; }
|
||||
[Required] public DateOnly EstimateDeliveryDate { get; set; }
|
||||
[Required] public DateOnly ExpeditionDate { get; set; }
|
||||
[Required] public DateOnly RealDeliveryDate { get; set; }
|
||||
|
||||
public Deliverer? Deliverer { get; set; }
|
||||
}
|
15
PyroFetes/Models/Price.cs
Normal file
15
PyroFetes/Models/Price.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(SupplierId))]
|
||||
public class Price
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int SupplierId { get; set; }
|
||||
[Required] public decimal SellingPrice { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public Supplier? Supplier { get; set; }
|
||||
}
|
16
PyroFetes/Models/ProductDelivery.cs
Normal file
16
PyroFetes/Models/ProductDelivery.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(DeliveryNoteId))]
|
||||
public class ProductDelivery
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int DeliveryNoteId { get; set; }
|
||||
[Required] public int Quantity { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public DeliveryNote? DeliveryNote { get; set; }
|
||||
}
|
||||
|
9
PyroFetes/Models/PurchaseOrder.cs
Normal file
9
PyroFetes/Models/PurchaseOrder.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class PurchaseOrder
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? PurchaseConditions { get; set; }
|
||||
}
|
16
PyroFetes/Models/PurchaseProduct.cs
Normal file
16
PyroFetes/Models/PurchaseProduct.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(PurchaseOrderId))]
|
||||
public class PurchaseProduct
|
||||
{
|
||||
public Product? Product { get; set; }
|
||||
[Required] public int ProductId { get; set; }
|
||||
|
||||
public PurchaseOrder? PurchaseOrder { get; set; }
|
||||
[Required] public int PurchaseOrderId { get; set; }
|
||||
|
||||
[Required] public int Quantity { get; set; }
|
||||
}
|
10
PyroFetes/Models/Quotation.cs
Normal file
10
PyroFetes/Models/Quotation.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Quotation
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? Message { get; set; }
|
||||
[Required] public string? ConditionsSale { get; set; }
|
||||
}
|
15
PyroFetes/Models/QuotationProduct.cs
Normal file
15
PyroFetes/Models/QuotationProduct.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
[PrimaryKey(nameof(ProductId), nameof(QuotationId))]
|
||||
public class QuotationProduct
|
||||
{
|
||||
[Required] public int ProductId { get; set; }
|
||||
[Required] public int QuotationId { get; set; }
|
||||
[Required] public int Quantity { get; set; }
|
||||
|
||||
public Product? Product { get; set; }
|
||||
public Quotation? Quotation { get; set; }
|
||||
}
|
10
PyroFetes/Models/Setting.cs
Normal file
10
PyroFetes/Models/Setting.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class Setting
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required] public string? Logo { get; set; }
|
||||
[Required] public string? ElectronicSignature { get; set; }
|
||||
}
|
16
PyroFetes/Models/Supplier.cs
Normal file
16
PyroFetes/Models/Supplier.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
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? Phone { get; set; }
|
||||
[Required] public string? Address { get; set; }
|
||||
[Required] public int ZipCode { get; set; }
|
||||
[Required] public string? City { get; set; }
|
||||
[Required] public int DeliveryDelay { get; set; }
|
||||
}
|
13
PyroFetes/Models/User.cs
Normal file
13
PyroFetes/Models/User.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PyroFetes.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
[Key] public int Id { get; set; }
|
||||
[Required, MaxLength(100)] public string? Name { get; set; }
|
||||
[Required, MinLength(12)] public string? Password { get; set; }
|
||||
[Required] public string? Salt { get; set; }
|
||||
[Required] public string? Email { get; set; }
|
||||
[Required] public string? Fonction { get; set; }
|
||||
}
|
@@ -17,8 +17,4 @@
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user