2022-01-19 00:46:41 -06:00
|
|
|
const { DataTypes, Model } = require('sequelize');
|
|
|
|
|
const sequelize = require('../../config/sequelize.conf');
|
|
|
|
|
const Usuario = require('./Usuario');
|
|
|
|
|
const Area = require('./Area');
|
|
|
|
|
const FechaInscripcion = require('./FechaInscripcion');
|
|
|
|
|
|
|
|
|
|
class Inscripcion extends Model {}
|
|
|
|
|
Inscripcion.init(
|
|
|
|
|
{
|
|
|
|
|
idInscripcion: {
|
|
|
|
|
type: DataTypes.INTEGER,
|
2022-01-19 20:14:24 -06:00
|
|
|
primaryKey: true,
|
2022-01-19 00:46:41 -06:00
|
|
|
allowNull: false,
|
|
|
|
|
unique: true,
|
|
|
|
|
autoIncrement: true,
|
|
|
|
|
},
|
|
|
|
|
validacion: {
|
2022-02-10 00:44:23 -06:00
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
defaultValue: 2,
|
2022-01-19 00:46:41 -06:00
|
|
|
},
|
2022-03-15 00:23:09 -06:00
|
|
|
cancelacion: {
|
2022-01-19 00:46:41 -06:00
|
|
|
type: DataTypes.BOOLEAN,
|
2022-03-15 00:23:09 -06:00
|
|
|
defaultValue: 0,
|
2022-01-19 00:46:41 -06:00
|
|
|
},
|
2022-03-18 00:29:38 -06:00
|
|
|
motivo: {
|
|
|
|
|
type: DataTypes.STRING(100),
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
2022-01-19 00:46:41 -06:00
|
|
|
folio: {
|
2022-03-06 14:57:03 -06:00
|
|
|
type: DataTypes.STRING(10),
|
2022-01-19 00:46:41 -06:00
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
|
|
|
|
monto: {
|
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
2022-02-17 00:54:55 -06:00
|
|
|
hizoPago: {
|
|
|
|
|
type: DataTypes.BOOLEAN,
|
2022-01-19 00:46:41 -06:00
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
2022-02-02 23:32:41 -06:00
|
|
|
rutaTicket: {
|
|
|
|
|
type: DataTypes.STRING(100),
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
2022-02-09 16:27:21 -06:00
|
|
|
extension: {
|
|
|
|
|
type: DataTypes.STRING(6),
|
2022-02-17 00:54:55 -06:00
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
|
|
|
|
fechaInscripcion: {
|
|
|
|
|
type: DataTypes.DATE,
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
|
|
|
|
fechaTicket: {
|
|
|
|
|
type: DataTypes.DATE,
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
2022-02-09 16:27:21 -06:00
|
|
|
},
|
2022-08-04 17:12:39 -05:00
|
|
|
idPeriodo: {
|
|
|
|
|
type: DataTypes.INTEGER(8),
|
|
|
|
|
allowNull: true,
|
|
|
|
|
defaultValue: null,
|
|
|
|
|
},
|
2022-01-19 00:46:41 -06:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sequelize,
|
|
|
|
|
modelName: 'Inscripcion',
|
|
|
|
|
tableName: 'inscripcion',
|
|
|
|
|
timestamps: false,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Inscripcion.belongsTo(Usuario, {
|
|
|
|
|
foreignKey: {
|
|
|
|
|
name: 'idUsuario',
|
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
allowNull: false,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Inscripcion.belongsTo(Area, {
|
|
|
|
|
foreignKey: {
|
|
|
|
|
name: 'idArea',
|
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
|
allowNull: false,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
module.exports = Inscripcion;
|