Commit Graph

337 Commits

Author SHA1 Message Date
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
Rebecca Law
64db8cb18d Merge branch 'master' into select-inbound-number-to-assign 2017-09-25 11:13:12 +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
Ken Tsang
366d07dbbe Add ServiceLetterContact data model and script 2017-09-21 16:08:49 +01:00
Rebecca Law
18581c754a Add new endpoint to get available inbound number.
Add new endpoint to allocate a specific number to a given service.

This will allow the platform admin user to choose a number when setting the inbound_sms permission for a service.
2017-09-21 15:18:52 +01:00
Chris Hill-Scott
8360b9a122 Merge pull request #1265 from alphagov/logoless-organsations
Make organisation logo nullable
2017-09-21 13:01:06 +01:00
Rebecca Law
0c9f16a8d1 Add id and service_id to the serialize method on ServiceEmailReplyTo 2017-09-21 10:21:32 +01:00
Rebecca Law
08fdcbfc67 Merge pull request #1266 from alphagov/use-reply-to-from-new-table
Use reply to email address from new table
2017-09-21 09:54:52 +01:00
Leo Hemsted
9afb2c36e7 Merge pull request #1241 from alphagov/letter-received
Letters are accepted, not created or sending
2017-09-20 16:51:31 +01:00
Leo Hemsted
4174c72f21 allow 'accepted' as a proxy for created + sending as well as 'failed' for the three failure types when querying the api 2017-09-20 15:30:14 +01:00
Rebecca Law
06ffac9a0f Merge branch 'master' into use-reply-to-from-new-table 2017-09-20 14:00:04 +01:00
Rebecca Law
3a5706994f Merge pull request #1258 from alphagov/add-multiple-reply-to-email-endpoints
Add multiple reply to email endpoints
2017-09-20 13:26:02 +01:00
Leo Hemsted
cb3379d0b6 rename received_by_notify to accepted
accepted is nice since it both implies that things look good, while
not being commital about next steps.
2017-09-20 11:20:51 +01:00
Leo Hemsted
4936fa384c return fake "received_by_notify" status for letter notifications
created and sending aren't quite as helpful for letters, since their
journey through notify and our providers is so different to emails/sms.
So instead, we should return estimated_dispatch_date (in a future PR)
and the status should just read received_by_notify
2017-09-20 11:20:13 +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
Rebecca Law
a53a0da414 [WIP] need to fix the tests 2017-09-20 10:45:35 +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
Chris Hill-Scott
29a962060f Return delivery estimate for letter notifications
> For get all or get one letter the response needs to be updated so that
> it looks similar to admin app.
>
> status: created|sending --> received letter
> new column: `estimated delivery date`: derived from created at date.
> (see how the admin app is doing it)
>
> NOTE:
> At the moment we only have 2 statuses for a letter created and
> sending, but we will want to have other internal statuses that make
> sense to the Notify team but not our services. When we know those
> statuses the status map will be updated at that point.

– https://www.pivotaltracker.com/story/show/150512525

This commit implements the date (not status) part of this story.
2017-09-15 14:58:07 +01:00
Rebecca Law
6b2c2962c9 New endpoint to insert new service reply to email address and update existing one. 2017-09-14 17:54:38 +01:00
Katie Smith
72760550bd Add endpoint to get the email reply to addresses for a service
- Changed the dao_get_reply_to_by_service_id method to return a list of
results.
- Added a GET /service/<service_id>/email-reply-to endpoint
2017-09-13 16:58:36 +01:00
Rebecca Law
d356957974 Change the ServiceEmailReplyTo model to uselist for the backref to services (allow 0 to many reply to emails)
Add another assert in the test
2017-09-12 10:14:58 +01:00
Imdad Ahad
d997eb3af9 Create ServiceEmailReplyTo table 2017-09-07 15:41:23 +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
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
kentsanggds
3bfbb9d71f Merge pull request #1178 from alphagov/ken-use-inbound-number
Use inbound number for delivering sms and to show on service settings
2017-08-18 11:42:52 +01:00
Chris Hill-Scott
953e2ae5bd Merge pull request #1180 from alphagov/return-template-name
Return template name in public API
2017-08-17 12:44:24 +01:00
Ken Tsang
667ee57a35 Refactor code to use inbound_numbers if set 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
faae6e3537 Update inbound_number number col size 2017-08-16 12:50:44 +01:00
Chris Hill-Scott
04e41e3147 Return template name in public API
The use for the public template API is for building caseworking systems
or similar, where you might need a list of templates to pick from (ie
instead of using the Notify web interface to pick from and send a
message).

Right now our API isn’t returning the template name as part of the
response. The name is a useful, human-friendly way of identifying a
template.

This commit changes the response to include the name.

Some clients will need updating before this can be useful.
2017-08-15 14:46:30 +01:00
Imdad Ahad
19b09f2a27 Rename method to convert from utc to bst for consistency 2017-08-11 16:56:46 +01:00
Ken Tsang
cfabab0785 Refactor code to add updated_at 2017-08-11 12:56:59 +01:00
Ken Tsang
ffc2da2369 Update serialization for services 2017-08-11 12:56:59 +01:00
Ken Tsang
61c09f142c Refactored model and dao 2017-08-11 12:56:59 +01:00
Ken Tsang
3c392596a3 Add backref in InboundNumber model 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
Leo Hemsted
da02ffa32f ensure template history serializes using template serialize fn 2017-08-09 12:24:35 +01:00
Leo Hemsted
c9762f75a1 make sure template serialises letter subjects 2017-08-09 11:56:52 +01:00
Leo Hemsted
13917c9c57 give test letter api notifications a different filename
so they can be distinguished on the frontend.

Also, some related cleanup:

* don't show test api letters on the frontpage
* make sure the subject is returned from the API for letters
* make sure the letter's address is returned for letters
2017-08-01 18:23:29 +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
Leo Hemsted
2746bf0318 process letters from api traffic
there are three steps to this

1. Create a job
  * Starts in status 'ready to send'
  * Created by None, since it's from the API
  * original file name 'letter submitted via api'
2. Create a single notification for that job
  * job_row_number 0
  * client reference if provided
  * address line 1 as recipient
3. Trigger the build_dvla_file task
  we know that all the notifications have been created for this job
  (since we just created them ourselves synchronously), so this will
  just create the dvla-format file for the job, and upload it to s3.
2017-07-27 11:12:09 +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
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
9400988d72 Monthly billing - part 1
This is still a work in progress but it would be good to get some eyes on it.
This commit includes creating and updating a row in the monthly billing table and a method to fetch the results.
There is a command to populate the monthly billing for a service and month so we can try it out.
The total cost at the moment are wrong, they do not take into account the free allowance - see notes below about adding that to the table.
Left to do:
create a nightly task to run to update the monthly totals.
create an endpoint to return the yearly billing, the current day will need to be calculated on the fly and added to the totals.
Add the free allowance into the total costs.
2017-07-18 18:21:35 +01:00
Rebecca Law
4b05c32b62 Create a new table to warehouse the monthly billing numbers 2017-07-13 17:22:11 +01:00
Ken Tsang
b814c5ff26 Refactor organisation rest to remove marshmallow 2017-07-12 12:01:50 +01:00
Ken Tsang
a6df96213b Update model and migration script 2017-07-12 12:01:50 +01:00
Ken Tsang
f76962ad4d Add versioning to Organisations 2017-07-12 12:01:50 +01:00
Ken Tsang
c743e52fe8 Add organisations model and create dao 2017-07-12 12:01:50 +01:00