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

namespace Vrh.iScheduler.Report
{
    /// <summary>
    /// Riportcsomagba tartozó riportok.
    /// </summary>
    [Table("SchedulerReportPackageItems")]
    public class SchedulerReportPackageItem
    {
        /// <summary>
        /// Riport csomag elemeinek belső egyedi azonosítója
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// Melyik riportcsomagba tartozik a report.
        /// </summary>
        [Index("IX_SchedulerReportPackageItems_SchedulerReportPackageId_ReportId_LCID_PresetId", 1, IsUnique = true)]
        public int SchedulerReportPackageId { get; set; }

        /// <summary>
        /// Riport azonosítója (neve).
        /// </summary>
        [Required, MaxLength(50)]
        [Index("IX_SchedulerReportPackageItems_SchedulerReportPackageId_ReportId_LCID_PresetId", 2, IsUnique = true)]
        public string ReportId { get; set; }

        /// <summary>
        /// Melyik nyelvi változat kerül a csomagba.
        /// </summary>
        [Required, MaxLength(10)]
        [Index("IX_SchedulerReportPackageItems_SchedulerReportPackageId_ReportId_LCID_PresetId", 3, IsUnique = true)]
        public string LCID { get; set; }

        /// <summary>
        /// Melyik előzetes paraméterkészlettel fusson a riport.
        /// </summary>
        [Required, MaxLength(50)]
        [Index("IX_SchedulerReportPackageItems_SchedulerReportPackageId_ReportId_LCID_PresetId", 4, IsUnique = true)]
        public string PresetId { get; set; }

        /// <summary>
        /// Riport formátuma.
        /// </summary>
        [Required, MaxLength(10)]
        public string ExportType { get; set; }

        /// <summary>
        /// Az a riport csomag, amelyhez ez az elem tartozik.
        /// </summary>
        [ForeignKey("SchedulerReportPackageId")]
        public virtual SchedulerReportPackage SchedulerReportPackage { get; set; }
    }
}
