Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
e043f92
feat: add new patch profile presenter
matheusspacifico Aug 9, 2025
e97b072
feat: add new patch profile service
matheusspacifico Aug 9, 2025
7ace4b7
wip: implement patch user profile service
matheusspacifico Aug 11, 2025
a2bb129
Merge branch 'dev' into patch-user
matheusspacifico Aug 12, 2025
51e2391
Merge branch 'dev' into patch-user
matheusspacifico Aug 13, 2025
dd9c766
chore: move account/text value object to shared
matheusspacifico Aug 13, 2025
98ca907
chore: delete review/text value object and move tests to shared module
matheusspacifico Aug 13, 2025
f7cbaae
chore: remove unneeded comments
matheusspacifico Aug 13, 2025
cb9f0a1
Merge pull request #179 from pet-ads/patch-user
matheusspacifico Aug 14, 2025
a91eaea
feat: add name value object
matheusspacifico Aug 14, 2025
69ea2af
refactor: allow apostrophe in name value object
matheusspacifico Aug 14, 2025
cdc5d70
refactor: move username value object to shared module
matheusspacifico Aug 14, 2025
47a3fc2
refactor!: add name attribute to user table and modify every needed file
matheusspacifico Aug 14, 2025
bddae34
fix: add apostrophes word in name value object error message
matheusspacifico Aug 14, 2025
402864f
test: add name and username value objects test
matheusspacifico Aug 14, 2025
673e63a
fix: change "keyword" to "keywords"
matheusspacifico Aug 18, 2025
aa50074
refactor: allow semicolon delimiter in bibtex keywords
matheusspacifico Aug 18, 2025
6f04d27
Merge branch 'dev' into update-user-table
matheusspacifico Aug 18, 2025
4387f7b
Merge pull request #185 from pet-ads/update-user-table
matheusspacifico Aug 19, 2025
ec5e0c6
refactor(doi): update regex to allow prefix
matheusspacifico Aug 20, 2025
7a3465e
refactor(bib): allow singular keyword alongside plural keywords
matheusspacifico Aug 20, 2025
35350e9
fix(bib): properly formating doi
matheusspacifico Aug 20, 2025
3f01525
refactor(doi): add more valid doi url in regex
matheusspacifico Aug 20, 2025
ffa5aa5
test: change data factory to use first name for username
matheusspacifico Aug 20, 2025
269308b
fix: add missing name attribute to restful user profile presenter
matheusspacifico Aug 23, 2025
55fc08b
test: add missing name parameter at retrieve user profile tests
matheusspacifico Aug 25, 2025
cc5785b
feat: add pick many question class
matheusspacifico Aug 25, 2025
c74bdc4
feat: add pick many building option to question builder
matheusspacifico Aug 25, 2025
662017c
feat: update question mapper to allow pick many questions
matheusspacifico Aug 25, 2025
122819d
feat: add pick many questions to question service
matheusspacifico Aug 25, 2025
268abf9
test: add pick many dto options to question test data factory
matheusspacifico Aug 25, 2025
0079fbd
test: add pick many question option to create find and update tests
matheusspacifico Aug 25, 2025
d1bb4ea
feat: add pick many question option to link factory
matheusspacifico Aug 25, 2025
4765ca8
feat: update all question restful presenter to allow pick many
matheusspacifico Aug 25, 2025
0c56e30
feat: add create pick many question endpoints for extraction and rob
matheusspacifico Aug 25, 2025
6a51f83
fix: fix pick many endpoint returning the wrong requestion type in json
matheusspacifico Aug 25, 2025
2514b98
fix: fix code and description get question response model field being…
matheusspacifico Aug 25, 2025
9fde190
chore: mock two pick many questions into web application
matheusspacifico Aug 26, 2025
78d391d
feat: implement answering pick many question
matheusspacifico Aug 26, 2025
5e530bf
chore: add pick many to dictionary
matheusspacifico Aug 26, 2025
28f8038
refactor: add pick many options guard clause
matheusspacifico Aug 26, 2025
cd12110
refactor: add error catching when building a question
matheusspacifico Aug 26, 2025
348c292
test: add new invalid entries tests for update question service
matheusspacifico Aug 26, 2025
c62ea3d
test: add new invalid entries tests for create question service
matheusspacifico Aug 26, 2025
bf780b9
test: add pick many value object tests
matheusspacifico Aug 26, 2025
5ef4f02
fix: add missing return statement
matheusspacifico Aug 26, 2025
66448c1
test: add test data for pick many controller tests
matheusspacifico Aug 26, 2025
3eef601
test: add new pick many controller tests
matheusspacifico Aug 26, 2025
3079503
test: add test data for answering pick many questions
matheusspacifico Aug 26, 2025
03aa108
test: add more tests for answer service
matheusspacifico Aug 26, 2025
13d846f
chore: add custom spring startup banner
matheusspacifico Aug 26, 2025
7607cee
Merge pull request #188 from pet-ads/pick-many
matheusspacifico Aug 27, 2025
8c423c2
refactor: adapt protocol stage service to new modularization
matheusspacifico Aug 29, 2025
3a3d2aa
test: adapt protocol stage tests to new modularization
matheusspacifico Aug 29, 2025
03340a5
fix: fix service crash when parsing dto with a blank title
matheusspacifico Aug 29, 2025
b0a0988
Merge pull request #191 from pet-ads/refactor/protocol-controller
matheusspacifico Sep 2, 2025
7f0aed4
feat: add objectives field to SystematicStudy with validation
ericksgmes Sep 2, 2025
268271e
feat: add objectives field to CreateSystematicStudyService request model
ericksgmes Sep 2, 2025
1de42e7
feat: add objectives field to SystematicStudyDto
ericksgmes Sep 2, 2025
56e67ed
feat: map objectives field in SystematicStudyMapper
ericksgmes Sep 2, 2025
a31da0b
feat: include objectives field in CreateSystematicReviewExampleService
ericksgmes Sep 2, 2025
07b2e49
feat: add objectives field to createReview link in LinksFactory
ericksgmes Sep 2, 2025
59ee464
feat: add objectives field to PostRequest and map to RequestModel
ericksgmes Sep 2, 2025
7be29af
feat: map objectives field in SystematicStudyDbMapper
ericksgmes Sep 2, 2025
50e9b04
feat: add objectives field to SystematicStudyDocument
ericksgmes Sep 2, 2025
14772a5
test: include objectives field in test data for FindProtocolStageServ…
ericksgmes Sep 3, 2025
dc9592e
test: include objectives field in test data for FindProtocolStageServ…
ericksgmes Sep 3, 2025
70d67ef
test: add objectives field to test cases in SystematicStudyTest
ericksgmes Sep 3, 2025
87cc5c3
test: include objectives field in TestDataFactory
ericksgmes Sep 3, 2025
30c3707
test: update SystematicStudyTest to validate objectives field
ericksgmes Sep 3, 2025
1ff93ae
test: enhance TestDataFactory to handle objectives in request creation
ericksgmes Sep 3, 2025
23a834e
fix: remove comma from mocked pick many question
matheusspacifico Sep 3, 2025
68dc4b2
feat: add single user repository method that returns profile and cred…
matheusspacifico Sep 4, 2025
b05dbd6
test: add full user dto to test data factory
matheusspacifico Sep 4, 2025
d1ba8c4
refactor: change retrieve user profile service to use new repository …
matheusspacifico Sep 4, 2025
b67b417
test: change retrieve user profile test to use new repository method
matheusspacifico Sep 4, 2025
c8ffecc
refactor: add invalid entries data class to patch user response model
matheusspacifico Sep 4, 2025
1da15da
wip: implement patch user profile service
matheusspacifico Sep 4, 2025
d4f6fbe
build(security): enable an extra cors localhost port
matheusspacifico Sep 6, 2025
07f5b37
Merge branch 'dev' into patch-user-profile
matheusspacifico Sep 6, 2025
5d93392
Merge branch 'dev' into feat-objectives-systematic-study
matheusspacifico Sep 6, 2025
6fae019
refactor(patch-profile): create helper function to increase readability
matheusspacifico Sep 9, 2025
c5bb75f
feat(patch-profile): add restful presenter
matheusspacifico Sep 9, 2025
213fbfe
feat(patch-profile): add a new user endpoint method
matheusspacifico Sep 9, 2025
95d3e63
fix(user-controller): typos
matheusspacifico Sep 9, 2025
57133ab
refactor(patch-profile): add request model for patching user profile
matheusspacifico Sep 9, 2025
bfbbf2f
test(patch-profile): add unit tests for PatchUserProfileServiceImpl
matheusspacifico Sep 9, 2025
357c8ca
build: add swagger dependency for account module
matheusspacifico Sep 10, 2025
aaf0be1
feat: add missing swagger schema tag to account module services
matheusspacifico Sep 10, 2025
d2b1e57
refactor(protocol-controller): update base path to include /api/v1
matheusspacifico Sep 11, 2025
526411f
Merge pull request #193 from pet-ads/patch-user-profile
matheusspacifico Sep 11, 2025
1973927
Merge branch 'dev' into feat-objectives-systematic-study
matheusspacifico Sep 11, 2025
d1c9c7e
test(protocol-controller): update URLs to include /api/v1 in tests
matheusspacifico Sep 13, 2025
8950a98
refactor(protocol-service): change protocol goal to systematic study …
matheusspacifico Sep 13, 2025
0342bbe
refactor(converters): improve validation and error handling for BibTe…
matheusspacifico Sep 13, 2025
0e2565c
refactor(bibtex-converter): enhance regex patterns for entry type and…
matheusspacifico Sep 13, 2025
6a962ea
refactor(bib-converter): revert exception handling for nullable allow…
matheusspacifico Sep 13, 2025
d14c25b
feat: add specific exceptions for bib service
matheusspacifico Sep 16, 2025
2a5ccd5
refactor(bibtex-service): improve field parsing and add detailed erro…
matheusspacifico Sep 16, 2025
b7ee070
test(bibtex-service): replace IllegalArgumentException with BibtexPar…
matheusspacifico Sep 16, 2025
abaa2d8
test(bibtex-testdata): add missing commas to BibTeX test data entries
matheusspacifico Sep 16, 2025
ebdaf05
feat(ris-parser): add specific exceptions for RIS parsing
matheusspacifico Sep 16, 2025
98ace19
refactor(bibtex-exceptions): rename exception classes for consistency…
matheusspacifico Sep 16, 2025
a03e3e4
refactor(ris-converter-service): improve field parsing, error handlin…
matheusspacifico Sep 16, 2025
d73648d
test(ris-converter-service): replace IllegalArgumentException with Ri…
matheusspacifico Sep 16, 2025
7760239
refactor(ris-converter-service): fix regex patterns for entry and tit…
matheusspacifico Sep 16, 2025
e9be97e
test(ris-testdata, bibtex-testdata): update test data with corrected …
matheusspacifico Sep 16, 2025
aa10c20
test(ris, bibtex-converter-service): disable invalid DOI tests and al…
matheusspacifico Sep 16, 2025
794bf86
test(bibtex-testdata): add missing author fields to test data entries
matheusspacifico Sep 16, 2025
3e44678
feat(update-systematic-study): add support for objectives field in up…
matheusspacifico Sep 16, 2025
5f6de41
Merge pull request #194 from pet-ads/refactor-bib-ris-converter
matheusspacifico Sep 16, 2025
88952a0
Merge pull request #195 from pet-ads/feat-objectives-systematic-study
matheusspacifico Sep 16, 2025
5287249
feat: add UNKNOWN study type for consistency
matheusspacifico Sep 18, 2025
537272f
refactor(bib-parser): make bibtex id the only obligatory field and re…
matheusspacifico Sep 18, 2025
611df7f
test(bib-parser): remove old tests that lost their meaning
matheusspacifico Sep 18, 2025
3843f0b
chore(bib-parser): change error message
matheusspacifico Sep 18, 2025
908f97d
chore(bib-parser): edit bibtex test data to invalidate some bibtex
matheusspacifico Sep 18, 2025
efe1684
refactor(study): now study allow blank title, authors, year and venue
matheusspacifico Sep 18, 2025
f8e5c92
chore(ris-parser): invalidate some ris from test data
matheusspacifico Sep 18, 2025
d1e4f89
refactor(ris-parser): make the title the only obligatory field and re…
matheusspacifico Sep 18, 2025
acea51c
test(ris-parser): adapt tests to satisfy new parser logic
matheusspacifico Sep 18, 2025
ad9190d
feat(change-account-password): introduce service and presenter interf…
matheusspacifico Sep 24, 2025
292e928
chore(change-account-password): add missing service method params
matheusspacifico Sep 25, 2025
6b62bb9
feat(security): add PasswordEncoderPort abstraction and its adapter i…
matheusspacifico Sep 25, 2025
be6f498
chore(change-account-password): remove now unneeded comment
matheusspacifico Sep 25, 2025
9293a9f
feat(change-account-password): add repository method to update user p…
matheusspacifico Sep 25, 2025
7039a72
feat(change-account-password): implement ChangeAccountPasswordService…
matheusspacifico Sep 25, 2025
e5034ac
feat(change-account-password): add request and restful presenter for …
matheusspacifico Sep 25, 2025
fd3befe
feat(change-account-password): register ChangeAccountPasswordServiceI…
matheusspacifico Sep 25, 2025
5849cef
feat(change-account-password): add endpoint to update user account pa…
matheusspacifico Sep 25, 2025
cd02117
feat(change-account-password): add OpenAPI schema annotation to Respo…
matheusspacifico Sep 25, 2025
c3e70a0
feat(change-account-password): add logout functionality after passwor…
matheusspacifico Sep 25, 2025
cac0368
test(change-account-password): add unit tests for ChangeAccountPasswo…
matheusspacifico Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/dictionaries/project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions account/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.31</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
package br.all.application.user.create

import io.swagger.v3.oas.annotations.media.Schema
import java.util.UUID

interface RegisterUserAccountService {

fun register(presenter: RegisterUserAccountPresenter, request: RequestModel)

data class RequestModel(
val name: String,
val username: String,
val password: String,
val email: String,
val country: String,
val affiliation: String,
)

@Schema(name = "RegisterUserAccountResponseModel", description = "Response model for Register User Account Service")
data class ResponseModel(
val id: UUID,
val username: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import br.all.application.user.repository.UserAccountRepository
import br.all.application.user.repository.toDto
import br.all.domain.shared.exception.UniquenessViolationException
import br.all.domain.shared.user.Email
import br.all.domain.shared.user.Name
import br.all.domain.shared.user.Text
import br.all.domain.shared.user.Username
import br.all.domain.user.*

class RegisterUserAccountServiceImpl(private val repository: UserAccountRepository) : RegisterUserAccountService {
Expand All @@ -20,12 +23,14 @@ class RegisterUserAccountServiceImpl(private val repository: UserAccountReposito
if (presenter.isDone()) return

val userAccountId = UserAccountId()
val name = Name(request.name)
val username = Username(request.username)
val email = Email(request.email)
val country = Text(request.country)

val userAccount = UserAccount(
id = userAccountId,
name = name,
username = username,
password = request.password,
email = email,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package br.all.application.user.find
import io.swagger.v3.oas.annotations.media.Schema
import java.util.UUID

interface RetrieveUserProfileService {
Expand All @@ -8,8 +9,10 @@ interface RetrieveUserProfileService {
val userId: UUID
)

@Schema(name = "RetrieveUserProfileService", description = "Response model for Retrieve User Profile Service")
data class ResponseModel(
val userId: UUID,
val name: String,
val username: String,
val email: String,
val affiliation: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ import br.all.application.user.find.RetrieveUserProfileService.ResponseModel
import br.all.application.user.repository.UserAccountRepository

class RetrieveUserProfileServiceImpl(
private val userAccountRepository: UserAccountRepository
private val repository: UserAccountRepository
) : RetrieveUserProfileService {
override fun retrieveData(
presenter: RetrieveUserProfilePresenter,
request: RequestModel
) {
val userProfile = userAccountRepository.loadUserProfileById(request.userId)
if (userProfile == null) {
val userAccount = repository.loadFullUserAccountById(request.userId)
if (userAccount == null) {
presenter.prepareFailView(NoSuchElementException("User with id ${request.userId} doesn't exist!"))
return
}

val userCredentials = userAccountRepository.loadCredentialsById(request.userId)
if (userCredentials == null) {
presenter.prepareFailView(NoSuchElementException("Account credentials with id ${request.userId} doesn't exist!"))
return
}


val profile = ResponseModel(
userId = userProfile.id,
username = userCredentials.username,
email = userProfile.email,
affiliation = userProfile.affiliation,
country = userProfile.country,
authorities = userCredentials.authorities
userId = userAccount.id,
name = userAccount.name,
username = userAccount.username,
email = userAccount.email,
affiliation = userAccount.affiliation,
country = userAccount.country,
authorities = userAccount.authorities
)

presenter.prepareSuccessView(profile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import java.util.*

data class UserAccountDto(
val id: UUID,
val name: String,
val username: String,
val password: String,
val email: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import br.all.domain.user.UserAccount

fun UserAccount.toDto() = UserAccountDto(
id.value(),
name.value,
accountCredentials.username.value,
accountCredentials.password,
email.email,
Expand All @@ -17,4 +18,3 @@ fun UserAccount.toDto() = UserAccountDto(
accountCredentials.isCredentialsNonExpired,
accountCredentials.isEnabled
)

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ interface UserAccountRepository {
fun existsByUsername(username: String): Boolean
fun deleteById(id: UUID)
fun loadUserProfileById(id: UUID): UserProfileDto?
fun loadFullUserAccountById(id: UUID): UserAccountDto?
fun updatePassword(id: UUID, newHashedPassword: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import java.util.UUID

data class UserProfileDto(
val id: UUID,
val name: String,
val email: String,
val country: String,
val affiliation: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package br.all.application.user.update

import br.all.application.user.update.ChangeAccountPasswordService.ResponseModel
import br.all.domain.shared.presenter.GenericPresenter

interface ChangeAccountPasswordPresenter : GenericPresenter<ResponseModel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package br.all.application.user.update

import io.swagger.v3.oas.annotations.media.Schema
import java.util.UUID

interface ChangeAccountPasswordService {
fun changePassword(presenter: ChangeAccountPasswordPresenter, request: RequestModel)

data class RequestModel(
val userId: UUID,
val oldPassword: String,
val newPassword: String,
val confirmPassword: String
)

@Schema(name = "ChangeAccountPasswordServiceResponseModel", description = "Response model for Change Account Password Service")
data class ResponseModel(
val userId: UUID
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package br.all.application.user.update

import br.all.application.user.repository.UserAccountRepository
import br.all.domain.shared.service.PasswordEncoderPort

class ChangeAccountPasswordServiceImpl(
private val repository: UserAccountRepository,
private val encoder: PasswordEncoderPort
) : ChangeAccountPasswordService {
override fun changePassword(
presenter: ChangeAccountPasswordPresenter,
request: ChangeAccountPasswordService.RequestModel
) {
val userCredentials = repository.loadCredentialsById(request.userId)
if (userCredentials == null) {
presenter.prepareFailView(NoSuchElementException("User with id ${request.userId} doesn't exist!"))
return
}

if (!encoder.matches(request.oldPassword, userCredentials.password)) {
presenter.prepareFailView(IllegalArgumentException("Invalid old password provided!"))
return
}

if (request.newPassword != request.confirmPassword) {
presenter.prepareFailView(IllegalArgumentException("Confirm password does not match new password!"))
return
}

if (encoder.matches(request.newPassword, userCredentials.password)) {
presenter.prepareFailView(IllegalArgumentException("New password cannot be the same as the old password!"))
return
}

val newHashedPassword = encoder.encode(request.newPassword)

try {
repository.updatePassword(request.userId, newHashedPassword)
presenter.prepareSuccessView(ChangeAccountPasswordService.ResponseModel(
request.userId,
))
} catch (e: Exception) {
presenter.prepareFailView(e)
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package br.all.application.user.update

import br.all.domain.shared.presenter.GenericPresenter
import br.all.application.user.update.PatchUserProfileService.ResponseModel

interface PatchUserProfilePresenter : GenericPresenter<ResponseModel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package br.all.application.user.update

import io.swagger.v3.oas.annotations.media.Schema
import java.util.UUID

interface PatchUserProfileService {
fun patchProfile(presenter: PatchUserProfilePresenter, request: RequestModel)

data class RequestModel(
val userId: UUID,
val name: String,
val email: String,
val affiliation: String,
val country: String
)

@Schema(name = "PatchUserProfileServiceResponseModel", description = "Response model for Patch User Profile Service")
data class ResponseModel(
val userId: UUID,
val name: String,
val username: String,
val email: String,
val affiliation: String,
val country: String,
val invalidEntries: List<InvalidEntry>
)

data class InvalidEntry(
val field: String,
val entry: String,
val message: String
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package br.all.application.user.update

import br.all.application.user.repository.UserAccountRepository
import br.all.application.user.update.PatchUserProfileService.RequestModel
import br.all.application.user.update.PatchUserProfileService.ResponseModel
import br.all.application.user.update.PatchUserProfileService.InvalidEntry
import br.all.domain.shared.user.Email
import br.all.domain.shared.user.Name
import br.all.domain.shared.user.Text

class PatchUserProfileServiceImpl(
private val repository: UserAccountRepository
) : PatchUserProfileService {
override fun patchProfile(
presenter: PatchUserProfilePresenter,
request: RequestModel
) {
val userAccount = repository.loadFullUserAccountById(request.userId)
if (userAccount == null) {
presenter.prepareFailView(NoSuchElementException("User with id ${request.userId} doesn't exist!"))
return
}

val invalidEntries = mutableListOf<InvalidEntry>()

val updatedName = validateField("name", request.name, userAccount.name, invalidEntries) { Name(it).value }
val updatedEmail = validateField("email", request.email, userAccount.email, invalidEntries) { Email(it).email }
val updatedCountry = validateField("country", request.country, userAccount.country, invalidEntries) { Text(it).value }
val updatedAffiliation = validateField("affiliation", request.affiliation, userAccount.affiliation, invalidEntries) { Text(it).value }

val updatedUserAccount = userAccount.copy(
name = updatedName,
email = updatedEmail,
country = updatedCountry,
affiliation = updatedAffiliation
)

val responseModel = ResponseModel(
userId = request.userId,
name = updatedName,
username = userAccount.username,
email = updatedEmail,
affiliation = updatedAffiliation,
country = updatedCountry,
invalidEntries = invalidEntries
)

repository.save(updatedUserAccount)
presenter.prepareSuccessView(responseModel)
}

private fun validateField(
fieldName: String,
newValue: String,
currentValue: String,
errors: MutableList<InvalidEntry>,
validationLogic: (String) -> String
): String {
return try {
validationLogic(newValue)
} catch (e: Exception) {
errors.add(InvalidEntry(
field = fieldName,
entry = newValue,
message = e.message ?: "Invalid $fieldName format"
))

currentValue
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package br.all.domain.user

import br.all.domain.shared.user.Username

class AccountCredentials (
val username: Username,
val password: String,
Expand Down
4 changes: 4 additions & 0 deletions account/src/main/kotlin/br/all/domain/user/UserAccount.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package br.all.domain.user

import br.all.domain.shared.ddd.Entity
import br.all.domain.shared.user.Email
import br.all.domain.shared.user.Name
import br.all.domain.shared.user.Text
import br.all.domain.shared.user.Username
import java.time.LocalDateTime
import java.util.UUID

class UserAccount(
id: UserAccountId,
var name: Name,
val createdAt: LocalDateTime = LocalDateTime.now(),
var email: Email,
var country: Text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import java.util.*
@Table(name = "USER_ACCOUNTS")
class UserAccountEntity (
@Id var id: UUID,
@Column(nullable = false)
var name: String,
@OneToOne( mappedBy = "userAccount", cascade = [CascadeType.ALL])
@PrimaryKeyJoinColumn
var accountCredentialsEntity: AccountCredentialsEntity,
Expand Down
Loading