Skip to content

Conversation

@alberto-art3ch
Copy link
Contributor

@alberto-art3ch alberto-art3ch commented Feb 28, 2025

Description

Trigger business event (internal only) when new datatable entry was added to a loan. By default we dont need any listener to be implemented. This logic will make easier to implement custom logic in case a new datatable entry got created, updated or deleted.

FINERACT-2180

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per https://github.com/apache/fineract/#pull-requests

  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.

  • Create/update unit or integration tests for verifying the changes made.

  • Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.

  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes

  • Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)

FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@alberto-art3ch alberto-art3ch force-pushed the PS-2337-Backend-Trigger-internal-business-event-when-new-datatable-entry-was-added branch from a82b7c4 to 74d4fec Compare March 6, 2025 12:26

@Override
public Long getAggregateRootId() {
throw new UnsupportedOperationException("Unimplemented method 'getAggregateRootId'");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the entity id as aggregateRootId here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated


@Override
public Long getAggregateRootId() {
throw new UnsupportedOperationException("Unimplemented method 'getAggregateRootId'");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the entity id as aggregateRootId here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated


@Override
public Long getAggregateRootId() {
throw new UnsupportedOperationException("Unimplemented method 'getAggregateRootId'");
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the entity id as aggregateRootId here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Updated

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

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

Kindly see my review!

@alberto-art3ch alberto-art3ch force-pushed the PS-2337-Backend-Trigger-internal-business-event-when-new-datatable-entry-was-added branch from 74d4fec to 263a97c Compare March 7, 2025 15:43
@adamsaghy adamsaghy changed the title FINERACT-2180: Trigger (internal) business event when new datatable e… FINERACT-2180: Trigger (internal) business event when new datatable entry was added Mar 10, 2025
+ whereValue;

this.jdbcTemplate.update(sql); // NOSONAR
final Map<String, String> dataParams = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

@adamsaghy @alberto-art3ch Do we need to fetch the data from the datatable that we are trying to delete and include it in the event?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well.. good question...but i think it is fine..since this way we can make sure the downstream systems are notified and they have some extra information.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Map change as requested

private final EntityTables entityType;
private final Long entityId;
private final Long appTableId;
private final Map<String, String> data;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should have Map<String, Object> type instead of Map<String, String>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Map change as requested

@alberto-art3ch alberto-art3ch force-pushed the PS-2337-Backend-Trigger-internal-business-event-when-new-datatable-entry-was-added branch 2 times, most recently from a2b8a9a to dcffa3a Compare March 13, 2025 17:10
@alberto-art3ch alberto-art3ch force-pushed the PS-2337-Backend-Trigger-internal-business-event-when-new-datatable-entry-was-added branch from dcffa3a to d90d20b Compare March 13, 2025 17:14
Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

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

LGTM

@adamsaghy adamsaghy merged commit e1d8207 into apache:develop Mar 14, 2025
10 checks passed
@adamsaghy adamsaghy deleted the PS-2337-Backend-Trigger-internal-business-event-when-new-datatable-entry-was-added branch March 14, 2025 09:46
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