Account Settings Service (IAccountSettingsService) Interface
Namespace: Cxt.Account.Settings.API.Abstractions
The IAccountSettingsService interface defines the contract for services that handle the business logic related to managing client account visibility settings. It outlines the primary operations that any implementing service class must provide.
This interface is crucial for decoupling the API controller from the concrete service implementation, allowing for easier testing and maintenance.
Purpose
To provide a standardized set of operations for:
- Adding new account visibility preferences for a client.
- Updating existing account visibility preferences.
- Deleting specific account visibility preferences.
- Retrieving a client's current account visibility preferences.
Methods
Add Client Account Settings Preferences Service
csharp
Task<bool> AddClientAccountSettingsPreferencesService(AccountSettingsAddRequest request, CancellationToken cancellationToken);- Description: Adds or updates account settings preferences for a client based on the provided request.
- Parameters:
Parameter Type Description requestAccountSettingsAddRequestAn AccountSettingsAddRequestobject containing the client's GCN, business unit, and the list of accounts with their visibility settings.cancellationTokenCancellationTokenA CancellationTokento observe while waiting for the task to complete, allowing the operation to be cancelled. - Returns:
Task<bool>-trueif the operation was successful,falseotherwise.
Update Client Account Settings Preferences Service
csharp
Task<bool> UpdateClientAccountSettingsPreferencesService(AccountSettingsUpdateRequest request, CancellationToken cancellationToken);- Description: Updates existing account settings preferences for a client.
- Parameters:
Parameter Type Description requestAccountSettingsUpdateRequestAn AccountSettingsUpdateRequestobject containing the details of the preferences to be updated.cancellationTokenCancellationTokenA CancellationToken. - Returns:
Task<bool>-trueif the update was successful,falseotherwise.
Delete Client Account Settings Preferences Service
csharp
Task<bool> DeleteClientAccountSettingsPreferencesService(AccountSettingsDeleteRequest request, CancellationToken cancellationToken);- Description: Deletes a specific account setting preference for a client.
- Parameters:
Parameter Type Description requestAccountSettingsDeleteRequestAn AccountSettingsDeleteRequestobject specifying the GCN, account number, and account type of the preference to delete.cancellationTokenCancellationTokenA CancellationToken. - Returns:
Task<bool>-trueif the deletion was successful,falseotherwise.
Retrieve Client Account Settings Preferences Service
csharp
Task<AccountSettingsResponse> RetrieveClientAccountSettingsPreferencesService(string gcn, CancellationToken cancellationToken);- Description: Retrieves the account settings preferences for a client identified by their GCN.
- Parameters:
Parameter Type Description gcnstringA stringrepresenting the Global Client Number.cancellationTokenCancellationTokenA CancellationToken. - Returns:
Task<AccountSettingsResponse>- AnAccountSettingsResponseobject containing the client's preferences. If no settings are found, the response object might be empty or specific properties within it (likeProfileAccounts) might be null or empty, depending on the implementation.
Consumers
- The primary consumer of this interface is the
AccountSettingsController(seeAccount Settings Controller), which uses an instance of a class implementingIAccountSettingsService(likeAccountSettingsService Class) to perform the actual operations.
This interface plays a key role in the API's architecture by abstracting the core business logic for account settings management.