Proposal Selection
When selecting the investment proposal, the client must specify the desired investment category. The possible BUSINESS LINES and corresponding INVESTMENT CATEGORIES are listed below:
Vorsorge (pension):
- 3a pillar (3a)
- Vested benefits (FZ)
Finance (wealth management):
- Invest (3b)
Note
Investment types can be activated or deactivated depending on the needs of the company.
Querying business lines
Assuming that the client is interested in a 3A plan, we retrieve the ID of the Vorsorge business line and the ID of the 3A investment category ID. These IDs are used to retrieve the questionnaire, which is used to calculate the client's risk appetite and suggest the best investment proposal:
var businessLines = await httpClient.GetFromJsonAsync<IList<BusinessLineOutputModel>>("api/v1/business-lines");
var businessLineVorsorge = businessLines.First(x => x.Code == "VORSORGE");
var investmentCategories = await httpClient.GetFromJsonAsync<IList<InvestmentCategoryOutputModel>>("api/v1/investment-categories/business-line-id/" + businessLineVorsorge.Id);
var investmentCategory3A = investmentCategories.First(x => x.Code == "3A");
Questionnaire responses
Given a business line, we retrieve the respective questionnaire, with possible responses.
In the following example, we simulate some client responses to draw a client risk profile:
var activeQuestionnaire = await httpClient.GetFromJsonAsync<QuestionnaireOutputModel>($"api/v1/questionnaires/business-line-id/{businessLineVorsorge.Id}/active");
var activeQuestionnaireQuestions = activeQuestionnaire.Sections.SelectMany(x => x.Questions);
var response1 = activeQuestionnaireQuestions.ElementAt(0).Responses.First(x => x.Code == "VORSORGE0004-QUESTION0001-RESPONSE0001").Id;
var response2 = activeQuestionnaireQuestions.ElementAt(1).Responses.First(x => x.Code == "VORSORGE0004-QUESTION0002-RESPONSE0002").Id;
var response3 = activeQuestionnaireQuestions.ElementAt(2).Responses.First(x => x.Code == "VORSORGE0004-QUESTION0003-RESPONSE0003").Id;
var response4 = activeQuestionnaireQuestions.ElementAt(3).Responses.First(x => x.Code == "VORSORGE0004-QUESTION0004-RESPONSE0003").Id;
var responsesCsv = response1 + "," + response2 + "," + response3 + "," + response4;
var risk = await httpClient.GetFromJsonAsync<RiskCategorizationOutputModel>($"api/v1/risk-categorizations/business-line-id/{businessLineVorsorge.Id}/calculate-risk?csv-response-ids={responsesCsv}");
Obtaining investment proposals
Given a client's risk profile, we can now retrieve investment proposals suitable for the client:
var proposals = await httpClient.GetFromJsonAsync<List<ProposalOutputModel>>($"api/v1/proposals/investment-category-id/{investmentCategory3A.Id}/risk-id/{risk.Id}");
var proposalSelectedByUser = proposals.First();
The result of the proposal can be displayed as follows:
Also, it is possible that the client chooses an investment model that does not correspond to the one proposed. In this case it is necessary to specify the reasons to change proposal. This is a simple list of answers with the following structure:
public class ReasonToChangeProposalResponseOutputModel
{
public long Id { get; set; }
public string Code { get; set; }
public string Description { get; set; }
public int Order { get; set; }
}
public class ReasonToChangeProposalOutputModel
{
public long Id { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public bool IsDeleted { get; set; }
public IList<ReasonToChangeProposalResponseOutputModel> Responses { get; set; }
}
var reasonsToChangeProposal = await httpClient.GetFromJsonAsync<ReasonToChangeProposalOutputModel>($"api/v1/reason-to-change-proposed-proposal/investment-category-id/{investmentCategory3A.Id}/active");