Skip to content

feat(EM-32): Extract and version ftgo-common shared library#43

Open
devin-ai-integration[bot] wants to merge 1 commit intofeat/microservices-migration-v2from
devin/1771604443-em32-extract-ftgo-common
Open

feat(EM-32): Extract and version ftgo-common shared library#43
devin-ai-integration[bot] wants to merge 1 commit intofeat/microservices-migration-v2from
devin/1771604443-em32-extract-ftgo-common

Conversation

@devin-ai-integration
Copy link

feat(EM-32): Extract and version ftgo-common shared library

Summary

Extracts the monolith's ftgo-common module into libs/ftgo-common/ as a standalone, versioned shared library targeting Java 17 / Spring Boot 3.2 / Jakarta namespace.

What changed:

  • Copied all 8 source files from ftgo-common/src/ into libs/ftgo-common/src/ under the new com.ftgo.common package
  • Migrated javax.persistencejakarta.persistence and javax.annotationjakarta.annotation
  • Replaced commons-lang EqualsBuilder/HashCodeBuilder/ToStringBuilder in Money.java with java.util.Objects
  • Rewrote build.gradle with explicit dependencies (Jakarta Persistence 3.1, Jackson 2.15, Spring Boot 3.2, JUnit 5)
  • Added settings.gradle so the library can build independently (gradle build from libs/ftgo-common/)
  • Added unit tests for Money, Address, PersonName, UnsupportedStateTransitionException, and MoneyModule serialization
  • Added README.md documenting the library API

No monolith source files or root settings.gradle were modified.

Review & Testing Checklist for Human

  • Money.equals() uses BigDecimal.equals() which is scale-sensitive (new BigDecimal("10.0") ≠ new BigDecimal("10")). This matches the original behavior but could be a latent bug for consumers—confirm this is acceptable or consider compareTo == 0.
  • MoneyModule uses deprecated ctxt.mappingException() (Jackson 2.15 deprecation warning emitted during build). Verify this is acceptable or should be replaced with ctxt.handleUnexpectedToken().
  • settings.gradle coexistence: A standalone settings.gradle was added for independent buildability. When this module is eventually wired into the root Gradle build, confirm this won't conflict—may need to be removed or conditioned at that point.
  • Address and PersonName lack equals/hashCode: Same as the original monolith, but as JPA embeddables/value objects this is a gap worth considering.
  • Recommended test plan: Clone the branch, run cd libs/ftgo-common && gradle build with JDK 17+ to verify compilation and all 19 tests pass. Spot-check that no monolith files under ftgo-common/ were modified.

Notes

  • Money.ZERO is not final—carried over from the original source
  • Dependency versions are hard-coded in build.gradle; a version catalog can be introduced in a follow-up when the root build is modernized
  • Library was verified building independently with Gradle 8.5 + JDK 17 (all tests green)

Link to Devin run: https://app.devin.ai/sessions/55ac098d3ebb428a9632461a5597df0d
Requested by: @abj453demo

- Copy all source files from ftgo-common/ to libs/ftgo-common/
- Migrate package from net.chrisrichardson.ftgo.common to com.ftgo.common
- Update JPA annotations from javax.persistence to jakarta.persistence
- Update javax.annotation to jakarta.annotation
- Replace commons-lang with java.util.Objects for equals/hashCode
- Update build.gradle with Java 17, Spring Boot 3.2, Jakarta Persistence 3.1
- Add settings.gradle for independent buildability
- Add unit tests for Money, PersonName, Address, UnsupportedStateTransitionException
- Add MoneySerializationTest for Jackson serialization/deserialization
- Add README documenting library API and usage

Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.

0 participants