Skip to content
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

GW2024 Part 6: User Notification Step #1023

Merged
merged 2 commits into from
Mar 21, 2024
Merged

GW2024 Part 6: User Notification Step #1023

merged 2 commits into from
Mar 21, 2024

Conversation

shtukas
Copy link
Contributor

@shtukas shtukas commented Mar 20, 2024

Previously:

This is the sixth PR in our series where we are using the GW2024 migration to show how to organise the changes required to build a modern migration.

Here we prepare the Notification step.

The Notification step is very generic and doesn't need customisation, and updating the code only required to make sure that we apply this migration's capping for the communication to the user. (Remember that we store uncapped prices, and apply capping during the Salesforce notification step, the Notification step and the Amendment step). We also add a test to clarify the notification schedule. Which clarifies that the natural first date for notifications will be April 1st.

This test is written in a different way that similar tests we wrote in the past. It started from the assumption that we knew for sure the first available start date. I downloaded the Dynamo table and printed the list of dates to get confirmation that the Estimation step has set up the first start date of this migration to May 20th.

Note: We also unlock the following Salesforce update step: SalesforceNotificationDateUpdateHandler. We are doing both in one step instead of staging two changes as we did here: #1019 and here: #1020 .


Finding the date distribution using Ruby:

"""
aws dynamodb scan --region eu-west-1 --table-name PriceMigration-PROD-GW2024 --select ALL_ATTRIBUTES --page-size 50000 --max-items 50000 --output json --profile membership > 02-data.json
"""

data = JSON.parse(IO.read('02-data.json'))

puts data["Items"]
    .select{|item| item["startDate"] }
    .map{|item| item["startDate"]["S"] }
    .uniq
    .sort

The dates are between 2024-05-20 and 2025-05-19


A note on running the Notification step:

Over the first few days we will run the state machine manually, it won't yet be on automatic pilot. Notably we will run the Notification step for the first time on April 2nd. This implies that on that date the engine will process items with a start date of 2024-05-20 and 2024-05-21.

Also note that it is not un-usual that we get errors the first couple of days because of incomplete user data in Salesforce, which require slight changes in the data retrieval rules. This is expected and there is no real way to test for it before hand. Any user provided data is bound to be slightly dirty.

@shtukas shtukas changed the title prepare notifications GW2024 Part 6: Notification Step Mar 20, 2024
@shtukas shtukas marked this pull request as ready for review March 20, 2024 12:48
@shtukas shtukas requested a review from a team as a code owner March 20, 2024 12:48
@shtukas shtukas changed the title GW2024 Part 6: Notification Step GW2024 Part 6: User Notification Step Mar 20, 2024
@shtukas shtukas merged commit e973ec3 into main Mar 21, 2024
1 check passed
@shtukas shtukas deleted the ph-20240320-1217-6 branch March 21, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants