Files
notifications-admin/app/notify_client/letter_jobs_client.py
Alexey Bezhan b75681dfbc Add a platform admin page to submit returned letter references
A platform admin form accepts a list of references (one per line)
received from DVLA and sends them to the API to update notification
statuses.

References we get from DVLA start with `NOTIFY00\d`, which isn't
part of the reference we store in the database, so we remove them
before sending the data to the API.

The new `returned-letter` status should be treated as `delivered`
for now until we decide a way to display returned letters to users.
2018-09-07 11:13:01 +01:00

23 lines
578 B
Python

from app.notify_client import NotifyAdminAPIClient
class LetterJobsClient(NotifyAdminAPIClient):
def __init__(self):
super().__init__("a" * 73, "b")
def get_letter_jobs(self):
return self.get(url='/letter-jobs')['data']
def send_letter_jobs(self, job_ids):
return self.post(
url='/send-letter-jobs',
data={"job_ids": job_ids}
)['data']
def submit_returned_letters(self, references):
return self.post(
url='/letters/returned',
data={'references': references}
)