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

feat: Add BulkImport APIs and cron #148

Open
wants to merge 7 commits into
base: feat/bulk-import-base
Choose a base branch
from

Conversation

anku255
Copy link

@anku255 anku255 commented Mar 20, 2024

Summary of change

(A few sentences about this PR)

Related issues

Checklist for important updates

  • Changelog has been updated
  • Changes to the version if needed
    • In build.gradle
  • Had installed and ran the pre-commit hook
  • Issue this PR against the latest non released version branch.
    • To know which one it is, run find the latest released tag (git tag) in the format vX.Y.Z, and then find the latest branch (git branch --all) whose X.Y is greater than the latest released tag.
    • If no such branch exists, then create one from the latest released branch.

build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
Comment on lines 55 to 74
// This method returns a JSON object string representation, excluding 'status', 'createdAt', and 'updatedAt'.
// It is used for inserting the user into the database or during testing.
public String toRawDataForDbStorage() {
JsonObject jsonObject = new Gson().fromJson(new Gson().toJson(this), JsonObject.class);
jsonObject.remove("status");
jsonObject.remove("createdAt");
jsonObject.remove("updatedAt");
return jsonObject.toString();
}

public static BulkImportUser fromRawDataFromDbStorage(String id, String rawData, BULK_IMPORT_USER_STATUS status, String primaryUserId, String errorMessage, long createdAt, long updatedAt) {
BulkImportUser user = new Gson().fromJson(rawData, BulkImportUser.class);
user.id = id;
user.status = status;
user.primaryUserId = primaryUserId;
user.errorMessage = errorMessage;
user.createdAt = createdAt;
user.updatedAt = updatedAt;
return user;
}
Copy link
Member

Choose a reason for hiding this comment

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

these two fucntions are very unclear. As a reader of this code, it makes no sense why they are there. Please add more detailed comment with examples.

Copy link
Author

Choose a reason for hiding this comment

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

I have added comment to explain the purpose of these functions. That should help explain it.

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.

3 participants