summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
diff options
context:
space:
mode:
authorIvo Stoilov (GitHub) <istoilov@luxoft.com>2017-02-15 18:32:09 +0200
committerokozlovlux <okozlov@luxoft.com>2017-05-17 19:27:10 +0300
commitf175409c5e370b6c5c8b67ec72214990a9268673 (patch)
tree1735dbb7f2d84939bef562a09413c641a0c1ff27 /src/components/policy/policy_external/src/sql_pt_ext_queries.cc
parent458fa67468b2c10a7f8eb18277a83eb90c2f8004 (diff)
downloadsdl_core-f175409c5e370b6c5c8b67ec72214990a9268673.tar.gz
Add new external UCS-related params in PTU, PreloadedPT, SnapshotPT
- added perstistence for external user consent status - fixed failed UTs
Diffstat (limited to 'src/components/policy/policy_external/src/sql_pt_ext_queries.cc')
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_queries.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
index 4a69aaf44f..f0cd32dc02 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
@@ -85,6 +85,9 @@ const std::string kSelectDeviceData = "SELECT * FROM `device`";
const std::string kSelectConsentGroup =
"SELECT * FROM `consent_group` WHERE `device_id` = ? ";
+const std::string kSelectExternalConsentStatusGroup =
+ "SELECT * FROM `external_consent_status_group` WHERE `device_id` = ? ";
+
const std::string kInsertPreconsentedGroups =
"INSERT INTO `preconsented_group` (`application_id`, `functional_group_id`)"
" SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
@@ -136,6 +139,12 @@ const std::string kInsertConsentGroups =
"`input`, `time_stamp`) "
"VALUES (?,?,?,?,?,?)";
+const std::string kInsertExternalConsentStatusGroups =
+ "INSERT OR REPLACE INTO `external_consent_status_group` "
+ "(`device_id`, `application_id`, `functional_group_id`, `is_consented`, "
+ "`input`, `time_stamp`) "
+ "VALUES (?,?,?,?,?,?)";
+
const std::string kDeleteAppGroupConsent =
"DELETE FROM `consent_group` WHERE "
"`application_id` = ? AND `functional_group_id` = ? ";
@@ -263,5 +272,28 @@ const std::string kHasMsgLanguageCode =
const std::string kDeletePreconsentedGroupsByApplicationId =
"DELETE FROM `preconsented_group` WHERE `application_id` = ?";
+const std::string kSelectExternalConsentStatus =
+ "SELECT `entity_type`, `entity_id`, `on_off` from "
+ "`_internal_external_consent_status`";
+
+const std::string kInsertExternalConsentStatus =
+ "INSERT OR REPLACE INTO `_internal_external_consent_status` "
+ "(`id`,`entity_type`, "
+ "`entity_id`, `on_off`) VALUES ((SELECT `id` from "
+ "`_internal_external_consent_status` "
+ "WHERE `entity_type` = ? AND `entity_id` = ?), ?, ?, ?)";
+
+const std::string kDeleteExternalConsentEntities =
+ "DELETE FROM `external_consent_entities`";
+
+const std::string kInsertExternalConsentEntity =
+ "INSERT INTO `external_consent_entities` (`group_id`, `entity_type`, "
+ "`entity_id`, `on_off`) "
+ " VALUES (?, ?, ?, ?)";
+
+const std::string kSelectExternalConsentEntity =
+ "SELECT `group_id`, `entity_type`, `entity_id`, `on_off` from "
+ "`external_consent_entities`";
+
} // namespace sql_pt_ext
} // namespace policy