-- INTERLINK WhatsApp v2.7.1 - Hotfix saludo + falta de servicio
-- Requiere v2.7 previamente instalada. No borra datos.
USE `interlink_crm`;

INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no me estan dando el internet','no me estan dando el internet','f344bc6cac7505afe6b73d8485b139254b4b98143e1a5fa048fcbeeb2a1ea5f5',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no nos estan dando internet','no nos estan dando internet','c97a6cfbec31f20125fe5cc87a5fbf49308ed179b64e89c751a3f51fb5b7c01a',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no me da internet','no me da internet','8b4009faf7b7817583e805e2eab6c319480fd28e910dc1dfad192caedc48dc67',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no me llega internet','no me llega internet','d123759c43dc306cfe0cf367e5798f8f6286b3156b4329336512fa9119e87956',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no nos llega internet','no nos llega internet','653dc88ef47478acfd873fb4238eee471d461bfeb5dffaea2b208580c7fd60f9',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','se me fue el internet','se me fue el internet','2ef324b23597bc8cbbe1b0c41fa5cd04a88b4537776c8a444273668677552f88',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','me quede sin internet','me quede sin internet','92e8798f57362f897253ce78af9e3edba78efa7b4eef63f00fc55753eee2a10e',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','no tengo servicio de internet','no tengo servicio de internet','4b426ec880706fd04753b7c0b505a799be1ff2f10e6fa5d85e0c3e354119e524',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','el internet no me funciona','el internet no me funciona','0c64ba7bf45893bb5969873c29741ee0b71dcd5d763b9f847d69eb3f12823f4d',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','queria avisar que no me estan dando el internet','queria avisar que no me estan dando el internet','dffe257813798259e302ee1439eebcf064be62e74001b201c1e432cd20c1a5ac',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','queria avisarle que no me estan dando el internet','queria avisarle que no me estan dando el internet','f6c8f060594dd215de3f3e4e0f19068cd8fe0d2a0eea2cace0153fe527833043',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','hola buenas noches queria avisarle que no me estan dando el internet','hola buenas noches queria avisarle que no me estan dando el internet','e70f859ef69d1141b37fc6671f59ee922712ec8d0d26f5141dc30e8bd3a6a4f7',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_intent_examples` (`query_key`,`handler_intent`,`example_text`,`normalized_text`,`example_hash`,`priority`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('no_service_all','support_no_service','y queria avisarle que no no me estan dando el internet','y queria avisarle que no no me estan dando el internet','3c6c035953e551cbc485fbf7466622b8863e852975aa7e0d83dd62ee7623d1f0',80,1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `query_key`=VALUES(`query_key`),`handler_intent`=VALUES(`handler_intent`),`example_text`=VALUES(`example_text`),`normalized_text`=VALUES(`normalized_text`),`priority`=VALUES(`priority`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();

INSERT INTO `wa2_ai_test_cases` (`suite_key`,`message_text`,`expected_intent`,`expected_query_key`,`customer_validated`,`access_technology`,`locality`,`required_terms`,`forbidden_terms`,`case_hash`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('isp_v271_regression','Hola, buenas noches. Quería avisarle que no me están dando el internet.','support_no_service','no_service_all',1,'unknown',NULL,'','ticket creado|hay un corte confirmado|pago confirmado|mañana irá el técnico','f0c552bb1a3da51c45c86892e8075d59cd1a8f374f34893443b0a24756250403',1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `message_text`=VALUES(`message_text`),`expected_intent`=VALUES(`expected_intent`),`expected_query_key`=VALUES(`expected_query_key`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_ai_test_cases` (`suite_key`,`message_text`,`expected_intent`,`expected_query_key`,`customer_validated`,`access_technology`,`locality`,`required_terms`,`forbidden_terms`,`case_hash`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('isp_v271_regression','Y quería avisarle que no, no me están dando el internet.','support_no_service','no_service_all',1,'unknown',NULL,'','ticket creado|hay un corte confirmado|pago confirmado|mañana irá el técnico','c4f415bd60092d5390d9e069715f586e36707cb99506754e2ca6a460c3e6543d',1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `message_text`=VALUES(`message_text`),`expected_intent`=VALUES(`expected_intent`),`expected_query_key`=VALUES(`expected_query_key`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_ai_test_cases` (`suite_key`,`message_text`,`expected_intent`,`expected_query_key`,`customer_validated`,`access_technology`,`locality`,`required_terms`,`forbidden_terms`,`case_hash`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('isp_v271_regression','Buenas noches, no me da internet','support_no_service','no_service_all',1,'unknown',NULL,'','ticket creado|hay un corte confirmado|pago confirmado|mañana irá el técnico','f3c30b612660b5886afa3b3fad25812c750298f90e6ca70d8b185e7077c40ed1',1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `message_text`=VALUES(`message_text`),`expected_intent`=VALUES(`expected_intent`),`expected_query_key`=VALUES(`expected_query_key`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_ai_test_cases` (`suite_key`,`message_text`,`expected_intent`,`expected_query_key`,`customer_validated`,`access_technology`,`locality`,`required_terms`,`forbidden_terms`,`case_hash`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('isp_v271_regression','Hola, no me llega internet','support_no_service','no_service_all',1,'unknown',NULL,'','ticket creado|hay un corte confirmado|pago confirmado|mañana irá el técnico','c7064728531f939c637d7732099956ed0d429a120203a36265ec9114e0fc140e',1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `message_text`=VALUES(`message_text`),`expected_intent`=VALUES(`expected_intent`),`expected_query_key`=VALUES(`expected_query_key`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();
INSERT INTO `wa2_ai_test_cases` (`suite_key`,`message_text`,`expected_intent`,`expected_query_key`,`customer_validated`,`access_technology`,`locality`,`required_terms`,`forbidden_terms`,`case_hash`,`active`,`source_pack`,`created_at`,`updated_at`) VALUES ('isp_v271_regression','Me quedé sin internet','support_no_service','no_service_all',1,'unknown',NULL,'','ticket creado|hay un corte confirmado|pago confirmado|mañana irá el técnico','c707748f925a2ba7281d245f35292c5c8667503afc795b654f71b2e69fddccb5',1,'interlink_isp_v271',NOW(),NOW()) ON DUPLICATE KEY UPDATE `message_text`=VALUES(`message_text`),`expected_intent`=VALUES(`expected_intent`),`expected_query_key`=VALUES(`expected_query_key`),`active`=1,`source_pack`=VALUES(`source_pack`),`updated_at`=NOW();

INSERT INTO `wa2_schema_migrations` (`migration_key`,`applied_at`) VALUES ('wa2_v271_greeting_no_service_hotfix',NOW()) ON DUPLICATE KEY UPDATE `applied_at`=VALUES(`applied_at`);

SELECT COUNT(*) AS ejemplos_v271 FROM `wa2_intent_examples` WHERE `source_pack`='interlink_isp_v271' AND `active`=1;
SELECT COUNT(*) AS pruebas_v271 FROM `wa2_ai_test_cases` WHERE `source_pack`='interlink_isp_v271' AND `active`=1;
