const Sequelize = require('sequelize');
var db = require('../database/db.js');

const PlanillaAporte = db.sequelize.define('PLANILLA_APORTE', {
    ID_PLANILLA_APORTE: {
        primaryKey: true,
        type: Sequelize.BIGINT,
        allowNull: false,
        autoIncrement: true
    },
    PERIODO: {
        type: Sequelize.STRING,
        allowNull: false
    },
    ESTADO_PLANILLA: {
        type: Sequelize.STRING,
        allowNull: true
    },
    SUB_TIPO: {
        type: Sequelize.STRING,
        allowNull: true
    },
    CEDULA: {
        type: Sequelize.STRING,
        allowNull: true
    },
    NOMBRE: {
        type: Sequelize.STRING(400),
        allowNull: true
    },
    REGIMEN_TRABAJO: {
        type: Sequelize.STRING(400),
        allowNull: true
    },
    NOVEDAD: {
        type: Sequelize.STRING(200),
        allowNull: true
    },
    SUELDO: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    DIAS: {
        type: Sequelize.DECIMAL(10, 2),
        allowNull: true
    },
    PATRONAL: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    INDIVIDUAL: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    APORTE_ADICIONAL: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    CESANTIA: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    PORCENTAJE_CCC: {
        type: Sequelize.DECIMAL(10, 2),
        allowNull: true
    },
    VALOR_CCC: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    TOTAL_APORTE: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    ADICIONAL_TIEMPO_PARCIAL: {
        type: Sequelize.DECIMAL(14, 2),
        allowNull: true
    },
    JUSTIFICACION_PAGO: {
        type: Sequelize.TEXT,
        allowNull: true
    },
    MARCADO_PLANILLA: {
        type: Sequelize.STRING,
        allowNull: true
    },
    HOJA_ORIGEN: {
        type: Sequelize.STRING,
        allowNull: false
    },
    LOTE_CARGA: {
        type: Sequelize.STRING,
        allowNull: false
    },
    FECHA_CARGA: {
        type: Sequelize.STRING,
        allowNull: false
    },
    ID_USUARIO_CARGA: {
        type: Sequelize.INTEGER,
        allowNull: true
    },
    ESTADO: {
        type: Sequelize.BOOLEAN,
        allowNull: false,
        defaultValue: true
    }
}, {
    timestamps: false,
    id: false
});

module.exports = PlanillaAporte;
