DELIMITER $$
DROP PROCEDURE IF EXISTS sp_save_survey_answers$$
CREATE PROCEDURE sp_save_survey_answers(
    IN p_surveyId INT,
    IN p_idUser INT,
    IN p_engineerName VARCHAR(255),
    IN p_rhName VARCHAR(255),
    IN p_answers_json JSON
)
BEGIN
    INSERT INTO surveys_answers (context_id, id_user, engineer_name, rh_name, snapshot_json)
    VALUES (p_surveyId, p_idUser, p_engineerName, p_rhName, p_answers_json);
    
    SELECT 1 AS success;
END$$
DELIMITER ;
