mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
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.
23 lines
578 B
Python
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}
|
|
)
|