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

[MODINVSTOR-1243] Implement endpoint to retrieve items from multiple tenants #755

Merged
merged 17 commits into from
Aug 28, 2024

Conversation

Saba-Zedginidze-EPAM
Copy link
Contributor

@Saba-Zedginidze-EPAM Saba-Zedginidze-EPAM commented Aug 23, 2024

Purpose

[MODINVSTOR-1243] Implement endpoint to retrieve items from multiple tenants

Approach

  • Add new types for receiving request body
  • Add new endpoint
  • Add endpoint handle to fetch items from different tenants

Screenshots

Verified and left comment on JIRA ticket: https://folio-org.atlassian.net/browse/MODINVSTOR-1243?focusedCommentId=226464

@SerhiiNosko SerhiiNosko requested a review from a team August 28, 2024 07:49
Copy link

@SerhiiNosko SerhiiNosko merged commit 6d09dae into master Aug 28, 2024
6 checks passed
return List.of();
}
return JsonArrayHelper.toList(response.getJson(), ITEMS_FIELD).stream()
.map(item -> item.put(TENANT_ID_FIELD, tenantId))
Copy link
Contributor

Choose a reason for hiding this comment

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

could you say why "tenantId" field is set to the item json? Looks like it does not comply with the response definition because the item schema does not contain "tenantId" field.

Copy link
Contributor

@SerhiiNosko SerhiiNosko Aug 28, 2024

Choose a reason for hiding this comment

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

In screen from testing I see that response object has tenantId populated:
image
Maybe Item object allows to add properties dynamically

Copy link
Contributor

Choose a reason for hiding this comment

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

the field "tenantId" successfully has been added to response because in the code we set it to JsonObject representing item and that allows to add any property

Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we can improve this in some way, for example by adding tenantId to Item schema explicitly?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose yes, or maybe to add a new response schema for this endpoint that would refer to the item schema

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