feat(EM-31): Extract ftgo-common-jpa and ftgo-domain as Versioned Shared Libraries#47
Open
devin-ai-integration[bot] wants to merge 1 commit intofeat/microservices-migration-v2from
Conversation
…red libraries
- Populate libs/ftgo-common-jpa/ with JPA utilities:
- MoneyConverter (JPA AttributeConverter for Money <-> BigDecimal)
- JpaConfiguration (Spring config for EntityScan/JpaRepositories)
- orm.xml updated to Jakarta Persistence 3.1 with com.ftgo.common package
- Unit tests for MoneyConverter
- Populate libs/ftgo-domain/ with domain model and DDD infrastructure:
- DomainEvent, DomainEventPublisher, ResultWithEvents (DDD base types)
- All domain entities migrated: Order, Restaurant, Consumer, Courier
- Value objects: MenuItem, RestaurantMenu, OrderLineItem, OrderLineItems,
DeliveryInformation, PaymentInformation, Action, Plan, etc.
- Repositories: OrderRepository, RestaurantRepository, ConsumerRepository,
CourierRepository
- Unit tests for key classes
- Package migration: net.chrisrichardson.ftgo -> com.ftgo
- javax.persistence -> jakarta.persistence namespace migration
- Replaced commons-lang with java.util.Objects
- Java 17, Spring Boot 3.2.5, Jakarta Persistence 3.1
- README documentation for both libraries
Co-Authored-By: Alex Baker <alexandercommander453@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(EM-31): Extract ftgo-common-jpa and ftgo-domain as Versioned Shared Libraries
Summary
Populates the scaffolded
libs/ftgo-common-jpa/andlibs/ftgo-domain/directories with real source migrated from the monolith'sftgo-common-jpa/andftgo-domain/modules.libs/ftgo-common-jpa (
com.ftgo.common.jpa):MoneyConverter— JPA@Converter(autoApply=true)forMoney ↔ BigDecimalJpaConfiguration— Spring@Configurationenabling entity scan and JPA repositoriesMETA-INF/orm.xml— updated to Jakarta Persistence 3.1 namespace, class refs tocom.ftgo.commonlibs/ftgo-domain (
com.ftgo.domain):DomainEvent,DomainEventPublisher,ResultWithEventsOrder,Restaurant,Consumer,Courier(+ all value objects, repositories, enums, config)ftgo-domain/copied with package + namespace migrationCross-cutting migrations applied:
net.chrisrichardson.ftgo→com.ftgojavax.persistence→jakarta.persistenceorg.apache.commons.langreflection builders →java.util.ObjectsUnit tests added for
MoneyConverter,DomainEventPublisher,ResultWithEvents,MenuItem,OrderState,LineItemQuantityChange.Review & Testing Checklist for Human
MoneyConverter+orm.xmlconflict: Both define howMoneyis persisted —orm.xmlmaps it as an embeddable, whileMoneyConverter(autoApply=true) treats it as a converted single-column type. Verify these don't conflict at runtime; you may need to remove one or setautoApply=false.DomainEventPublisher.subscribe()ignores theeventTypeparameter: TheClass<T> eventTypearg is accepted but never used for filtering —publish()broadcasts to all handlers with an unchecked cast. This will causeClassCastExceptionif heterogeneous event types are subscribed. Verify this is intentional or fix the filtering.build.gradlefiles hardcode versions (3.2.5,5.10.2) instead of usinggradle/libs.versions.toml. Consider aligning with project conventions.Order.revise()logic: Lineif (change.newOrderTotal.isGreaterThanOrEqual(orderMinimum))throwsOrderMinimumNotMetException— this seems inverted (should throw when BELOW minimum). This is copied from monolith, so it's pre-existing, but worth verifying.Test Plan
./gradlew :libs:ftgo-common-jpa:test :libs:ftgo-domain:testDomainEventPublisherbehaves correctly with multiple event typesNotes
settings.gradlewas NOT modified per instructions — libs have their ownsettings.gradlefor standalone buildsftgo-*/src/were modified