Skip to content

Commit

Permalink
Merge pull request #378 from USEPA/feature/update-bap-query-fields
Browse files Browse the repository at this point in the history
Update fields used in BAP queries for 2023 PRF data
  • Loading branch information
courtneymyers authored Jan 29, 2024
2 parents fa4b369 + f0ddba6 commit 60e158b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 9 additions & 6 deletions app/server/app/utilities/bap.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const { submissionPeriodOpen } = require("../config/formio");
* } | null
* CSB_NCES_ID__c: string
* School_District_Prioritized__c: string
* School_District_Poverty_Rate__c: string
* Self_Certification_Category__c: string
* Prioritized_as_High_Need__c: string
* Prioritized_as_Tribal__c: string
* Prioritized_as_Rural__c: string
Expand All @@ -146,6 +146,7 @@ const { submissionPeriodOpen } = require("../config/formio");
* CSB_Fuel_Type__c: string
* CSB_GVWR__c: string
* Old_Bus_Odometer_miles__c: string
* Old_Bus_NCES_District_ID__c: string
* CSB_Model__c: string
* CSB_Model_Year__c: string
* CSB_Manufacturer__c: string
Expand All @@ -154,7 +155,7 @@ const { submissionPeriodOpen } = require("../config/formio");
* Annual_Mileage__c: string
* Old_Bus_Estimated_Remaining_Life__c: string
* Old_Bus_Annual_Idling_Hours__c: string
* CSB_Funds_Requested__c: string
* New_Bus_Infra_Rebate_Requested__c: string
* New_Bus_Fuel_Type__c: string
* New_Bus_GVWR__c: string
* New_Bus_ADA_Compliant__c: string
Expand Down Expand Up @@ -811,7 +812,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
// School_District_Contact__r.Phone,
// CSB_NCES_ID__c,
// School_District_Prioritized__c,
// School_District_Poverty_Rate__c,
// Self_Certification_Category__c,
// Prioritized_as_High_Need__c,
// Prioritized_as_Tribal__c,
// Prioritized_as_Rural__c
Expand Down Expand Up @@ -855,7 +856,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
"School_District_Contact__r.Phone": 1,
CSB_NCES_ID__c: 1,
School_District_Prioritized__c: 1,
School_District_Poverty_Rate__c: 1,
Self_Certification_Category__c: 1,
Prioritized_as_High_Need__c: 1,
Prioritized_as_Tribal__c: 1,
Prioritized_as_Rural__c: 1,
Expand Down Expand Up @@ -898,6 +899,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
// CSB_Fuel_Type__c,
// CSB_GVWR__c,
// Old_Bus_Odometer_miles__c,
// Old_Bus_NCES_District_ID__c,
// CSB_Model__c,
// CSB_Model_Year__c,
// CSB_Manufacturer__c,
Expand All @@ -906,7 +908,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
// Annual_Mileage__c,
// Old_Bus_Estimated_Remaining_Life__c,
// Old_Bus_Annual_Idling_Hours__c,
// CSB_Funds_Requested__c,
// New_Bus_Infra_Rebate_Requested__c,
// New_Bus_Fuel_Type__c,
// New_Bus_GVWR__c,
// New_Bus_ADA_Compliant__c
Expand All @@ -933,6 +935,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
CSB_Fuel_Type__c: 1,
CSB_GVWR__c: 1,
Old_Bus_Odometer_miles__c: 1,
Old_Bus_NCES_District_ID__c: 1,
CSB_Model__c: 1,
CSB_Model_Year__c: 1,
CSB_Manufacturer__c: 1,
Expand All @@ -941,7 +944,7 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
Annual_Mileage__c: 1,
Old_Bus_Estimated_Remaining_Life__c: 1,
Old_Bus_Annual_Idling_Hours__c: 1,
CSB_Funds_Requested__c: 1,
New_Bus_Infra_Rebate_Requested__c: 1,
New_Bus_Fuel_Type__c: 1,
New_Bus_GVWR__c: 1,
New_Bus_ADA_Compliant__c: 1,
Expand Down
10 changes: 6 additions & 4 deletions app/server/app/utilities/formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
School_District_Contact__r,
CSB_NCES_ID__c,
School_District_Prioritized__c,
School_District_Poverty_Rate__c,
Self_Certification_Category__c,
Prioritized_as_High_Need__c,
Prioritized_as_Tribal__c,
Prioritized_as_Rural__c,
Expand Down Expand Up @@ -227,6 +227,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
CSB_Fuel_Type__c,
CSB_GVWR__c,
Old_Bus_Odometer_miles__c,
Old_Bus_NCES_District_ID__c,
CSB_Model__c,
CSB_Model_Year__c,
CSB_Manufacturer__c,
Expand All @@ -235,7 +236,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
Annual_Mileage__c,
Old_Bus_Estimated_Remaining_Life__c,
Old_Bus_Annual_Idling_Hours__c,
CSB_Funds_Requested__c,
New_Bus_Infra_Rebate_Requested__c,
New_Bus_Fuel_Type__c,
New_Bus_GVWR__c,
New_Bus_ADA_Compliant__c,
Expand Down Expand Up @@ -273,6 +274,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
bus_existingOdometer: Old_Bus_Odometer_miles__c,
bus_existingModel: CSB_Model__c,
bus_existingModelYear: CSB_Model_Year__c,
bus_existingNcesId: Old_Bus_NCES_District_ID__c,
bus_existingManufacturer: CSB_Manufacturer__c,
bus_existingManufacturerOther: CSB_Manufacturer_if_Other__c,
bus_existingAnnualFuelConsumption: CSB_Annual_Fuel_Consumption__c,
Expand All @@ -285,7 +287,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
orgContactFName: newOwnerRecord?.Contact__r?.FirstName,
orgContactLName: newOwnerRecord?.Contact__r?.LastName,
},
bus_rebate: CSB_Funds_Requested__c,
bus_rebate: New_Bus_Infra_Rebate_Requested__c,
bus_newFuelType: New_Bus_Fuel_Type__c,
bus_newGvwr: New_Bus_GVWR__c,
_bus_newADAfromFRF: New_Bus_ADA_Compliant__c,
Expand Down Expand Up @@ -334,7 +336,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
_bap_district_state: CSB_School_District__r?.BillingState,
_bap_district_zip: CSB_School_District__r?.BillingPostalCode,
_bap_district_priority: School_District_Prioritized__c,
_bap_district_selfCertify: School_District_Poverty_Rate__c,
_bap_district_selfCertify: Self_Certification_Category__c,
_bap_district_priorityReason: {
highNeed: Prioritized_as_High_Need__c,
tribal: Prioritized_as_Tribal__c,
Expand Down

0 comments on commit 60e158b

Please sign in to comment.