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

[MODFIN-358] - Add tenantId to the locations schema for restrict by Fund functionality #406

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

imerabishvili
Copy link
Contributor

Purpose

https://folio-org.atlassian.net/browse/MODFIN-358

Approach

Added migration to update DB according to new schema.

Learning

Pre-Merge Checklist:

Before merging this PR, please go through the following list and take appropriate actions.

  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • Were any API paths or methods changed, added or removed?
    • Were there any schema changes?
    • Did any of the interface versions change?
    • Were permissions changed, added or removed?
    • Are there new interface dependencies?
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all the appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?
  • Did you modify code to call some additional endpoints?
    • If so, do you check that necessary module permission added in ModuleDescriptor-template.yaml file?

Ideally, all the PRs involved in breaking changes would be merged on the same day
to avoid breaking the folio-testing environment.
Communication is paramount if that is to be achieved,
especially as the number of inter-module and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems,
ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@imerabishvili imerabishvili requested a review from a team April 8, 2024 10:33
(SELECT jsonb_agg(jsonb_build_object('locationId', value)) from jsonb_array_elements(jsonb->'locationIds'))
)
WHERE jsonb ? 'locationIds'
AND jsonb->>'locationIds' != '[]';
Copy link
Contributor

@SerhiiNosko SerhiiNosko Apr 8, 2024

Choose a reason for hiding this comment

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

I just created new fund via UI with not populating locations and in DB see this structure:
{ "id": "9d3dae57-139d-4c55-90ef-66308c16cfd5", "code": "TestFund", "name": "TestFund", "_version": 1, "ledgerId": "7cef8378-7cbd-1fae-bcdd-8b9d7c0af9de", "metadata": { "createdDate": "2024-04-08T10:47:28.909Z", "updatedDate": "2024-04-08T10:47:28.909Z", "createdByUserId": "4614b2f7-85e2-4243-a487-50d6e5abf14e", "updatedByUserId": "4614b2f7-85e2-4243-a487-50d6e5abf14e" }, "acqUnitIds": [], "fundStatus": "Active", "locationIds": [], "allocatedToIds": [], "allocatedFromIds": [], "externalAccountNo": "12345", "restrictByLocations": false, "donorOrganizationIds": [] }
So it has empty array of locationIds and this script will don nothing with it because of this AND filtering.
I think expected result will be if we have empty array of location objects in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

seems forget to push because could not see this change in schema.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SQL file was updated.

@SerhiiNosko
Copy link
Contributor

@imerabishvili there is some conflict in acq-models

@SerhiiNosko
Copy link
Contributor

@imerabishvili here we introduced API breaking change, so need to increate major version of fund interface

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@imerabishvili imerabishvili merged commit 33cf0d1 into master Apr 11, 2024
6 checks passed
@imerabishvili imerabishvili deleted the MODFIN-358 branch April 11, 2024 13:10
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.

2 participants