Commit Graph

362 Commits

Author SHA1 Message Date
Leo Hemsted
0ab89116ee use server_default in alembic to ensure zero-downtimeness
we can back-fill data, however, between alembic running and the api
updating to the new code, it'll still try and create new users without
adding the auth_type, because that won't be referenced in the model yet.

Instead of using a python-level default, a postgres-level
server_default will make postgres set every row to sms_auth if it's not
defined in the application.
2017-10-30 11:59:35 +00:00
Leo Hemsted
c39ec90727 add auth type table, currently contains sms_auth and email_auth 2017-10-30 11:11:37 +00:00
Ken Tsang
8a4c8802ef Add notification email reply_to script 2017-10-27 15:11:35 +01:00
Leo Hemsted
46f5896b3b add new email_auth service permission 2017-10-27 14:28:20 +01:00
Rebecca Law
b048b2c3bf DB update script for new table 2017-10-26 16:40:38 +01:00
Rebecca Law
d975f30888 Fix merge conflict 2017-10-19 14:39:53 +01:00
Rebecca Law
954a80649e Merge branch 'master' into add-update-multiple-sms-sender 2017-10-19 14:34:58 +01:00
venusbb
7e78e19500 Unique constrain and db.relationship 2017-10-19 12:00:01 +01:00
venusbb
b2fa7cdd83 create new table annual_billing 2017-10-18 15:35:51 +01:00
Rebecca Law
4ca6fbc724 Added dao methods needed to add or update multiple sms senders for a service.
Remove the unique constraint for service on the ServiceSmsSender model.
2017-10-18 13:13:23 +01:00
Rebecca Law
1a463cba1f Merge branch 'master' into add-update-multiple-sms-sender 2017-10-18 11:18:44 +01:00
Chris Hill-Scott
2a5e6c2d0c Store organisation type against each service
> So that we can default services to their appropriate text allowance,
> we need to find out what sector they're in. So let's start collecting
> that from teams as they create new services.

In order to work out what a team’s allowance should be, we need to know
what part of government they’re from. We’re going to do this logic in
the admin app and then `POST` the allowance to the API.

So all we need to do with the information that the users give us is
store it against the service, so we have a record. Doesn’t need any
logic doing as a result of it, doesn’t need foreign keying to the
organisations table, etc.
2017-10-18 10:49:31 +01:00
Rebecca Law
edba490c72 Remove unique constraint for ServiceSmsSenders.
This will allow a service to have multiple sms senders.
2017-10-17 16:53:13 +01:00
Venus Bailey
9b60d69931 Revert "Revert "[#151837054] Add new column free_sms_fragment_limit in the Services table"" 2017-10-16 16:24:34 +01:00
Venus Bailey
616a6f8ef8 Revert "[#151837054] Add new column free_sms_fragment_limit in the Services table" 2017-10-16 12:43:05 +01:00
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
Richard Chapman
d8e1a34610 Added a unique constraint to the notification_id column of the notification_to_email_reply_to table so that each notification can only have one mapping to service_email_reply_to and hence one email address. 2017-10-03 11:03:31 +01:00
Richard Chapman
fdc4d4c24f Reanmed the link table to be a bteer description of what the table is for as it was previously confusing. Updated the migration script to reflect those changes 2017-09-28 11:11:41 +01:00
Richard Chapman
6356a5320a Updated model with a new table notification_to_email_sender and created db migration script 2017-09-27 10:36:25 +01:00
Ken Tsang
366d07dbbe Add ServiceLetterContact data model and script 2017-09-21 16:08:49 +01:00
Chris Hill-Scott
bde6a9e131 Make organisation logo nullable
Now we have the org banner branding, not all organisations need a logo.
So it shouldn’t be an error to not provide one.
2017-09-20 11:06:16 +01:00
chrisw
f49eca5324 Add a non-GOV.UK banner option for email branding
Added an extra name, 'org_banner', for branding types into branding_type table
Added org banner into user model in database
Added checks for new branding type to ensure that the correct data is passed into the dict
Tested new checks in html email options
2017-09-19 14:40:22 +01:00
Imdad Ahad
d997eb3af9 Create ServiceEmailReplyTo table 2017-09-07 15:41:23 +01:00
Imdad Ahad
b85ff4e6a6 Update the alembic generator template to be PEP friendly 2017-09-07 15:41:04 +01:00
Rebecca Law
3b115cc79f Remove the or current_app['FROM_NUMBER'] since sms_sender is a required field. 2017-09-06 15:33:09 +01:00
Rebecca Law
86929fd6b6 Create a table for service_sms_senders.
Migration from inbound_number to service_sms_senders.
May need to pull out the migration into another PR.
2017-09-05 17:53:47 +01:00
Chris Hill-Scott
caea65165c Allow Notify service to send international sms
Right now Notify restricts you to registering with a UK mobile number.
This is because when we built the user registration stuff we couldn’t
send to international mobiles.

However we can send to international mobile numbers, and it’s totally
reasonable to expect employees of the UK government to be working
abroad, and have a foreign mobile phone – we’ve heard from one such
user.

In order for users of Notify to register with an international phone
number, the Notify service needs to have the `international_sms`
permission set. Which this service does, as a data migration.
2017-08-29 15:18:49 +01:00
Ken Tsang
81754712ce Removed number col size migration 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
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
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
782f3ea693 Rename method to get start and end date of a month for clarity 2017-08-11 16:56:47 +01:00
Ken Tsang
2b92c95c22 Update migration script 2017-08-11 13:25:09 +01:00
Ken Tsang
cfabab0785 Refactor code to add updated_at 2017-08-11 12:56:59 +01:00
Ken Tsang
d101e262b5 Renamed migration scripts 2017-08-11 12:56:59 +01:00
Ken Tsang
4de6060694 Add data models, dao for inbound_numbers 2017-08-11 12:56:59 +01:00
Imdad Ahad
dcecd21f82 Drop unused month and year columns from monthlybilling 2017-08-11 10:44:34 +01:00
Chris Hill-Scott
fdcb0da218 Add letter organisation for Companies House
Depends on:
- [ ] https://github.com/alphagov/notifications-template-preview/pull/37
2017-08-10 14:40:21 +01:00
Leo Hemsted
2ab105aaf4 add tests for letter api notifications 2017-07-27 16:43:55 +01:00
Leo Hemsted
f528236eda make job.created_by nullable
Since letter jobs from the API aren't created by any single individual,
lets make created_by nullable. Note: We'll have to make sure that we
update the admin app to handle these jobs nicely
2017-07-27 12:58:13 +01:00
Rebecca Law
8b6be67bbd make columns nullable 2017-07-26 15:06:09 +01:00
Rebecca Law
5669d0475f Don't drop the columns yet 2017-07-26 14:46:40 +01:00
Rebecca Law
c1f2634c90 Removed month and year and replaced it with start_date and end_date.
This will allow us to sort the data properly.
2017-07-26 13:19:17 +01:00
Ken Tsang
4989493bdf Renamed migration script 2017-07-25 17:23:30 +01:00
Ken Tsang
277f5b9053 Renamed script 2017-07-25 17:20:35 +01:00
Ken Tsang
beca03a39c Add migration script to drop service flags 2017-07-25 17:20:35 +01:00
Rebecca Law
3e2b8190b9 - Added a scheduled task to create or update billing for the month, yesterday is used to calculate the start and end date for the month.
- The new task has not been added to the beat application yet.
- Added an updated_at column to the monthly billing table, we may want to only calculate from the last updated date rather than the entire month.
2017-07-24 15:13:18 +01:00
Rebecca Law
793248a74f Fix data migration merge conflict 2017-07-19 15:47:12 +01:00
Rebecca Law
bc4afb25ae Merge branch 'master' into month-billing-table 2017-07-19 14:33:19 +01:00