CONTROLLERS.

This commit is contained in:
MarcEricMartel
2022-11-02 18:00:48 -07:00
parent 8b776405be
commit c59c7ee9f1
7 changed files with 235 additions and 27 deletions

View File

@@ -5,11 +5,19 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace GrossesMitainesAPI.Models;
public class InvoiceModel {
public enum InStates {
Confirmed,
Cancelled,
Preparing,
Shipping,
Shipped,
Returned
}
public class ProductInvoice {
[Key]
public int Id { get; set; }
public ProductModel Product { get; set; }
public int Quantity { get; set; }
public uint Quantity { get; set; }
}
[Key]
@@ -23,14 +31,11 @@ public class InvoiceModel {
[Required, EmailAddress]
public string EmailAddress { get; set; }
public InventoryUser? LinkedAccount { get; set; }
public DateTime PurchaseDate { get; } = DateTime.Now;
public DateTime PurchaseDate { get; set; } = 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;
public InStates Status { get; set; } = InStates.Confirmed;
}

View File

@@ -0,0 +1,5 @@
namespace GrossesMitainesAPI.Models;
public class LoginModel {
public string email { get; set; } = "";
public string password { get; set; } = "";
}

View File

@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace GrossesMitainesAPI.Models;
public class SignUpUserModel {
[Required, MinLength(2), MaxLength(30)]
public string FirstName { get; set; }
[Required, MinLength(1), MaxLength(30)]
public string LastName { get; set; }
[Required, EmailAddress]
public string Email { get; set; }
[Required, Phone]
public string Phone { get; set; }
[Required]
public string Password { get; set; }
public List<AddressModel> Adresses { get; set; }
}