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

namespace Vulnerator.Model.Entity
{
    [Table("VulnerabilitySources")]
    public class VulnerabilitySource : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public VulnerabilitySource()
        {
            SCAP_Scores = new ObservableCollection<SCAP_Score>();
            Vulnerabilities = new ObservableCollection<Vulnerability>();
        }

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long VulnerabilitySource_ID { get; set; }

        [Required]
        [StringLength(100)]
        public string SourceName { get; set; }

        [StringLength(100)]
        public string SourceSecondaryIdentifier { get; set; }

        [StringLength(500)]
        public string VulnerabilitySourceFileName { get; set; }

        [StringLength(2000)]
        public string SourceDescription { get; set; }

        [Required]
        [StringLength(25)]
        public string SourceVersion { get; set; }

        [Required]
        [StringLength(25)]
        public string SourceRelease { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<SCAP_Score> SCAP_Scores { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Vulnerability> Vulnerabilities { get; set; }
    }
}
