Skip to content

Commit

Permalink
Update KDoc & README
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 8, 2024
1 parent 92473bb commit b232884
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
30 changes: 15 additions & 15 deletions STCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -52,36 +52,36 @@ 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`

- **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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ class TransferManager internal constructor(
private val realmProvider: RealmProvider,
private val clientProvider: ApiClientProvider,
) {
//TODO: Implement here
// TODO: Implement here
}

0 comments on commit b232884

Please sign in to comment.