Skip to content

Commit

Permalink
Merge branch 'main' into NDT-529-Format-of-Federal-Funding-requested-…
Browse files Browse the repository at this point in the history
…needs-refinement
  • Loading branch information
RRanath committed Sep 26, 2024
2 parents 4954893 + fac75b3 commit dd6414b
Show file tree
Hide file tree
Showing 10 changed files with 369 additions and 162 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ jobs:
yarn
git checkout "${GITHUB_HEAD_REF}"
yarn run release-it --ci --branch="${GITHUB_HEAD_REF}" --git.commitArgs=-n
- name: Enable Auto-Merge
if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft
run: |
PR_URL="${{ github.event.pull_request.html_url }}"
gh pr merge --auto --merge "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Uncheck the checkbox
if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft
uses: actions/github-script@v7
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [1.193.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.1...v1.193.2) (2024-09-26)

## [1.193.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.0...v1.193.1) (2024-09-18)

### Bug Fixes
Expand Down
36 changes: 35 additions & 1 deletion app/backend/lib/sow_import/tab_7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const readBudget = async (sow_id, wb, sheet_name) => {
fundingFromAllOtherSources: '',
amountRequestedFromProvince: '',
totalInfrastructureBankFunding: '',
totalFNHAFunding: '',
totalFundingRequestedCCBC: '',
},
detailedBudget: {
Expand Down Expand Up @@ -126,6 +127,13 @@ const readBudget = async (sow_id, wb, sheet_name) => {
2627: '',
total: '',
},
fnhaFunding: {
2324: '',
2425: '',
2526: '',
2627: '',
total: '',
},
otherFundingPartners: [],
totalFinancialContribution: {
2324: '',
Expand Down Expand Up @@ -472,6 +480,7 @@ const readBudget = async (sow_id, wb, sheet_name) => {
budget[row]['K'];
row++;
// next 7 are possible other
let fnhaFundingRow = {};
for (let otherRow = row; otherRow < row + 7; otherRow++) {
const otherSuspect = budget[otherRow]['B'];
let otherValue;
Expand All @@ -483,8 +492,14 @@ const readBudget = async (sow_id, wb, sheet_name) => {
}
// if we don't have the predefined phrase, we have a custom other
if (
otherValue.indexOf('Identify other source of funding by name') === -1
otherValue.indexOf('Identify other source of funding by name') > -1
) {
continue;
} else if (
otherValue.indexOf('First Nations Health Authority (FNHA)') > -1
) {
fnhaFundingRow = budget[otherRow];
} else {
detailedBudget.summaryOfEstimatedProjectFunding.otherFundingPartners.push(
{
fundingPartnersName: budget[otherRow]['B'],
Expand All @@ -497,6 +512,19 @@ const readBudget = async (sow_id, wb, sheet_name) => {
);
}
}

// FNHA Funding
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2324] =
fnhaFundingRow['G'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2425] =
fnhaFundingRow['H'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2526] =
fnhaFundingRow['I'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2627] =
fnhaFundingRow['J'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding.total =
fnhaFundingRow['K'] ?? 0;
detailedBudget.summaryTable.totalFNHAFunding = fnhaFundingRow['K'] ?? 0;
}
// get totals
if (value.indexOf('Total Financial Contributions') > -1) {
Expand Down Expand Up @@ -632,6 +660,12 @@ const ValidateData = (data) => {
error: 'Invalid data: Amount CIB will contribute',
});
}
if (typeof data.totalFNHAFunding !== 'number') {
errors.push({
level: 'cell',
error: 'Invalid data: First Nations Health Authority (FNHA)',
});
}
if (typeof data.fundingFromAllOtherSources !== 'number') {
errors.push({
level: 'cell',
Expand Down
5 changes: 4 additions & 1 deletion app/lib/helpers/ccbcSummaryGenerateFormData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ const getSowData = (sowData, baseSowData) => {
cibFunding:
sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable
?.totalInfrastructureBankFunding,
fhnaFunding: null,
fhnaFunding:
sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable
?.totalFNHAFunding,
otherFunding:
sowData?.nodes[0]?.sowTab7SBySowId?.nodes[0]?.jsonData?.summaryTable
?.fundingFromAllOtherSources,
Expand Down Expand Up @@ -203,6 +205,7 @@ const getSowData = (sowData, baseSowData) => {
fundingRequestedCcbc: 'SOW',
applicantAmount: 'SOW',
cibFunding: 'SOW',
fhnaFunding: 'SOW',
otherFunding: 'SOW',
totalProjectBudget: 'SOW',
effectiveStartDate: 'SOW',
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"archiver": "^7.0.1",
"body-parser": "1.20.3",
"cheerio": "^1.0.0-rc.12",
"connect-pg-simple": "^7.0.0",
"connect-pg-simple": "^10.0.0",
"convict": "^6.2.4",
"cookie-parser": "^1.4.6",
"dayjs": "^1.11.11",
Expand All @@ -88,7 +88,7 @@
"luxon": "^3.4.3",
"material-react-table": "2.13",
"morgan": "^1.10.0",
"next": "^14.1.1",
"next": "^14.2.10",
"openid-client": "^5.6.5",
"passport": "^0.7.0",
"patch-package": "^8.0.0",
Expand Down
Loading

0 comments on commit dd6414b

Please sign in to comment.