import {GetRequestParams} from "../Axios";
import {Order} from "../../components/UI/DuaList/ListHeader/ListHead";
import {FilterStatusType} from "../ReactComponents";
import {WorkPackage} from "../../components/Rescom/RescomProjects/RescomProjectsList/ProjectsList";
import {PersonalFolderFile} from "../HrSupport/PersonalFolder";

export interface RescomContract {
    to_resolve: boolean | undefined;
    contract_file: PersonalFolderFile | null
    contract_form_file: PersonalFolderFile | null
    project: any;
    work_packages: WorkPackage[]
    work_relation_id: number | null;
    project_wp: string | undefined;
    unit_acronym: any;
    contract_code: string;
    afm: string | undefined;
    messages: never[];
    occupation: string | undefined;
    contract_duration: string | undefined;
    extra: any;
    id: any;
    type:ContractType
    contract_type: any;
    user_id: string;
    staffCategory?: string;
    titleA1?: string;
    applicationNumber?: string;

    status: boolean;
    contract_id: string | number;
    firsname: string;
    lastname: string;
    fathers_name: string;
    project_code: string;
    project_acronym: string;
    unit: string;
    scientific_supervisor_fullname: string;
    protocol_number: string;
    contract_start_date: string; // ISO format
    contract_end_date: string;   // ISO format
    remaining_days: number;
    contract_cost: string;
    hours: number;
    hourly_rate: number |string;
    comments: string|undefined;
    message_counter: number;
    CommentIconEmpty: any;
}

export interface ContractType {
    description: string
    id: 1
    name: 'pending' | 'awaiting_acceptance' | 'accepted' | 'declined' | 'cancelled' | 'error' | 'cancel'
    view_name: string
    view_name_plural: string
    type: FilterStatusType
}
export interface ContractMessageData {

    user_email: string;
    created_at: any;
    id: string;
    author: string;   // who wrote it
    date: string;     // ISO date string
    content?: string;  // actual comment text
}


export interface ContractMessage {
    decrypted_content: string;
    records: ContractMessageData
    user_email: string;
    created_at: any;
    id: string;
    author: string;   // who wrote it
    date: string;     // ISO date string
    content?: string;  // actual comment text
}


export interface GetRescomContractsParams extends GetRequestParams {
    date_to_end?: any;
    date_to_start?: any;
    date_from_end?: any;
    date_from_start?:any;
    unit_code?: any
    contract_type: any
    status: any
    date_from: any
    date_to: any
    fpa: boolean | null | string
    to_resolve: boolean | null | string
    article_39: boolean | null | string
    order: Order,
    order_by: string
    search: string
    role?: string
    project_code: string
    user_id:string | number
}
