import { type ListFrontEndInterface } from '../CommonType'

export interface FormComponentProps extends FormStaeInterface {
    LeaveType: number
    LeaveEditRecord: any
    onFinish: () => void
    resetdata: string
    setResetData: React.Dispatch<React.SetStateAction<string>>
}

export interface FormStaeInterface {
    workflowDropDownList: ListFrontEndInterface[]
    LeaveModeDropDownList: ListFrontEndInterface[]
    userList: ListFrontEndInterface[]
}

export interface LeaveFormListType extends LeaveFormStateType {
    resetdata: string
    setResetData: React.Dispatch<React.SetStateAction<string>>
}

export interface LeaveFormStateType {
    LeaveList: LeaveListType[]
    LeaveListCount: number
}
export interface LeaveListTableIntrface extends LeaveListType {
    key: React.Key
}
export interface LeaveListType {
    leaveId: number
    leaveFrom: string
    leaveTo: string
    description: string
    leaveApprovedBy: number
    leaveApprovalStatus: string
    leaveApprovalDescription: string
    leaveType: number
    leaveMode: number
    coveringPersonId: number
    leaveTypeName: string
    leaveModeName: string
    coveringPersonName: string
    workflowId: number
    appliedOn: string
    leaveAppliedBy: number
    approvalHistoryList: ApprovalHistoryType[]
}

export interface ApplyFormListType extends ApplyFormStateType {
    onFinish: any
    editedData: (data: PermissionListType) => void
    savaStatus: boolean
    statusHandlingFunction: (status: boolean) => void
}

export interface ApplyFormStateType {
    PermissionList: PermissionListType[]
    PermissionListCount: number
}

export interface PermissionListType {
    coveringEndTime: string
    coveringFrom: string
    coveringRequired: number
    coveringStartTime: string
    coveringTo: string
    description: string
    endTime: string
    endTo: string
    permissionApprovalDescription: string
    permissionApprovalStatus: string
    permissionId: number
    startFrom: string
    startTime: string
    workflowId: number
    approvalHistoryList: ApprovalHistoryType[]
}

export interface ApplyFormType extends ApplyFormPermissionStateType {
    LeaveType: number
    resetdata: string
    setResetData: React.Dispatch<React.SetStateAction<string>>
}

export interface ApplyFormPermissionStateType {
    workflowDropDownList: ListFrontEndInterface[]
}

export interface CalendarComponentPropsType extends CalendarComponentStateType {
    setActive: boolean
}

export interface CalendarComponentStateType {
    TeamCalenderList: CalendarEventType[]
    PersonalCalenderList: CalendarEventType[]
}

export interface CalendarEventType {
    className: string
    description: string
    end: string
    key: string | number
    start: string
    title: string
}

export interface ApplyExpandViewType {
    listsData: {
        approvalHistoryList: ApprovalHistoryType[]
        coveringFrom: string
        coveringStartTime: string
        coveringEndTime: string
    }
}

export interface ApprovalHistoryType {
    workflowName: string
    approverName: string
    approvalStatus: string
}

export interface LeaveExpandViewType {
    listsData: {
        approvalHistoryList?: ApprovalHistoryType[]
    }
}

export interface LeavePayloadInteface {
    data: LeaveListType[]
    noOfRecords: number
}

export interface PermissionPayloadInteface {
    data: PermissionListType[]
    noOfRecords: number
}
