Skip to content

Commit

Permalink
Merge pull request #474 from USEPA/develop
Browse files Browse the repository at this point in the history
Sync staging with develop
  • Loading branch information
courtneymyers authored Aug 29, 2024
2 parents 7906ab8 + 43ede32 commit ba07808
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
21 changes: 17 additions & 4 deletions app/client/src/routes/helpdesk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
useContentData,
useHelpdeskAccess,
submissionNeedsEdits,
submissionNeedsReimbursement,
} from "@/utilities";
import { Loading, LoadingButtonIcon } from "@/components/loading";
import { Message } from "@/components/message";
Expand Down Expand Up @@ -183,12 +184,24 @@ function ResultTableRow(props: {

const bapInternalStatus = bap.status || "";
const formioStatus = formioStatusMap.get(formio.state);
const bapReimbursementNeeded = bap.reimbursementNeeded || false;

const status = submissionNeedsEdits({ formio, bap })
const needsEdits = submissionNeedsEdits({ formio, bap });

const crfNeedsReimbursement =
formType === "crf" &&
submissionNeedsReimbursement({
status: bapInternalStatus,
reimbursementNeeded: bapReimbursementNeeded,
});

const status = needsEdits
? "Edits Requested"
: bapStatusMap[rebateYear][formType].get(bapInternalStatus) ||
formioStatus ||
"";
: crfNeedsReimbursement
? "Reimbursement Needed"
: bapStatusMap[rebateYear][formType].get(bapInternalStatus) ||
formioStatus ||
"";

const nameField = formioNameField[rebateYear][formType];
const emailField = formioEmailField[rebateYear][formType];
Expand Down
14 changes: 11 additions & 3 deletions app/server/app/routes/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ router.get("/formio/submission/:rebateYear/:formType/:id", (req, res) => {
Parent_CSB_Rebate__r,
} = bapSubmission ?? {};

const {
CSB_Funding_Request_Status__c,
CSB_Payment_Request_Status__c,
CSB_Closeout_Request_Status__c,
Reimbursement_Needed__c,
} = Parent_CSB_Rebate__r ?? {};

/**
* NOTE: For submissions not in the BAP, each property of the bap object
* parameter will be null.
Expand All @@ -148,12 +155,13 @@ router.get("/formio/submission/:rebateYear/:formType/:id", (req, res) => {
reviewItemId: CSB_Review_Item_ID__c || null, // CSB Rebate ID with form/version ID (9 digits)
status:
(Record_Type_Name__c?.startsWith("CSB Funding Request")
? Parent_CSB_Rebate__r?.CSB_Funding_Request_Status__c
? CSB_Funding_Request_Status__c
: Record_Type_Name__c?.startsWith("CSB Payment Request")
? Parent_CSB_Rebate__r?.CSB_Payment_Request_Status__c
? CSB_Payment_Request_Status__c
: Record_Type_Name__c?.startsWith("CSB Close Out Request")
? Parent_CSB_Rebate__r?.CSB_Closeout_Request_Status__c
? CSB_Closeout_Request_Status__c
: "") || null,
reimbursementNeeded: Reimbursement_Needed__c || null,
},
req,
res,
Expand Down
5 changes: 4 additions & 1 deletion app/server/app/utilities/bap.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const { submissionPeriodOpen } = require("../config/formio");
* | 'CSB Funding Request 2023'
* | 'CSB Payment Request 2023'
* | 'CSB Close Out Request 2023'
* | 'CSB Funding Request 2024'
* | 'CSB Payment Request 2024'
* | 'CSB Close Out Request 2024'
* } Record_Type_Name__c
* @property {string | null} Rebate_Program_Year__c
* @property {{
Expand Down Expand Up @@ -561,7 +564,7 @@ async function queryForBapFormSubmissionData(
CSB_Modified_Full_String__c: 1, // ISO 8601 date time string
CSB_Review_Item_ID__c: 1, // CSB Rebate ID with form/version ID (9 digits)
Parent_Rebate_ID__c: 1, // CSB Rebate ID (6 digits)
Record_Type_Name__c: 1, // 'CSB Funding Request' | 'CSB Payment Request' | 'CSB Close Out Request' | 'CSB Funding Request 2023' | 'CSB Payment Request 2023' | 'CSB Close Out Request 2023'
Record_Type_Name__c: 1, // 'CSB Funding Request' | 'CSB Payment Request' | 'CSB Close Out Request' | same three forms with rebate year (.e.g., 'CSB Funding Request 2023')
Rebate_Program_Year__c: 1, // '2022' | '2023' | '2024'
"Parent_CSB_Rebate__r.CSB_Funding_Request_Status__c": 1,
"Parent_CSB_Rebate__r.CSB_Payment_Request_Status__c": 1,
Expand Down

0 comments on commit ba07808

Please sign in to comment.