Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

23608 - Update furnishing entries transferred to bc mail+ #3025

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def update_notes_and_status(self, furnishings_list, funishing_status, furnishing
for furnishing in furnishings_list:
furnishing.notes = furnishing_notes
furnishing.status = funishing_status
furnishing.processed_date = datetime.utcnow()
furnishing.save()

def process_paper_letters(self):
Expand Down Expand Up @@ -163,7 +164,7 @@ def process_paper_letters(self):
with self._bcmail_sftp_connection as client:
resp = self.upload_to_sftp(client, self._xpro_letters, filename)
self.update_notes_and_status(
self._bc_mail_furnishings,
self._xpro_mail_furnishings,
JazzarKarim marked this conversation as resolved.
Show resolved Hide resolved
Furnishing.FurnishingStatus.PROCESSED,
'SFTP of XPRO batch letter was a success.'
)
Expand Down
13 changes: 13 additions & 0 deletions jobs/furnishings/tests/unit/stage_processors/test_stage_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,16 @@ async def test_process_paper_letters(app, session, sftpserver, sftpconnection, t
with sftpconnection as sftpclient:
uploaded_files = sftpclient.listdir(storage_directory)
assert len(uploaded_files) == 1

# Fetch the updated furnishing
updated_furnishing = Furnishing.find_by_id(mail_furnishing.id)

# Assert the status is updated correctly
assert updated_furnishing.status == Furnishing.FurnishingStatus.PROCESSED

# Assert the processed_date is set
assert updated_furnishing.processed_date is not None

# Assert the correct note is added based on the entity type
expected_note = 'SFTP of BC batch letter was a success' if entity_type == Business.LegalTypes.COMP.value else 'SFTP of XPRO batch letter was a success'
assert expected_note in updated_furnishing.notes
Loading