using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WebVentaCoche.Enums;
using WebVentaCoche.ViewModels;

namespace WebVentaCoche.Models
{
    public class Order
    {
        [Key]
        public int Id { get; set; } 
        [Required]
        public string UserId { get; set; } 
        [ForeignKey("UserId")]
        public virtual User User { get; set; } 
        [Required]
        public DateTime OrderDate { get; set; }
        public DateTime? ShippedDate { get; set; }
        [Required]
        public decimal TotalAmount { get; set; }
        [Required]
        public OrderStatus Status { get; set; }
        [Required]
        public string ShippingAddress { get; set; }
        public virtual List<OrderDetail> OrderDetails { get; set; } = new List<OrderDetail>();
    }
}
