Commit Graph

15 Commits

Author SHA1 Message Date
Leo Hemsted
97110e293b make inbound sms page respect data retention
also, it should default to last 7 days, not last 6 days. also change
count_inbound_sms to have the days passed in, so that it's more
explicit at the endpoint that we only return 7 days regardless of your
service's data retention
2019-03-27 17:47:26 +00:00
Leo Hemsted
7683e340cc get all inbound sms should default to 7 days, not 6
to be consistent with other checks.
2019-02-28 15:28:13 +00:00
Leo Hemsted
b4d1a590b7 rename days_ago_to_start to limit_days
consistency with the rest of the app
2019-02-28 13:59:59 +00:00
Leo Hemsted
88303140ec give dao_get_inbound_sms_for_service optional day limit
defaults to 6 to preserve backwards compatibility
2019-02-27 17:17:35 +00:00
Leo Hemsted
e7b8f83fc8 make inbound sms honour data retention
code inspired by the delete notification code, but with some clean up
since we don't deal with different types etc, and only need to run the
query for services with inbound numbers

also, update tests.app.db.create_inbound_sms to create inbound numbers
and assign them to services to ensure the test db is always accurate
and reflects real world usage
2019-02-27 15:53:55 +00:00
chrisw
2abbb590ab Only get inbound messages that are a maximum of 7 days old 2018-05-10 14:00:55 +01:00
chrisw
0f2ddd8cfa added new paginated inbound endpoint 2018-04-04 17:10:41 +01:00
chrisw
ac50250ad7 update paginated inbound sms method 2018-03-23 11:09:51 +00:00
Rebecca Law
c54e0d322b A little clean up 2017-12-28 10:58:15 +00:00
Leo Hemsted
08494ef206 more flake8. lots of unused imports and variables that didn't get used. i tried to preserve old variable names as comments when it looked like they were useful (eg when they were describing timestamps) 2017-11-28 17:23:09 +00:00
Ken Tsang
362072129f Add tests for dao_get_paginated_inbound_sms_for_service 2017-11-09 15:23:45 +00: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
Imdad Ahad
23a501af16 Add dao to get inbound sms by id 2017-06-06 17:11:59 +01:00
Imdad Ahad
0631b6c988 Add dao to delete inbound sms after seven days 2017-06-02 16:10:27 +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