Add fields to record a service’s estimated volumes

When a service go live we ask people for their estimated sending
volumes. At the moment we only put this in the ticket, and store it in
a spreadsheet.

This means that a service can
- say they want to go live
- say they are sending 100,000 emails per year
- not have created any email templates
- still see ‘create templates’ as ‘completed’ in the go live checklist

If we store this data against the service we can collect it earlier, and
then use it to determine automatically what kind of templates the user
needs to create before their go live checklist can be considered
complete.
This commit is contained in:
Chris Hill-Scott
2019-02-13 14:00:52 +00:00
parent f8f7d245b3
commit 17e32fa5f6
3 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
"""
Revision ID: 0260_service_volumes
Revises: 0259_remove_service_postage
Create Date: 2019-02-13 13:45:00.782500
"""
from alembic import op
from itertools import product
import sqlalchemy as sa
revision = '0260_service_volumes'
down_revision = '0259_remove_service_postage'
TABLES_AND_CHANNELS = product(
('services', 'services_history'),
('volume_{}'.format(channel) for channel in ('email', 'letter', 'sms')),
)
def upgrade():
for table, channel in TABLES_AND_CHANNELS:
op.add_column(table, sa.Column(channel, sa.String(length=255), nullable=True))
def downgrade():
for table, channel in TABLES_AND_CHANNELS:
op.drop_column(table, channel)