Skip to content

Commit

Permalink
chore: use controller instead of repository
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomoaccursi authored and andrea-acampora committed Mar 12, 2023
1 parent db97b20 commit 097fa38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/main/kotlin/infrastructure/provider/Provider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@

package infrastructure.provider

import usecase.repository.TrackingDataRepository
import application.controller.manager.StaffTrackingDatabaseManager

/** The provider of the [TrackingDataRepository]. */
/**
* It's responsible to provide the [StaffTrackingDatabaseManager]
* to Staff Tracking Controller.
*/
interface Provider {

/** The manager of staff tracking database operations. */
val trackingDatabaseManager: TrackingDataRepository
/** The manager of staff tracking inside database. */
val staffTrackingDatabaseManager: StaffTrackingDatabaseManager
}
11 changes: 8 additions & 3 deletions src/main/kotlin/infrastructure/provider/ProviderImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

package infrastructure.provider

import usecase.repository.TrackingDataRepository
import application.controller.manager.StaffTrackingDatabaseManager
import infrastructure.database.MongoClient

/** The implementation of the [Provider] interface. */
/**
* The implementation of the [Provider] interface.
*/
class ProviderImpl : Provider {

init {
Expand All @@ -19,5 +22,7 @@ class ProviderImpl : Provider {
}
}

override val trackingDatabaseManager: TrackingDataRepository = TODO() // MongoClient
override val staffTrackingDatabaseManager: StaffTrackingDatabaseManager by lazy {
MongoClient(System.getenv("STAFF_TRACKING_MONGODB_URL"))
}
}

0 comments on commit 097fa38

Please sign in to comment.