using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using ComputerStoreContracts.Enums;

namespace ComputerStoreDatabase.Models;

public class User
{
    public int ID { get; set; }

    [Required]
    public string Login { get; set; } = string.Empty;

    [Required]
    public string Password { get; set; } = string.Empty;

    [Required]
    public string FIO { get; set; } = string.Empty;

    [Required]
    public string Email { get; set; } = string.Empty;

    public UserType UserType { get; set; }

    [ForeignKey("UserID")]
    public virtual List<Product> Products { get; set; } = new();

    [ForeignKey("UserID")]
    public virtual List<Component> Components { get; set; } = new();

    [ForeignKey("UserID")]
    public virtual List<Assembly> Assemblies { get; set; } = new();

    [ForeignKey("UserID")]
    public virtual List<Request> Requests { get; set; } = new();
}
