Commit Graph

1675 Commits

Author SHA1 Message Date
Rebecca Law
cc04b5eb1d Added new endpoint for job statistics.
The structure has been flattened, so I need to create a new endpoint, start using that endpoint, then change the name back.
Added template_id and version to the get job stats by id.
2017-06-12 17:15:32 +01:00
Rebecca Law
c7707873e4 Queries to get job statistics by job_id or by service_id. 2017-06-12 14:25:17 +01:00
Rebecca Law
03c6e74c46 Merge pull request #1024 from alphagov/job-stats-for-dashboard
Change the job_statistics table structure
2017-06-08 13:19:15 +01:00
minglis
1b0ff63b1e Merge pull request #1022 from alphagov/remove-nasty-query-from-dashboard
Remove nasty query from dashboard
2017-06-08 10:58:35 +01:00
Imdad Ahad
fd85a840d3 Merge pull request #1020 from alphagov/service-notification-by-id
Add private endpoint to get notification by ID
2017-06-07 16:24:47 +01:00
Imdad Ahad
7e22f3823f Merge pull request #1021 from alphagov/imdad-feat-get-inbound-by-id
Add endpoint to get inbound sms by id
2017-06-07 16:24:17 +01:00
Imdad Ahad
71bfefcea5 Merge pull request #1019 from alphagov/imdad-feat-remove-dvla-files-on-schedule
Remove letter jobs separately
2017-06-07 14:59:41 +01:00
Imdad Ahad
5b4ceda1c6 Refactor:
* Filter inbound by service_id
* Refactor to return 404 instead of 400 for consistency
2017-06-07 14:23:31 +01:00
Martyn Inglis
fa0d51b66c Added the free limit to the detailed service representation. 2017-06-07 14:19:25 +01:00
Chris Hill-Scott
f1399ca7f1 Fix support URLs in Notify emails 2017-06-07 11:58:10 +01:00
Rebecca Law
1b4097cb16 Add three new columns to job_statistics for sent, delivered and failed.
A job only ever has one notification type.
This is the first deploy, where the columns are added and populated.

Next a data migration will happen to populate these new columns for the older jobs that do not have the values set.
Then we stop populating the old columns and remove them.
This refactoring of the table structure will make the queries to the table much easier to handle.
2017-06-07 11:15:05 +01:00
Martyn Inglis
d97c7c8e56 - Fix up free tier on the service object, use it only on dump not create/update in marshmallow
- Ensure tests leave config as was after a test run that alters free tier quantity
2017-06-07 09:58:57 +01:00
Imdad Ahad
ee488d416a Add endpoint to get inbound by id 2017-06-06 17:12:21 +01:00
Imdad Ahad
23a501af16 Add dao to get inbound sms by id 2017-06-06 17:11:59 +01:00
Chris Hill-Scott
635fb8fe44 Add private endpoint to get notification by ID
We need this for the two way stuff in the admin app.

We already have this as a public endpoint, but the admin app can’t use
it, because the admin app auths with its own key, not that of the
service it’s acting on behalf of.

This endpoint makes sure that a request originating from one service
can’t be used to see notifications belonging to another service.
2017-06-06 16:21:57 +01:00
Martyn Inglis
cad195949a Ensure that the bill includes whatever free allowance is applicable. 2017-06-06 16:21:05 +01:00
Imdad Ahad
74a8905be9 Seperate deletion of jobs:
* Two separate jobs, one for sms&email and another for letter
* Change celery task for delete to accept template type filter
* General refacor of tests to make more readable
2017-06-06 16:02:01 +01:00
Imdad Ahad
6b4597149f Add filter to get jobs to delete (sms, email, letter) 2017-06-06 16:01:27 +01:00
Martyn Inglis
96d30d31b1 Get existing tests to pass.
Done by ensuring that the rate limit is 0, so that all messages are billable.
2017-06-06 14:55:37 +01:00
Martyn Inglis
75bf693f44 Add the yearly free limit to the service model.
This allows us to reference it across the API code base and return it in the API.

But not currently attached to the service DB model - a static method on the class.
2017-06-06 14:49:05 +01:00
Martyn Inglis
18dcc10a06 Fixed typo 2017-06-06 14:04:11 +01:00
Martyn Inglis
941613a8bf Merge branch 'master' into remove-nasty-query-from-dashboard 2017-06-06 14:03:47 +01:00
Martyn Inglis
29455b6d3b Strip leading 44 from inbound SMS numbers to normalise to how we store things. 2017-06-06 11:50:30 +01:00
Martyn Inglis
7a03ef3de4 Pseudo Code 2017-06-05 17:25:40 +01:00
minglis
85b9968473 Merge pull request #1012 from alphagov/firetext-inbound-sms
Firetext inbound sms
2017-06-05 16:59:03 +01:00
Martyn Inglis
b296e736f2 Reorder the migrations. 2017-06-05 11:51:30 +01:00
Martyn Inglis
f15d235d1e Merge branch 'master' into firetext-inbound-sms 2017-06-05 11:33:53 +01:00
Martyn Inglis
012f8d2675 Adds provider onto the inbound sms table so we know where this came from. 2017-06-02 16:37:57 +01:00
Imdad Ahad
56c3f3cf7c Add task to delete inbound sms everyday at 1am 2017-06-02 16:10:27 +01:00
Imdad Ahad
0631b6c988 Add dao to delete inbound sms after seven days 2017-06-02 16:10:27 +01:00
Martyn Inglis
3e1de2e901 Capture the fire text callbacks.
Parse the form data, and stop the message
2017-06-02 15:58:36 +01:00
Leo Hemsted
69c299dd6c ensure international numbers are handled correctly
the international flag semantically means 'Should we throw an error if an
international number is passed in?' (and the answer is no. We should not.)
2017-06-02 15:20:18 +01:00
Leo Hemsted
bf18b179b0 ensure the user_number in inbound sms is international
rather than using the `normalise_phone_number` function, use the
`validate_and_format_phone_number` function - this will also convert
all numbers to international format, which means we won't need to
worry about whether the user enters internaional or UK phone numbers
when searching
2017-06-02 15:20:18 +01:00
Leo Hemsted
ef52337d85 add inbound sms api
two endpoints:
* get all inbound sms for a service (you can limit to the X most
  recent, or filter by user's phone number [which will be normalised])
* get a summary of inbound sms for a service - returns the count of
  inbound sms in the database, and the date that the most recent was
  sent
2017-06-02 15:20:18 +01:00
Rebecca Law
9d80bdc70f Merge branch 'master' into letters-billing-table
Conflicts:
	app/models.py
2017-06-02 14:47:28 +01:00
Leo Hemsted
d9bdacb5cd parse datetimes from mmg inbound sms
the DateRecieved field from MMG comes in with +s instead of spaces,
and uriencoded (the same as how they format their messages)
Make sure we decode this, and then convert to a UTC timestamp
2017-06-02 10:14:01 +01:00
Leo Hemsted
dba4e2ad89 mmg spell received incorrectly, lets use that 2017-06-01 17:27:09 +01:00
Martyn Inglis
c57e2a6894 Merge branch 'master' into inbound-sms
Conflicts:
	app/notifications/receive_notifications.py
	tests/app/notifications/test_receive_notification.py
2017-06-01 15:56:33 +01:00
minglis
a4c8f83839 Merge pull request #983 from alphagov/remove-nasty-query-from-dashboard
Remove nasty query from dashboard
2017-06-01 15:31:02 +01:00
Martyn Inglis
a60d40bbc0 Merge branch 'master' into remove-nasty-query-from-dashboard
Conflicts:
	tests/app/service/test_rest.py
2017-06-01 14:47:00 +01:00
Chris Hill-Scott
af087f36d6 Merge pull request #1005 from alphagov/hide-one-off-dashboard
Ignore one-off messages in job list on dashboard
2017-06-01 14:37:50 +01:00
Chris Hill-Scott
eb493f6817 Rename ‘One-off message’ to ‘Report’
See 7915845cb5
2017-06-01 13:56:47 +01:00
Leo Hemsted
3e47519045 Merge pull request #1006 from alphagov/revert-1001-revert-988-non-null-again
Revert "Revert "Remove nulls from sms_sender""
2017-06-01 13:14:03 +01:00
Leo Hemsted
dd9fd6cf92 still return RECEIVED even if we couldn't find a matching service
mmg don't need to retry that message or anything. just log it.
2017-06-01 13:13:51 +01:00
Martyn Inglis
7f65aa3eef Merge branch 'master' into remove-nasty-query-from-dashboard
Conflicts:
	app/service/rest.py
	tests/app/service/test_rest.py
2017-06-01 13:11:54 +01:00
Rebecca Law
40aadf2748 Merge pull request #991 from alphagov/invite-service-to-schedule
Invite the service to schedule notifications from the API
2017-06-01 12:37:32 +01:00
Chris Hill-Scott
78d071f22f Ignore one-off messages in job list on dashboard
Same as how we ignore ‘send yourself a test’ messages (see:
d8467bfc3c). The dashboard gets clogged
up with one off messages otherwise, which affects:
- performance
- users ability to find their jobs
2017-06-01 12:30:47 +01:00
Leo Hemsted
d33698216c Revert "Revert "Remove nulls from sms_sender"" 2017-06-01 11:00:26 +01:00
minglis
94e0315715 Merge pull request #1004 from alphagov/firetext-inbound-sms
Firetext inbound sms
2017-06-01 10:28:53 +01:00
minglis
501506f849 Merge pull request #996 from alphagov/stop-reading-from-old-queues
Removed references to old queus
2017-06-01 09:43:12 +01:00