Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] OpenSpp Adaptor #1

Closed
wants to merge 303 commits into from
Closed

[ADD] OpenSpp Adaptor #1

wants to merge 303 commits into from

Conversation

nhatnm0612
Copy link

@nhatnm0612 nhatnm0612 commented Jun 14, 2023

Summary

Add adaptor for OpenSpp

Details

Based on npm module Odoo [https://www.npmjs.com/package/odoo].

Creating a adaptor for OpenSPP with these functions:

  • Write the Adaptor
  • Prepare a demo flow

registrant_id is from: https://github.com/OpenSPP/openspp-registry/issues/247

Implement the methods:

Issues

Issue

Review Checklist

Before merging, the reviewer should check the following items:

  • Does the PR do what it claims to do?
  • If this is a new adaptor, has the migration tool been run and the
    migration guide followed?
  • Are there any unit tests? Should there be?
  • Is there a changeset associated with this PR? Should there be? Note that
    dev only changes don't need a changeset.

Copy link
Member

@jeremi jeremi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Rename Household to group everywhere.
  • Add getIndividual
  • Add getPrograms
  • Add getEnrolledPrograms
  • Add enroll
  • Add unenroll
  • Add createChangeRequest

packages/openspp/src/Adaptor.js Outdated Show resolved Hide resolved
];
let defaultFields = [
"individual", "kind", "start_date", "ended_date",
"individual_birthdate", "individual_gender"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those field ("individual_birthdate", "individual_gender") are not in the default implementation of OpenSPP I think.
Try the code with a fresh install with openspp-docker.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this is not in OpenSPP, but is implemented by you in OpenG2P repo. (link here)
And I think that it is good to have.

sppConnector.connect((err) => {
if (err) {
Log.error(err);
throw new Error("Can't login to OpenSPP, please check your credentials or network!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have more details in the error we can give to the users?

packages/openspp/src/Adaptor.js Outdated Show resolved Hide resolved
josephjclark and others added 29 commits August 3, 2023 16:07
1) Don't try to expand a stream
2) don't callback at the with an empty chunk
it was not being used
Fix streaming interface to parseCSV
@nhatnm0612 nhatnm0612 closed this by deleting the head repository Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants