Skip to content

Commit

Permalink
additional furnishing record updates (bcgov#2848)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzdev420 authored Jul 19, 2024
1 parent 8b7f098 commit d4e808a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""Email processing rules and actions for involuntary_dissolution stage 1 overdue ARs notifications."""
from __future__ import annotations

from datetime import datetime
from pathlib import Path

from entity_queue_common.service_utils import logger
Expand Down Expand Up @@ -93,4 +94,8 @@ def post_process(email_msg: dict, status: str):
furnishing_id = email_msg['data']['furnishing']['furnishingId']
furnishing = Furnishing.find_by_id(furnishing_id)
furnishing.status = status
furnishing.processed_date = datetime.utcnow()
furnishing.last_modified = datetime.utcnow()
if status == Furnishing.FurnishingStatus.FAILED:
furnishing.notes = 'Failure to send email'
furnishing.save()
2 changes: 2 additions & 0 deletions queue_services/entity-emailer/tests/unit/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,3 +526,5 @@ def test_involuntary_dissolution_stage_1_notification(app, db, session, mocker,

updated_furnishing = Furnishing.find_by_id(furnishing.id)
assert updated_furnishing.status.name == expected_furnishing_status
if expected_furnishing_status == 'FAILED':
assert updated_furnishing.notes == 'Failure to send email'

0 comments on commit d4e808a

Please sign in to comment.