- had to update the serialization in the model so that the date time is appended with the UTC timezone
- test has been added to ensure that the schema will validate the response correctly
We want services to have control over this setting, rather than deriving
it from the value of their sender. This commit does that derivation one
last time, and stores it in the column, where it can be changed as and
when needed.
We want new services, when they do the tour, to see how the service name
they just made shows up in the messages. This is how it (should) work
at the moment (although got broken because of the multiple senders
stuff).
Need to do this before we do the migration now otherwise a new service
could sneak in with this setting still set to `null`.
This was already working, but adds a test to make sure that it works as
requested.
Still to do:
- migrate all services to having `True` or `False` in this column
- make column non-nullable
- start rejecting `None` as a possible value for this update
In future changes, services will be able to control whether their text
messages will be prefixed with the name of their service.
This commit:
- adds a column to store the value of that setting
- makes the service model take notice of it, if it were to have a value
set
It doesn’t:
- provide a way of setting the value of this column
Currently the column can have three values:
- `None` – ignore it (this is what all current services will start as)
and continue to determine whether to prefix messages by looking at the
sender
- `True` – always the service name to the start of text messages
- `False` – never add the service name to the start of text messages
In the future we’ll migrate all services to be either `True` or `False`,
the `None` will go away and all services will have direct control over
the setting.
`service.sms_sender` has been deprecated; we should be looking at which
of the service’s SMS senders is default to work out if the message
has been sent from GOVUK or not (and if it has, then prefix the message
with the service name).
The arguments to `SMSMessageTemplate` are _super_ badly named – `sender`
isn’t really used as a string, it’s a boolean that effectively means
‘is this a custom sender (`True`) or the platform default (`False`)’. We
should rename it once this bug is fixed.
If the service is sending messages from GOVUK, then its messages should
be prefixed with the service name. Right now this logic is:
- worked out separately in the admin app and API
- isn’t aware of multiple senders
This commit moves the logic to one place (the service model). It does
this in a slightly naive way, in that it only looks at the default
sender, not the actual sender of the message.
In the future this will go away because we’ll move it to being a setting
that’s controlled independently of the service name. But this is the
first step towards that.
fixup! Add prefix SMS with service name to service model
- moved get_current_financial_year_start_year from service.utils to dao.date_utils
- Moved logic for data persistence from rest to dao when updating records in db
also, downgrade client returning bad status codes from `exception` to
error - it's not a problem with our system so we don't want it to trip
any cloudwatch alerts or anything.
NotificationStatistics was added as a spike but didn't work out as expected. This is finally removing all that unused code.
I'll drop the table in the next PR