Account Settings V2 (BFF) Models
Namespace: CXT.IO.Dashboard.Api.ModelsSource File: AccountSettingsV2Model.cs
These models are tailored for the Dashboard API's (BFF) V2 interface and are used by the AccountSettingsController and AccountSettingsV2Service.
AccountSettingsV2SaveRequestModel
Used as the request body for the POST /api/v2/account-settings endpoint to save or update multiple account settings at once.
Properties
Records
public List<AccountSettingsV2RecordsModel> Records { get; set; }- Description: A list of individual account settings to be saved or updated.
Example Usage (C#)
var saveRequest = new AccountSettingsV2SaveRequestModel
{
Records = new List<AccountSettingsV2RecordsModel>
{
new AccountSettingsV2RecordsModel
{
ProfileId = "PROF1",
AccountNumber = "12345",
AccountName = "Primary Account",
AccountHidden = true,
BusinessUnit = "BU1"
},
new AccountSettingsV2RecordsModel
{
ProfileId = "PROF1",
AccountNumber = "67890",
AccountName = "Secondary Account",
AccountHidden = false,
BusinessUnit = "BU1"
}
}
};AccountSettingsV2RecordsModel
Represents a single account record within the AccountSettingsV2SaveRequestModel.
Inherits from: AccountSettingsProfileAccount (from the Investec.AccountSettings.Models NuGet package).
Properties
ProfileId
public string ProfileId { get; set; }- Description: Specifies the profile to which this account record belongs. This is crucial for correctly grouping records when interacting with the downstream API.
Inherited Properties
- This model includes all properties from
AccountSettingsProfileAccount, such asAccountNumber,AccountName,AccountType,AccountHidden, andBusinessUnit.
AccountSettingsV2ResponseModel
The primary data structure within the response from the GET /api/v2/account-settings endpoint, grouping accounts by profile.
Properties
ProfileId
public string ProfileId { get; set; }- Description: Identifies the profile to which the accounts in
AccountListbelong.
AccountList
public List<AccountVersionedModel> AccountList { get; set; }- Description: A list of
AccountVersionedModelobjects, where each represents an account and its visibility setting.
AccountVersionedModel
Represents an individual account within the AccountSettingsV2ResponseModel.
Inherits from: AccountModel (from the Investec.AccountSettings.Models NuGet package).
Properties
ApiVersion
public string ApiVersion { get; set; }- Description: A string indicating the API version associated with this account data (e.g., "v2"). This is set by the
AccountSettingsV2Service.
Inherited Properties
- This model includes all properties from
AccountModel, such asAccountNumber,AccountName,AccountType,AccountHidden, andDateUpdated.
Relationship to Core Models
- The
AccountSettingsV2SaveRequestModeland itsAccountSettingsV2RecordsModelare designed to be easily transformed byAccountSettingsV2Serviceinto theAccountSettingsAddRequest(and its nestedAccountSettingsProfileandAccountSettingsProfileAccountmodels) from theInvestec.AccountSettings.ModelsNuGet package, which is what the V1 downstream Account Settings API expects. - The
AccountSettingsV2ResponseModeland itsAccountVersionedModelare constructed byAccountSettingsV2Serviceafter fetching data (asAccountSettingsResponsefromInvestec.AccountSettings.Models) from the V1 downstream API and then transforming it into this V2 BFF-specific format.
These V2 models in the BFF layer facilitate a more streamlined or specific contract for the V2 API consumers while allowing the BFF to adapt to the (potentially V1) interfaces of the underlying core services.