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(LENS-1466): add support for partial updates in the UpdateStreamService #127

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

jgwatkincoveo
Copy link
Contributor

@jgwatkincoveo jgwatkincoveo commented Mar 20, 2024

LENS-1466

Added the capability of pushing the partialUpdate object in the UpdateStreamService. See Dictionary field update

Testing

Update the catalog using the SDK
This resulted in the following data
Screenshot 2024-03-20 at 10 58 00
Screenshot 2024-03-20 at 10 58 19
Screenshot 2024-03-20 at 10 58 33

After using the sdk with the following to update

UpdateStreamService updateStreamService = new UpdateStreamService(SourceBuilder.buildCatalogSource());
Map<String,String> dictionary = new HashMap<>();
dictionary.put("sp", "Spanish");
dictionary.put("de", "German");

PartialUpdateDocument partialUpdateDocument1 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.FIELDVALUEREPLACE, "ec_description", "Some Great description");
PartialUpdateDocument partialUpdateDocument2 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.ARRAYREMOVE, "availableskus", new String[]{"sku1"});
PartialUpdateDocument partialUpdateDocument3 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.DICTIONARYPUT, "languages", dictionary);
PartialUpdateDocument partialUpdateDocument4 = new PartialUpdateDocument("http://someurl.com/92833", PartialUpdateOperator.DICTIONARYREMOVE, "languages", new String[]{"en", "fr"});

PartialUpdateDocument partialUpdateDocument5 = new PartialUpdateDocument("http://someurl.com/92834", PartialUpdateOperator.ARRAYAPPEND, "availableskus", new String[]{"sku1", "sku2"});
PartialUpdateDocument partialUpdateDocument6 = new PartialUpdateDocument("http://someurl.com/92834", PartialUpdateOperator.DICTIONARYREMOVE, "languages", "en");

updateStreamService.addPartialUpdate(partialUpdateDocument1);
updateStreamService.addPartialUpdate(partialUpdateDocument2);
updateStreamService.addPartialUpdate(partialUpdateDocument3);
updateStreamService.addPartialUpdate(partialUpdateDocument4);
updateStreamService.addPartialUpdate(partialUpdateDocument5);
updateStreamService.addPartialUpdate(partialUpdateDocument6);
HttpResponse<String> response = updateStreamService.close();

We get the following updated in the admin UI

Screenshot 2024-03-20 at 11 01 10
Screenshot 2024-03-20 at 11 01 25
Screenshot 2024-03-20 at 11 02 01

@jgwatkincoveo jgwatkincoveo requested a review from a team as a code owner March 20, 2024 15:11
@jgwatkincoveo jgwatkincoveo requested review from olamothe, y-lakhdar and fbeaudoincoveo and removed request for a team March 20, 2024 15:11
@jgwatkincoveo jgwatkincoveo changed the title LENS-1466 Added partial update support for update streaming service feat(LENS-1466): add support for partial updates in the UpdateStreamService Mar 20, 2024
Copy link

@samisayegh samisayegh left a comment

Choose a reason for hiding this comment

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

Great 🙌

Copy link

@sallainCoveo sallainCoveo left a comment

Choose a reason for hiding this comment

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

@jgwatkincoveo jgwatkincoveo merged commit 7725e54 into main Mar 26, 2024
5 checks passed
@jgwatkincoveo jgwatkincoveo deleted the feature/LENS-1466-partial-update branch March 26, 2024 14:38
This was referenced Apr 30, 2024
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.

4 participants