Renvoit du rôle au frontend avec Get Login (UPDATE-DATABASE)
This commit is contained in:
@@ -1,12 +1,36 @@
|
||||
using GrossesMitainesAPI.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GrossesMitainesAPI.Models;
|
||||
public class InvoiceModel {
|
||||
public InventoryUser Account { get; set; }
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public Dictionary<Product, int> Products { get; set; }
|
||||
public InventoryUser.Address BillingAddress { get; set; }
|
||||
public InventoryUser.Address ShippingAddress { get; set; }
|
||||
public class ProductInvoice {
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public ProductModel Product { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[Required, MinLength(2), MaxLength(30)]
|
||||
public string FirstName { get; set; }
|
||||
[Required, MinLength(1), MaxLength(30)]
|
||||
public string LastName { get; set; }
|
||||
[Required, Phone]
|
||||
public string PhoneNumber { get; set; }
|
||||
[Required, EmailAddress]
|
||||
public string EmailAddress { get; set; }
|
||||
public InventoryUser? LinkedAccount { get; set; }
|
||||
public DateTime PurchaseDate { get; } = DateTime.Now;
|
||||
[Required]
|
||||
public List<ProductInvoice> Products { get; set; }
|
||||
|
||||
//[Required, Column("BillingAddress")]
|
||||
//public AddressModel BillingAddress { get; set; }
|
||||
[Required]
|
||||
public AddressModel ShippingAddress { get; set; }
|
||||
public bool Canceled { get; set; } = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user