From b23288435ee125bb6ba066119cd1ce6c3e21942b Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Tue, 8 Oct 2024 13:18:18 +0200 Subject: [PATCH] Update KDoc & README --- STCore/README.md | 30 +++++++++---------- .../SwissTransferInjection.kt | 2 +- .../managers/AccountManager.kt | 8 +++++ .../managers/TransferManager.kt | 2 +- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/STCore/README.md b/STCore/README.md index 0928dadf..8f947cd3 100644 --- a/STCore/README.md +++ b/STCore/README.md @@ -33,11 +33,11 @@ centralized access point to orchestrate transfer operations. ### Table of Public Properties and Methods -| Type | Name | Description | -|----------|--------------------|-------------------------------------------------------------------------------| -| Property | appSettingsManager | A manager used to orchestrate AppSettings operations. | -| Property | transferManager | A manager used to orchestrate transfer operations. | -| Method | loadDefaultAccount | Loads the default user account and initializes Realm transfers for this user. | +| Type | Name | Description | +|----------|--------------------|-------------------------------------------------------| +| Property | appSettingsManager | A manager used to orchestrate AppSettings operations. | +| Property | transferManager | A manager used to orchestrate Transfers operations. | +| Property | accountManager | A manager used to orchestrate Accounts operations. | ### Details of Properties and Methods @@ -52,7 +52,7 @@ centralized access point to orchestrate transfer operations. ```kotlin val core = SwissTransferInjection() val appSettingsManager = core.appSettingsManager - // Use the appSettingsManager to orchestrate AppSettings related operations + // Use the appSettingsManager to orchestrate AppSettings ``` #### Property: `transferManager` @@ -60,28 +60,28 @@ centralized access point to orchestrate transfer operations. - **Type**: `TransferManager` - **Description**: - `transferManager` is a lazily initialized property that provides a manager to orchestrate all transfer operations. It - uses `realmProvider` and `apiClientProvider` to configure and manage transfers efficiently. + uses `realmProvider` and `apiClientProvider` to configure and manage Transfers efficiently. - **Usage Example**: ```kotlin val core = SwissTransferInjection() val transferManager = core.transferManager - // Use the transferManager to orchestrate transfers + // Use the transferManager to orchestrate Transfers ``` -#### Method: `loadDefaultAccount` +#### Property: `accountManager` -- **Signature**: `fun loadDefaultAccount()` +- **Type**: `AccountManager` - **Description**: - - `loadDefaultAccount` is a method that loads the default user account and initializes Realm transfers for the default user ID - defined in the constants. This method is essential to ensure the application is correctly set up for the default user from - the start. + - `accountManager` is a lazily initialized property that provides a manager to orchestrate all Accounts operations. It uses + `appSettingsController`, `uploadController`, `transfersController` and `realmProvider` to configure and manage Accounts + efficiently. - **Usage Example**: ```kotlin val core = SwissTransferInjection() - core.loadDefaultAccount() - // The default user account is now loaded and ready to use + val accountManager = core.accountManager + // Use the accountManager to orchestrate Accounts ``` ## Contributing diff --git a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SwissTransferInjection.kt b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SwissTransferInjection.kt index 83c52c77..1b74fa34 100644 --- a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SwissTransferInjection.kt +++ b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SwissTransferInjection.kt @@ -51,7 +51,7 @@ class SwissTransferInjection { private val uploadController by lazy { UploadController(realmProvider) } private val transfersController by lazy { TransfersController(realmProvider) } - /** A manager used to orchestrate transfer operations. */ + /** A manager used to orchestrate Transfers operations. */ val transferManager by lazy { TransferManager(realmProvider, apiClientProvider) } /** A manager used to orchestrate AppSettings operations. */ diff --git a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AccountManager.kt b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AccountManager.kt index f7a6e81a..cadde6f8 100644 --- a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AccountManager.kt +++ b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/AccountManager.kt @@ -22,6 +22,14 @@ import com.infomaniak.multiplatform_swisstransfer.database.cache.setting.AppSett import com.infomaniak.multiplatform_swisstransfer.database.cache.setting.TransfersController import com.infomaniak.multiplatform_swisstransfer.database.cache.setting.UploadController +/** + * AccountManager is responsible for orchestrating Accounts operations using Realm for local data management. + * + * @property appSettingsController The controller for managing AppSettings operations. + * @property uploadController The controller for managing Upload operations. + * @property transfersController The controller for managing Transfers operation. + * @property realmProvider The provider for managing Realm database operations. + */ class AccountManager internal constructor( private val appSettingsController: AppSettingsController, private val uploadController: UploadController, diff --git a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/TransferManager.kt b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/TransferManager.kt index bae2c532..fea0dc66 100644 --- a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/TransferManager.kt +++ b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/TransferManager.kt @@ -35,5 +35,5 @@ class TransferManager internal constructor( private val realmProvider: RealmProvider, private val clientProvider: ApiClientProvider, ) { - //TODO: Implement here + // TODO: Implement here }