Commit Graph

17 Commits

Author SHA1 Message Date
Kenneth Kehl
58a8b51f59 more input checking 2025-06-26 10:35:46 -07:00
Kenneth Kehl
2e7e6e81fc Need to remove priority logic 2024-08-09 09:11:28 -07:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Katie Smith
8ae2b0bb31 Replace how .dump is called
As with `.load`, only data is now returned instead of a tuple.
2022-05-25 11:35:44 +01:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Leo Hemsted
42e6bd8b82 remove unused old file 2019-12-13 10:02:39 +00:00
Katie Smith
cf7997d925 Change get_providers endpoint to return no of SMS sent by each provider
In addition to the existing provider data, we also want return the number of
billable units (muliplied by the rate multiplier) that each SMS provider sent
this month. This will be used on the platform admin providers page.

Since we can no longer get all the information we need from the provider details
schema, this makes a new DAO function to get all the data for the endpoint.
2019-05-07 08:31:04 +01:00
Imdad Ahad
1ccaf08003 Fix migration and small refactor 2017-03-08 09:49:47 +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
37341e7a62 Updates:
* Add notify user id in config
* Add dao method to get provider history versions along with tests
* BUG: Provider switching did not handle case where priorities were equal. This
* adds a fix to properly cover this case along with tests
2017-03-03 10:54:20 +00:00
Imdad Ahad
e1d1769345 Refactor to switch properly when providers have equal priority with test 2017-01-23 13:36:04 +00:00
Imdad Ahad
d466265a9d Refactor provider switch methods in dao and tests 2017-01-20 16:13:13 +00:00
Leo Hemsted
f1899c6d53 add updated_at to provider_details
it's set to utcnow from dao_update_provider_details
2016-12-19 17:45:46 +00:00
Leo Hemsted
8bb0261c79 dont let user update prov details version, and refactor tests
the provider details tests were previously very stateful - they
would update a value, and then because provider_details is a "static"
table that is not wiped by the notify_db_session fixture, the tests
were forced to make a second update that reverted that change. if the
test fails for whatever reason, the provider_details table ends up
permanently modified, playing havoc on tests further down the line.

this commit adds the fixture `restore_provider_details` to conftest.
this fixture stores a copy of the contents of ProviderDetails and
ProviderDetailsHistory tables outside of the session, runs the test,
and then clears the table and puts those old values in

this means that the tests have been cleaned up so that they do not
do operations twice in reverse. they've also been cleaned up
generally, including fixture optimisations and such
2016-12-19 17:13:10 +00:00
Adam Shimali
b33312b855 Change endpoint responses where there are marshalling, unmarshalling
or param errors to raise invalid data exception. That will cause
those responses to be handled in by errors.py, which will log
the errors.

Set most of schemas to strict mode so that marshmallow will raise
exception rather than checking for errors in return tuple from load.

Added handler to errors.py for marshmallow validation errors.
2016-06-15 14:37:51 +01:00
Martyn Inglis
9e71759e57 Added get provider by id 2016-05-10 15:18:41 +01:00
Martyn Inglis
571686b638 Ensure that the primary provider is used in all tasks 2016-05-10 09:04:22 +01:00