Commit Graph

298 Commits

Author SHA1 Message Date
venusbb
f95282a84d Add column, free_sms_fragment_limit, to services & services_history
- Created new column in both tables
- Modified model and Service schema
- Modifed existing test
2017-10-12 12:16:13 +01:00
Rebecca Law
78a9d74c49 Merge branch 'master' into return-service_sms_sender_value 2017-10-04 13:29:05 +01:00
Imdad Ahad
cb37ba5f78 Update schema to return default letter contact for a service 2017-10-03 10:31:21 +01:00
Rebecca Law
fb68767720 Update service_schema to return the default sms_sender from the new table rather than the services table. 2017-10-02 17:15:15 +01:00
venusbb
4e991c26a2 Progress: Filtered day completed 2017-09-22 15:39:53 +01:00
venusbb
da21248dcf Merge branch 'master' of https://github.com/alphagov/notifications-api into vb-platform-admin-api 2017-09-22 11:14:09 +01:00
venusbb
d59a1f447a Progress: Today stats completed 2017-09-22 11:05:36 +01:00
Ken Tsang
91a618531d Update serialization and service schema
- added id and service_id in serialization
- added 'letter_contacts' to the exluded list for marshmallow service schema
2017-09-21 16:38:24 +01:00
Rebecca Law
9e818a558e Fix the ServiceSchema to only dump the reply_to_email_address 2017-09-20 15:47:29 +01:00
Rebecca Law
a53a0da414 [WIP] need to fix the tests 2017-09-20 10:45:35 +01:00
Rebecca Law
3779f9d1df Merge branch 'master' into updating-service_sms_senders 2017-09-12 12:11:38 +01:00
Rebecca Law
5439b01a6e When an inbound number is allocated insert or update a row in service_sms_senders. 2017-09-12 12:09:32 +01:00
Katie Smith
269e88f7de Update reply to email test
- Updated reply to email test so that the request to create or update
email is not mocked.
- Excluded reply_to_email_addresses from the Service schema
2017-09-12 09:07:34 +01:00
Rebecca Law
f624f4f033 Insert and update methods for service_sms_sender 2017-09-11 17:40:37 +01:00
Chris Hill-Scott
26f50af6e9 Let whitelist and user have int. phone numbers
On the frontend, we’re letting users register with international phone
numbers. So we shouldn’t block users from doing this on the API side.

Same thing for the whitelist, where we’re also allowing international
phone numbers now.
2017-08-30 10:55:18 +01:00
Leo Hemsted
c863b33c8d make sure letters are handled properly by the v1 api 2017-08-25 16:47:17 +01:00
Ken Tsang
b814c5ff26 Refactor organisation rest to remove marshmallow 2017-07-12 12:01:50 +01:00
Rebecca Law
a01163d719 Merge pull request #1077 from alphagov/drop-template_stats-table
Remove the archived table template_statistics.
2017-07-12 10:41:32 +01:00
Imdad Ahad
44c5831f3d Remove old status schema references 2017-07-10 15:50:57 +01:00
Rebecca Law
8a01a76e33 Remove the archived table template_statistics. The last time the table we updated was August 30 2016, it's safe to say we are done with it.
I updated the InboundSms and TemplateRedacted model to include an index in the db.
Dropped service_permissions.updated_at column since we are not auditting the table
2017-07-10 14:43:46 +01:00
Ken Tsang
98cd838510 ken-use-only-new-service-permissions 2017-07-06 12:27:55 +01:00
Rebecca Law
49917ccafd Add redact_personalisation to TemplateSchema 2017-06-29 18:16:03 +01:00
Leo Hemsted
bd71ee9d02 add redact to notification with template schema.
So that when the admin gets notifications, the template they return
also has a "redact_personalisation" boolean attached to it. Note, it
won't do the redacting on the api - that'll be part of the admin.

Under the hood, this uses an association_proxy, which is essentially
black magic. But it proxies the `redact_personalisation` property of
`TemplateRedacted` onto the `Template` object, so that Marshmallow
can pick it up.

Note: NOT currently added to NotificationWithTemplateHistory
2017-06-28 16:15:03 +01:00
Leo Hemsted
9f307fd1c5 add created_by to notifications
this is so one-off notifications can be tied to a user
(jobs have a created_by, and api notifications don't make sense
 to have one)
2017-06-20 11:51:17 +01:00
Rebecca Law
3a66027d6a Refactor ApiKeys.secret and ServiceInboundApi.bearer_token to use the same encryption method and get rid of the duplicate code. 2017-06-19 14:32:22 +01:00
Martyn Inglis
fa0d51b66c Added the free limit to the detailed service representation. 2017-06-07 14:19:25 +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
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
Ken Tsang
112c673593 Removed a few lines from schema 2017-05-26 17:23:01 +01:00
Ken Tsang
18b8382d6e Refactor schema and improve tests 2017-05-26 17:17:15 +01:00
Ken Tsang
56e9faab2e Refactor schema 2017-05-26 16:21:22 +01:00
Ken Tsang
1375bbe400 Refactor schema to improve error response 2017-05-25 17:55:24 +01:00
Ken Tsang
54d85fd8df Add tests for services with no permissions 2017-05-25 17:48:09 +01:00
Ken Tsang
234312ece0 Update service permissions to ensure state in sync 2017-05-25 17:48:09 +01:00
Ken Tsang
2f626fa6fc Add permissions validation in service schema 2017-05-25 17:47:21 +01:00
Ken Tsang
8e3e31faaf Updated service DAO and API end points 2017-05-25 17:47:21 +01:00
Leo Hemsted
466c833c39 marshmallow schemas no longer return _status_enum column
now return `status`, as they should
2017-05-10 17:30:09 +01:00
Rebecca Law
a564b9aeb0 Update /service/{}/notifications to look for a "to" query string, if it exists call the search notifications_by_to_field method. 2017-05-08 17:20:21 +01:00
Martyn Inglis
2a0f8c8808 Validate International phone numbers
- uses new utils methods to validate phone numbers
- defaults to International=True on validation. This ensures the validator works on all numbers
- Then check if the user can send this message to the number internationally if needed.
2017-04-26 15:56:45 +01:00
Imdad Ahad
c4fac1d937 Revert "Revert "add DVLA organisations to API"" 2017-04-21 16:05:07 +01:00
Imdad Ahad
4dfd5448ad Make get all notications return in csv format too:
* This adds functionality (via an extra req param) to the
* existing get all notifications method allowing us to specify
* when we want the API to return in csv/non-csv format
2017-04-20 12:31:49 +01:00
Rebecca Law
2d9a449d1e Changed styling 2017-04-07 14:36:00 +01:00
Rebecca Law
f7ab49246a Added an endpoint that returns all letter jobs, ordered by created_at desc. 2017-04-07 11:50:56 +01:00
Imdad Ahad
ed8dcf5fa1 Refactor schemas and add tests to ensure user is returned on provider schema
dump
2017-03-09 08:43:44 +00:00
Imdad Ahad
e42b15ac7a Split schema for provider and provider history 2017-03-08 17:21:02 +00:00
Imdad Ahad
f6dbc6a06c Updates:
* Add endpoint to retrieve provider history
* Remove marshmallow schemas when updating a provider
* Include created by user when updating a provider
2017-03-03 10:54:20 +00:00
Imdad Ahad
69b1007c33 Add schema and separate endpoint to update a user password 2017-02-07 11:27:13 +00:00
Rebecca Law
41b49eb8e0 Make the update template endpoint work when process_type is present. 2017-01-17 15:48:51 +00:00
Leo Hemsted
501187a9f4 bump utils to 13.0.1
brings in a fix to InvalidEmail/Phone/AddressExceptions not being
instantiated correctly. `exception.message` is not a python standard,
so we shouldn't be relying on it to transmit exception reasons -
rather we should be using `str(exception)` instead. This involved a
handful of small changes to the schema validation
2017-01-09 16:37:58 +00:00
Chris Hill-Scott
59af44d7ab Update utils to 12.0.0
Includes:

- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
      changes which are responsible for all the changes to the API in
      this PR)

The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:

ac20f7e99e/tests/test_base_template.py (L140-L159)
2016-12-13 10:57:01 +00:00