using MTWorkHR.Application.Models;
using MTWorkHR.Core.Entities;
using MTWorkHR.Core.Entities.Base;
using MTWorkHR.Core.Global;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTWorkHR.Application.Models
{
    public class ContractDto : EntityDto
    {
        public ContractTypeEnum ContractTypeId { get; set; }
        public ContractStatusEnum ContractStatusId { get; set; } 

        public long CompanyId { get; set; }
        public string CompanyRepresentativeId { get; set; }
       
        public string UserId { get; set; }
        [JsonProperty(Required = Required.AllowNull)]
        public string? EmployeeName { get; set; }
        [JsonProperty(Required = Required.AllowNull)]
        public string? EmployeeEmail { get; set; }
      
        public int? JobId { get; set; }
        public int? AcademicQualificationId { get; set; }
        public int? SpecializationId { get; set; }
        public int WorkCountryId { get; set; }
        public int WorkStateId { get; set; }
        //-------------------Scope of work-----------
        public string? JobTitleName { get; set; }
        public string? JobDescription{ get; set; }
        [MaxLength(150)]
        public string? JobNumber { get; set; } //ثابت و مأخوذ من المنصة
        //----------------Contract data -------------------------
        public DateTime? StartDate { get; set; }
        [JsonProperty(Required = Required.AllowNull)]
        public DateTime? EndDate { get; set; }

        [JsonProperty(Required = Required.AllowNull)]
        public ContractDurationEnum? ContractDurationId { get; set; } //:  اختيار: شهري – ربعي – نصف سنوي – 3 ارباع – سنوي
        public TypeOfWork? TypeOfWork { get; set; } //: :   اختيار: عقد بدوام كامل -  عقد دوام جزئي   
        [JsonProperty(Required = Required.AllowNull)]
        public int? VacationDays { get; set; } //اختيار: بدون – سنويا (رقم)
        public int? TrialPeriod { get; set; } // تجربة (ادخال: تلقائياً كل ربع سنوي أسبوع تلقائياً) آخر: تعديل
        public TerminateContractEnum WhoCanTerminateContractInTrial { get; set; } //اختيار   الجميع – صاحب العمل – الموظف
        public TerminateContractEnum WhoCanTerminateContract { get; set; }
        [JsonProperty(Required = Required.AllowNull)]
        public int? NoticePeriodBeforeTermination { get; set; } //اختيار: بدون – تحديد (ادخال: تلقائياً مدة 10 أيام قبل انتهاء الاستحقاق) آخر: تعديل


        //------Working time---------------
        [JsonProperty(Required = Required.AllowNull)]
        public List<string>? WorkingDays { get; set; } //:   اختيار متعدد الأيام سبت أحد اثنين..... (بحيث الأيام الأخرى تكون إجازة) 1,2,3,4,5
        public WorkingHours WorkingHours { get; set; } //	يومي/ اسبوعي  
        public int? WorkingHoursNum { get; set; } // عدد الساعات
        public DateTime? StartDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل
        public DateTime? EndDailyWorkingHours { get; set; } // تحديد ساعات الدوام قائمة الساعات << التوقيت بحسب دولة صاحب العمل

        //----------Salary-----------------
        [MaxLength(50)]
        public string? Currency { get; set; }
        public decimal? Salary{ get; set; }
        public string? BillingCycle { get; set; }// 2 fortnightly, 4 Monthly
        //------------------------Fixed Pay----------------
        public DateTime? FirstPatchDateFrom { get; set; } 
        public DateTime? FirstPatchDateTo { get; set; } //
        public decimal? FirstPatchAmount { get; set; }

        public DateTime? LastPatchDateFrom { get; set; } //
        public DateTime? LastPatchDateTo { get; set; } // 
        public decimal? LastPatchAmount { get; set; }
        public string? Teams{ get; set; }
        public string? Vacations{ get; set; }

        //__________________HR data_________-
        public List<TeamDto>? TeamList { get; set; }
        public List<OrderRequestDto>? OrderList { get; set; }


        //---------Allowances----------------------
        public bool IncludesAllAllowances { get; set; }
        public List<ContractAllowanceDto>? FixedAllowances { get; set; }

        //-------------------------------
        public List<ContractTaskDto>? ContractTasks { get; set; }
        public List<ProjectStageDto>? ProjectStages { get; set; }

    }
}