-
Notifications
You must be signed in to change notification settings - Fork 1
CCM-12034: Added new sms nudge views #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e0408d1
CCM-12034: Added new sms nudge views
ScottFullerton-NHSE 4c8adea
CCM-12034: update terraform docs
Ian-Hodges 30471c6
Merge branch 'main' into feature/CCM-12034-sms-nudge-views
Ian-Hodges 70eb1d9
CCM-12034: typo in workflow description
Ian-Hodges e4f41f4
CCM-12034: add nudge client id to tfvars
Ian-Hodges faa1f8d
CCM-12034: add flagged guids to .gitleaksignore file
Ian-Hodges d040fbe
CCM-12034: view query performance improvement
Ian-Hodges File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...re/terraform/components/reporting/null_resource_request_item_plan_status_smsnudge_view.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| resource "null_resource" "request_item_plan_status_smsnudge_view" { | ||
| triggers = { | ||
| sql = filesha256("${path.module}/scripts/sql/views/request_item_plan_status_smsnudge.sql") | ||
| } | ||
|
|
||
| provisioner "local-exec" { | ||
| command = <<EOT | ||
| ${path.module}/scripts/create_replace_view.sh \ | ||
| ${aws_athena_workgroup.setup.name} \ | ||
| ${aws_glue_catalog_database.reporting.name} \ | ||
| request_item_plan_status_smsnudge \ | ||
| sms_nudge_client_id "${local.sms_nudge_client_id}" | ||
| EOT | ||
| } | ||
|
|
||
| depends_on = [ | ||
| null_resource.request_item_plan_status_table, | ||
| null_resource.request_item_status_smsnudge_staging_view | ||
| ] | ||
| } |
19 changes: 19 additions & 0 deletions
19
...terraform/components/reporting/null_resource_request_item_status_smsnudge_staging_view.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| resource "null_resource" "request_item_status_smsnudge_staging_view" { | ||
| triggers = { | ||
| sql = filesha256("${path.module}/scripts/sql/views/request_item_status_smsnudge_staging.sql") | ||
| } | ||
|
|
||
| provisioner "local-exec" { | ||
| command = <<EOT | ||
| ${path.module}/scripts/create_replace_view.sh \ | ||
| ${aws_athena_workgroup.setup.name} \ | ||
| ${aws_glue_catalog_database.reporting.name} \ | ||
| request_item_status_smsnudge_staging \ | ||
| sms_nudge_client_id "${local.sms_nudge_client_id}" | ||
| EOT | ||
| } | ||
|
|
||
| depends_on = [ | ||
| null_resource.request_item_status_table | ||
| ] | ||
| } |
19 changes: 19 additions & 0 deletions
19
...ructure/terraform/components/reporting/null_resource_request_item_status_smsnudge_view.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| resource "null_resource" "request_item_status_smsnudge_view" { | ||
| triggers = { | ||
| sql = filesha256("${path.module}/scripts/sql/views/request_item_status_smsnudge.sql") | ||
| } | ||
|
|
||
| provisioner "local-exec" { | ||
| command = <<EOT | ||
| ${path.module}/scripts/create_replace_view.sh \ | ||
| ${aws_athena_workgroup.setup.name} \ | ||
| ${aws_glue_catalog_database.reporting.name} \ | ||
| request_item_status_smsnudge | ||
| EOT | ||
| } | ||
|
|
||
| depends_on = [ | ||
| null_resource.request_item_status_smsnudge_staging_view, | ||
| null_resource.request_item_plan_status_smsnudge_view | ||
| ] | ||
| } |
16 changes: 16 additions & 0 deletions
16
...re/terraform/components/reporting/scripts/sql/views/request_item_plan_status_smsnudge.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| CREATE OR REPLACE VIEW ${view_name} AS | ||
| SELECT | ||
| rip.*, | ||
| ris.originatingclientid, | ||
| ris.originatingcampaignid, | ||
| ris.originatingbillingrefid, | ||
| ris.originatingrequestitemid, | ||
| ris.originatingrequestitemplanid, | ||
| original_ri.sendinggroupid AS originalsendinggroupid | ||
| FROM request_item_plan_status rip | ||
| LEFT JOIN request_item_status_smsnudge_staging ris | ||
| ON rip.requestitemid = ris.requestitemid | ||
| LEFT JOIN request_item_status original_ri | ||
| ON original_ri.requestitemid = ris.originatingrequestitemid | ||
| AND original_ri.clientid = ris.originatingclientid | ||
| WHERE rip.clientid = ${sms_nudge_client_id} | ||
markpullan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
7 changes: 7 additions & 0 deletions
7
...ructure/terraform/components/reporting/scripts/sql/views/request_item_status_smsnudge.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| CREATE OR REPLACE VIEW ${view_name} AS | ||
| SELECT | ||
| ris.*, | ||
| rips.originalsendinggroupid | ||
| FROM request_item_status_smsnudge_staging ris | ||
| LEFT JOIN request_item_plan_status_smsnudge rips | ||
| ON ris.requestitemid = rips.requestitemid | ||
markpullan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
10 changes: 10 additions & 0 deletions
10
...terraform/components/reporting/scripts/sql/views/request_item_status_smsnudge_staging.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| CREATE OR REPLACE VIEW ${view_name} AS | ||
| SELECT | ||
| ris.*, | ||
| NULLIF(split_part(ris.billingref, '|', 1), '') AS originatingclientid, | ||
| NULLIF(split_part(ris.billingref, '|', 2), '') AS originatingcampaignid, | ||
| NULLIF(split_part(ris.billingref, '|', 3), '') AS originatingbillingrefid, | ||
| NULLIF(split_part(ris.requestitemrefid, '_', 1), '') AS originatingrequestitemid, | ||
| NULLIF(split_part(ris.requestitemrefid, '_', 2), '') AS originatingrequestitemplanid | ||
| FROM request_item_status ris | ||
| WHERE ris.clientid = ${sms_nudge_client_id} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.