-- REGISTRO DE PAGINAS EXISTENTES EN EL WIZARD
CREATE TABLE `registration_process_wizard` (
  `serial_rpw` INT(11) NOT NULL AUTO_INCREMENT,
  `name_rpw` VARCHAR(45) NOT NULL,
  `link_rpw` VARCHAR(1024) NOT NULL,
  `order_rpw` INT(11) NOT NULL,
  `status_rpw` ENUM('ACTIVE','INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_rpw`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;


-- REGISTRO DEL ESTADO DEL WIZARD POR USUARIO
CREATE TABLE `registration_process_wizard_user` (
  `serial_rpwu` INT(11) NOT NULL AUTO_INCREMENT,
  `serial_usr` INT(11) NOT NULL,
  `serial_scy` INT(11) NOT NULL,
  `serial_rpw` INT(11) NOT NULL,
  `payment_type` VARCHAR(45) NULL DEFAULT NULL,
  `date_rpwu` DATE NOT NULL,
  `status_rpwu` ENUM('ACTIVE','INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_rpwu`),
  INDEX `registration_process_wizard_user_idx` (`serial_usr` ASC),
  INDEX `registration_process_wizard_user_serial_scy_idx` (`serial_scy` ASC),
  INDEX `registration_process_wizard_user_serial_rpw_idx` (`serial_rpw` ASC),
  CONSTRAINT `registration_process_wizard_user_serial_usr`
    FOREIGN KEY (`serial_usr`)
    REFERENCES `user` (`serial_usr`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `registration_process_wizard_user_serial_scy`
    FOREIGN KEY (`serial_scy`)
    REFERENCES `school_year` (`serial_scy`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
CONSTRAINT `registration_process_wizard_user_serial_rpw`
    FOREIGN KEY (`serial_rpw`)
    REFERENCES `registration_process_wizard` (`serial_rpw`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;


-- Sugerencia para configuracion tabla registration_process_wizard para colegios sin rubros

INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('1', 'FAMILIA', 'modules/registration_process_wizard/main', '1', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('2', 'REPRESENTATNTES', 'modules/registration_process_wizard/fUpdateGuardianData', '2', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('3', 'ESTUDIANTES', 'modules/registration_process_wizard/fUpdateStudentData', '3', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('4', 'MEDICO', 'modules/registration_process_wizard/fUpdateMedicalProfile', '4', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('5', 'RUBROS', 'modules/registration_process_wizard/fAssignOptionalPaymentConcepts', '5', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('6', 'RESUMEN DE RUBROS', 'modules/registration_process_wizard/fPrintReview', '6', 'ACTIVE');
INSERT INTO `registration_process_wizard` (`serial_rpw`, `name_rpw`, `link_rpw`, `order_rpw`, `status_rpw`) VALUES ('7', 'FINALIZAR', 'modules/registration_process_wizard/fPayPaymentConcepts', '7', 'ACTIVE');
