Account Settings API Controller
This controller (AccountSettingsController.cs) manages client account settings preferences. It provides endpoints for adding, retrieving, updating, and deleting account settings, as well as a mock endpoint for testing purposes.
Base Route: /api/v1/account-settings
API Version: 1
Authentication: [AllowAnonymous] - These endpoints do not require authentication.
Endpoints
Add Account Settings Preferences
Adds new account visibility preferences for a client.
- HTTP Method:
POST - Route:
/(relative to base route, i.e.,/api/v1/account-settings) - Request Body:
- Type:
AccountSettingsAddRequest - Description: Contains the client's GCN, business unit, and a list of account profiles with their visibility settings.
- Type:
- Responses:
204 No Content: Successfully created the account settings preferences.400 Bad Request: If the request is invalid or an error occurs during processing. The response body may contain an error message:json{ "data": { "message": "Error processing request to add account settings for client." } }
Example cURL:
curl -X POST \
http://localhost:PORT/api/v1/account-settings \
-H 'Content-Type: application/json' \
-d '{ \
"gcn": "123456789", \
"businessUnit": "Private Bank SA", \
"clientAccountProfiles": [ \
{ \
"profileId": "DefaultProfile01", \
"accounts": [ \
{ \
"accountNumber": "ACC001", \
"accountName": "My Cheque Account", \
"accountType": "Cheque", \
"accountStatus": "Active", \
"productSegment": "Transactional", \
"businessUnit": "Private Bank SA", \
"accountHidden": false \
} \
] \
} \
] \
}'Get Account Settings Preferences
Retrieves the account visibility settings preferences for a specific client by their Global Client Number (GCN).
- HTTP Method:
GET - Route:
/{gcn}(e.g.,/api/v1/account-settings/123456789) - Path Parameter:
gcn(string): The Global Client Number of the client.
- Responses:
200 OK: Successfully retrieved the account settings.- Response Body Type:
AccountSettingsResponse
- Response Body Type:
404 Not Found: If no account settings are found for the provided GCN. The response body may contain an error message:json{ "message": "No account settings found for the specified GCN." }
Example cURL:
curl -X GET \
http://localhost:PORT/api/v1/account-settings/123456789Update Account Settings Preferences
Updates existing account visibility preferences for a client.
- HTTP Method:
POST - Route:
/update(i.e.,/api/v1/account-settings/update) - Request Body:
- Type:
AccountSettingsUpdateRequest - Description: Contains the client's GCN and the updated account preferences.
- Type:
- Responses:
204 No Content: Successfully updated the account settings preferences.400 Bad Request: If the request is invalid or an error occurs during processing. The response body may contain an error message:json{ "data": { "message": "Error processing request to update account settings for client." } }
Example cURL:
curl -X POST \
http://localhost:PORT/api/v1/account-settings/update \
-H 'Content-Type: application/json' \
-d '{ \
"gcn": "123456789", \
"businessUnit": "Private Bank SA", \
"clientAccountProfiles": [ \
{ \
"profileId": "DefaultProfile01", \
"accounts": [ \
{ \
"accountNumber": "ACC001", \
"accountName": "My Cheque Account (Updated)", \
"accountType": "Cheque", \
"accountStatus": "Active", \
"productSegment": "Transactional", \
"businessUnit": "Private Bank SA", \
"accountHidden": true \
} \
] \
} \
] \
}' # Example payload, actual structure depends on AccountSettingsUpdateRequestDelete Account Settings Preferences
Deletes specific account visibility preferences for a client.
- HTTP Method:
POST - Route:
/delete(i.e.,/api/v1/account-settings/delete) - Request Body:
- Type:
AccountSettingsDeleteRequest - Description: Contains identifiers for the client and the specific account setting to delete.
- Type:
- Responses:
204 No Content: Successfully deleted the account settings preference.400 Bad Request: If the request is invalid or an error occurs. The response body may contain an error message:json{ "data": { "message": "Error processing request to delete account settings for client." } }
Example cURL:
curl -X POST \
http://localhost:PORT/api/v1/account-settings/delete \
-H 'Content-Type: application/json' \
-d '{ \
"gcn": "123456789", \
"accountNumber": "ACC001", \
"accountType": "Cheque" \
}'Get Mock Account Settings (For Testing)
Retrieves mock account settings data. This endpoint is intended for testing and development purposes.
- HTTP Method:
GET - Route:
/mock(i.e.,/api/v1/account-settings/mock) - Responses:
200 OK: Successfully retrieved mock account settings.- Response Body Type:
BaseResponseModel<List<AccountSettingsResponse>>
- Response Body Type:
404 Not Found: If no mock data is available.
Example cURL:
curl -X GET \
http://localhost:PORT/api/v1/account-settings/mock