﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PAaaS.Models
{
    using System.ComponentModel.DataAnnotations.Schema;

    public class Assignment
    {
        [Key]
        public int Id { get; set; }
        
        [Column(TypeName = "DateTime2")]
        public DateTime? CreatedOn { get; set; }

        [Required]
        [MaxLength(200)]
        [MinLength(5)]
        public string Title { get; set; }
        
        [Required]
        [MaxLength(500)]
        [MinLength(10)]
        public string Description { get; set; }
        
        [Column(TypeName = "DateTime2")]
        public DateTime? DueDate { get; set; }

        public TimeSpan? Duration { get; set; }

        public double? Latitude { get; set; }

        public double? Longitude { get; set; }

        public AssignmentState State { get; set; }

        public DateTime? CompletedOn { get; set; }

        [Required]
        public decimal Price { get; set; }

        public bool IsPublic { get; set; }

        public string OwnerId { get; set; }

        public virtual User Owner { get; set; }

        public string AssigneeId { get; set; }

        public virtual User Assignee { get; set; }

        public int CategoryId { get; set; }

        public virtual AssignmentCategory Category { get; set; }
    }
}