Plan Modification

Clients can always change their portfolio strategy and select a different investment model. Keep in mind that if the risk associated with the new portfolio model does not match the client's risk profile, you must provide the reason to change proposal response ID(s).

Attention

Plan modification is possible only when the plan creation order has been accepted.

Selecting proposal

The following describes how to retrieve all alternative investment proposals for plan modification.

								
  var clientPortfolio = await httpClient.GetFromJsonAsync<PortfolioOutputModel>($"api/v1/user-portfolios/portfolio-id/{portfolioId}?portfolio-view-as=Snapshot");

  var url = $"api/v1/proposals/investment-category-id/{clientPortfolio.InvestmentCategoryId}";
  var proposals = await httpClient.GetFromJsonAsync<List<ProposalOutputModel>>(url);
  var alternativeProposals = proposals.Where(x => x.Id != clientPortfolio.ProposalId).ToList();
									

Preparing the contract

See the Preparing the contract chapter regarding plan creation, as the steps are the same.

Submitting the order

In the following code snippet, we submit a plan change, passing the new Proposal ID selected by the user/client. This will change the investment strategy.

								
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  // Please note:
  //   1.a new PDF document is needed for plan change. For this example we simply use an empty PDF.
  //   2.reason to change proposal is hard-coded while should be choosen by client
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

  var clientPortfolio = await httpClient.GetFromJsonAsync<PortfolioOutputModel>($"api/v1/user-portfolios/portfolio-id/{portfolioId}");

  var reasonToChangeProposalUrl = $"api/v1/reason-to-change-proposed-proposal/investment-category-id/{clientPortfolio.InvestmentCategoryId}/active";
  var reasonToChangeProposal = await httpClient.GetFromJsonAsync<ReasonToChangeProposalOutputModel>(reasonToChangeProposalUrl);

  var orderPortfolioModificationInputModel = new
  {
	PortfolioId = portfolioId,
	// Assume this is the new portfolio model selected by client
	ProposalId = alternativeProposals.First().Id,
	// Assume this is reason to change proposal selected by client
	ReasonToChangeProposalResponsesIds = new List<long>{ reasonToChangeProposal.Responses.First().Id }
  };

  // For simplicity, use an empty PDF contract template
  var byteArray = FileContentHelper.GetFileContent(this.GetType(), "Contract-3A.pdf");

  var httpContent = HttpHelper.CreateMultipartFormDataHttpContent(orderPortfolioModificationInputModel, byteArray);
  var httpResponseMessage = await httpClient.PostAsync("api/v1/user-portfolio-orders/modification", httpContent);
  if (httpResponseMessage.IsSuccessStatusCode == false)
  {
	// Manage the error
  }
									

After the order is submitted, the Portfolio.HasPendingOrder will be TRUE.

When "PendingOrder" is TRUE, no plan modification is allowed.

Once the order is accepted, this value will change to FALSE and a new plan change will be possible.