Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.

1 change: 1 addition & 0 deletions .idea/encodings.xml

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

6 changes: 6 additions & 0 deletions account/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,11 @@
<artifactId>postgresql</artifactId>
<version>42.7.2</version>
</dependency>
<dependency>
<groupId>br.all</groupId>
<artifactId>shared</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import br.all.application.user.create.RegisterUserAccountService.RequestModel
import br.all.application.user.create.RegisterUserAccountService.ResponseModel
import br.all.application.user.repository.UserAccountRepository
import br.all.application.user.repository.toDto
import br.all.domain.shared.user.Email
import br.all.domain.user.*

class RegisterUserAccountServiceImpl(private val repository: UserAccountRepository) : RegisterUserAccountService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fun UserAccount.toDto() = UserAccountDto(
id.value(),
accountCredentials.username.value,
accountCredentials.password,
email.value,
email.email,
country.value,
affiliation,
createdAt,
Expand Down

This file was deleted.

66 changes: 0 additions & 66 deletions account/src/main/kotlin/br/all/domain/user/Email.kt

This file was deleted.

1 change: 1 addition & 0 deletions account/src/main/kotlin/br/all/domain/user/UserAccount.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package br.all.domain.user

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

Expand Down
4 changes: 2 additions & 2 deletions account/src/main/kotlin/br/all/domain/user/Username.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package br.all.domain.user
import br.all.domain.shared.ddd.Notification
import br.all.domain.shared.ddd.ValueObject

data class Username(val value: String) : ValueObject (){
data class Username(val value: String) : ValueObject(){

init {
val notification = validate()
Expand All @@ -16,6 +16,6 @@ data class Username(val value: String) : ValueObject (){
notification.addError("Username must not be blank!")
else if (!value.matches( Regex("[a-zA-Z0-9-_]*")))
notification.addError("Username must contain only letters and numbers, dashes and underscores!")
return notification;
return notification
}
}
20 changes: 11 additions & 9 deletions account/src/test/kotlin/br/all/domain/user/UserAccountTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package br.all.domain.user

import br.all.domain.shared.user.Email
import io.github.serpro69.kfaker.Faker
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Tag
import java.time.LocalDateTime
import java.util.UUID
Expand Down Expand Up @@ -45,27 +46,27 @@ class UserAccountTest{
@Test
fun `should create account credentials with default values`(){
val user = createUser()
assertEquals(user.accountCredentials.refreshToken, null)
assertTrue(user.accountCredentials.isCredentialsNonExpired)
assertTrue(user.accountCredentials.isAccountNonExpired)
assertTrue(user.accountCredentials.isAccountNonLocked)
assertTrue(user.accountCredentials.isEnabled)
Assertions.assertEquals(user.accountCredentials.refreshToken, null)
Assertions.assertTrue(user.accountCredentials.isCredentialsNonExpired)
Assertions.assertTrue(user.accountCredentials.isAccountNonExpired)
Assertions.assertTrue(user.accountCredentials.isAccountNonLocked)
Assertions.assertTrue(user.accountCredentials.isEnabled)
}

@Test
fun `should change username in account credentials`(){
val user = createUser()
val username = Username("new_name")
user.changeUsername(username)
assertEquals(user.accountCredentials.username, username)
Assertions.assertEquals(user.accountCredentials.username, username)
}

@Test
fun `should change password in account credentials`(){
val user = createUser()
val password = "new_password"
user.changePassword(password)
assertEquals(user.accountCredentials.password, password)
Assertions.assertEquals(user.accountCredentials.password, password)
}

private fun createUser(
Expand All @@ -79,6 +80,7 @@ class UserAccountTest{
authorities: Set<Authority> = setOf(Authority.USER)
) = UserAccount(
UserAccountId(id),
createdAt, email, country, affiliation, username, password, authorities)
createdAt, email, country, affiliation, username, password, authorities
)

}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<module>web</module>
<module>account</module>
<module>scas</module>
<module>shared</module>
</modules>

<parent>
Expand Down
6 changes: 6 additions & 0 deletions review/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>br.all</groupId>
<artifactId>shared</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-annotations-jakarta -->
<dependency>
<groupId>io.swagger.core.v3</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package br.all.domain.model.protocol

import br.all.domain.shared.ddd.Notification
import br.all.domain.shared.ddd.ValueObject
import jakarta.persistence.Embeddable

data class Criterion internal constructor(
data class Criterion(
val description: String,
val type: CriterionType,
) : ValueObject() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package br.all.domain.model.protocol

import br.all.domain.shared.ddd.Entity
import br.all.domain.model.question.QuestionId
import br.all.domain.model.review.SystematicStudyId
import br.all.domain.shared.ddd.Entity
import br.all.domain.shared.utils.exists
import br.all.domain.shared.valueobject.Language
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package br.all.domain.model.question

import br.all.domain.model.protocol.ProtocolId
import br.all.domain.model.review.SystematicStudyId
import br.all.domain.model.study.Answer
import br.all.domain.shared.ddd.Notification
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package br.all.domain.model.question

import br.all.domain.model.protocol.ProtocolId
import br.all.domain.shared.ddd.Entity
import br.all.domain.model.review.SystematicStudyId
import br.all.domain.model.study.Answer
import br.all.domain.shared.ddd.Entity
import br.all.domain.shared.ddd.Notification
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package br.all.domain.model.question

import br.all.domain.shared.ddd.Identifier
import br.all.domain.shared.ddd.Notification
import java.rmi.server.UID
import java.util.UUID

@JvmInline
value class QuestionId(val value : UUID) : Identifier <UUID>{
value class QuestionId(val value : UUID) : Identifier<UUID> {
override fun validate() = Notification()
override fun value(): UUID = value
override fun toString() = value.toString()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.all.domain.model.review

import br.all.domain.model.user.ResearcherId
import br.all.domain.shared.ddd.Entity
import br.all.domain.model.user.ResearcherId
import br.all.domain.shared.ddd.Notification
import br.all.domain.shared.utils.exists
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package br.all.domain.model.search

import br.all.domain.shared.ddd.Entity
import br.all.domain.model.protocol.SearchSource
import br.all.domain.model.user.ResearcherId
import br.all.domain.model.review.SystematicStudyId
import br.all.domain.shared.ddd.Entity
import br.all.domain.shared.ddd.Notification
import java.time.LocalDateTime
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import br.all.domain.shared.ddd.Notification
import java.util.*

@JvmInline
value class SearchSessionID(val value: UUID) : Identifier <UUID>{
value class SearchSessionID(val value: UUID) : Identifier<UUID> {

init {
val notification = validate()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package br.all.domain.model.study

import br.all.domain.model.protocol.Criterion
import br.all.domain.shared.ddd.Entity
import br.all.domain.model.protocol.Criterion
import br.all.domain.model.review.SystematicStudyId
import br.all.domain.model.search.SearchSessionID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package br.all.domain.model.study

import br.all.domain.shared.ddd.Identifier
import br.all.domain.shared.ddd.Notification
import java.util.UUID
import javax.swing.LookAndFeel

@JvmInline
value class StudyReviewId(val value: Long) : Identifier <Long>{
value class StudyReviewId(val value: Long) : Identifier<Long> {

init {
val notification = validate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import br.all.domain.shared.ddd.Notification
import java.util.*

@JvmInline
value class ResearcherId(val value : UUID ) : Identifier <UUID> {
value class ResearcherId(val value : UUID ) : Identifier<UUID> {

override fun validate() = Notification()

Expand Down
13 changes: 0 additions & 13 deletions review/src/main/kotlin/br/all/domain/shared/ddd/Entity.kt

This file was deleted.

6 changes: 0 additions & 6 deletions review/src/main/kotlin/br/all/domain/shared/ddd/Identifier.kt

This file was deleted.

13 changes: 0 additions & 13 deletions review/src/main/kotlin/br/all/domain/shared/ddd/Notification.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package br.all.domain.shared.utils

import br.all.domain.shared.ddd.Notification
import br.all.domain.shared.ddd.ValueObject
import kotlin.text.iterator

data class Phrase(private val text: String) : ValueObject() {
init {
Expand Down
7 changes: 1 addition & 6 deletions scas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<!-- <testSourceDirectory>src/test/kotlin</testSourceDirectory>-->
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
Expand Down Expand Up @@ -78,11 +78,6 @@
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>br.all</groupId>
<artifactId>review</artifactId>
Expand Down
Loading
Loading