POST | /members/{EmployeeGuid}/investmentprofile |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class RecommendedRisk implements IConvertible
{
String? riskName;
int? riskValue;
String? riskId;
RecommendedRisk({this.riskName,this.riskValue,this.riskId});
RecommendedRisk.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
riskName = json['riskName'];
riskValue = json['riskValue'];
riskId = json['riskId'];
return this;
}
Map<String, dynamic> toJson() => {
'riskName': riskName,
'riskValue': riskValue,
'riskId': riskId
};
getTypeName() => "RecommendedRisk";
TypeContext? context = _ctx;
}
class RiskModel implements IConvertible
{
RecommendedRisk? recommendedRisk;
RecommendedRisk? chosenRisk;
RiskModel({this.recommendedRisk,this.chosenRisk});
RiskModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
recommendedRisk = JsonConverters.fromJson(json['recommendedRisk'],'RecommendedRisk',context!);
chosenRisk = JsonConverters.fromJson(json['chosenRisk'],'RecommendedRisk',context!);
return this;
}
Map<String, dynamic> toJson() => {
'recommendedRisk': JsonConverters.toJson(recommendedRisk,'RecommendedRisk',context!),
'chosenRisk': JsonConverters.toJson(chosenRisk,'RecommendedRisk',context!)
};
getTypeName() => "RiskModel";
TypeContext? context = _ctx;
}
class InvestmentProductAllocationsSpec implements IConvertible
{
int? fromAge;
int? term;
Map<String,double?>? allocs;
double? totalAlloc;
InvestmentProductAllocationsSpec({this.fromAge,this.term,this.allocs,this.totalAlloc});
InvestmentProductAllocationsSpec.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fromAge = json['fromAge'];
term = json['term'];
allocs = JsonConverters.fromJson(json['allocs'],'Map<String,double?>',context!);
totalAlloc = JsonConverters.toDouble(json['totalAlloc']);
return this;
}
Map<String, dynamic> toJson() => {
'fromAge': fromAge,
'term': term,
'allocs': JsonConverters.toJson(allocs,'Map<String,double?>',context!),
'totalAlloc': totalAlloc
};
getTypeName() => "InvestmentProductAllocationsSpec";
TypeContext? context = _ctx;
}
class InvestmentProduct implements IConvertible
{
String? code;
String? name;
String? group;
bool? isAssetClassFund;
List<InvestmentProductAllocationsSpec>? allocs;
int? order;
Map<int,Map<String,double>?>? allocationsDictionary;
InvestmentProduct({this.code,this.name,this.group,this.isAssetClassFund,this.allocs,this.order,this.allocationsDictionary});
InvestmentProduct.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
code = json['code'];
name = json['name'];
group = json['group'];
isAssetClassFund = json['isAssetClassFund'];
allocs = JsonConverters.fromJson(json['allocs'],'List<InvestmentProductAllocationsSpec>',context!);
order = json['order'];
allocationsDictionary = JsonConverters.fromJson(json['allocationsDictionary'],'Map<int,Map<String,double>?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'code': code,
'name': name,
'group': group,
'isAssetClassFund': isAssetClassFund,
'allocs': JsonConverters.toJson(allocs,'List<InvestmentProductAllocationsSpec>',context!),
'order': order,
'allocationsDictionary': JsonConverters.toJson(allocationsDictionary,'Map<int,Map<String,double>?>',context!)
};
getTypeName() => "InvestmentProduct";
TypeContext? context = _ctx;
}
class RecommendedProductType implements IConvertible
{
String? product;
String? investmentProduct;
double? score;
int? productType;
List<InvestmentProduct>? investmentProducts;
RecommendedProductType({this.product,this.investmentProduct,this.score,this.productType,this.investmentProducts});
RecommendedProductType.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
product = json['product'];
investmentProduct = json['investmentProduct'];
score = JsonConverters.toDouble(json['score']);
productType = json['productType'];
investmentProducts = JsonConverters.fromJson(json['investmentProducts'],'List<InvestmentProduct>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'product': product,
'investmentProduct': investmentProduct,
'score': score,
'productType': productType,
'investmentProducts': JsonConverters.toJson(investmentProducts,'List<InvestmentProduct>',context!)
};
getTypeName() => "RecommendedProductType";
TypeContext? context = _ctx;
}
class RecommendedProducts implements IConvertible
{
RecommendedProductType? recommendedProduct;
RecommendedProductType? chosenProduct;
RecommendedProducts({this.recommendedProduct,this.chosenProduct});
RecommendedProducts.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
recommendedProduct = JsonConverters.fromJson(json['recommendedProduct'],'RecommendedProductType',context!);
chosenProduct = JsonConverters.fromJson(json['chosenProduct'],'RecommendedProductType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'recommendedProduct': JsonConverters.toJson(recommendedProduct,'RecommendedProductType',context!),
'chosenProduct': JsonConverters.toJson(chosenProduct,'RecommendedProductType',context!)
};
getTypeName() => "RecommendedProducts";
TypeContext? context = _ctx;
}
class MatrixNoRisk implements IConvertible
{
String? minimumAllocationInStocks;
String? maximumAllocationinStocks;
MatrixNoRisk({this.minimumAllocationInStocks,this.maximumAllocationinStocks});
MatrixNoRisk.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
minimumAllocationInStocks = json['minimumAllocationInStocks'];
maximumAllocationinStocks = json['maximumAllocationinStocks'];
return this;
}
Map<String, dynamic> toJson() => {
'minimumAllocationInStocks': minimumAllocationInStocks,
'maximumAllocationinStocks': maximumAllocationinStocks
};
getTypeName() => "MatrixNoRisk";
TypeContext? context = _ctx;
}
class RecommendedProductGraph implements IConvertible
{
List<Map<String,String>>? barGraphData;
MatrixNoRisk? pieGraphInfo;
RecommendedProductGraph({this.barGraphData,this.pieGraphInfo});
RecommendedProductGraph.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
barGraphData = JsonConverters.fromJson(json['barGraphData'],'List<Map<String,String>>',context!);
pieGraphInfo = JsonConverters.fromJson(json['pieGraphInfo'],'MatrixNoRisk',context!);
return this;
}
Map<String, dynamic> toJson() => {
'barGraphData': JsonConverters.toJson(barGraphData,'List<Map<String,String>>',context!),
'pieGraphInfo': JsonConverters.toJson(pieGraphInfo,'MatrixNoRisk',context!)
};
getTypeName() => "RecommendedProductGraph";
TypeContext? context = _ctx;
}
class InvestmentRiskProfileSaveResponse implements IConvertible
{
RiskModel? risk;
RecommendedProducts? product;
RecommendedProductGraph? recommendedProductGraph;
InvestmentRiskProfileSaveResponse({this.risk,this.product,this.recommendedProductGraph});
InvestmentRiskProfileSaveResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
risk = JsonConverters.fromJson(json['risk'],'RiskModel',context!);
product = JsonConverters.fromJson(json['product'],'RecommendedProducts',context!);
recommendedProductGraph = JsonConverters.fromJson(json['recommendedProductGraph'],'RecommendedProductGraph',context!);
return this;
}
Map<String, dynamic> toJson() => {
'risk': JsonConverters.toJson(risk,'RiskModel',context!),
'product': JsonConverters.toJson(product,'RecommendedProducts',context!),
'recommendedProductGraph': JsonConverters.toJson(recommendedProductGraph,'RecommendedProductGraph',context!)
};
getTypeName() => "InvestmentRiskProfileSaveResponse";
TypeContext? context = _ctx;
}
class InvestmentRiskProfileSaveRequest implements IConvertible
{
String? employeeGuid;
List<QuestionnaireAnswers>? answers;
InvestmentRiskProfileSaveRequest({this.employeeGuid,this.answers});
InvestmentRiskProfileSaveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
employeeGuid = json['employeeGuid'];
answers = JsonConverters.fromJson(json['answers'],'List<QuestionnaireAnswers>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'employeeGuid': employeeGuid,
'answers': JsonConverters.toJson(answers,'List<QuestionnaireAnswers>',context!)
};
getTypeName() => "InvestmentRiskProfileSaveRequest";
TypeContext? context = _ctx;
}
class QuestionnaireAnswers implements IConvertible
{
int? questionNumber;
int? optionNumber;
QuestionnaireAnswers({this.questionNumber,this.optionNumber});
QuestionnaireAnswers.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
questionNumber = json['questionNumber'];
optionNumber = json['optionNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'questionNumber': questionNumber,
'optionNumber': optionNumber
};
getTypeName() => "QuestionnaireAnswers";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
'RecommendedRisk': TypeInfo(TypeOf.Class, create:() => RecommendedRisk()),
'RiskModel': TypeInfo(TypeOf.Class, create:() => RiskModel()),
'InvestmentProductAllocationsSpec': TypeInfo(TypeOf.Class, create:() => InvestmentProductAllocationsSpec()),
'Map<String,double?>': TypeInfo(TypeOf.Class, create:() => Map<String,double?>()),
'InvestmentProduct': TypeInfo(TypeOf.Class, create:() => InvestmentProduct()),
'List<InvestmentProductAllocationsSpec>': TypeInfo(TypeOf.Class, create:() => <InvestmentProductAllocationsSpec>[]),
'Map<int,Map<String,double>?>': TypeInfo(TypeOf.Class, create:() => Map<int,Map<String,double>?>()),
'Map<String,double>': TypeInfo(TypeOf.Class, create:() => Map<String,double>()),
'RecommendedProductType': TypeInfo(TypeOf.Class, create:() => RecommendedProductType()),
'List<InvestmentProduct>': TypeInfo(TypeOf.Class, create:() => <InvestmentProduct>[]),
'RecommendedProducts': TypeInfo(TypeOf.Class, create:() => RecommendedProducts()),
'MatrixNoRisk': TypeInfo(TypeOf.Class, create:() => MatrixNoRisk()),
'RecommendedProductGraph': TypeInfo(TypeOf.Class, create:() => RecommendedProductGraph()),
'List<Map<String,String>>': TypeInfo(TypeOf.Class, create:() => <Map<String,String>>[]),
'InvestmentRiskProfileSaveResponse': TypeInfo(TypeOf.Class, create:() => InvestmentRiskProfileSaveResponse()),
'InvestmentRiskProfileSaveRequest': TypeInfo(TypeOf.Class, create:() => InvestmentRiskProfileSaveRequest()),
'List<QuestionnaireAnswers>': TypeInfo(TypeOf.Class, create:() => <QuestionnaireAnswers>[]),
'QuestionnaireAnswers': TypeInfo(TypeOf.Class, create:() => QuestionnaireAnswers()),
});
Dart InvestmentRiskProfileSaveRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /members/{EmployeeGuid}/investmentprofile HTTP/1.1
Host: hcbtas-q-albamfs-api.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
employeeGuid: 00000000000000000000000000000000,
answers:
[
{
questionNumber: 0,
optionNumber: 0
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { risk: { recommendedRisk: { riskName: String, riskValue: 0, riskId: String }, chosenRisk: { riskName: String, riskValue: 0, riskId: String } }, product: { recommendedProduct: { product: String, investmentProduct: String, score: 0, productType: 0, investmentProducts: [ { riskId: String, riskName: String } ] }, chosenProduct: { product: String, investmentProduct: String, score: 0, productType: 0, investmentProducts: [ { riskId: String, riskName: String } ] } }, recommendedProductGraph: { barGraphData: [ { String: String } ], pieGraphInfo: { minimumAllocationInStocks: String, maximumAllocationinStocks: String } } }