Skip to content

Commit

Permalink
Merge pull request #3486 from bcgov/NDT-477-Federal-Funding-Source-in…
Browse files Browse the repository at this point in the history
…-CBC-highlighted-yellow-erroneously

fix: federal funding source validation for cbc
  • Loading branch information
RRanath authored Aug 15, 2024
2 parents 99ff13a + 4e5bbba commit fcfd7bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
6 changes: 1 addition & 5 deletions app/formSchema/analyst/cbc/tombstone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ const cbcTombstone: RJSFSchema = {
title: 'Tombstone',
description: '',
type: 'object',
required: [
'applicantContractualName',
'currentOperatingName',
'federalFundingSource',
],
required: ['applicantContractualName', 'currentOperatingName'],
properties: {
originalProjectNumber: {
type: 'string',
Expand Down
23 changes: 12 additions & 11 deletions app/utils/cbcCustomValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ const CBC_VALIDATIONS = {
],
color: CBC_WARN_COLOR,
},
federalFundingSource: {
rules: [
{
condition: (data) =>
(data.funding?.federalFundingRequested > 0 ||
data.tombstone?.federalProjectNumber) &&
!data.tombstone?.federalFundingSource,
error: 'Missing Federal funding source',
},
],
color: CBC_WARN_COLOR,
},
federalProjectNumber: {
rules: [
{
Expand Down Expand Up @@ -155,17 +167,6 @@ const CBC_VALIDATIONS = {
],
color: CBC_WARN_COLOR,
},
federalFundingRequested: {
rules: [
{
condition: (data) =>
data.funding?.federalFundingRequested &&
!data.tombstone?.federalFundingSource,
error: 'Missing Federal funding source',
},
],
color: CBC_WARN_COLOR,
},
},
locationsAndCounts: {
indigenousCommunities: {
Expand Down

0 comments on commit fcfd7bc

Please sign in to comment.