From 1bb956933f0b90ee0afe762ed9fe6388bd7da9e3 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Fri, 4 Nov 2022 11:02:43 -0400 Subject: [PATCH 1/3] Update data injected into payment request form submissions to include all four sam.gov contact email addresses for the sam.gov entity --- app/client/src/routes/allRebates.tsx | 1 + app/client/src/routes/paymentRequestForm.tsx | 11 +++++++++++ app/server/app/routes/api.js | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/app/client/src/routes/allRebates.tsx b/app/client/src/routes/allRebates.tsx index 011bc84c..c0978325 100644 --- a/app/client/src/routes/allRebates.tsx +++ b/app/client/src/routes/allRebates.tsx @@ -679,6 +679,7 @@ function PaymentRequestSubmission({ rebate }: { rebate: Rebate }) { email, title, name, + entity, comboKey: application.bap.comboKey, rebateId: application.bap.rebateId, // CSB Rebate ID (6 digits) reviewItemId: application.bap.reviewItemId, // CSB Rebate ID w/ form/version ID (9 digits) diff --git a/app/client/src/routes/paymentRequestForm.tsx b/app/client/src/routes/paymentRequestForm.tsx index 4a4ce734..f462894f 100644 --- a/app/client/src/routes/paymentRequestForm.tsx +++ b/app/client/src/routes/paymentRequestForm.tsx @@ -163,6 +163,13 @@ function PaymentRequestFormContent({ email }: { email: string }) { // TODO: do we need to account for when ENTITY_STATUS__c does not equal "Active" (e.g. its expired)? if (!entity) return null; + const { + ELEC_BUS_POC_EMAIL__c, + ALT_ELEC_BUS_POC_EMAIL__c, + GOVT_BUS_POC_EMAIL__c, + ALT_GOVT_BUS_POC_EMAIL__c, + } = entity; + const { title, name } = getUserInfo(email, entity); return ( @@ -206,6 +213,10 @@ function PaymentRequestFormContent({ email }: { email: string }) { hidden_current_user_email: email, hidden_current_user_title: title, hidden_current_user_name: name, + hidden_sam_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c, + hidden_sam_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c, + hidden_sam_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c, + hidden_sam_alt_govt_bus_poc_email: ALT_GOVT_BUS_POC_EMAIL__c, ...pendingSubmissionData, }, }} diff --git a/app/server/app/routes/api.js b/app/server/app/routes/api.js index 02eae509..329543e7 100644 --- a/app/server/app/routes/api.js +++ b/app/server/app/routes/api.js @@ -433,6 +433,7 @@ router.post( email, title, name, + entity, comboKey, rebateId, reviewItemId, @@ -446,6 +447,13 @@ router.post( return res.status(401).json({ message: "Unauthorized" }); } + const { + ELEC_BUS_POC_EMAIL__c, + ALT_ELEC_BUS_POC_EMAIL__c, + GOVT_BUS_POC_EMAIL__c, + ALT_GOVT_BUS_POC_EMAIL__c, + } = entity; + return getApplicationSubmission(req, reviewItemId) .then(({ formsTableRecordQuery, busTableRecordsQuery }) => { const { @@ -479,6 +487,10 @@ router.post( hidden_current_user_email: email, hidden_current_user_title: title, hidden_current_user_name: name, + hidden_sam_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c, + hidden_sam_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c, + hidden_sam_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c, + hidden_sam_alt_govt_bus_poc_email: ALT_GOVT_BUS_POC_EMAIL__c, hidden_bap_rebate_id: rebateId, hidden_bap_district_id: CSB_NCES_ID__c, hidden_bap_primary_name: Primary_Applicant__r?.Name, From 0266c9b9044e18f5ac1e8438b4e1fd97da414413 Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Fri, 4 Nov 2022 11:03:49 -0400 Subject: [PATCH 2/3] Add payment request form schema server status endpoint --- app/server/app/routes/status.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/server/app/routes/status.js b/app/server/app/routes/status.js index 0e681dae..578b603d 100644 --- a/app/server/app/routes/status.js +++ b/app/server/app/routes/status.js @@ -4,6 +4,7 @@ const { axiosFormio, formioProjectUrl, formioApplicationFormPath, + formioPaymentRequestFormPath, } = require("../config/formio"); const { getSamEntities } = require("../utilities/bap"); @@ -28,6 +29,7 @@ router.get("/bap-sam-data", (req, res) => { }); const applicationFormApiPath = `${formioProjectUrl}/${formioApplicationFormPath}`; +const paymentRequestFormApiPath = `${formioProjectUrl}/${formioPaymentRequestFormPath}`; router.get("/formio-application-schema", (req, res) => { axiosFormio(req) @@ -42,4 +44,17 @@ router.get("/formio-application-schema", (req, res) => { }); }); +router.get("/formio-payment-request-schema", (req, res) => { + axiosFormio(req) + .get(paymentRequestFormApiPath) + .then((axiosRes) => axiosRes.data) + .then((schema) => { + // Verify that schema has type of form and a title exists (confirming formio returned a valid schema) + return res.json({ status: schema.type === "form" && !!schema.title }); + }) + .catch(() => { + return res.json({ status: false }); + }); +}); + module.exports = router; From 146d86a07b0a6a2e06d026b4fb902101afabe68d Mon Sep 17 00:00:00 2001 From: Courtney Myers Date: Fri, 4 Nov 2022 12:41:00 -0400 Subject: [PATCH 3/3] Inject SAM.gov UEI and EFTI fields into payment request form submissions --- app/client/src/routes/paymentRequestForm.tsx | 4 ++++ app/server/app/routes/api.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/client/src/routes/paymentRequestForm.tsx b/app/client/src/routes/paymentRequestForm.tsx index f462894f..8af46d15 100644 --- a/app/client/src/routes/paymentRequestForm.tsx +++ b/app/client/src/routes/paymentRequestForm.tsx @@ -164,6 +164,8 @@ function PaymentRequestFormContent({ email }: { email: string }) { if (!entity) return null; const { + UNIQUE_ENTITY_ID__c, + ENTITY_EFT_INDICATOR__c, ELEC_BUS_POC_EMAIL__c, ALT_ELEC_BUS_POC_EMAIL__c, GOVT_BUS_POC_EMAIL__c, @@ -213,6 +215,8 @@ function PaymentRequestFormContent({ email }: { email: string }) { hidden_current_user_email: email, hidden_current_user_title: title, hidden_current_user_name: name, + hidden_sam_uei: UNIQUE_ENTITY_ID__c, + hidden_sam_efti: ENTITY_EFT_INDICATOR__c || "0000", hidden_sam_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c, hidden_sam_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c, hidden_sam_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c, diff --git a/app/server/app/routes/api.js b/app/server/app/routes/api.js index 329543e7..e00156ac 100644 --- a/app/server/app/routes/api.js +++ b/app/server/app/routes/api.js @@ -448,6 +448,8 @@ router.post( } const { + UNIQUE_ENTITY_ID__c, + ENTITY_EFT_INDICATOR__c, ELEC_BUS_POC_EMAIL__c, ALT_ELEC_BUS_POC_EMAIL__c, GOVT_BUS_POC_EMAIL__c, @@ -487,6 +489,8 @@ router.post( hidden_current_user_email: email, hidden_current_user_title: title, hidden_current_user_name: name, + hidden_sam_uei: UNIQUE_ENTITY_ID__c, + hidden_sam_efti: ENTITY_EFT_INDICATOR__c || "0000", hidden_sam_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c, hidden_sam_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c, hidden_sam_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c,