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:
Martyn Inglis
2016-03-21 13:24:37 +00:00
parent e2cfbce8c4
commit e0316d1881
10 changed files with 289 additions and 54 deletions

View File

@@ -13,6 +13,11 @@ class Client(object):
pass
STATISTICS_REQUESTED = 'requested'
STATISTICS_DELIVERED = 'delivered'
STATISTICS_FAILURE = 'failure'
class ClientResponse:
def __init__(self):
self.__response_model__ = None
@@ -24,7 +29,6 @@ class ClientResponse:
return self.response_code_to_object(response_code)['message']
def response_code_to_notification_status(self, response_code):
print(response_code)
return self.response_code_to_object(response_code)['notification_status']
def response_code_to_notification_statistics_status(self, response_code):