import { FormControl } from '@angular/forms';

import { Profile } from './profile.model';

export interface Jump {
    slug: string;
    date: string;
    numero: number;
    lieu?: string;
    oaci?: string;
    aeronef?: string;
    imat?: string;
    hauteur?: number;
    deploiement?: number;
    voile?: string;
    taille?: number;
    categorie?: string;
    module?: string;
    participants?: number;
    sautants: Array<string>;
    programme?: string;
    accessoires?: string;
    zone?: string;
    dossier?: string;
    video?: string;
    author: Profile;
    createdAt: string;
    updatedAt: string;
    //isEdit?: boolean;
    isSelected?: boolean;
};

export interface JumpForm {
    date: FormControl<string>;
    numero: FormControl<number>;
    lieu: FormControl<string>;
    oaci: FormControl<string>;
    aeronef: FormControl<string>;
    imat: FormControl<string>;
    hauteur: FormControl<number>;
    deploiement: FormControl<number>;
    voile: FormControl<string>;
    taille: FormControl<number>;
    categorie: FormControl<string>;
    module: FormControl<string>;
    participants: FormControl<number>;
    //sautants: FormControl<Array<string>>;
    programme: FormControl<string>;
    accessoires: FormControl<string>;
    zone: FormControl<string>;
    dossier: FormControl<string>;
    video: FormControl<string>;
}

export interface JumpAddParams {
    numeros: string;
    date: string;
    video: boolean;
};

export interface JumpByDate {
    _id: {
        month: number;
        year: number;
    };
    count: number;
};

export interface ColumnDefinition {
    key: string;
    type: string;
    label: string;
    required?: boolean;
    pattern?: string;
    min?: number;
    step?: number;
};

export const jumpColumns: Array<ColumnDefinition> = [
    {
        key: 'isSelected',
        type: 'isSelected',
        label: ''
    },
    {
        key: 'date',
        type: 'date',
        label: 'Date',
        required: true
    },
    {
        key: 'numero',
        type: 'numeric',
        label: 'Numéro',
        required: true,
        min: 0,
        step: 1
    },
    {
        key: 'lieu',
        type: 'text',
        label: 'Lieu'
    },
    {
        key: 'oaci',
        type: 'text',
        label: 'OACI'
    },
    {
        key: 'aeronef',
        type: 'text',
        label: 'Aéronef'
    },
    {
        key: 'imat',
        type: 'text',
        label: 'Imat.'
    },
    {
        key: 'hauteur',
        type: 'numeric',
        label: 'Hauteur'
    },
    {
        key: 'deploiement',
        type: 'numeric',
        label: 'Deploiement'
    },
    {
        key: 'voile',
        type: 'text',
        label: 'Voile'
    },
    {
        key: 'taille',
        type: 'numeric',
        label: 'Taille'
    },
    {
        key: 'categorie',
        type: 'text',
        label: 'Categorie'
    },
    {
        key: 'module',
        type: 'text',
        label: 'Module'
    },
    {
        key: 'participants',
        type: 'numeric',
        label: 'Participants'
    },
    {
        key: 'sautants',
        type: 'text',
        label: 'Sautants'
    },
    {
        key: 'programme',
        type: 'text',
        label: 'Programme'
    },
    {
        key: 'accessoires',
        type: 'text',
        label: 'Accessoires'
    },
    {
        key: 'zone',
        type: 'text',
        label: 'Zone'
    },
    /*{
        key: 'dossier',
        type: 'text',
        label: ''
    },*/
    {
        key: 'video',
        type: 'text',
        label: 'Vidéo'
    },
    {
        key: 'isEdit',
        type: 'isEdit',
        label: ''
    }
];