Skip to content

feat: Added domain model builders and DSL#4

Merged
sh1sh4k1n9 merged 11 commits into
devfrom
ch3zych3z/model-builder
Apr 16, 2026
Merged

feat: Added domain model builders and DSL#4
sh1sh4k1n9 merged 11 commits into
devfrom
ch3zych3z/model-builder

Conversation

@ch3zych3z
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@sh1sh4k1n9 sh1sh4k1n9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как будто нужно еще вот эту штуку использовать. https://kotlinlang.org/docs/type-safe-builders.html#scope-control-dslmarker

У нас есть клэш по неймингу, так что нам актуально будто. Да и в целом для билдеров полезно

Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/group/ClassBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/model/task/Submission.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/group/ClassBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/task/ContestBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/task/ContestBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/task/ContestBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/group/ClassBuilder.kt Outdated
@ch3zych3z ch3zych3z marked this pull request as ready for review March 15, 2026 22:01
@ch3zych3z ch3zych3z enabled auto-merge (squash) March 15, 2026 22:01
@ch3zych3z ch3zych3z force-pushed the ch3zych3z/model-builder branch from b376020 to 9525e78 Compare March 15, 2026 22:05
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/group/ClassBuilder.kt Outdated
Comment thread testsys-domain/src/main/kotlin/tech/testsys/domain/builder/task/TaskBuilder.kt Outdated
@ch3zych3z ch3zych3z requested a review from sh1sh4k1n9 March 24, 2026 19:53
@ch3zych3z ch3zych3z force-pushed the ch3zych3z/model-builder branch from 987adb8 to 315534c Compare April 8, 2026 20:54
@sh1sh4k1n9 sh1sh4k1n9 force-pushed the ch3zych3z/model-builder branch from 315534c to 8f5efaf Compare April 8, 2026 22:10
@@ -0,0 +1,818 @@
package tech.testsys.domain.builder.api

Check warning

Code scanning / detekt

Too many functions inside a/an file/class/object/interface always indicate a violation of the single responsibility principle. Maybe the file/class/object/interface wants to manage too many things at once. Extract functionality which clearly belongs together. Warning test

File '/home/runner/work/testsys-app/testsys-app/testsys-domain/src/main/kotlin/tech/testsys/domain/builder/api/BuilderApi.kt' with '77' functions detected. Defined threshold inside files is set to '11'
@@ -0,0 +1,818 @@
package tech.testsys.domain.builder.api

import tech.testsys.domain.builder.group.*

Check warning

Code scanning / detekt

Wildcard imports should be replaced with imports using fully qualified class names. Wildcard imports can lead to naming conflicts. A library update can introduce naming clashes with your classes which results in compilation errors. Warning test

tech.testsys.domain.builder.group.* is a wildcard import. Replace it with fully qualified imports.
package tech.testsys.domain.builder.api

import tech.testsys.domain.builder.group.*
import tech.testsys.domain.builder.task.*

Check warning

Code scanning / detekt

Wildcard imports should be replaced with imports using fully qualified class names. Wildcard imports can lead to naming conflicts. A library update can introduce naming clashes with your classes which results in compilation errors. Warning test

tech.testsys.domain.builder.task.* is a wildcard import. Replace it with fully qualified imports.

import tech.testsys.domain.builder.group.*
import tech.testsys.domain.builder.task.*
import tech.testsys.domain.builder.user.*

Check warning

Code scanning / detekt

Wildcard imports should be replaced with imports using fully qualified class names. Wildcard imports can lead to naming conflicts. A library update can introduce naming clashes with your classes which results in compilation errors. Warning test

tech.testsys.domain.builder.user.* is a wildcard import. Replace it with fully qualified imports.
import tech.testsys.domain.builder.user.*
import tech.testsys.domain.builder.util.chooser.TaskDataChooser
import tech.testsys.domain.builder.util.lazify
import tech.testsys.domain.model.group.*

Check warning

Code scanning / detekt

Wildcard imports should be replaced with imports using fully qualified class names. Wildcard imports can lead to naming conflicts. A library update can introduce naming clashes with your classes which results in compilation errors. Warning test

tech.testsys.domain.model.group.* is a wildcard import. Replace it with fully qualified imports.
contests(listOf(10L, 20L))
},
)
} No newline at end of file

Check warning

Code scanning / detekt

Checks whether files end with a line separator. Warning test

The file /home/runner/work/testsys-app/testsys-app/testsys-domain/src/test/kotlin/tech/testsys/domain/builder/group/ClassBuilderTests.kt is not ending with a new line.
import tech.testsys.domain.model.task.DeveloperSolution
import tech.testsys.domain.model.task.DeveloperSolutionData

class DeveloperSolutionBuilderTests : DomainEntityBuilderTests<DeveloperSolution, DeveloperSolutionData, DeveloperSolutionDataBuilder>(

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning test

Line detected, which is longer than the defined maximum line length in the code style.
task(1)
submission(1)
})
} No newline at end of file

Check warning

Code scanning / detekt

Checks whether files end with a line separator. Warning test

The file /home/runner/work/testsys-app/testsys-app/testsys-domain/src/test/kotlin/tech/testsys/domain/builder/task/SubmissionBuilderTests.kt is not ending with a new line.
import tech.testsys.domain.model.user.MultipleRoleUser
import tech.testsys.domain.model.user.MultipleRoleUserData

class MultipleRoleUserBuilderTests : DomainEntityBuilderTests<MultipleRoleUser, MultipleRoleUserData, MultipleRoleUserDataBuilder>(

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning test

Line detected, which is longer than the defined maximum line length in the code style.
MultipleRoleUserBuilder(),
MultipleRoleUserDataBuilder()
) {
override fun buildDataWithAllFields() = listOf(

Check warning

Code scanning / detekt

One method should have one responsibility. Long methods tend to handle many things at once. Prefer smaller methods to make them easier to understand. Warning test

The function buildDataWithAllFields is too long (69). The maximum length is 60.
@sh1sh4k1n9 sh1sh4k1n9 disabled auto-merge April 16, 2026 19:02
@sh1sh4k1n9 sh1sh4k1n9 merged commit b6bbd81 into dev Apr 16, 2026
2 of 4 checks passed
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.

5 participants