Skip to content

New adaptor: OpenG2P #1806

Description

@jackohilts

Background

OpenG2P is an open-source DPG for social protection. It's used by governments to register people, run benefit programmes and make payments. OpenFn has no OpenG2P adaptor today. The closest is openspp, since OpenSPP started as an OpenG2P fork. Its 4.0.0 rebuild (#1792) has moved to OpenSPP2's REST API, so it's a useful template but not a substitute.

OpenG2P is made of separately deployed modules:

  • Registry (Gen 2): a FastAPI service with a Partner API. Writes go through an approval workflow.
  • Social Registry (1.3): the older, Odoo-based registry.
  • PBMS: programmes, enrolment, cycles and entitlements (Odoo).
  • G2P Bridge: disbursements.
  • SPAR: maps an ID to a bank or wallet account.

It also implements the G2P Connect standard for registry, disbursement and mapper APIs.

Typical use cases

  • Push registrations from ODK, KoBo or CommCare into the Registry.
  • Enrol eligible registrants into a PBMS programme.
  • Sync payment status back to an M&E or case management system.
  • Share registry data with other government systems via G2P Connect.

Requirements

  • NOTE; from Claude, authored by Jack. They seem right to me but open to flexibility for v1 if any of these seem too much
  1. Auth: OAuth2 client credentials via Keycloak, with automatic token refresh.
  2. A separate base URL in the configuration for each module (Registry, PBMS, Bridge, SPAR).
  3. A generic request(method, path, body, options) for any unwrapped endpoint.
  4. Registry: search, get, create and update registrants. Return the change-request ID on writes.
  5. Registry: add and remove group (household) members.
  6. PBMS: list and get programmes, and enrol or unenrol registrants.
  7. PBMS: read cycles and entitlements.
  8. G2P Bridge: create a disbursement envelope and batch, and get disbursement status.
  9. SPAR: resolve an ID to a financial address.
  10. G2P Connect: registry search and subscribe.
  11. Consistent paging, with results in state.data.
  12. Error messages that pass through OpenG2P's validation errors, without logging credentials or PII.
  13. Reuse OpenSPP operation names where they fit.
  14. Unit tests with mocks for every operation, plus JSDoc examples.

API docs

Test environment

OpenG2P has no public sandbox. The options are:

  • OpenG2P In a Box, a single-VM dev install (16 vCPU, 64 GB RAM).
  • The example bank simulator for disbursement testing.
  • Asking the OpenG2P team for a hosted dev namespace - reach to Jack if that is necessary!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Priority Level

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions