Skip to content

FINERACT-2701: support LocalDateTime for savings transactions - #6187

Open
AnvayKharb wants to merge 1 commit into
apache:developfrom
AnvayKharb:fix/FINERACT-2701-savings-transaction-localdatetime
Open

FINERACT-2701: support LocalDateTime for savings transactions#6187
AnvayKharb wants to merge 1 commit into
apache:developfrom
AnvayKharb:fix/FINERACT-2701-savings-transaction-localdatetime

Conversation

@AnvayKharb

@AnvayKharb AnvayKharb commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds support for LocalDateTime in Savings Account withdrawals and transfers while maintaining full backward compatibility with the existing LocalDate request format.

The implementation allows clients to continue sending yyyy-MM-dd requests unchanged while also accepting yyyy-MM-dd'T'HH:mm:ss for improved transaction date and time precision. Existing behavior for date-only requests is preserved, and the UnsupportedTemporalTypeException encountered when formatting transaction dates with time precision has been resolved.

Related Issues

Closes #FINERACT-2701

@AnvayKharb
AnvayKharb force-pushed the fix/FINERACT-2701-savings-transaction-localdatetime branch 3 times, most recently from 61a46fe to c62facb Compare July 27, 2026 16:18
@AnvayKharb
AnvayKharb force-pushed the fix/FINERACT-2701-savings-transaction-localdatetime branch from c62facb to 7215a56 Compare July 27, 2026 18:46
@IOhacker
IOhacker requested a review from adamsaghy July 28, 2026 16:26

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks weird at first...
Let me review a little deeper...

We should really not use LocalDateTime and mess with modifiers (Midnight...)

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
<changeSet author="fineract" id="1">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please dont use TIMESTAMP... use TIMESTAMP WITH TZ for postgres and DATETIME(6) for mysql

<addColumn tableName="m_savings_account_transaction">
<column name="transaction_datetime" type="TIMESTAMP"/>
</addColumn>
<addColumn tableName="m_account_transfer_transaction">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have transaction date for transfer and for savings transactions.

If the plan is to store a user provided TIME part as well, lets do it with timezone infomation and as a standalone field for the TIME only. transaction date + transaction time together can represent a more precise point in time... TZ informations are important to ensure correctness across timezones.

We are storing all date time and time in UTC.

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. I’m not keen on introducing a brand new field called TIMESTAMP (on the database side) and LocalDateTime (on the Java side). Instead, let’s use OffsetTime to ensure accurate timezone handling.

  2. The transaction date field already exists in the savings transaction and savings transfer entities, and it’s of type DATE. Do we really need a user-provided time part? Will this be different from the created date time (OffsetDateTime)?

If we do need a user-provided time part, let’s add a new field that stores as OffsetTime and is optional for backward compatibility.

  1. I suggest that we request the transaction date and transaction time as two separate fields. This way, we avoid supporting a single field with different data types.

  2. Let’s avoid using LocalDateTime and parsing to that data type in all places. Instead, the user should provide the time part with an offset TZ. Is this a viable option?

@AnvayKharb @IOhacker what do you think?

@AnvayKharb

Copy link
Copy Markdown
Contributor Author

Hi @adamsaghy Thanks for the detailed review. I understand your concerns. Using a separate optional transactionTime with timezone information while keeping the existing transactionDate sounds like a cleaner and more backward-compatible approach than introducing a LocalDateTime field. I'll wait for @IOhacker 's thoughts as well, and if we're aligned on this direction, I'll update the implementation accordingly.

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