Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	bin/www
#	model/Classes/Bot.js
#	model/Classes/MySQLDataBase.js
  • Loading branch information
characat0 committed May 8, 2020
2 parents 74f33b2 + a2721d1 commit 5119a2a
Show file tree
Hide file tree
Showing 100 changed files with 4,399 additions and 2,925 deletions.
34 changes: 34 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
DATABASE_NAME
DATABASE_USERNAME
DATABASE_PASSWORD
DATABASE_TIMEZONE
DATABASE_HOST
DATABASE_PORT
DATABASE_DIALECT
DATABASE_ACQUIRE_TIME
DATABASE_MAX_CONNECTION
DATABASE_MIN_CONNECTION
DATABASE_IDLE_TIME
DATABASE_EVICT_TIME
NODE_ENVIRONMENT
PROCESS_OWN_PING_INTERVAL
CACHE_TIME
AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY
AWS_S3_REGION
AWS_S3_BUCKET
AWS_S3_CACHE
FACEBOOK_TOKEN
FACEBOOK_API_VERSION
FACEBOOK_VERIFY_TOKEN
GOOGLE_APPLICATION_CREDENTIALS
GOOGLE_DIALOGFLOW_JSON
GOOGLE_DIALOGFLOW_LANGUAGE
ACADEMIBOT_MEDIA_FOLDER
ACADEMIBOT_BIENVENIDA
ACADEMIBOT_USERS_FOLDER
SERVER_COOKIE_NAME
SERVER_OWN_URL
SERVER_COOKIE_SECRET
SERVER_COOKIE_MAXAGE
PORT
34 changes: 0 additions & 34 deletions .env_sample

This file was deleted.

2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node app.js
web: node ./bin/www
23 changes: 23 additions & 0 deletions Schema/Canal_mensajeria.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { DataTypes, Model } = require("sequelize");
const sequelize = require("../database");

class Canal_mensajeria extends Model { }

Canal_mensajeria.init({
id: {
type: DataTypes.STRING(20),
primaryKey: true,
comment: "Nombre del canal de mensajería."
},
descripcion: {
type: DataTypes.TEXT,
allowNull: false
}
}, {
tableName: 'canal_mensajeria',
sequelize,
timestamps: false,
underscored: true,
comment: "Entidad canal de mensajería, identificado por un nombre único, seguido de una descripción."
});
module.exports = Canal_mensajeria;
30 changes: 30 additions & 0 deletions Schema/Ciclo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { DataTypes, Model } = require("sequelize");
const sequelize = require("../database");

class Ciclo extends Model {
enviable() {
return {
title: this.get('nombre'),
payload: `SetCiclo:${this.get('id')}`
}
}
}

Ciclo.init({
id: {
type: DataTypes.TINYINT.UNSIGNED,
primaryKey: true
},
nombre: {
type: DataTypes.STRING(30),
allowNull: false
}
}, {
tableName: 'ciclo',
timestamps: false,
sequelize,
underscored: true,
comment: 'Esta entidad almacena atributos sobre el Ciclo academico.'
});

module.exports = Ciclo;
33 changes: 33 additions & 0 deletions Schema/Cuenta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const { Model, DataTypes } = require("sequelize");
const sequelize = require("../database");

class Cuenta extends Model { }

Cuenta.init({
id: {
type: DataTypes.INTEGER({ length: 10, zerofill: true, unsigned: true}),
primaryKey: true,
autoIncrement: true
},
tipo_cuenta_id: {
type: DataTypes.SMALLINT.UNSIGNED,
allowNull: false
}
}, {
sequelize,
tableName: 'cuenta',
initialAutoIncrement: 1000000000,
timestamps: true,
updatedAt: false,
paranoid: true,
underscored: true,
indexes: [
{
unique: false,
fields: [{ name: 'tipo_cuenta_id' }]
}
],
comment: "Instancia de cuenta, entidad volátil que permite representar el comportamiento de los personajes."
});

module.exports = Cuenta;
57 changes: 57 additions & 0 deletions Schema/Curso.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { DataTypes, Model } = require("sequelize");
const sequelize = require("../database");

class Curso extends Model {
enviable() {
return {
title: this.get('nombre').toUpperCase(),
subtitle: `Sis. de evaluación: ${this.get('sistema_calificacion_id')}\nCréditos: ${this.get('creditos')}`,
buttons: [
{
title : `MATERIAL ${this.get('id')}`,
payload : `SetCurso:${this.get('id')}`
}
]
};
}
}

Curso.init({
id: {
type: DataTypes.STRING(10),
primaryKey: true
},
nombre: {
type: DataTypes.STRING(100),
allowNull: false
},
descripcion: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null
},
creditos: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true,
defaultValue: null
},
sistema_calificacion_id: {
type: DataTypes.CHAR(1),
allowNull: false
}
}, {
tableName: 'curso',
timestamps: true,
createdAt: false,
sequelize,
underscored: true,
indexes: [
{
unique: false,
fields: [{ name: 'sistema_calificacion_id' }]
}
],
comment: 'Esta entidad almacena atributos sobre el Curso.'
});

module.exports = Curso;
34 changes: 34 additions & 0 deletions Schema/Elemento_malla_curricular.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { DataTypes, Model } = require("sequelize");
const sequelize = require("../database");

class Elemento_malla_curricular extends Model { }

Elemento_malla_curricular.init({
especialidad_id: {
type: DataTypes.STRING(10),
primaryKey: true
},
curso_id: {
type: DataTypes.STRING(10),
primaryKey: true
},
ciclo_id: {
type: DataTypes.TINYINT.UNSIGNED,
primaryKey: true
}
}, {
tableName: 'elemento_malla_curricular',
timestamps: true,
createdAt: false,
underscored: true,
sequelize,
indexes: [
{
unique: false,
fields: [{ name: 'especialidad_id' }, { name: 'ciclo_id' }]
}
],
comment: "Elemento de la malla curricular, denotado por tres claves foraneas que la vez se comportan como primaria."
});

module.exports = Elemento_malla_curricular;
49 changes: 49 additions & 0 deletions Schema/Especialidad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const { DataTypes, Model } = require("sequelize");
const sequelize = require("../database");

class Especialidad extends Model {
enviable() {
return {
title: this.get('nombre').toUpperCase(),
subtitle: this.get('descripcion'),
buttons: [
{
title : `ELEGIR ${this.get('id')}`,
payload : `SetEspecialidad:${this.get('id')}`
}
]
};
}
}

Especialidad.init({
id: {
type: DataTypes.STRING(10),
primaryKey: true
},
nombre: {
type: DataTypes.STRING,
allowNull: false
},
descripcion: {
type: DataTypes.TEXT,
allowNull: true
},
facultad_id: {
type: DataTypes.STRING(10),
allowNull: false
}
},{
indexes: [
{
unique: true,
fields: [{ name: 'nombre' }]
}
],
comment: 'Esta entidad almacena atributos de la Especialidad.',
tableName: 'especialidad',
timestamps: false,
underscored: true,
sequelize
});
module.exports = Especialidad;
37 changes: 37 additions & 0 deletions Schema/Evento.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const { Model, DataTypes } = require("sequelize");
const sequelize = require("../database");

class Evento extends Model { }

Evento.init({
id: {
type: DataTypes.INTEGER({ length: 10, zerofill: true, unsigned: true}),
primaryKey: true,
autoIncrement: true
},
tipo_evento_id: {
type: DataTypes.SMALLINT.UNSIGNED,
allowNull: false
},
duracion_en_ms: {
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
defaultValue: 0
},
error: {
type: DataTypes.JSON,
allowNull: true,
defaultValue: null
}
}, {
initialAutoIncrement: 1000000000,
tableName: 'evento',
timestamps: true,
updatedAt: false,
paranoid: true,
underscored: true,
sequelize,
comment: "Instancia evento, representa a un evento real, hereda atributos de un tipo de evento."
});

module.exports = Evento;
Loading

0 comments on commit 5119a2a

Please sign in to comment.