Skip to content

Commit

Permalink
Merge pull request #3489 from bcgov/NDT-480-Household-count-validatio…
Browse files Browse the repository at this point in the history
…ns-should-be-based-on-on-Project-Type

fix: cbc household count validation
  • Loading branch information
rafasdc authored Aug 28, 2024
2 parents 9083c27 + 58e9d74 commit be49d13
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.186.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.186.1...v1.186.2) (2024-08-28)

### Bug Fixes

- cbc household count validation ([9c203db](https://github.com/bcgov/CONN-CCBC-portal/commit/9c203db6d2a4e6f2a40d3d785137f2c62a0abc98))

## [1.186.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.186.0...v1.186.1) (2024-08-27)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion app/formSchema/analyst/cbc/locationsAndCounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const locationsAndCounts: RJSFSchema = {
required: [
'projectLocations',
'communitiesAndLocalesCount',
'householdCount',
'indigenousCommunities',
],
properties: {
communitiesAndLocalesCount: {
Expand Down
12 changes: 12 additions & 0 deletions app/utils/cbcCustomValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ const CBC_VALIDATIONS = {
],
color: CBC_WARN_COLOR,
},
householdCount: {
rules: [
{
condition: (data) =>
(data?.projectType?.projectType === 'Last-Mile' ||
data?.projectType?.projectType === 'Last-Mile & Cellular' ||
data?.projectType?.projectType === 'Last-Mile & Transport') &&
!data?.locationsAndCounts?.householdCount,
error: `You have chosen a Last-Mile project type, please enter in the number of households`,
},
],
},
},
projectType: {
lastMileProjectType: {
Expand Down
1 change: 1 addition & 0 deletions db/sqitch.plan
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,4 @@ tables/cbc_add_fk_update_constraint 2024-07-11T20:32:11Z Rafael Solorzano <61289
mutations/edit_cbc_project_communities 2024-08-21T15:16:56Z Anthony Bushara <anthony@button.is> # Add and delete project communities to a cbc project
@1.186.0 2024-08-27T20:55:46Z CCBC Service Account <ccbc@button.is> # release v1.186.0
@1.186.1 2024-08-27T22:52:17Z CCBC Service Account <ccbc@button.is> # release v1.186.1
@1.186.2 2024-08-28T15:58:56Z CCBC Service Account <ccbc@button.is> # release v1.186.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CONN-CCBC-portal",
"version": "1.186.1",
"version": "1.186.2",
"main": "index.js",
"repository": "https://github.com/bcgov/CONN-CCBC-portal.git",
"author": "Romer, Meherzad CITZ:EX <Meherzad.Romer@gov.bc.ca>",
Expand Down

0 comments on commit be49d13

Please sign in to comment.