using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace TravelExpenses.Models
{
    public class TravelOrder
    {
        [Key][DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int TravelOrderId { get; set; }
        [Required] public string TravelOrderNumber { get; set; }
        [Required] public DateTime DateOfIssue { get; set; }
        [Required] public DateTime DateOfEdit { get; set; }
        [Required] public int PersonId { get; set; } public Person Person { get; set; }
        //automatski se popunjava naziv radnog mjesta i takav se upisuje u bazu
        [Required] public int PositionId { get; set; } public Position Position { get; set; }
        //automatski se popunjava adresa centra u kojem zaposlenik radi
        [Required] public int CenterId { get; set; } public Center Center { get; set; }
        [Required] public DateTime FromDateTime { get; set; }
        [NotMapped] public DateTime FromDate { get; set; }
        [NotMapped] public DateTime FromTime { get; set; }
        //automatski se popunjava ime i prezime nadređenog
        public int? SuperiorId { get; set; } public Person Superior { get; set; }
        public bool Cancelled { get; set; }
        public bool PlaceOfResidence { get; set; }
        public string Task { get; set; }
        [Required] public DateTime ToDateTime { get; set; }
        [NotMapped] public DateTime ToDate { get; set; }
        [NotMapped] public DateTime ToTime { get; set; }
        [Required] public int VehicleId { get; set; } public Vehicle Vehicle { get; set; }
        //TODO: putne troškove tereti - na prvu izgleda da je to samo informativno polje
        //TODO: mjesto troška - na prvu izgleda da je to samo informativno polje
        public decimal Advance { get; set; }
        public int CurrencyId { get; set; } public Currency Currency { get; set; }

    }
}
