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


module.exports = {

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

    username: {
      type: 'string',
      allowNull: true

    },

    date: {
      type: 'string',
      allowNull: true

    },
    heure: {
      type: 'string',
      allowNull: true

    },
    ip: {
      type: 'string',
      allowNull: true

    },
    location: {
      type: 'string',
      allowNull: true

    },
    departement: {
      type: 'string',
      allowNull: true

    },
    latitude: {
      type: 'string',
      allowNull: true

    },
    longitude: {
      type: 'string',
      allowNull: true

    },
   
    action: {
      type: 'string',
      allowNull: true

    },
     // Type d’appareil (mobile, web, etc.)
     device: {
      type: 'string',
      allowNull: true,
      description: 'Type appareil (Android, iOS, Web, etc.)',
    },
     // Statut de la tentative (succès, échec)
     status: {
      type: 'string',
      isIn: ['success', 'failed'],
      defaultsTo: 'success',
      description: 'Statut de la connexion',
    },
    // Message d’erreur éventuel
    errorMessage: {
      type: 'string',
      allowNull: true,
      description: 'Message erreur en cas d échec',
    },


  },

};

