using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Rainbow.Models
{
    public class Server : IAuditInfo
    {
        public Server()
        {
            IpAddresses = new List<IpAddress>();
            Credentials = new List<Credentials>();
            Children = new List<Server>();
        }

        [Key]
        public int Id { get; set; }

        public int? ParentId { get; set; }

        public int? OwnerId { get; set; }

        [Required, Display(Name = "Hostname")]
        public string HostName { get; set; }

        [Display(Name = "Betriebssystem")]
        public string OperatingSystem { get; set; }

        [Display(Name = "Hardwareausstattung")]
        public string HardwareDescription { get; set; }

        [Display(Name="Anmerkungen")]
        public string Comments { get; set; }

        [Required, Display(Name = "Erstellt")]
        public DateTime Created { get; set; }

        [Display(Name = "Erstellt von")]
        public string CreatedBy { get; set; }

        [Required, Display(Name = "Geändert")]
        public DateTime LastModified { get; set; }

        [Display(Name = "Geändert von")]
        public string LastModifiedBy { get; set; }

        public ICollection<IpAddress> IpAddresses { get; set; }

        public ICollection<Credentials> Credentials { get; set; }

        public ICollection<Server> Children { get; set; }
    }
}