From 688736bcf84dc9f4c0a3ee444cee83c870b73b21 Mon Sep 17 00:00:00 2001 From: Eric Darchis Date: Thu, 31 Aug 2023 18:33:10 +0200 Subject: [PATCH 1/2] OMT-333 Primary indicators --- src/index.js | 15 ++++++- ...olicyPrimaryOperationalIndicatorsReport.js | 39 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/reports/PolicyPrimaryOperationalIndicatorsReport.js diff --git a/src/index.js b/src/index.js index 4440f1d..970d5fc 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,7 @@ import { reducer } from "./reducer"; import { RIGHT_POLICY } from "./constants"; import { policyMutation } from "./utils/utils"; import PolicyRenewalsReport from "./reports/PolicyRenewalsReport"; +import PolicyPrimaryOperationalIndicatorsReport from "./reports/PolicyPrimaryOperationalIndicatorsReport"; const ROUTE_POLICY_POLICIES = "policy/policies"; const ROUTE_POLICY_POLICY = "policy/policy"; @@ -49,6 +50,18 @@ const DEFAULT_CONFIG = { return params; }, }, + { + key: "policy_primary_operational_indicators", + component: PolicyPrimaryOperationalIndicatorsReport, + isValid: (values) => (values) => values.yearMonth, + getParams: (values) => { + const params = {yearMonth: values.yearMonth} + if (values.location) { + params.locationId = decodeId(values.location.id); + } + return params; + }, + }, ], "refs": [ { key: "policy.PolicyOfficerPicker", ref: PolicyOfficerPicker }, @@ -81,7 +94,7 @@ const DEFAULT_CONFIG = { ], "insuree.EnquiryDialog": [FamilyOrInsureePoliciesSummary, InsureeEligibilityEnquiry, InsureeEligibilitySummary], "insuree.FamilyOverview.panels": [FamilyOrInsureePoliciesSummary], - "insuree.FamilyOverview.mutations": [policyMutation] + "insuree.FamilyOverview.mutations": [policyMutation], } export const PolicyModule = (cfg) => { diff --git a/src/reports/PolicyPrimaryOperationalIndicatorsReport.js b/src/reports/PolicyPrimaryOperationalIndicatorsReport.js new file mode 100644 index 0000000..6670d63 --- /dev/null +++ b/src/reports/PolicyPrimaryOperationalIndicatorsReport.js @@ -0,0 +1,39 @@ +import { Grid } from "@material-ui/core"; +import { PublishedComponent, useModulesManager, useTranslations } from "@openimis/fe-core"; +import React from "react"; + +const InsureeMissingPhotoReport = (props) => { + const { values, setValues } = props; + const modulesManager = useModulesManager(); + const { formatMessage } = useTranslations("policy", modulesManager); + + return ( + + + setValues({ ...values, yearMonth })} + /> + + + + setValues({ + ...values, + location, + }) + } + value={values.location} + locationLevel={1} + /> + + + ); +}; + +export default InsureeMissingPhotoReport; From 70fe7bc89ba93b5be7d5a53f0224dee8b5c68d17 Mon Sep 17 00:00:00 2001 From: olewandowski1 Date: Fri, 8 Dec 2023 13:58:22 +0100 Subject: [PATCH 2/2] OP-1619: implement policy projection with family details fields --- src/index.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 1bc6b0c..f746fa4 100644 --- a/src/index.js +++ b/src/index.js @@ -52,8 +52,35 @@ const DEFAULT_CONFIG = { ], "refs": [ { key: "policy.PolicyOfficerPicker", ref: PolicyOfficerPicker }, - { key: "policy.PolicyOfficerPicker.projection", ref: ["id", "uuid", "code", "lastName", "otherNames"] }, - { key: "policy.PolicyPicker.projection", ref: ["id", "uuid", "startDate", "product{name, code}", "expiryDate", "value", "sumPremiums"] }, + { + key: "policy.PolicyOfficerPicker.projection", + ref: ["id", "uuid", "code", "lastName", "otherNames"], + }, + { + key: "policy.PolicyPicker.projection", + ref: [ + "id", + "uuid", + "startDate", + "product{name, code}", + "expiryDate", + "value", + "sumPremiums", + ], + }, + { + key: "policy.PolicyPicker.projection.withFamily", + ref: [ + "id", + "uuid", + "startDate", + "product{name, code}", + "expiryDate", + "value", + "sumPremiums", + "family{id, uuid, headInsuree{chfId, lastName, otherNames, dob}}", + ], + }, { key: "policy.PolicyOfficerPicker.sort", ref: 'officer__code' }, { key: "policy.PolicyStatusPicker", ref: PolicyStatusPicker }, { key: "policy.PolicyStatusPicker.projection", ref: null },