Account Model (AccountModel) Class
The AccountModel class is a fundamental data structure within the Investec.AccountSettings.Models NuGet package. It represents the details of a single client account and is used to determine its visibility status.
Purpose
This model is used to carry information about an account, including its identifier, name, type, and whether it should be hidden from the client's view in banking applications.
Properties
The AccountModel class has the following properties:
| Property Name | Type | Required | JSON Property Name | Description |
|---|---|---|---|---|
AccountNumber | string | Yes | AccountNumber | The unique identifier for the account. |
AccountName | string | Yes | AccountName | The display name for the account. |
AccountType | string | Yes | AccountType | The type of account (e.g., Savings, Cheque, Credit Card). |
ProductSegment | string | No | ProductSegment | The specific product segment the account belongs to (if applicable). |
BusinessUnit | string | No | BusinessUnit | The business unit associated with the account. Defaults to an empty string. |
AccountHidden | bool | Yes | AccountHidden | A boolean flag indicating if the account should be hidden (true) or visible (false). |
DateUpdated | string | No | DateUpdated | The date when the account information was last updated (string format). |
Validation
AccountNumber,AccountName,AccountType, andAccountHiddenare required fields, enforced by the[Required]attribute. This means that when anAccountModelobject is created or processed, these fields must have valid values.
Example Usage (Conceptual)
While AccountModel is typically used within other request/response models (like AccountSettingsAddRequest), here's how you might conceptually work with an instance of it in C#:
using Investec.AccountSettings.Models;
// Creating an instance of AccountModel
var account = new AccountModel
{
AccountNumber = "ACC00123",
AccountName = "My Savings Account",
AccountType = "Savings",
ProductSegment = "Private Banking",
BusinessUnit = "Retail SA",
AccountHidden = false, // This account is currently visible
DateUpdated = "2023-10-26T10:00:00Z"
};
// Later, to hide the account:
// account.AccountHidden = true;
// This model would then be part of a larger request to an API,
// for example, within an AccountList in an AccountSettingsAddRequest.This model plays a crucial role in the overall Account Visibility feature by providing a standardized way to define and manage the visibility state of each individual account.