Commit Graph

3270 Commits

Author SHA1 Message Date
Ken Tsang
9ab1dfd6d0 Just order by updated_at for inbound_numbers 2017-08-16 16:28:21 +01:00
Ken Tsang
902b28e00f Refactor to check active flag 2017-08-16 16:27:42 +01:00
Ken Tsang
fbe1a14304 Removed create_inbound_numberfrom fixture 2017-08-16 14:23:32 +01:00
Ken Tsang
084eac5735 Update dao to order by updated_at, number 2017-08-16 14:02:47 +01:00
Ken Tsang
c36423aac6 Refactor code for dao_fetch_servies_by_sms_sender to use inbound_numbers
This will need to be refactored after the deployment of api and admin and after the update script for existing services using inbound numbers has been executed.
2017-08-16 12:51:31 +01:00
Ken Tsang
ce962380e3 Update to return empty json block not '' 2017-08-16 12:50:44 +01:00
Ken Tsang
667ee57a35 Refactor code to use inbound_numbers if set 2017-08-16 12:50:44 +01:00
Ken Tsang
e14fa2d87e Refactored to use service_id to set flag 2017-08-16 12:50:44 +01:00
Ken Tsang
4eba6335d6 Moved url_prefix to inbound_number rest.py 2017-08-16 12:50:44 +01:00
Ken Tsang
81754712ce Removed number col size migration 2017-08-16 12:50:44 +01:00
Ken Tsang
7f1de19592 Refactored to put logic into API 2017-08-16 12:50:44 +01:00
Ken Tsang
f0e9b93136 Update path to use dash 2017-08-16 12:50:44 +01:00
Ken Tsang
6f12b760f3 Removed print 2017-08-16 12:50:44 +01:00
Ken Tsang
faae6e3537 Update inbound_number number col size 2017-08-16 12:50:44 +01:00
Ken Tsang
22956b7427 Refactor code 2017-08-16 12:50:44 +01:00
Ken Tsang
d2a618cf0a Refactor set_inbound_number_for_service
As don't need the check for available inbound numbers
2017-08-16 12:50:44 +01:00
Ken Tsang
0c4c467cac Added extra tests after refactoring 2017-08-16 12:50:44 +01:00
Ken Tsang
c81b1aa6a0 Correct test for inbound_number 2017-08-16 12:50:44 +01:00
Ken Tsang
838401ebb3 Refactored endpoints 2017-08-16 12:50:44 +01:00
Ken Tsang
104fc93503 Refactor code 2017-08-16 12:50:44 +01:00
Ken Tsang
d5b91f9911 Fixed admin_request bug 2017-08-16 12:50:44 +01:00
Ken Tsang
468048797a Refactor conftest 2017-08-16 12:50:44 +01:00
Ken Tsang
6908ec4821 Add inbound_number rest and tests 2017-08-16 12:50:44 +01:00
Ken Tsang
47a1403591 Refactor code to add updated_at 2017-08-16 12:50:44 +01:00
Imdad Ahad
fbe505a991 Merge pull request #1172 from alphagov/imdad-feat-get-billing-from-new-table
Populate and retrieve billing data from the new MonthlyBilling table
2017-08-16 12:35:12 +01:00
Imdad Ahad
94605d31fa Change how we populate and retrieve MonthlyBilling totals:
1. For both email and sms, store [] in monthly_totals if
there is no billing data (no notifications sent etc.) and
return this via the API

2. General refactoring of indentation
2017-08-15 16:09:42 +01:00
Chris Hill-Scott
7879bc0e7e Merge pull request #1177 from alphagov/fix-migration-order
Fix order of DB migrations
2017-08-14 14:18:15 +01:00
Chris Hill-Scott
6f18415997 Fix order of DB migrations
More migrations got merged in between me making 0114 and merging the PR
that contained 0114.

If we named the files as just 0114.py then this would get flagged as a
merge conflict…
2017-08-14 13:54:18 +01:00
Chris Hill-Scott
eb43629576 Merge pull request #1171 from alphagov/ch-letter-logo
Add letter organisation for Companies House
2017-08-14 13:48:12 +01:00
Imdad Ahad
46ca086aa2 Update command to populate monthly billing data for email and sms 2017-08-11 16:57:18 +01:00
Imdad Ahad
69845e9f37 Add helper methods to retrieve billing data from the new table:
Get yearly and monthly billing data from the new table
with filter by notification type. Additionally let's calculate
current day delta totals
2017-08-11 16:57:18 +01:00
Imdad Ahad
35ad5d74f9 Retrieve billing data (for month) by notification type:
* Previously we were only returning SMS. Let's make this return for
a given notification type.
* General refactor of the monthly retrieval query
* Return an empty BillingData tuple if email billing data is empty
2017-08-11 16:57:18 +01:00
Imdad Ahad
839c161628 Update monthly billing for SMS and Email:
* Refactor code to update for EMAIL_TYPE and SMS_TYPE
* Make tests more robust (overlapping rates, multiple months, multiple noti
* types)
*
2017-08-11 16:57:18 +01:00
Imdad Ahad
ae76fd0f30 Small refactor to a test 2017-08-11 16:57:18 +01:00
Imdad Ahad
63e1167098 Make sure we update the correct month for billing:
When populating the monthly billing records on a schedule, we need
to ensure the correct month is being updated.

As an example, if the current datetime is 31 Mar 2016, 23:00. The
BST equivalent is the 1st April. Therefore we need to ensure we
update billing for April, not March. This takes care of that.
2017-08-11 16:57:17 +01:00
Imdad Ahad
782f3ea693 Rename method to get start and end date of a month for clarity 2017-08-11 16:56:47 +01:00
Imdad Ahad
19b09f2a27 Rename method to convert from utc to bst for consistency 2017-08-11 16:56:46 +01:00
kentsanggds
955ec60fe3 Merge pull request #1157 from alphagov/ken-add-inbound-number-model-dao
Add inbound number model and DAO
2017-08-11 15:17:47 +01:00
Rebecca Law
8658f691e7 Merge pull request #1173 from alphagov/turn-off-purge-dvla-resp-files
Stop purging the DVLA response files from S3
2017-08-11 13:40:20 +01:00
Ken Tsang
2b92c95c22 Update migration script 2017-08-11 13:25:09 +01:00
Ken Tsang
976be24cbc Refactor test 2017-08-11 12:56:59 +01:00
Ken Tsang
9a55e167f7 Refactored inbound_number dao 2017-08-11 12:56:59 +01:00
Ken Tsang
cfabab0785 Refactor code to add updated_at 2017-08-11 12:56:59 +01:00
Ken Tsang
2cfe85a2af Refactored inbound_number dao tests 2017-08-11 12:56:59 +01:00
Ken Tsang
e80bc9deb2 Refactor conftest 2017-08-11 12:56:59 +01:00
Ken Tsang
d101e262b5 Renamed migration scripts 2017-08-11 12:56:59 +01:00
Ken Tsang
668811197c Remove whitespace 2017-08-11 12:56:59 +01:00
Ken Tsang
c9f871c0c9 Refatored tests and fixtures for inbound_number 2017-08-11 12:56:59 +01:00
Ken Tsang
a127a6e871 Added active flag setting in inbound_number_dao 2017-08-11 12:56:59 +01:00
Ken Tsang
5e2d0bf5c6 Update test fixture to provide default provider 2017-08-11 12:56:59 +01:00