POST | /investmentallocation/save |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class InvestmentAllocation implements IConvertible
{
int? id;
int? memberId;
String? fundId;
double? currentBalancePercent;
double? futureContributionPercent;
double? currentBalanceFutureContributionPercent;
DateTime? dateCreated;
String? createdBy;
DateTime? dateUpdated;
String? updatedBy;
InvestmentAllocation({this.id,this.memberId,this.fundId,this.currentBalancePercent,this.futureContributionPercent,this.currentBalanceFutureContributionPercent,this.dateCreated,this.createdBy,this.dateUpdated,this.updatedBy});
InvestmentAllocation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
memberId = json['memberId'];
fundId = json['fundId'];
currentBalancePercent = JsonConverters.toDouble(json['currentBalancePercent']);
futureContributionPercent = JsonConverters.toDouble(json['futureContributionPercent']);
currentBalanceFutureContributionPercent = JsonConverters.toDouble(json['currentBalanceFutureContributionPercent']);
dateCreated = JsonConverters.fromJson(json['dateCreated'],'DateTime',context!);
createdBy = json['createdBy'];
dateUpdated = JsonConverters.fromJson(json['dateUpdated'],'DateTime',context!);
updatedBy = json['updatedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'memberId': memberId,
'fundId': fundId,
'currentBalancePercent': currentBalancePercent,
'futureContributionPercent': futureContributionPercent,
'currentBalanceFutureContributionPercent': currentBalanceFutureContributionPercent,
'dateCreated': JsonConverters.toJson(dateCreated,'DateTime',context!),
'createdBy': createdBy,
'dateUpdated': JsonConverters.toJson(dateUpdated,'DateTime',context!),
'updatedBy': updatedBy
};
getTypeName() => "InvestmentAllocation";
TypeContext? context = _ctx;
}
class MemberContribution implements IConvertible
{
int? id;
int? memberId;
DateTime? choiceStartDate;
DateTime? choiceEndDate;
double? baseContributionPercent;
double? voluntaryContributionPercent;
double? incentiveContributionPercent;
double? totalContributionPercent;
double? baseContributionValue;
double? voluntaryContributionValue;
double? incentiveContributionValue;
double? totalContributionValue;
DateTime? dateCreated;
String? createdBy;
DateTime? dateUpdated;
String? updatedBy;
MemberContribution({this.id,this.memberId,this.choiceStartDate,this.choiceEndDate,this.baseContributionPercent,this.voluntaryContributionPercent,this.incentiveContributionPercent,this.totalContributionPercent,this.baseContributionValue,this.voluntaryContributionValue,this.incentiveContributionValue,this.totalContributionValue,this.dateCreated,this.createdBy,this.dateUpdated,this.updatedBy});
MemberContribution.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
memberId = json['memberId'];
choiceStartDate = JsonConverters.fromJson(json['choiceStartDate'],'DateTime',context!);
choiceEndDate = JsonConverters.fromJson(json['choiceEndDate'],'DateTime',context!);
baseContributionPercent = JsonConverters.toDouble(json['baseContributionPercent']);
voluntaryContributionPercent = JsonConverters.toDouble(json['voluntaryContributionPercent']);
incentiveContributionPercent = JsonConverters.toDouble(json['incentiveContributionPercent']);
totalContributionPercent = JsonConverters.toDouble(json['totalContributionPercent']);
baseContributionValue = JsonConverters.toDouble(json['baseContributionValue']);
voluntaryContributionValue = JsonConverters.toDouble(json['voluntaryContributionValue']);
incentiveContributionValue = JsonConverters.toDouble(json['incentiveContributionValue']);
totalContributionValue = JsonConverters.toDouble(json['totalContributionValue']);
dateCreated = JsonConverters.fromJson(json['dateCreated'],'DateTime',context!);
createdBy = json['createdBy'];
dateUpdated = JsonConverters.fromJson(json['dateUpdated'],'DateTime',context!);
updatedBy = json['updatedBy'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'memberId': memberId,
'choiceStartDate': JsonConverters.toJson(choiceStartDate,'DateTime',context!),
'choiceEndDate': JsonConverters.toJson(choiceEndDate,'DateTime',context!),
'baseContributionPercent': baseContributionPercent,
'voluntaryContributionPercent': voluntaryContributionPercent,
'incentiveContributionPercent': incentiveContributionPercent,
'totalContributionPercent': totalContributionPercent,
'baseContributionValue': baseContributionValue,
'voluntaryContributionValue': voluntaryContributionValue,
'incentiveContributionValue': incentiveContributionValue,
'totalContributionValue': totalContributionValue,
'dateCreated': JsonConverters.toJson(dateCreated,'DateTime',context!),
'createdBy': createdBy,
'dateUpdated': JsonConverters.toJson(dateUpdated,'DateTime',context!),
'updatedBy': updatedBy
};
getTypeName() => "MemberContribution";
TypeContext? context = _ctx;
}
class InvestmentAllocationDataRequest implements IConvertible
{
List<InvestmentAllocation>? investmentAllocations;
MemberContribution? memberContribution;
int? memberId;
String? createdBy;
DateTime? dateOfBirthSpouse;
DateTime? dateOfBirthYoungestChild;
int? childrenCount;
String? investmentStrategy;
bool? isAdditionalInfoDisplayed;
InvestmentAllocationDataRequest({this.investmentAllocations,this.memberContribution,this.memberId,this.createdBy,this.dateOfBirthSpouse,this.dateOfBirthYoungestChild,this.childrenCount,this.investmentStrategy,this.isAdditionalInfoDisplayed});
InvestmentAllocationDataRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
investmentAllocations = JsonConverters.fromJson(json['investmentAllocations'],'List<InvestmentAllocation>',context!);
memberContribution = JsonConverters.fromJson(json['memberContribution'],'MemberContribution',context!);
memberId = json['memberId'];
createdBy = json['createdBy'];
dateOfBirthSpouse = JsonConverters.fromJson(json['dateOfBirthSpouse'],'DateTime',context!);
dateOfBirthYoungestChild = JsonConverters.fromJson(json['dateOfBirthYoungestChild'],'DateTime',context!);
childrenCount = json['childrenCount'];
investmentStrategy = json['investmentStrategy'];
isAdditionalInfoDisplayed = json['isAdditionalInfoDisplayed'];
return this;
}
Map<String, dynamic> toJson() => {
'investmentAllocations': JsonConverters.toJson(investmentAllocations,'List<InvestmentAllocation>',context!),
'memberContribution': JsonConverters.toJson(memberContribution,'MemberContribution',context!),
'memberId': memberId,
'createdBy': createdBy,
'dateOfBirthSpouse': JsonConverters.toJson(dateOfBirthSpouse,'DateTime',context!),
'dateOfBirthYoungestChild': JsonConverters.toJson(dateOfBirthYoungestChild,'DateTime',context!),
'childrenCount': childrenCount,
'investmentStrategy': investmentStrategy,
'isAdditionalInfoDisplayed': isAdditionalInfoDisplayed
};
getTypeName() => "InvestmentAllocationDataRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
'InvestmentAllocation': TypeInfo(TypeOf.Class, create:() => InvestmentAllocation()),
'MemberContribution': TypeInfo(TypeOf.Class, create:() => MemberContribution()),
'InvestmentAllocationDataRequest': TypeInfo(TypeOf.Class, create:() => InvestmentAllocationDataRequest()),
'List<InvestmentAllocation>': TypeInfo(TypeOf.Class, create:() => <InvestmentAllocation>[]),
});
Dart InvestmentAllocationDataRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /investmentallocation/save HTTP/1.1
Host: hcbtas-q-albamfs-api.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<InvestmentAllocationDataRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.ServiceModel">
<ChildrenCount>0</ChildrenCount>
<CreatedBy>String</CreatedBy>
<DateOfBirthSpouse>0001-01-01T00:00:00</DateOfBirthSpouse>
<DateOfBirthYoungestChild>0001-01-01T00:00:00</DateOfBirthYoungestChild>
<InvestmentAllocations xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
<d2p1:InvestmentAllocation>
<d2p1:CreatedBy>String</d2p1:CreatedBy>
<d2p1:CurrentBalanceFutureContributionPercent>0</d2p1:CurrentBalanceFutureContributionPercent>
<d2p1:CurrentBalancePercent>0</d2p1:CurrentBalancePercent>
<d2p1:DateCreated>0001-01-01T00:00:00</d2p1:DateCreated>
<d2p1:DateUpdated>0001-01-01T00:00:00</d2p1:DateUpdated>
<d2p1:FundId>String</d2p1:FundId>
<d2p1:FutureContributionPercent>0</d2p1:FutureContributionPercent>
<d2p1:Id>0</d2p1:Id>
<d2p1:MemberId>0</d2p1:MemberId>
<d2p1:UpdatedBy>String</d2p1:UpdatedBy>
</d2p1:InvestmentAllocation>
</InvestmentAllocations>
<InvestmentStrategy>String</InvestmentStrategy>
<IsAdditionalInfoDisplayed>false</IsAdditionalInfoDisplayed>
<MemberContribution xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
<d2p1:BaseContributionPercent>0</d2p1:BaseContributionPercent>
<d2p1:BaseContributionValue>0</d2p1:BaseContributionValue>
<d2p1:ChoiceEndDate>0001-01-01T00:00:00</d2p1:ChoiceEndDate>
<d2p1:ChoiceStartDate>0001-01-01T00:00:00</d2p1:ChoiceStartDate>
<d2p1:CreatedBy>String</d2p1:CreatedBy>
<d2p1:DateCreated>0001-01-01T00:00:00</d2p1:DateCreated>
<d2p1:DateUpdated>0001-01-01T00:00:00</d2p1:DateUpdated>
<d2p1:Id>0</d2p1:Id>
<d2p1:IncentiveContributionPercent>0</d2p1:IncentiveContributionPercent>
<d2p1:IncentiveContributionValue>0</d2p1:IncentiveContributionValue>
<d2p1:MemberId>0</d2p1:MemberId>
<d2p1:TotalContributionPercent>0</d2p1:TotalContributionPercent>
<d2p1:TotalContributionValue>0</d2p1:TotalContributionValue>
<d2p1:UpdatedBy>String</d2p1:UpdatedBy>
<d2p1:VoluntaryContributionPercent>0</d2p1:VoluntaryContributionPercent>
<d2p1:VoluntaryContributionValue>0</d2p1:VoluntaryContributionValue>
</MemberContribution>
<MemberId>0</MemberId>
</InvestmentAllocationDataRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length (HttpWebResponse)