﻿using HockeyApp.Common.Enums;
using HockeyApp.Models.Teams;
using System;
using HockeyApp.Models.Interfaces;
using HockeyApp.Models.Users;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace HockeyApp.Models.Announcements
{
    [Table("TournamentAnnouncementResponses", Schema = "ads")]
    public class TournamentAnnouncementResponse : IHistoryTrackableEntity
    {
        public long Id { get; set; }

        public long TeamId { get; set; }
        public virtual Team Team { get; set; }

        public long TournamentAnnouncementId { get; set; }
        public virtual TournamentAnnouncement TournamentAnnouncement { get; set; }

        public AnnouncementResponseState State { get; set; } = AnnouncementResponseState.New;

        [Column(TypeName = "datetime")]
        public DateTime CreateDate { get; set; }

        [ForeignKey("Creator")]
        public long CreatorId { get; set; }
        public virtual User Creator { get; set; }

        [ForeignKey("Editor")]
        public long? EditorId { get; set; }
        public virtual User Editor { get; set; }
        public DateTime? EditDate { get; set; }

        [Required]
        [StringLength(255)]
        public string ContactName { get; set; }

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

        public string Comment { get; set; }
    }
}
