Account infrastructure layer#193
Merged
scraft-official merged 4 commits intorelease/0.26from Jan 5, 2026
Merged
Conversation
Introduced AccountEntity, AccountEntityMeta, and AccountEntityRepository for JPA-based persistence of accounts. Added AccountEntityMapper for mapping between domain and infrastructure entities. Updated AccountRepositoryImpl to use the new infrastructure repository and interfaces, and made Account implement DomainEntity.
Updated AccountRepositoryImpl to use AccountEntityMapper for entity conversions and replaced String state parameters with EntityState in AccountEntityRepository methods. This improves type safety and streamlines entity mapping between domain and infrastructure layers.
Introduced @builder, @AllArgsConstructor (with @deprecated), and @tostring annotations to the Account class to reduce boilerplate and improve object construction and debugging.
Introduced a no-argument constructor to the Account class to support frameworks or tools that require a default constructor for instantiation.
NikodemCyrzan
approved these changes
Jan 5, 2026
scraft-official
added a commit
that referenced
this pull request
Jan 13, 2026
* Add infrastructure layer for Account entity Introduced AccountEntity, AccountEntityMeta, and AccountEntityRepository for JPA-based persistence of accounts. Added AccountEntityMapper for mapping between domain and infrastructure entities. Updated AccountRepositoryImpl to use the new infrastructure repository and interfaces, and made Account implement DomainEntity. * Refactor Account repository to use EntityState and mapper Updated AccountRepositoryImpl to use AccountEntityMapper for entity conversions and replaced String state parameters with EntityState in AccountEntityRepository methods. This improves type safety and streamlines entity mapping between domain and infrastructure layers. * Add Lombok annotations to Account class Introduced @builder, @AllArgsConstructor (with @deprecated), and @tostring annotations to the Account class to reduce boilerplate and improve object construction and debugging. * Add default constructor to Account class Introduced a no-argument constructor to the Account class to support frameworks or tools that require a default constructor for instantiation.
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.
This pull request introduces a full infrastructure layer for persisting and retrieving
Accountdomain objects using JPA, including entity definitions, mapping, and repository implementations. The changes establish a clear separation between the domain and infrastructure layers, enabling robust mapping and database operations for accounts.Infrastructure Layer Implementation for Account Persistence and Mapping:
Entity and Repository Definitions:
AccountEntityas a JPA entity representing accounts in the database, including fields for email, metadata, and timestamps. (backend/infrastructure/account/entity/AccountEntity.java)AccountEntityRepository, a JPA repository interface with custom queries for finding accounts by ID and email, filtered by entity state. (backend/infrastructure/account/entity/repository/AccountEntityRepository.java)AccountEntityMetato encapsulate versioned account metadata. (backend/infrastructure/account/entity/meta/AccountEntityMeta.java)Mapping Between Domain and Infrastructure:
AccountEntityMapperusing MapStruct to convert betweenAccountdomain objects andAccountEntityinfrastructure entities, including mapping for metadata. (backend/infrastructure/account/entity/mapper/AccountEntityMapper.java)Repository Implementation and Domain Integration:
AccountRepositoryImplto use the new JPA repository and mapper for all persistence operations, implementing methods to find accounts by ID/email and to save accounts. The class now implements a genericInfrastructureRepositoryinterface and uses constructor injection for dependencies. (backend/infrastructure/account/AccountRepositoryImpl.java)Accountclass to implement theDomainEntitymarker interface, aligning with the new infrastructure repository requirements. (domain/account/Account.java)