nuevo servicio especial listo

This commit is contained in:
2021-02-10 16:45:15 -06:00
parent 027fddf9cc
commit f76237ea20
8 changed files with 162 additions and 38 deletions
+16 -18
View File
@@ -2,13 +2,12 @@ const { DataTypes, Model } = require('sequelize');
const sequelize = require('../../config/sequelize.conf');
const Usuario = require('./Usuario');
const Carrera = require('./Carrera');
const Programa = require('./Programa');
const Status = require('./Status');
class CasoEspecial extends Model {}
CasoEspecial.init(
{
idServicio: {
idCasoEspecial: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
@@ -23,15 +22,24 @@ CasoEspecial.init(
type: DataTypes.STRING(60),
allowNull: false,
},
telefono: {
type: DataTypes.STRING(15),
institucion: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
dependencia: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
incapacidad: {
type: DataTypes.STRING(100),
allowNull: true,
defaultValue: null,
},
direccion: {
type: DataTypes.STRING(200),
allowNull: true,
defaultValue: null,
allowNull: false,
},
fechaInicio: {
type: DataTypes.DATE,
@@ -39,13 +47,11 @@ CasoEspecial.init(
},
fechaFin: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
allowNull: false,
},
fechaNacimiento: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
allowNull: false,
},
carpeta: {
type: DataTypes.STRING(60),
@@ -89,12 +95,4 @@ CasoEspecial.belongsTo(Status, {
},
});
CasoEspecial.belongsTo(Programa, {
foreignKey: {
name: 'idPrograma',
type: DataTypes.INTEGER,
allowNull: false,
},
});
module.exports = CasoEspecial;
+3 -4
View File
@@ -41,7 +41,7 @@ Servicio.init(
},
fechaFin: {
type: DataTypes.DATE,
allowNull: true,
allowNull: true, // eliminar
defaultValue: null,
},
fechaNacimiento: {
@@ -52,9 +52,8 @@ Servicio.init(
carpeta: {
type: DataTypes.STRING(60),
// allowNull:false,
allowNull: true,
// comentar linea de abajo
defaultValue: null,
allowNull: true, // eliminar
defaultValue: null, // eliminar
},
cartaAceptacion: {
type: DataTypes.STRING(60),