mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Adds notification stats update into the callback process
- when a provider callback occurs and we update the status of the notification, also update the statistics table Adds: - Mapping object to the clients to handle mapping to various states from the response codes, this replaces the map. - query lookup in the DAO to get the query based on response type / template type Tests around rest class and dao to check correct updating of stats Missing: - multiple client callbacks will keep incrementing the counts of success/failure. This edge case needs to be handle in a future story.
This commit is contained in:
@@ -15,14 +15,14 @@ def test_should_return_correct_details_for_delivery():
|
||||
def test_should_return_correct_details_for_bounced():
|
||||
assert aws_responses.response_code_to_message('Bounce') == 'Bounced'
|
||||
assert aws_responses.response_code_to_notification_status('Bounce') == 'bounce'
|
||||
assert aws_responses.response_code_to_notification_statistics_status('Bounce') == 'failed'
|
||||
assert aws_responses.response_code_to_notification_statistics_status('Bounce') == 'failure'
|
||||
assert not aws_responses.response_code_to_notification_success('Bounce')
|
||||
|
||||
|
||||
def test_should_return_correct_details_for_complaint():
|
||||
assert aws_responses.response_code_to_message('Complaint') == 'Complaint'
|
||||
assert aws_responses.response_code_to_notification_status('Complaint') == 'complaint'
|
||||
assert aws_responses.response_code_to_notification_statistics_status('Complaint') == 'failed'
|
||||
assert aws_responses.response_code_to_notification_statistics_status('Complaint') == 'failure'
|
||||
assert not aws_responses.response_code_to_notification_success('Complaint')
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ def test_should_return_correct_details_for_delivery():
|
||||
def test_should_return_correct_details_for_bounced():
|
||||
assert responses.response_code_to_message('1') == 'Declined'
|
||||
assert responses.response_code_to_notification_status('1') == 'failed'
|
||||
assert responses.response_code_to_notification_statistics_status('1') == 'failed'
|
||||
assert responses.response_code_to_notification_statistics_status('1') == 'failure'
|
||||
assert not responses.response_code_to_notification_success('1')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user