Skip to content

32886 - SAF - add ability to filter businesses based on director mail…#4254

Merged
Rajandeep98 merged 3 commits intobcgov:mainfrom
Rajandeep98:32886_Filter_Directors_On_Address
Apr 14, 2026
Merged

32886 - SAF - add ability to filter businesses based on director mail…#4254
Rajandeep98 merged 3 commits intobcgov:mainfrom
Rajandeep98:32886_Filter_Directors_On_Address

Conversation

@Rajandeep98
Copy link
Copy Markdown
Collaborator

@Rajandeep98 Rajandeep98 commented Apr 9, 2026

…ing address attributes

Issue #: /bcgov/entity#32886

Description of changes:
We want to add two boolean columns to the update the mv_legacy_corps_data materialized view in the COLIN extract.
directors_within_bc - returns true for a business where all directors have a mailing address where province = bc
directors_within_ca - returns true for a business where all directors have a mailing address where country = ca

Tasks

  • Add directors_within_bc column mv_legacy_corps_data
  • Add directors_within_ca column mv_legacy_corps_data

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).

cp.corp_num,
COUNT(*) AS dir_cnt,
COUNT(*) Filter (
WHERE cp.mailing_addr_id IS NOT NULL
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we should filter out stub addresses too. believe the stub address always has an address id = 1 in the COLIN extract.

i.e. add AND cp.mailing_addr_id <> 1 to where clause

AND UPPER(TRIM(ma.province)) = 'BC'
) AS dir_bc_mailing_cnt,
COUNT(*) Filter (
WHERE cp.mailing_addr_id IS NOT NULL
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as comment above.

Add AND cp.mailing_addr_id <> 1 to where clause to exclude stub addresses

Copy link
Copy Markdown
Collaborator

@argush3 argush3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-approving with assumption stub address comment is addressed

@sonarqubecloud
Copy link
Copy Markdown

@Rajandeep98 Rajandeep98 merged commit 0336589 into bcgov:main Apr 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants