using AutoMapper;
using DSaC_second.Models.DTOs;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DSaC_second.Database.Models
{
    [Table("contract")]
    [AutoMap(typeof(ContractBaseDto))]
    [AutoMap(typeof(ContractViewDto))]
    public class Contract
    {
        [Key]
        [Column("id")]
        public Guid Id { get; set; }

        [Column("contract_number")]
        [Required]
        public string ContractNumber { get; set; }

        [Column("manager_name")]
        [Required]
        public string ManagerName { get; set; }

        [Column("counterparty_id")]
        [Required]
        public Guid CounterpartyId { get; set; }

        [Column("creation_time")]
        [Required]
        public DateTime CreatinTime { get; set; } = DateTime.Now;

        [Column("is_closed")]
        [DefaultValue(false)]
        public bool IsClosed { get; set; }
    }
}
