Rebecca Law
9bfba52f53
Add pending flag to scheduled_notifications.
...
Set pending flag to false when the notification has been sent to provider task.
2017-05-22 15:07:16 +01:00
Rebecca Law
a57dc18895
Add validation for scheduled_for where the date can not be in the past or more than 24 hours in the future.
2017-05-22 14:39:30 +01:00
Rebecca Law
751abb4b99
Update dateformat for scheduled_for to include minutes.
2017-05-22 14:15:35 +01:00
kentsanggds
39f23c6189
Merge pull request #969 from alphagov/ken-refactor-service_permissions-data_model
...
Refactored service permissisons data model
2017-05-22 14:08:15 +01:00
Rebecca Law
3a3161ecc4
Merge branch 'master' into schedule-api-notification
...
Conflicts:
app/celery/scheduled_tasks.py
app/v2/notifications/post_notifications.py
tests/app/celery/test_scheduled_tasks.py
2017-05-22 14:05:57 +01:00
Ken Tsang
052004bef0
Refactored data model to remove cascade
2017-05-22 13:33:43 +01:00
Ken Tsang
28ef9a1853
Refactored service permissisons data model
2017-05-22 10:58:41 +01:00
Imdad Ahad
02db3be37c
General refactor
2017-05-22 10:12:18 +01:00
Martyn Inglis
119f0532ab
Renamed the API method/url
2017-05-22 10:06:34 +01:00
Martyn Inglis
f0395e7496
New endpoint to get the count of billable SMS units.
2017-05-19 16:43:05 +01:00
Martyn Inglis
2a0669636d
Add and test new DAO method that counts the billable units multiplied by rate multiplier for a given service for a given time period.
...
Currently this is SMS only.
Used by the dashboard for a headline figure.
2017-05-19 16:42:33 +01:00
Imdad Ahad
0e0c18583f
Fix test data and how we parse the JSON
2017-05-19 10:16:48 +01:00
minglis
da6a6f6641
Merge pull request #959 from alphagov/comma-format-message-limit
...
Comma-format number when emailing live services
2017-05-18 11:06:24 +01:00
Martyn Inglis
8dc7a86148
Merge branch 'master' into async-job-stats
...
Conflicts:
app/dao/services_dao.py
2017-05-18 09:34:54 +01:00
Ken Tsang
e68c3900e8
Add restricted argument for service mock
2017-05-17 16:06:35 +01:00
Rebecca Law
973cc2c4c9
Changed the scheduled_for datetime to only send and hour of a day to send.
...
Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
2017-05-17 15:06:15 +01:00
Ken Tsang
edff192efc
Remove whitespace
2017-05-17 14:18:12 +01:00
Ken Tsang
54446d5f4d
Add default permissions when creating a service
2017-05-17 14:18:12 +01:00
minglis
05a179c6ef
Merge pull request #941 from alphagov/load-service-on-auth
...
Load service on auth
2017-05-17 10:49:00 +01:00
Martyn Inglis
83a1b1526e
Merge branch 'master' into async-job-stats
...
Conflicts:
app/notifications/notifications_ses_callback.py
2017-05-17 09:49:43 +01:00
Rebecca Law
1034762489
Ensure the relationship between Notification and ScheduledNotification is one-to-one.
...
Update db script with the right number
2017-05-16 15:29:31 +01:00
kentsanggds
c4964d8cf4
Merge pull request #956 from alphagov/add-service-permissions
...
Add service permissions DAO and refactor user service permission mock
2017-05-16 14:26:15 +01:00
Rebecca Law
2e078f9fc8
Add scheduled task to send scheduled notifcations.
...
Fix the query to fetch scheduled notifications.
2017-05-16 13:47:22 +01:00
Ken Tsang
3602431c2a
Renamed test and refactored fixtures
2017-05-16 13:41:54 +01:00
Ken Tsang
2a48891025
Removed unused pytest from test
2017-05-16 12:54:32 +01:00
Ken Tsang
b233ae46f3
Tidy up test code for service permissions
2017-05-16 12:53:46 +01:00
Martyn Inglis
a5dae0bebd
Fixed test - I had deliberately failed the test as part of debugging and not fixed the assert. Doh.
2017-05-16 12:49:20 +01:00
Ken Tsang
733c16b2bb
Update to strip down DAO and clarify tests
2017-05-16 12:33:27 +01:00
Chris Hill-Scott
2d4f10bd22
Comma-format number when emailing live services
...
250,000 is easier to read than 250000.
2017-05-16 12:33:01 +01:00
Martyn Inglis
d1aff5bb6e
Complex test to check updating one type of notification job, doesn't update the other
...
- so if we timeout both SMS and Email the counts are correct
2017-05-16 11:36:52 +01:00
Ken Tsang
54d801979c
Refactored to handle single service permission
2017-05-16 10:57:57 +01:00
Rebecca Law
3c0da9c8fd
Merge branch 'master' into schedule-api-notification
2017-05-16 10:50:53 +01:00
Rebecca Law
579227dfc1
Method to return scheduled notifications that are ready to send
2017-05-16 10:48:04 +01:00
Imdad Ahad
e6db9ffc1b
Force parse JSON received from SNS:
...
* An SNS callback containing JSON has a plaintext header set. Using
* request.get_json() will return None if the header is not
* application/json unless the force parameter is set to True
2017-05-16 10:29:27 +01:00
Rebecca Law
a6529d2723
Return the scheduled_for datetime in the DATETIME_FORMAT from the post_notification
2017-05-16 09:57:58 +01:00
Imdad Ahad
98aeb9f9da
Merge pull request #951 from alphagov/imdad-feat-auto-send-email-live-service
...
Send a welcome email to newly live services
2017-05-15 17:39:38 +01:00
Ken Tsang
114d4d84d4
Add service permissions DAO and refactor user service permission mock
2017-05-15 17:28:14 +01:00
Rebecca Law
f0e2713bef
Add scheduled_for in the post notification request form.
...
Return scheduled for in get_notification requests.
2017-05-15 17:27:38 +01:00
Rebecca Law
38e5b31e9a
Update notification schemas with optional schedule_for element
2017-05-15 15:02:38 +01:00
Imdad Ahad
aa5f8ba443
Refactor tests for clarity
2017-05-15 15:02:16 +01:00
Imdad Ahad
d993e1a43e
Don't send notification if other service attrs changed
2017-05-15 15:02:01 +01:00
Imdad Ahad
4003edfa67
Add DVLA callback:
...
* Process SNS callback, trigger the update notifications celery task
* Put autoconfirm into its own method and use in callbacks
2017-05-15 11:12:31 +01:00
Imdad Ahad
ee484ec368
Add get_s3_file method for use in DVLA processing
2017-05-15 10:48:37 +01:00
Imdad Ahad
7a10a91262
Revert "Process SNS request triggered by a DVLA S3 update"
2017-05-12 17:21:07 +01:00
Martyn Inglis
fd542024a3
Merge branch 'master' into load-service-on-auth
2017-05-12 16:14:44 +01:00
Martyn Inglis
f4020aec05
these three tests replicate some testing that is done in the client tests themselves.
2017-05-12 16:10:21 +01:00
Leo Hemsted
700e3d2fa7
update delivery receipts for countries that return them
...
some countries don't return delivery receipts
some countries return delivery receipts when they reach the carrier
these countries, we should keep the notifications in sent (aka
sent_internatinally) for. However, for countries that have normal
delivery receipts, we should update them as we do for UK numbers
2017-05-12 15:01:55 +01:00
Imdad Ahad
0f7093fc38
Refactor and add filename in logging
2017-05-12 14:32:01 +01:00
Imdad Ahad
37165e5b6a
Add autoconfirm sns in dvla callback
2017-05-12 14:24:27 +01:00
Imdad Ahad
8a5e82904e
Update to pull from correct bucket and fix tests not mocking out correctly
2017-05-12 14:24:26 +01:00