-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52fce88
commit d56db40
Showing
43 changed files
with
271 additions
and
245 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
[*] | ||
max_line_length = 110 | ||
[*.{kt,kts}] | ||
ktlint_code_style = ktlint_official | ||
ktlint_standard_no-empty-first-line-in-class-body=disabled | ||
ktlint_standard_string-template-indent=disabled | ||
ktlint_standard_multiline-expression-wrapping=disabled | ||
ktlint_standard_indent=disabled | ||
ktlint_standard_string-template=disabled | ||
ktlint_standard_function-signature=disabled | ||
ktlint_standard_import-ordering=disabled |
This file contains 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
This file contains 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
24 changes: 24 additions & 0 deletions
24
app/adapters/env/src/main/kotlin/adapters/env/EnvModule.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package adapters.env | ||
|
||
import core.outport.GetDatabaseConfigPort | ||
import core.outport.GetDeploymentConfigPort | ||
import core.outport.GetDeploymentEnvPort | ||
import core.outport.GetRandomPersonServiceConfigPort | ||
import org.koin.dsl.binds | ||
import org.koin.dsl.module | ||
|
||
val envModule = | ||
module { | ||
single<GetDeploymentEnvPort> { | ||
AppOsEnvironment() | ||
} | ||
|
||
single { | ||
HoconBasedAppConfig(get<GetDeploymentEnvPort>().deploymentEnv) | ||
} binds | ||
arrayOf( | ||
GetDeploymentConfigPort::class, | ||
GetDatabaseConfigPort::class, | ||
GetRandomPersonServiceConfigPort::class, | ||
) | ||
} |
This file contains 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
22 changes: 0 additions & 22 deletions
22
app/adapters/env/src/main/kotlin/adapters/env/_EnvModule.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
64 changes: 64 additions & 0 deletions
64
app/adapters/persist/src/main/kotlin/adapters/persist/PersistenceModule.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package adapters.persist | ||
|
||
import adapters.persist.addressbook.LoadPersonAdapter | ||
import adapters.persist.addressbook.SavePersonAdapter | ||
import adapters.persist.addressbook.repo.PersonRepo | ||
import adapters.persist.addressbook.repo.PostalAddressRepo | ||
import adapters.persist.util.DatabaseErrorInspector | ||
import adapters.persist.util.postgresql.PgErrorInspector | ||
import core.outport.AddPersonPort | ||
import core.outport.BootPersistStoragePort | ||
import core.outport.DeletePersonPort | ||
import core.outport.GetDatabaseConfigPort | ||
import core.outport.LoadAllPersonsPort | ||
import core.outport.LoadPersonPort | ||
import core.outport.PersistTransactionPort | ||
import core.outport.ShutdownPersistStoragePort | ||
import core.outport.UpdatePersonPort | ||
import org.koin.dsl.binds | ||
import org.koin.dsl.module | ||
|
||
val persistenceModule = | ||
module { | ||
single<DatabaseErrorInspector> { | ||
PgErrorInspector() | ||
} | ||
|
||
single { | ||
DatabaseConnector( | ||
databaseConfig = get<GetDatabaseConfigPort>().database, | ||
errorInspector = get(), | ||
) | ||
} binds arrayOf( | ||
BootPersistStoragePort::class, | ||
ShutdownPersistStoragePort::class, | ||
PersistTransactionPort::class, | ||
) | ||
|
||
single { | ||
PersonRepo() | ||
} | ||
single { | ||
PostalAddressRepo() | ||
} | ||
|
||
single { | ||
LoadPersonAdapter( | ||
personRepo = get(), | ||
postalAddressRepo = get(), | ||
) | ||
} binds arrayOf( | ||
LoadPersonPort::class, | ||
LoadAllPersonsPort::class, | ||
) | ||
single { | ||
SavePersonAdapter( | ||
personRepository = get(), | ||
postalAddressRepo = get(), | ||
) | ||
} binds arrayOf( | ||
AddPersonPort::class, | ||
UpdatePersonPort::class, | ||
DeletePersonPort::class, | ||
) | ||
} |
This file contains 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
63 changes: 0 additions & 63 deletions
63
app/adapters/persist/src/main/kotlin/adapters/persist/_PersistenceModule.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.