Skip to content

Commit

Permalink
23959 rollback (#3034)
Browse files Browse the repository at this point in the history
* 23348 - Add allowable actions for notice of withdrawal (#3014)

* Add notice of withdrawal for existing business

* 23349 - validation notice of withdrawal (#3020)

* implement validation logic for NoW
* update schema version number in requirements
* exclude the new business scenario

* 23539 add batch_processing to colin_event_ids table (#3021)

* 23539 add batch_processing to colin_event_ids table

* add relationship, tests

* fix downgrade issue

* remove re-define batch_processing_step enum

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

* Fix bug

* 23697 - fix stage1 to stage2 dissolution transition bug (#3028)

* add SFTP off feature flag, modify stage 2 furnishing entry check, update tests
* adjust mail status check when FF is on
* add feature flag "disable-dissolution-sftp-bclaws"
* refactor stage 1 furnishing entries check
* update tests

* 23522-23562 continuation in workflow change (#3026)

* 23572 update dissolution letters (#3023)

* 23572 update dissolution letters

* add the dots

* 23845 - Bumped version numbers up for release 23.2a (#3030)

* bump version

* update entity-bn version

* udpate version

* 23563 - update review endpoint (#3029)

* 23563 - update review endpoint

* 23563 - update api spec

* 23563 - update api spec filing description

* Undo colin_event_id model changes (#3032)

---------

Co-authored-by: Aimee <[email protected]>
Co-authored-by: EasonPan <[email protected]>
Co-authored-by: Kevin Zhang <[email protected]>
Co-authored-by: Vysakh Menon <[email protected]>
Co-authored-by: ketaki-deodhar <[email protected]>
Co-authored-by: leodube-aot <[email protected]>
  • Loading branch information
7 people authored Oct 22, 2024
1 parent 0a2c234 commit 614813e
Show file tree
Hide file tree
Showing 39 changed files with 1,211 additions and 690 deletions.
5 changes: 3 additions & 2 deletions docs/business.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4639,7 +4639,7 @@ components:
Continuation_in:
type: object
title: Continuation In Filing
description: Represents the filing for a foreign corporation applying to “continue in” to BC. To do so, authorization must have been received from the foreign jurisdiction. Authorization is typically in the form of a letter. The authorization must be sent to the registry as a precondition to this transaction.
description: Represents the filing for a foreign corporation applying to “continue in” to BC. To do so, user must first submit a Continuation Authorization and have it approved by BC Registries before filing a Continuation Application. Authorization is typically in the form of a letter. The authorization must be reviewed and approved prior to complete filing. Once the authorization is approved by registries staff, user can continue with submitting continuation In filing.
required:
- continuationIn
properties:
Expand All @@ -4649,8 +4649,10 @@ components:
- foreignJurisdiction
- authorization
- nameRequest
- contactPoint
- offices
- parties
- shareStructure
properties:
business:
$ref: '#/components/schemas/Business'
Expand Down Expand Up @@ -4687,7 +4689,6 @@ components:
type: object
required:
- files
- date
properties:
files:
type: array
Expand Down
6 changes: 4 additions & 2 deletions jobs/furnishings/flags.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"flagValues": {
"enable-involuntary-dissolution": true
"enable-involuntary-dissolution": true,
"disable-dissolution-sftp-bcmail": true,
"disable-dissolution-sftp-bclaws": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,28 @@
{% endif %}
<div class="container letter-container ml-3">
{% if 'NO_AR' in furnishing.furnishingName %}
<div class="mt-5"><span class="bold">No Annual Reports Filed Since {{ furnishing.lastARDate }} for {{ furnishing.businessIdentifier }}</span></div>
<div class="mt-4">To file an annual report online, log in to your Business Page at <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
{% if 'XPRO' in furnishing.furnishingName %}
<div class="mt-5"><span class="bold">No Annual Reports Filed Since {{ furnishing.lastARDate }} for {{ furnishing.businessIdentifier }}</span></div>
<div class="mt-4">To file an annual report online, log in to your Business Page at <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
{% else %}
<div class="mt-5"><span class="bold">No Annual Reports Filed Since {{ furnishing.lastARDate }} for {{ furnishing.businessIdentifier }}</span></div>
<div class="mt-4">To file an annual report, log in to your Business Page at <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
{% endif %}
{% else %}
<div class="mt-5"><span class="bold">No Post Restoration Transition Application Filed Since {{ furnishing.lastARDate }} for {{ furnishing.businessIdentifier }}</span></div>
<div class="mt-4">To file a Post Restoration Transition Application (PRTA) online, log in to your Business Page at &nbsp;&nbsp; <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/<wbr>{{ furnishing.businessIdentifier }}</a> to file any outstanding annual reports listed.</div>
{% endif %}
{% if 'NO_AR' in furnishing.furnishingName %}
{% if 'XPRO' in furnishing.furnishingName %}
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your extraprovincial company has for two years failed to file the annual reports required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file an annual report with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be cancelled, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your extraprovincial company has for two years failed to file the annual reports required under section 380 of the Act. An extraprovincial company must annually, within two months after each anniversary of the date of its registration, file an annual report with the registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company’s registration may be cancelled, unless cause is shown to the contrary; The Registrar satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
{% else %}
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your company has for two years failed to file the annual reports required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file an annual report with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be dissolved, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding annual reports, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company may be dissolved, unless cause is shown to the contrary; The Registrar is satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
{% endif %}
{% else %}
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your company has for two years failed to file the PRTA required under section 51 of the Act. A company must annually, within two months after each anniversary of the date on which the company was recognized, file a PRTA with the Registrar.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding PRTA, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company will be dissolved, unless cause is shown to the contrary; I am satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
<div class="mt-5">Under section 422 of the Business Corporation Act (the Act), this letter is to notify you that your company has for 12 months failed to file the PRTA required under section 371 of the Act. A pre-existing company must file within 12 months of restoration a post-restoration transition application.</div>
<div class="mt-5">If within one month after the date of this letter, the company fails to file the outstanding PRTA, a notice may be published on the BC Laws website <a href="https://www.bclaws.gov.bc.ca/" class="break-url">www.bclaws.ca</a>. This notice will state that, at any time after the expiration of one month after the date of publication of the notice, the company may be dissolved, unless cause is shown to the contrary; The Registrar is satisfied the failure has been or is being remedied; or a copy of the entered court order to the contrary has been filed.</div>
{% endif %}

{% if furnishing.foreignRegistrations %}
Expand All @@ -75,19 +80,17 @@

{% if 'NO_AR' in furnishing.furnishingName %}
{% if 'XPRO' in furnishing.furnishingName %}
<div class="mt-5">To request a delay of the cancellation, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is cancelled under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is cancelled continues and may be enforced as if the company had not been cancelled.</div>
<div class="mt-5">To request a delay of the cancellation, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the cancellation of the company.</div>
{% else %}
<div class="mt-5">To request a delay of the dissolution, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is dissolved under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is dissolved continues and may be enforced as if the company had not been dissolved.</div>
{% endif %}
<div class="mt-5">If you have filed the outstanding annual reports, no further action is required.</div>
<div class="mt-5">If you need help with setting up an account or managing a business, please visit our Resources and Help page at <a href="https://bcreg.ca/resources" class="break-url">bcreg.ca/resources</a></div>
<div class="mt-5">If you need help with setting up an account or managing a business, please visit our Resources and Help page at <a href="https://bcreg.ca/resources" class="break-url">bcreg.ca/resources</a>.</div>
{% else %}
<div class="mt-5">To request a delay of the dissolution, go to <a href="https://www.business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}" class="break-url">business.bcregistry.gov.bc.ca/{{ furnishing.businessIdentifier }}</a> and request for a Delay of Dissolution or Cancellation under the To Do section. This must be completed prior to the dissolution of the company.</div>
<div class="mt-5">If your company is dissolved under section 422(1)(a) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is dissolved continues and may be enforced as if the company had not been dissolved.</div>
<div class="mt-5">If your company is dissolved under section 422(1)(f) of the Act, section 347 of the Act states the liability of each director, officer, shareholder and liquidator of a company that is dissolved continues and may be enforced as if the company had not been dissolved.</div>
<div class="mt-5">If you have filed the outstanding PRTA, no further action is required.</div>
<div class="mt-5">If you need help with setting up an account or managing a business, please visit our Resources and Help page at <a href="https://bcreg.ca/resources" class="break-url">bcreg.ca/resources</a></div>
<div class="mt-5">If you need help with setting up an account or managing a business, please visit our Resources and Help page at <a href="https://bcreg.ca/resources" class="break-url">bcreg.ca/resources</a>.</div>
{% endif %}

<p class="mt-5"><i><span class="bold">Issued</span> on my behalf on {{ furnishing.processedDate }}</i></p>
Expand Down
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,
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
6 changes: 4 additions & 2 deletions jobs/involuntary-dissolutions/flags.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"flagValues": {
"enable-involuntary-dissolution": true
"enable-involuntary-dissolution": true,
"disable-dissolution-sftp-bcmail": false,
"disable-dissolution-sftp-bclaws": false
}
}
}
36 changes: 30 additions & 6 deletions jobs/involuntary-dissolutions/involuntary_dissolutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,33 @@ def stage_1_process(app: Flask): # pylint: disable=redefined-outer-name,too-man
app.logger.error(err)


def _check_stage_1_furnishing_entries(furnishings):
"""Check furnishing entries - 2 scenarios.
1. if email processed, and mail processed or queued(FF) (after 5 business days still not in GS).
2. only available to send mail out, and it's processed.
"""
email_processed = any(
furnishing.furnishing_type == Furnishing.FurnishingType.EMAIL
and furnishing.status == Furnishing.FurnishingStatus.PROCESSED
for furnishing in furnishings
)

expected_mail_status = [Furnishing.FurnishingStatus.PROCESSED]
# if SFTP function is off, we expect the mail status will be QUEUED or PROCESSED
if flags.is_on('disable-dissolution-sftp-bcmail'):
expected_mail_status.append(Furnishing.FurnishingStatus.QUEUED)

mail_processed = any(
(furnishing.furnishing_type == Furnishing.FurnishingType.MAIL)
and (furnishing.status in expected_mail_status)
for furnishing in furnishings
)
email_exists = any(furnishing.furnishing_type == Furnishing.FurnishingType.EMAIL for furnishing in furnishings)
return (email_exists and email_processed and mail_processed) \
or (not email_exists and mail_processed)


def stage_2_process(app: Flask):
"""Update batch processing data for previously created in_progress batches."""
batch_processings = (
Expand All @@ -239,16 +266,13 @@ def stage_2_process(app: Flask):
stage_2_delay = timedelta(days=app.config.get('STAGE_2_DELAY'))

for batch_processing in batch_processings:
# Check if email or letter furnishing entry has been completed. If not, do not transition to stage 2.
furnishings = Furnishing.find_by(
batch_id=batch_processing.batch_id,
business_id=batch_processing.business_id
)
furnishing_entry_completed = any(
furnishing.furnishing_type in (Furnishing.FurnishingType.EMAIL, Furnishing.FurnishingType.MAIL)
and furnishing.status == Furnishing.FurnishingStatus.PROCESSED
for furnishing in furnishings
)

furnishing_entry_completed = _check_stage_1_furnishing_entries(furnishings)

if not furnishing_entry_completed:
batch_processing.status = BatchProcessing.BatchProcessingStatus.ERROR
batch_processing.notes = 'stage 1 email or letter has not been sent'
Expand Down
Loading

0 comments on commit 614813e

Please sign in to comment.