Skip to content

Commit

Permalink
feat: new app version data API implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed May 21, 2024
1 parent 0a46c06 commit efadbda
Show file tree
Hide file tree
Showing 75 changed files with 6,232 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist
*.json
# *.json
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"editor.trimAutoWhitespace": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.eslint": true
"source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit"
},

"files.exclude": {
Expand Down
2 changes: 2 additions & 0 deletions src/config/filtering/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"or_operator": "OR",
"eq": " eq ",
"in": " in ",
"gte": " ge ",
"lte": " le ",
"multi_param_separator": ","
}
8 changes: 8 additions & 0 deletions src/config/mapping/allocations/cycles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"value": "value",
"cycle": "periodCovered",
"component": "activityArea.name",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD", "#D9D9D9"],
"urlParams": "?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((periodCovered,activityArea/name),aggregate(actualAmount with sum as value))"
}
11 changes: 11 additions & 0 deletions src/config/mapping/allocations/radial.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dataPath": "value",
"cycle": "periodFrom",
"name": "activityArea.name",
"tooltipItem": "geography.parent.parent.name",
"value": "value",
"countryCode": "geography/code",
"urlParams": "?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((activityArea/name),aggregate(actualAmount with sum as value))",
"countriesCountUrlParams": "?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((geography/name))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD"]
}
7 changes: 7 additions & 0 deletions src/config/mapping/allocations/sunburst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dataPath": "value",
"value": "value",
"region": "geography.parent.name",
"country": "geography.name",
"urlParams": "?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((geography/parent/name,geography/name),aggregate(actualAmount with sum as value))"
}
8 changes: 8 additions & 0 deletions src/config/mapping/allocations/table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"value": "value",
"cycle": "periodCovered",
"component": "activityArea.name",
"geography": "geography.name",
"urlParams": "?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((activityArea/name,geography/name,periodCovered),aggregate(actualAmount with sum as value))"
}
37 changes: 37 additions & 0 deletions src/config/mapping/allocations/treemap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"dataPath": "value",
"value": "value",
"component": "activityArea.name",
"geography": "geography.name",
"colors": [
{
"bg": "#0A2840",
"text": "#FFFFFF",
"items": "#164366"
},
{
"bg": "#013E77",
"text": "#FFFFFF",
"items": "#0B5191"
},
{
"bg": "#00B5AE",
"text": "#000000",
"items": "#18CCC5"
},
{
"bg": "#C3EDFD",
"text": "#FFFFFF",
"items": "#B3D7E5"
},
{
"bg": "#F3F5F4",
"text": "#FFFFFF",
"items": "#DDDDDD"
}
],
"urlParams": [
"?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((activityArea/name),aggregate(actualAmount with sum as value))",
"?$apply=filter(indicatorName eq 'Communicated Allocation - Reference Rate' AND financialDataSet eq 'CommunicatedAllocation_ReferenceRate'<filterString>)/groupby((activityArea/name,geography/name),aggregate(actualAmount with sum as value))"
]
}
7 changes: 7 additions & 0 deletions src/config/mapping/budgets/breakdown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dataPath": "value",
"name": "activityAreaGroup.parent.parent.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((activityAreaGroup/parent/parent/name),aggregate(plannedAmount with sum as value))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD", "#F3F5F4"]
}
6 changes: 6 additions & 0 deletions src/config/mapping/budgets/cycles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dataPath": "value",
"from": "implementationPeriod/periodFrom",
"to": "implementationPeriod/periodTo",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate')/groupby((implementationPeriod/perioFrom,implementationPeriod/periodTo))"
}
16 changes: 16 additions & 0 deletions src/config/mapping/budgets/metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"dataPath": "value",
"indicatorNameField": "indicatorName",
"expenditureIndicatorName": "Total Expenditure to Last Expenditure Reporting Period - Reference Rate",
"budgetIndicatorName": "Total Budget to Last Expenditure Reporting Period - Reference Rate",
"disbursementIndicatorName": "Total Disbursement to Last Expenditure Reporting Period - Reference Rate",
"cashBalanceIndicatorName": "Opening Cash Balance - Reference Rate",
"organisationName": "implementationPeriod.grant.principalRecipient.name",
"organisationType": "implementationPeriod.grant.principalRecipient.type.name",
"expenditureValue": "actualCumulative",
"budgetValue": "plannedCumulative",
"disbursementValue": "actualCumulative",
"cashBalanceValue": "actual",
"urlParams": "?$apply=filter(financialDataSet eq 'ImplementationPeriodFinancialMetricAmount')/groupby((indicatorName),aggregate(actualAmount with sum as actual,actualAmountCumulative with sum as actualCumulative,plannedAmountCumulative with sum as plannedCumulative))",
"urlParamsOrganisations": "?$apply=filter(financialDataSet eq 'ImplementationPeriodFinancialMetricAmount')/groupby((indicatorName,implementationPeriod/grant/principalRecipient/type/name,implementationPeriod/grant/principalRecipient/name),aggregate(actualAmount with sum as actual,actualAmountCumulative with sum as actualCumulative,plannedAmountCumulative with sum as plannedCumulative))"
}
7 changes: 7 additions & 0 deletions src/config/mapping/budgets/radial.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dataPath": "value",
"name": "activityAreaGroup.parent.parent.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((activityAreaGroup/parent/parent/name),aggregate(plannedAmount with sum as value))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD", "#F3F5F4"]
}
9 changes: 9 additions & 0 deletions src/config/mapping/budgets/sankey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataPath": "value",
"level1Field": "activityAreaGroup.parent.name",
"level2Field": "activityAreaGroup.name",
"valueField": "value",
"cycle": "periodFrom",
"nodeColors": ["#252C34", "#252C34", "#252C34"],
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((activityAreaGroup/parent/name,activityAreaGroup/name),aggregate(plannedAmount with sum as value))"
}
9 changes: 9 additions & 0 deletions src/config/mapping/budgets/table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataPath": "value",
"parentField": "activityAreaGroup.parent.name",
"childrenField": "activityAreaGroup.name",
"valueField": "value",
"cycle": "periodFrom",
"countField": "count",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((activityAreaGroup/parent/name,activityAreaGroup/name),aggregate(plannedAmount with sum as value,implementationPeriod/grantId with countdistinct as count))"
}
37 changes: 37 additions & 0 deletions src/config/mapping/budgets/treemap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"dataPath": "value",
"cycle": "periodFrom",
"name": "activityAreaGroup.parent.parent.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((activityAreaGroup/parent/parent/name),aggregate(plannedAmount with sum as value))",
"textbgcolors": [
{
"color": "#0A2840",
"textcolor": "#FFFFFF"
},
{
"color": "#013E77",
"textcolor": "#FFFFFF"
},
{
"color": "#00B5AE",
"textcolor": "#FFFFFF"
},
{
"color": "#10708F",
"textcolor": "#FFFFFF"
},
{
"color": "#9EDBE9",
"textcolor": "#000000"
},
{
"color": "#C3EDFD",
"textcolor": "#000000"
},
{
"color": "#F3F5F4",
"textcolor": "#000000"
}
]
}
8 changes: 8 additions & 0 deletions src/config/mapping/disbursements/barChart.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"name": "activityArea.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((activityArea/name),aggregate(actualAmount with sum as value))&$orderby=value desc",
"biggerBarColor": "#00B5AE",
"barColor": "#013E77"
}
8 changes: 8 additions & 0 deletions src/config/mapping/disbursements/lineChart.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"cycle": "periodFrom",
"value": "value",
"line": "activityArea.name",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((periodFrom,activityArea/name),aggregate(actualAmount with sum as value))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD"]
}
11 changes: 11 additions & 0 deletions src/config/mapping/disbursements/table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dataPath": "value",
"indicatorField": "indicatorName",
"signedIndicator": "Total Signed Amount - Reference Rate",
"commitmentIndicator": "Total Commitment Amount - Reference Rate",
"disbursementIndicator": "Total Disbursed Amount - Reference Rate",
"component": "activityArea.name",
"grants": "count",
"valueField": "value",
"urlParams": "?$apply=filter(indicatorName in ('Total Signed Amount - Reference Rate','Total Commitment Amount - Reference Rate','Total Disbursed Amount - Reference Rate')<filterString>)/groupby((activityArea/name,indicatorName),aggregate(actualAmount with sum as value,implementationPeriod/grantId with countdistinct as count))&$orderby=value desc"
}
8 changes: 8 additions & 0 deletions src/config/mapping/documents/list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"type": "documentType.parent.name",
"title": "title",
"url": "url",
"geography": "geography.name",
"urlParams": "?$apply=filter(<filterString>)/groupby((geography/name,documentType/index,documentType/parent/name,title,url))&$orderby=documentType/index asc,title asc"
}
33 changes: 33 additions & 0 deletions src/config/mapping/eligibility/heatmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"dataPath": "value",
"cycle": "fundingStream",
"incomeLevel": "incomeLevel",
"diseaseBurden": "diseaseBurden",
"isEligible": "isEligible",
"eligibilityYear": "eligibilityYear",
"component": "activityArea.name",
"urlParams": "?$select=fundingStream,incomeLevel,isEligible,diseaseBurden,eligibilityYear,geography,activityArea&$expand=activityArea&$filter=geography/code eq '<countryCode>'",
"isEligibleValueMapping": {
"true": "Eligible",
"false": "Not Eligible"
},
"incomeLevelValueMapping": {
"Lower middle income": "LM",
"Small Island income": "SI",
"Low income": "Low",
"Lower-Lower middle income": "LLM",
"Upper middle income": "UM",
"NA": "NA",
"High income": "High",
"Upper-Lower middle income": "ULM"
},
"diseaseBurdenValueMapping": {
"NA": "NA",
"Low": "L",
"Moderate": "M",
"High": "H",
"Severe": "S",
"Extreme": "E",
"Not High": "NH"
}
}
6 changes: 6 additions & 0 deletions src/config/mapping/eligibility/stats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dataPath": "value",
"geography": "geography.name",
"component": "activityArea.name",
"urlParams": "?$apply=filter(isEligible eq true<filterString>)/groupby((activityArea/name,geography/name))"
}
15 changes: 15 additions & 0 deletions src/config/mapping/eligibility/table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"dataPath": "value",
"geography": "geography.name",
"year": "eligibilityYear",
"component": "activityArea.name",
"incomeLevel": "incomeLevel",
"diseaseBurden": "diseaseBurden",
"isEligible": "isEligible",
"eligibilityValues": {
"eligible": "Eligible",
"notEligible": "Not Eligible",
"transitionFunding": "Transition Funding"
},
"urlParams": "?$apply=<filterString>/groupby((geography/name,eligibilityYear,activityArea/name,isEligible,incomeLevel,diseaseBurden))&$orderby=geography/name,activityArea/name"
}
8 changes: 8 additions & 0 deletions src/config/mapping/expenditures/bar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"dataPath": "value",
"name": "activityArea.parent.parent.name",
"itemName": "activityArea.parent.name",
"indicatorName": "indicatorName",
"value": "actualCumulative",
"urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isLatestReported eq true<filterString>)/groupby((indicatorName,activityArea/parent/name,activityArea/parent/parent/name),aggregate(actualAmountCumulative with sum as actualCumulative))"
}
12 changes: 12 additions & 0 deletions src/config/mapping/expenditures/heatmap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dataPath": "value",
"budget": "value2",
"expenditure": "value1",
"cycle": "periodCovered",
"urlParams": "?$apply=filter(financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isLatestReported eq true<filterString>)/groupby((<rowField>,<columnField>),aggregate(actualAmountCumulative with sum as value1,plannedAmountCumulative with sum as value2))",
"fields": {
"principalRecipient": "implementationPeriod/grant/principalRecipient/name",
"principalRecipientType": "implementationPeriod/grant/principalRecipient/type/name",
"component": "implementationPeriod/grant/activityArea/name"
}
}
9 changes: 9 additions & 0 deletions src/config/mapping/expenditures/table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataPath": "value",
"name": "activityArea.parent.parent.name",
"itemName": "activityArea.parent.name",
"indicatorName": "indicatorName",
"cumulativeExpenditureValue": "actualCumulative",
"periodExpenditureValue": "actual",
"urlParams": "?$apply=filter(indicatorName in ('Expenditure: Module-Intervention - Reference Rate') AND isLatestReported eq true<filterString>)/groupby((indicatorName,activityArea/parent/name,activityArea/parent/parent/name),aggregate(actualAmountCumulative with sum as actualCumulative,actualAmount with sum as actual))"
}
5 changes: 5 additions & 0 deletions src/config/mapping/filter-options/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataPath": "value",
"label": "name",
"value": "name"
}
6 changes: 6 additions & 0 deletions src/config/mapping/filter-options/donors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dataPath": "value",
"label": "name",
"value": "id",
"type": "type.name"
}
9 changes: 9 additions & 0 deletions src/config/mapping/filter-options/geography.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataPath": "value[0].children",
"label": "name",
"value": "code",
"children": "children",
"isDonor": "isDonor",
"isRecipient": "isRecipient",
"level": "level"
}
5 changes: 5 additions & 0 deletions src/config/mapping/filter-options/principal-recipients.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataPath": "value",
"label": "name",
"value": "name"
}
5 changes: 5 additions & 0 deletions src/config/mapping/filter-options/replenishment-periods.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataPath": "value",
"label": "periodCovered",
"value": "periodCovered"
}
9 changes: 9 additions & 0 deletions src/config/mapping/financialInsightsStats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"dataPath": "value",
"valueField": "value",
"indicatorField": "indicatorName",
"signed": "Total Signed Amount - Reference Rate",
"commitment": "Total Commitment Amount - Reference Rate",
"disbursement": "Total Disbursed Amount - Reference Rate",
"urlParams": "?$apply=filter(indicatorName in ('Total Signed Amount - Reference Rate','Total Commitment Amount - Reference Rate','Total Disbursed Amount - Reference Rate')<filterString>)/groupby((indicatorName),aggregate(actualAmount with sum as value))"
}
16 changes: 16 additions & 0 deletions src/config/mapping/fundingrequests/location-table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"dataPath": "value",
"tableMap": [
"value[]",
{
"components": "",
"submissionDate": "submissionDate",
"approach": "reviewApproach",
"trpWindow": "window",
"trpOutcome": "reviewOutcome",
"portfolioCategorization": "",
"boardApproval": "boardApproval",
"items": []
}
]
}
Loading

0 comments on commit efadbda

Please sign in to comment.