change Recipient to Phone Number

This commit is contained in:
Kenneth Kehl
2024-02-21 10:30:24 -08:00
parent 3363cc6979
commit 96d5e72514
2 changed files with 9 additions and 9 deletions

View File

@@ -71,6 +71,7 @@ def generate_notifications_csv(**kwargs):
if "page" not in kwargs: if "page" not in kwargs:
kwargs["page"] = 1 kwargs["page"] = 1
# This generates the "batch" csv report
if kwargs.get("job_id"): if kwargs.get("job_id"):
original_file_contents = s3download(kwargs["service_id"], kwargs["job_id"]) original_file_contents = s3download(kwargs["service_id"], kwargs["job_id"])
original_upload = RecipientCSV( original_upload = RecipientCSV(
@@ -79,7 +80,7 @@ def generate_notifications_csv(**kwargs):
) )
original_column_headers = original_upload.column_headers original_column_headers = original_upload.column_headers
fieldnames = [ fieldnames = [
"Recipient", "Phone Number",
"Template", "Template",
"Sent by", "Sent by",
"Batch File", "Batch File",
@@ -92,9 +93,9 @@ def generate_notifications_csv(**kwargs):
fieldnames.append(header) fieldnames.append(header)
else: else:
# TODO This is deprecated because everything should be a job now, is it ever invoked? # This generates the "full" csv report
fieldnames = [ fieldnames = [
"Recipient", "Phone Number",
"Template", "Template",
"Sent by", "Sent by",
"Batch File", "Batch File",
@@ -102,7 +103,6 @@ def generate_notifications_csv(**kwargs):
"Status", "Status",
"Time", "Time",
] ]
current_app.logger.warning("Invoking deprecated report format")
yield ",".join(fieldnames) + "\n" yield ",".join(fieldnames) + "\n"

View File

@@ -88,14 +88,14 @@ def get_notifications_csv_mock(
( (
None, None,
[ [
"Recipient,Template,Sent by,Batch File,Carrier Response,Status,Time\n", "Phone Number,Template,Sent by,Batch File,Carrier Response,Status,Time\n",
"8005555555,foo,,,Did not like it,Delivered,1943-04-19 08:00:00 AM US/Eastern\r\n", "8005555555,foo,,,Did not like it,Delivered,1943-04-19 08:00:00 AM US/Eastern\r\n",
], ],
), ),
( (
"Anne Example", "Anne Example",
[ [
"Recipient,Template,Sent by,Batch File,Carrier Response,Status,Time\n", "Phone Number,Template,Sent by,Batch File,Carrier Response,Status,Time\n",
"8005555555,foo,Anne Example,,Did not like it,Delivered,1943-04-19 08:00:00 AM US/Eastern\r\n", # noqa "8005555555,foo,Anne Example,,Did not like it,Delivered,1943-04-19 08:00:00 AM US/Eastern\r\n", # noqa
], ],
), ),
@@ -128,7 +128,7 @@ def test_generate_notifications_csv_without_job(
8005555555 8005555555
""", """,
[ [
"Recipient", "Phone Number",
"Template", "Template",
"Sent by", "Sent by",
"Batch File", "Batch File",
@@ -152,7 +152,7 @@ def test_generate_notifications_csv_without_job(
8005555555, 🐜,🐝,🦀 8005555555, 🐜,🐝,🦀
""", """,
[ [
"Recipient", "Phone Number",
"Template", "Template",
"Sent by", "Sent by",
"Batch File", "Batch File",
@@ -182,7 +182,7 @@ def test_generate_notifications_csv_without_job(
"8005555555","🐜,🐜","🐝,🐝","🦀" "8005555555","🐜,🐜","🐝,🐝","🦀"
""", """,
[ [
"Recipient", "Phone Number",
"Template", "Template",
"Sent by", "Sent by",
"Batch File", "Batch File",