Skip to content

Commit e70fc07

Browse files
andrea-acamporamergify[bot]
authored andcommitted
style: format code due to new kotlin-qa plugin update
1 parent 0acfabd commit e70fc07

File tree

11 files changed

+28
-27
lines changed

11 files changed

+28
-27
lines changed

src/main/kotlin/application/controller/HealthProfessionalController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import usecase.repository.HealthProfessionalRepository
1919
*/
2020
class HealthProfessionalController(
2121
private val dbManager: HealthProfessionalDatabaseManager,
22-
private val dtManager: HealthProfessionalDigitalTwinsManager
22+
private val dtManager: HealthProfessionalDigitalTwinsManager,
2323
) : HealthProfessionalRepository {
2424

2525
override fun createHealthProfessional(healthProfessional: HealthProfessional): HealthProfessional? =

src/main/kotlin/application/service/HealthProfessionalServices.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ object HealthProfessionalServices {
2121
*/
2222
class CreateHealthProfessional(
2323
private val healthProfessional: HealthProfessional,
24-
private val healthProfessionalRepository: HealthProfessionalRepository
24+
private val healthProfessionalRepository: HealthProfessionalRepository,
2525
) : ApplicationService<HealthProfessional?> {
2626
override fun execute(): HealthProfessional? =
2727
if (healthProfessionalRepository.getHealthProfessional(healthProfessional.healthProfessionalId) == null) {
2828
healthProfessionalRepository.createHealthProfessional(healthProfessional)
29-
} else null
29+
} else {
30+
null
31+
}
3032
}
3133

3234
/**
@@ -35,7 +37,7 @@ object HealthProfessionalServices {
3537
*/
3638
class DeleteHealthProfessional(
3739
private val healthProfessionalId: String,
38-
private val healthProfessionalRepository: HealthProfessionalRepository
40+
private val healthProfessionalRepository: HealthProfessionalRepository,
3941
) : ApplicationService<Boolean> {
4042
override fun execute(): Boolean =
4143
healthProfessionalRepository.deleteHealthProfessional(healthProfessionalId)
@@ -47,7 +49,7 @@ object HealthProfessionalServices {
4749
*/
4850
class GetHealthProfessional(
4951
private val healthProfessionalId: String,
50-
private val healthProfessionalRepository: HealthProfessionalRepository
52+
private val healthProfessionalRepository: HealthProfessionalRepository,
5153
) : ApplicationService<HealthProfessional?> {
5254
override fun execute(): HealthProfessional? =
5355
healthProfessionalRepository.getHealthProfessional(healthProfessionalId)

src/main/kotlin/application/service/UserServices.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ object UserServices {
2323
override fun execute(): User? =
2424
if (userRepository.getUser(user.userId) == null) {
2525
userRepository.createUser(user)
26-
} else null
26+
} else {
27+
null
28+
}
2729
}
2830

2931
/**
3032
* Application service to delete a user given its [userId] using the [userRepository].
3133
*/
3234
class DeleteUser(
3335
private val userId: String,
34-
private val userRepository: UserRepository
36+
private val userRepository: UserRepository,
3537
) : ApplicationService<Boolean> {
3638
override fun execute(): Boolean = userRepository.deleteUser(userId)
3739
}
@@ -41,7 +43,7 @@ object UserServices {
4143
*/
4244
class GetUser(
4345
private val userId: String,
44-
private val userRepository: UserRepository
46+
private val userRepository: UserRepository,
4547
) : ApplicationService<User?> {
4648
override fun execute(): User? = userRepository.getUser(userId)
4749
}

src/main/kotlin/entity/healthprofessional/HealthProfessionalData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object HealthProfessionalData {
3333
/** The health professional phone number. */
3434
val phoneNumber: String,
3535
/** The health professional role. */
36-
val role: HealthProfessionalRole
36+
val role: HealthProfessionalRole,
3737
) {
3838
init {
3939
check(healthProfessionalId.isNotEmpty()) {

src/main/kotlin/infrastructure/api/routes/AuthenticationAPI.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ import usecase.AuthenticationUseCase
2121
* The Authentication API implementation.
2222
*/
2323
fun Route.authAPI(provider: Provider, apiPath: String) {
24-
2524
post("$apiPath/auth") {
2625
if (AuthenticationUseCase(
2726
call.parameters["id"].toString(),
2827
call.parameters["password"].toString(),
29-
UserController(provider.userDatabaseManager)
28+
UserController(provider.userDatabaseManager),
3029
).execute()
3130
) {
3231
call.respond(HttpStatusCode.OK)

src/main/kotlin/infrastructure/api/routes/HealthProfessionalAPI.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ import io.ktor.server.routing.post
2525
* The HealthProfessional API implementation.
2626
*/
2727
fun Route.healthProfessionalAPI(provider: Provider, apiPath: String) {
28-
2928
get("$apiPath/healthProfessionals/{healthProfessionalId}") {
3029
val healthProfessionalId = call.parameters["healthProfessionalId"].toString()
3130
HealthProfessionalServices.GetHealthProfessional(
3231
healthProfessionalId,
3332
HealthProfessionalController(
3433
provider.healthProfessionalDatabaseManager,
35-
provider.healthProfessionalDigitalTwinsManager
36-
)
34+
provider.healthProfessionalDigitalTwinsManager,
35+
),
3736
).execute().apply {
3837
if (this != null) {
3938
call.respond(HttpStatusCode.OK, this)
@@ -49,8 +48,8 @@ fun Route.healthProfessionalAPI(provider: Provider, apiPath: String) {
4948
healthProfessionalId,
5049
HealthProfessionalController(
5150
provider.healthProfessionalDatabaseManager,
52-
provider.healthProfessionalDigitalTwinsManager
53-
)
51+
provider.healthProfessionalDigitalTwinsManager,
52+
),
5453
).execute().apply {
5554
if (this) {
5655
call.respond(HttpStatusCode.NoContent)
@@ -66,8 +65,8 @@ fun Route.healthProfessionalAPI(provider: Provider, apiPath: String) {
6665
healthProfessional,
6766
HealthProfessionalController(
6867
provider.healthProfessionalDatabaseManager,
69-
provider.healthProfessionalDigitalTwinsManager
70-
)
68+
provider.healthProfessionalDigitalTwinsManager,
69+
),
7170
).execute().apply {
7271
if (this != null) {
7372
call.respond(HttpStatusCode.Created)

src/main/kotlin/infrastructure/api/routes/UserAPI.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ import io.ktor.server.routing.post
2525
* The User API implementation.
2626
*/
2727
fun Route.userAPI(provider: Provider, apiPath: String) {
28-
2928
get("$apiPath/users/{userId}") {
3029
val userId = call.parameters["userId"].toString()
3130
UserServices.GetUser(
3231
userId,
33-
UserController(provider.userDatabaseManager)
32+
UserController(provider.userDatabaseManager),
3433
).execute().apply {
3534
if (this != null) {
3635
call.respond(HttpStatusCode.OK, this)
@@ -44,7 +43,7 @@ fun Route.userAPI(provider: Provider, apiPath: String) {
4443
val userId = call.parameters["userId"].toString()
4544
UserServices.DeleteUser(
4645
userId,
47-
UserController(provider.userDatabaseManager)
46+
UserController(provider.userDatabaseManager),
4847
).execute().apply {
4948
if (this) {
5049
call.respond(HttpStatusCode.NoContent)
@@ -58,7 +57,7 @@ fun Route.userAPI(provider: Provider, apiPath: String) {
5857
val user = call.receive<User>()
5958
UserServices.CreateUser(
6059
user,
61-
UserController(provider.userDatabaseManager)
60+
UserController(provider.userDatabaseManager),
6261
).execute().apply {
6362
if (this != null) {
6463
call.respond(HttpStatusCode.Created)

src/main/kotlin/infrastructure/database/MongoClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.litote.kmongo.getCollection
2222
* The Mongo client.
2323
*/
2424
class MongoClient(
25-
connectionString: String
25+
connectionString: String,
2626
) : UserDatabaseManager, HealthProfessionalDatabaseManager {
2727

2828
init {

src/main/kotlin/usecase/AuthenticationUseCase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import usecase.repository.UserRepository
1717
class AuthenticationUseCase(
1818
private val userId: String,
1919
private val password: String,
20-
private val userRepository: UserRepository
20+
private val userRepository: UserRepository,
2121
) : UseCase<Boolean> {
2222

2323
override fun execute(): Boolean =

src/test/kotlin/architecture/CleanArchitectureTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CleanArchitectureTest : StringSpec({
2727
.check(
2828
ClassFileImporter()
2929
.withImportOption { !it.contains("/test/") } // ignore tests classes
30-
.importPackages("entity", "usecase", "application", "infrastructure")
30+
.importPackages("entity", "usecase", "application", "infrastructure"),
3131
)
3232
}
3333
})

0 commit comments

Comments
 (0)