/**
 * Role.js
 *
 * @description :: A model definition represents a database table/collection.
 * @docs        :: https://sailsjs.com/docs/concepts/models-and-orm/models
 */


module.exports = {
    tableName: 'abscence_presence',

    attributes: {
        /* id: {
         type: 'number',
         //columnName: 'id',
         unique: true,
         autoIncrement: true,
         primaryKey: true,
         //required: true,
         columnType: 'integer',
     },*/
        codeAbscence: {
            type: 'string',
            columnName: 'code_abscence',
            required: true,
            

        },
        codeMatiere: {
            type: 'string',
            columnName: 'codeMatiere',
            required: true,

        },
        codeClasse: {
            type: 'string',
            columnName: 'codeClasse',
            required: true,

        },
        
        codeEnseignant: {
            type: 'string',
            columnName: 'codeEnseignant',
            //allowNull: true,
            required: true,
        },
        dateCours: {
            type: 'string',
            columnName: 'date_cours',
            allowNull: true
        },
        heureDebutCours: {
            type: 'string',
            columnName: 'heure_deb_cours',
            allowNull: true
        },
        heureFinCours: {
            type: 'string',
            columnName: 'heure_fin_cours',
            allowNull: true
        },

        dateEnregistrement: {
            type: 'string',
            columnName: 'date_enregistrement',
            allowNull: true

        },
        heureEnregistrement: {
            type: 'string',
            columnName: 'heure_enregistrement',
            allowNull: true

        },
        
        observation: {
            type: 'string',
            columnName: 'observation',
            allowNull: true

        },
        sms: {
            type: 'boolean',
            columnName: 'sms',
            //allowNull: true,
            defaultsTo: false,


        },
        whatsapp: {
            type: 'boolean',
            columnName: 'whatsapp',
            defaultsTo: false,
        },
        estValider: {
            type: 'boolean',
            columnName: 'est_valider',
            defaultsTo: false,
        },

        codeEcole: {
            type: 'string',
            columnName: 'code_ecole',
            required: true,

        },
        anneeScolaire: {
            type: 'string',
            columnName: 'anneeScolaire',
            required: true,
            //columnType: 'bigint'
        },


    },

};

