Mapping config files are used in order to make the data middleware API re-usable with different data source APIs and without the need of changing the core of the codebase.
The data middleware API consists of many endpoints that are defined and implemented in the controller source files. The endpoints are grouped in controllers based on the datasets coming from the datasource API (The Global Fund | Data Service).
The endpoints are defined in the controller source files like the following example:
@get('/grants')
get
: HTTP method type'/grants'
: the endpoint route, in this case it can be accessed throughhttp://localhost:4200/grants
Each endpoint is implemented using 4 source files
- Controller: core logic of the endpoint
- Mapping: a JSON file defining the needed data fields and their corresponding field from the datasource API
- Utils mapping: a JSON file defining util functionalities and how they are associated with the corresponding ones from the datasource API
- Filters mapping: a JSON file defining the filter fields and their corresponding field from the datasource API
Generic datasource API filter/sort/paginate syntax mapping For example page size parameter key:
- In ODATA API syntax:
"page_size": "$top"
- In Django API syntax:
"page_size": "page_size"
- In Solr API syntax:
"page_size": "rows"
Data source API endpoint keys can be found in here
Grants & Grant detail
@get('/grants')
Data source API endpoint key: grants
Controller
Mapping
Utils mapping
Filters mapping
@get('/grant/detail')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Utils mapping
@get('/grant/periods')
Data source API endpoint key: grantPeriods
Controller
Mapping
Utils mapping
@get('/grant/period/info')
Data source API endpoint key: grantPeriods
, performancerating
Controller
Mapping
Utils mapping
@get('/grants/radial')
Data source API endpoint key: grantsNoCount
, vgrantPeriods
, performancerating
Controller
Mapping
Filters mapping 1
Filters mapping 2
Allocations
@get('/allocations')
Data source API endpoint key: allocations
Controller
Mapping
Filters mapping
@get('/allocations/periods')
Data source API endpoint key: allocations
Controller
Mapping
Filters mapping
@get('/allocations/drilldown')
Data source API endpoint key: allocations
Controller
Mapping
Filters mapping
@get('/allocations/geomap')
Data source API endpoint key: allocations
, geojson
Controller
Mapping
Filters mapping
@get('/allocations/geomap/multicountries')
Data source API endpoint key: allocations
, multicountriescountriesdata
Controller
Mapping
Filters mapping
Budgets
@get('/budgets/flow')
Data source API endpoint key: budgets
Controller
Mapping
Filters mapping
@get('/budgets/time-cycle')
Data source API endpoint key: budgets
Controller
Mapping
Filters mapping
@get('/budgets/drilldown')
Data source API endpoint key: budgets
Controller
Mapping
Filters mapping
@get('/budgets/drilldown/2')
Data source API endpoint key: budgets
Controller
Mapping
Filters mapping
@get('/budgets/geomap')
Data source API endpoint key: budgets
, geojson
Controller
Mapping
Filters mapping
@get('/budgets/geomap/multicountries')
Data source API endpoint key: budgets
, multicountriescountriesdata
Controller
Mapping
Filters mapping
Disbursements/Signed/Commitment
@get('/disbursements/time-cycle')
Data source API endpoint key: disbursements
Controller
Mapping
Filters mapping
@get('/signed/time-cycle')
Data source API endpoint key: vgrantPeriods
Controller
Mapping
Filters mapping
@get('/commitment/time-cycle')
Data source API endpoint key: vcommitments
Controller
Mapping
Filters mapping
@get('/disbursements/time-cycle/drilldown')
Data source API endpoint key: disbursements
Controller
Mapping
Filters mapping
@get('/signed/time-cycle/drilldown')
Data source API endpoint key: vgrantPeriods
Controller
Mapping
Filters mapping
@get('/commitment/time-cycle/drilldown')
Data source API endpoint key: vcommitments
Controller
Mapping
Filters mapping
@get('/disbursements/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/signed/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/commitment/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/disbursements/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/signed/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/commitment/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/disbursements/geomap')
Data source API endpoint key: grantsNoCount
, geojson
Controller
Mapping
Filters mapping
@get('/disbursements/geomap/multicountries')
Data source API endpoint key: grantPeriods
, multicountriescountriesdata
Controller
Mapping
Filters mapping
@get('/location/disbursements/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/location/signed/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/location/commitment/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/grant/disbursements/time-cycle')
Data source API endpoint key: grantDetailDisbursements
Controller
Mapping
Filters mapping
@get('/grant/commitment/time-cycle')
Data source API endpoint key: commitments
Controller
Mapping
Filters mapping
@get('/grant/disbursements/treemap')
Data source API endpoint key: grantDetailGrants
Controller
Mapping
Filters mapping
@get('/grant/signed/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
@get('/grant/commitment/treemap')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
Documents
@get('/documents')
Data source API endpoint key: documents
Controller
Mapping
Utils mapping
Filters mapping
@get('/grant-documents')
Data source API endpoint key: documents
Controller
Mapping
Utils mapping
Filters mapping
Eligibility
@get('/eligibility')
Data source API endpoint key: eligibility
Controller
Mapping
Filters mapping
@get('/eligibility/years')
Data source API endpoint key: eligibility
Controller
Mapping
@get('/eligibility/country')
Data source API endpoint key: eligibility
Controller
Mapping
Filters mapping
Filter options
@get('/filter-options/locations')
Data source API endpoint key: filteroptionslocations
Controller
Mapping
@get('/filter-options/components')
Data source API endpoint key: filteroptionscomponents
Controller
Mapping
@get('/filter-options/partner-types')
Data source API endpoint key: filteroptionspartnertypes
Controller
Mapping
@get('/filter-options/status')
Data source API endpoint key: filteroptionsstatus
Controller
Mapping
@get('/filter-options/replenishment-periods')
Data source API endpoint key: filteroptionsreplenishmentperiods
Controller
Mapping
@get('/filter-options/donors')
Data source API endpoint key: filteroptionsdonors
Controller
Mapping
Global search
@get('/global-search')
Data source API endpoint key: listed in the mapping file
Controller
Mapping
Location detail
@get('/location/detail')
Data source API endpoint key: multicountries
, grantsNoCount
Controller
Mapping
Filters mapping
Partner detail
@get('/partner/detail')
Data source API endpoint key: grantsNoCount
Controller
Mapping
Filters mapping
Performance framework
@get('/performance-framework')
Data source API endpoint key: performanceframework
Controller
Mapping
Utils mapping
@get('/performance-framework/expand')
Data source API endpoint key: performanceframework
Controller
Mapping
Utils mapping
Performance rating
@get('/performance-rating')
Data source API endpoint key: performancerating
Controller
Mapping
Pledges & Contributions
@get('/pledges-contributions/time-cycle')
Data source API endpoint key: pledgescontributions
Controller
Mapping
Filters mapping
@get('/pledges-contributions/geomap')
Data source API endpoint key: pledgescontributions
Controller
Mapping
Filters mapping
@get('/pledges-contributions/time-cycle/drilldown')
Data source API endpoint key: pledgescontributions
Controller
Mapping
Filters mapping
@get('/pledges-contributions/treemap')
Data source API endpoint key: pledgescontributions
Controller
Mapping
Filters mapping
Results
@get('/results')
Data source API endpoint key: results
Controller
Mapping
Utils mapping
Filters mapping
@get('/results/years')
Data source API endpoint key: results
Controller
Mapping
@get('/results-stats')
Data source API endpoint key: results
Controller
Mapping
Filters mapping