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

26412 cont_in_magic_link_outputs #1761

Merged
merged 4 commits into from
Mar 17, 2025
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
116 changes: 5 additions & 111 deletions api/namex/resources/name_requests/report_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ def _get_template_data(nr_model):
nr_report_json['isModernized'] = True if instruction_group == 'modernized' else False
nr_report_json['isColin'] = True if instruction_group == 'colin' else False
nr_report_json['isSociety'] = True if instruction_group == 'so' else False
nr_report_json['isNew'] = True if instruction_group == 'new' else False
nr_report_json['isPaper'] = not (ReportResource._is_colin(nr_model['entity_type_cd']) or ReportResource._is_modernized(nr_model['entity_type_cd']) or ReportResource._is_society(nr_model['entity_type_cd']) or ReportResource._is_potential_colin(nr_model['entity_type_cd']))
nr_report_json['isPaper'] = not (ReportResource._is_colin(nr_model['entity_type_cd']) or ReportResource._is_modernized(nr_model['entity_type_cd']) or ReportResource._is_society(nr_model['entity_type_cd']))
nr_report_json['requestCodeDescription'] = \
ReportResource._get_request_action_cd_description(nr_report_json['request_action_cd'])
nr_report_json['nrStateDescription'] = \
Expand Down Expand Up @@ -390,111 +389,6 @@ def _get_next_action_text(entity_type_cd: str, url: str, instruction_group: str)
STEPS_TO_RESTORE_URL = current_app.config.get('STEPS_TO_RESTORE_URL')

next_action_text = {
# BC Types
'CR': {
'NEW': 'Check your email for instructions on how to complete your application using this name request.',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>'
},
'UL': {
'NEW': 'Check your email for instructions on how to complete your application using this name request.',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>'
},
'FR': {
'NEW': f'Use this name request to complete your application by visiting <a href="{url}">'
'Registering Proprietorships and Partnerships</a>',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
'Registering Proprietorships and Partnerships</a> for more information. To learn more, visit '
f'<a href="{BUSINESS_CHANGES_URL}">Making Changes to your Proprietorship or'
' Partnership</a>'
},
'GP': {
'NEW': f'Use this name request to complete your application by visiting <a href="{url}">'
'BC Registries and Online Services</a>',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
'BC Registries and Online Services</a> for more information. To learn more, visit '
f'<a href="{BUSINESS_CHANGES_URL}">Making Changes to your Proprietorship or'
' Partnership</a>'
},
'DBA': {
'NEW': f'Use this name request to complete your application by visiting <a href="{url}">'
'Registering Proprietorships and Partnerships</a>',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
'Registering Proprietorships and Partnerships</a> for more information. To learn more, visit '
f'<a href="{BUSINESS_CHANGES_URL}">Making Changes to your Proprietorship or'
' Partnership</a>'
},
'LP': {
'DEFAULT': f'Visit <a href= "{url}">Forms, fees and information packages page</a> and'
' download the appropriate form'
},
'LL': {
'DEFAULT': f'Visit <a href= "{url}">Forms, fees and information packages page</a> and'
' download the appropriate form'
},
'CP': {
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">{url}</a>'
},
'BC': {
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">{url}</a>'
},
'CC': {
'NEW': 'Check your email for instructions on how to complete your application using this name request.',
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>'
},
'SO': {
'DEFAULT': f'To complete your filing, visit <a href="{url}">'
f'{url}</a> and login with your BCeID.'
},
'PA': {
'DEFAULT': ReportResource.GENERIC_STEPS
},
'FI': {
'DEFAULT': ReportResource.GENERIC_STEPS
},
'PAR': {
'DEFAULT': ReportResource.GENERIC_STEPS
},
# XPRO and Foreign Types
'XCR': {
'NEW': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>',
'CHG': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>',
'DEFAULT': f'To complete your filing, <a href= "{url}">visit our Forms page</a> to'
' download and submit a form'
},
'XUL': {
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>'
},
'RLC': {
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
f'{url}</a>'
},
'XLP': {
'DEFAULT': f'Visit <a href= "{url}">Forms, fees and information packages page</a> and'
' download the appropriate form'
},
'XLL': {
'DEFAULT': f'Visit <a href= "{url}">Forms, fees and information packages page</a> and'
' download the appropriate form'
},
'XCP': {
'DEFAULT': 'Extraprovincial Cooperative Association'
},
'XSO': {
'DEFAULT': f'To complete your filing, visit <a href="{url}">'
f'{url}</a> and login with your BCeID.'
},
# Used for mapping back to legacy oracle codes, description not required
'FIRM': {
'DEFAULT': 'FIRM (Legacy Oracle)'
}
}
old_next_action_text = {
# BC Types
'CR': {
'DEFAULT': f'Use this name request to complete your application by visiting <a href="{url}">'
Expand Down Expand Up @@ -602,17 +496,17 @@ def _get_next_action_text(entity_type_cd: str, url: str, instruction_group: str)
'reh': { # Restoration or Reinstatement
'DEFAULT': f'To complete your application using this business name, choose the appropriate <a href="{STEPS_TO_RESTORE_URL}">'
f'information package</a> and submit the required forms to BC Registries.'
},
'magic-link': {
'DEFAULT': 'Check your email for instructions on how to complete your application using this name request.'
}
}

text = next_action_text_by_group.get(instruction_group, None)
if text:
return text

email_feature_flags = ReportResource._get_email_feature_flags()
if email_feature_flags.get('enable_won_emails'):
return next_action_text.get(entity_type_cd, None)
return old_next_action_text.get(entity_type_cd, None)
return next_action_text.get(entity_type_cd, None)

@staticmethod
def _get_email_feature_flags():
Expand Down
4 changes: 2 additions & 2 deletions services/emailer/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading