Skip to content

Commit

Permalink
Merge pull request #402 from USEPA/feature/add-applicant-org-county-data
Browse files Browse the repository at this point in the history
Feature/add applicant org county data
  • Loading branch information
courtneymyers authored Mar 28, 2024
2 parents a8bc7f6 + f228b1f commit 112047f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/server/app/utilities/bap.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ const { submissionPeriodOpen } = require("../config/formio");
* CSB_Snapshot__r: {
* JSON_Snapshot__c: string
* }
* Applicant_Organization__r: {
* Id: string
* County__c: string
* }
* Primary_Applicant__r: {
* Id: string
* FirstName: string
Expand Down Expand Up @@ -837,6 +841,8 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
// `SELECT
// Id,
// CSB_Snapshot__r.JSON_Snapshot__c
// Applicant_Organization__r.Id
// Applicant_Organization__r.County__c
// Primary_Applicant__r.Id,
// Primary_Applicant__r.FirstName,
// Primary_Applicant__r.LastName,
Expand Down Expand Up @@ -886,6 +892,8 @@ async function queryBapFor2023PRFData(req, frfReviewItemId) {
// "*": 1,
Id: 1, // Salesforce record ID
"CSB_Snapshot__r.JSON_Snapshot__c": 1,
"Applicant_Organization__r.Id": 1,
"Applicant_Organization__r.County__c": 1,
"Primary_Applicant__r.Id": 1,
"Primary_Applicant__r.FirstName": 1,
"Primary_Applicant__r.LastName": 1,
Expand Down
3 changes: 2 additions & 1 deletion app/server/app/utilities/formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {

const {
CSB_Snapshot__r,
Applicant_Organization__r,
Primary_Applicant__r,
Alternate_Applicant__r,
CSB_School_District__r,
Expand Down Expand Up @@ -374,7 +375,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
_bap_applicant_organization_name: LEGAL_BUSINESS_NAME__c,
_bap_applicant_street_address_1: PHYSICAL_ADDRESS_LINE_1__c,
_bap_applicant_street_address_2: PHYSICAL_ADDRESS_LINE_2__c,
_bap_applicant_county: "", // TODO: ask BAP how to get this value
_bap_applicant_county: Applicant_Organization__r?.County__c,
_bap_applicant_city: PHYSICAL_ADDRESS_CITY__c,
_bap_applicant_state: PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c,
_bap_applicant_zip: PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c,
Expand Down

0 comments on commit 112047f

Please sign in to comment.