Skip to content

Commit

Permalink
remove receipt and continuation application document for COMPLETED st…
Browse files Browse the repository at this point in the history
…atus and adjust the email template follows the new design
  • Loading branch information
eason-pan-bc committed Nov 15, 2024
1 parent 0b3fc05 commit 76aa443
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _get_pdfs(
# add receipt
corp_name = filing.filing_json['filing']['continuationIn']['nameRequest'].get('legalName', 'Numbered Company')

# Debugging logger for #24361, will remove later
# Debugging logger for #24361, will have another PR before closing the ticket to remove it
current_app.logger.debug(
f'\U0001F4D2 - Business: {business}\n'
f"""\U0001F4D2 - Payload to get receipt: json:
Expand All @@ -94,7 +94,7 @@ def _get_pdfs(
headers=headers
)
if receipt.status_code != HTTPStatus.CREATED:
# Debugging logger for #24361, will remove later
# Debugging logger for #24361, will have another PR before closing the ticket to remove it
current_app.logger.debug(f'\U0001F4D2 - Error getting receipt, when PAID Response: {receipt.text}')
# debugging logger end
logger.error('Failed to get receipt pdf for filing: %s', filing.id)
Expand Down Expand Up @@ -126,20 +126,6 @@ def _get_pdfs(
attach_order += 1

elif status == Filing.Status.COMPLETED.value:
# add filing pdf
filing_pdf_type = 'continuationIn'
filing_pdf_encoded = get_filing_document(business['identifier'], filing.id, filing_pdf_type, token)
if filing_pdf_encoded:
pdfs.append(
{
'fileName': 'Continuation Application.pdf',
'fileBytes': filing_pdf_encoded.decode('utf-8'),
'fileUrl': '',
'attachOrder': str(attach_order)
}
)
attach_order += 1

# add certificate of continuation
certificate_pdf_type = 'certificateOfContinuation'
certificate_encoded = get_filing_document(business['identifier'], filing.id, certificate_pdf_type, token)
Expand Down Expand Up @@ -168,37 +154,6 @@ def _get_pdfs(
)
attach_order += 1

# add receipt
corp_name = business.get('legalName')

receipt = requests.post(
f'{current_app.config.get("PAY_API_URL")}/{filing.payment_token}/receipts',
json={
'corpName': corp_name,
'filingDateTime': filing_date_time,
'effectiveDateTime': effective_date if effective_date != filing_date_time else '',
'filingIdentifier': str(filing.id),
'businessNumber': business.get('taxId', '')
},
headers=headers
)
if receipt.status_code != HTTPStatus.CREATED:
# Debugging logger for #24361, will remove later
current_app.logger.debug(f'\U0001F4D2 - Error getting receipt, when COMPLETED Response: {receipt.text}')
# debugging logger end
logger.error('Failed to get receipt pdf for filing: %s', filing.id)
else:
receipt_encoded = base64.b64encode(receipt.content)
pdfs.append(
{
'fileName': 'Receipt.pdf',
'fileBytes': receipt_encoded.decode('utf-8'),
'fileUrl': '',
'attachOrder': str(attach_order)
}
)
attach_order += 1

return pdfs


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
</ul>
{% else %}
<ul class="outputs">
<li>Continuation Application</li>
<li>Notice of Articles</li>
<li>Certificate of Continuation</li>
<li>Receipt</li>
</ul>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion queue_services/entity-emailer/src/entity_emailer/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def process_email(email_msg: dict, flask_app: Flask): # pylint: disable=too-man
"""Process the email contained in the submission."""
if not flask_app:
raise QueueException('Flask App not available.')
# Debugging logger for #24361, will remove later
# Debugging logger for #24361, will have another PR before closing the ticket to remove it
flask_app.logger.debug(f'\U0001F4D2 email_msg: {email_msg}')
# debugging logger end
with flask_app.app_context():
Expand Down

0 comments on commit 76aa443

Please sign in to comment.