Skip to content

Commit

Permalink
Merge pull request #75 from openimis/develop
Browse files Browse the repository at this point in the history
MERGING develop into release/23.10
  • Loading branch information
delcroip authored Dec 15, 2023
2 parents 7845818 + 762ab3d commit a206c11
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 2 deletions.
44 changes: 42 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -49,11 +50,50 @@ 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 },
{ 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 },
Expand Down
39 changes: 39 additions & 0 deletions src/reports/PolicyPrimaryOperationalIndicatorsReport.js
Original file line number Diff line number Diff line change
@@ -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 (
<Grid container direction="column" spacing={1}>
<Grid item>
<PublishedComponent
pubRef="core.DatePicker"
value={values.yearMonth}
module="policy"
required
label="PrimaryOperationalIndicatorsReport.yearMonth"
onChange={(yearMonth) => setValues({ ...values, yearMonth })}
/>
</Grid>
<Grid item>
<PublishedComponent
pubRef="location.LocationPicker"
onChange={(location) =>
setValues({
...values,
location,
})
}
value={values.location}
locationLevel={1}
/>
</Grid>
</Grid>
);
};

export default InsureeMissingPhotoReport;

0 comments on commit a206c11

Please sign in to comment.