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

[MODFISTO-460] Removed the old transaction API #408

Merged
merged 13 commits into from
Apr 22, 2024
Merged

Conversation

damien-git
Copy link
Contributor

@damien-git damien-git commented Apr 11, 2024

Purpose

MODFISTO-460 - Remove the old transaction API (storage)

Approach

See ticket

mod-finance PR to update the version
acq-models PR to merge after this one

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.

@damien-git damien-git self-assigned this Apr 11, 2024
@damien-git damien-git marked this pull request as ready for review April 16, 2024 15:50
@damien-git damien-git requested a review from a team April 16, 2024 17:42
@@ -366,7 +361,7 @@
{
"tableName": "fund_distribution",
"fromModuleVersion": "mod-finance-storage-4.2.1",
"mode": "delete",
"mode": "DELETE",
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about delete declaration completely instead of using "mode"" : "DELETE" ? It should work in the same way but schema.json will be simpler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you sure the tables would get deleted ?
If yes, I feel like this can still be useful for documentation purpose (for instance if we hear a report that some customer using an old version has some data in a particular table and that table is no longer used, we will figure it out faster when seeing that table with the DELETE mode in the schema), but we could probably remove deleted tables from 4 versions back or more.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes it should be deleted but I am ok alsot remain as is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I think about it, I see another reason to keep this code: it helps to make sure we don't create a new table with the same name as an old table, which could potentially cause issues when upgrading FOLIO.

Error error = new Error()
.withCode(ErrorCodes.GENERIC_ERROR_CODE.getCode())
.withMessage(message)
.withParameters(singletonList(causeParam));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use List.of(), As far as I know singletonList will allow null

Copy link
Contributor

Choose a reason for hiding this comment

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

other places as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was prefering singletonList for single element lists, but I will switch to List.of.

src/main/java/org/folio/rest/util/ResponseUtils.java Outdated Show resolved Hide resolved
Comment on lines +21 to +23
import static io.vertx.core.Future.succeededFuture;
import static org.folio.dao.ledger.LedgerPostgresDAO.LEDGER_TABLE;
import static org.folio.dao.transactions.BatchTransactionDAO.TRANSACTIONS_TABLE;
Copy link
Contributor

Choose a reason for hiding this comment

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

some parts import static is the beginning and some parts is in last part, we should use one approach for import style. Old folio documenation says static should be in the beginning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to me. I was just letting my editor figuring it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

related bug (for google style)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it looks like the default in Intellij is to put static imports last. So I prefer not to change that at this point (if we wanted to, we would have to let all developers know that they have to change their settings).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also we should probably change that in a separate ticket if we want to do it. The current order is inconsistent, and this PR is already hard to read.

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer intellij idea default, but to be consitent I am using folio import style. I favour of moving towards to default intellij idea import style. In that way, no one have to change its import settings.

Copy link

sonarcloud bot commented Apr 19, 2024

@damien-git damien-git merged commit 82eb073 into master Apr 22, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants