diff --git a/bciers/apps/reporting/src/app/components/finalReview/FinalReviewForm.tsx b/bciers/apps/reporting/src/app/components/finalReview/FinalReviewForm.tsx index 73284d24af..81f3f74a70 100644 --- a/bciers/apps/reporting/src/app/components/finalReview/FinalReviewForm.tsx +++ b/bciers/apps/reporting/src/app/components/finalReview/FinalReviewForm.tsx @@ -14,6 +14,7 @@ import { withTheme } from "@rjsf/core"; import { customizeValidator } from "@rjsf/validator-ajv8"; import finalReviewTheme from "./formCustomization/finalReviewTheme"; import { additionalReportingDataUiSchema } from "@reporting/src/data/jsonSchema/additionalReportingData/additionalReportingData"; +import { complianceSummaryUiSchema } from "@reporting/src/data/jsonSchema/complianceSummary"; interface Props extends HasReportVersion { taskListElements: TaskListElement[]; @@ -27,6 +28,7 @@ const finalReviewSchemaMap: { [key: string]: any } = { productionData: productionDataUiSchema, emissionAllocation: emissionAllocationUiSchema, additionalReportingData: additionalReportingDataUiSchema, + complianceSummary: complianceSummaryUiSchema, }; const resolveUiSchema = (uiSchema: any) => { diff --git a/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/additionalReportingData.ts b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/additionalReportingDataFactoryItem.ts similarity index 100% rename from bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/additionalReportingData.ts rename to bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/additionalReportingDataFactoryItem.ts diff --git a/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/allocationOfEmissions.ts b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/allocationOfEmissionsFactoryItem.ts similarity index 100% rename from bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/allocationOfEmissions.ts rename to bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/allocationOfEmissionsFactoryItem.ts diff --git a/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/complianceSummaryFactoryItem.ts b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/complianceSummaryFactoryItem.ts new file mode 100644 index 0000000000..52b4f9d96f --- /dev/null +++ b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/complianceSummaryFactoryItem.ts @@ -0,0 +1,19 @@ +import { complianceSummarySchema } from "@reporting/src/data/jsonSchema/complianceSummary"; +import { ReviewDataFactoryItem } from "./factory"; +import { getComplianceData } from "@reporting/src/app/utils/getComplianceData"; + +const complianceSummaryFactoryItem: ReviewDataFactoryItem = async ( + versionId, +) => { + const complianceData = await getComplianceData(versionId); + + return [ + { + schema: complianceSummarySchema, + data: complianceData, + uiSchema: "complianceSummary", + }, + ]; +}; + +export default complianceSummaryFactoryItem; diff --git a/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/factory.ts b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/factory.ts index d687ae779f..0ccd7965aa 100644 --- a/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/factory.ts +++ b/bciers/apps/reporting/src/app/components/finalReview/reviewDataFactory/factory.ts @@ -5,9 +5,10 @@ import operationReviewFactoryItem from "./operationReviewFactoryItem"; import personResponsibleFactoryItem from "./personResponsibleFactoryItem"; import emissionsSummaryFactoryItem from "./emissionsSummaryFactoryItem"; import productionDataFactoryItem from "./productionDataFactoryItem"; -import allocationOfEmissionsFactoryItem from "./allocationOfEmissions"; +import allocationOfEmissionsFactoryItem from "./allocationOfEmissionsFactoryItem"; import { RJSFSchema } from "@rjsf/utils"; -import additionalReportingDataFactoryItem from "./additionalReportingData"; +import additionalReportingDataFactoryItem from "./additionalReportingDataFactoryItem"; +import complianceSummaryFactoryItem from "./complianceSummaryFactoryItem"; export type ReviewData = { schema: RJSFSchema; @@ -34,5 +35,6 @@ export default async function reviewDataFactory( ...(await productionDataFactoryItem(versionId, facilityId)), ...(await allocationOfEmissionsFactoryItem(versionId, facilityId)), ...(await additionalReportingDataFactoryItem(versionId, facilityId)), + ...(await complianceSummaryFactoryItem(versionId, facilityId)), ]; }