POST | /clientcountryconfig/validate |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CalcEngineApi.ServiceModel;
using TasSyd.Model.Client;
using TasSyd.Model.Base;
using TasSyd.Model.Stochastic;
using TasSyd.Model.Enums;
using TasSyd.Model.Core.Contributions;
using TasSyd.Model.Core;
namespace CalcEngineApi.ServiceModel
{
public partial class ClientCountryConfigValidateReq
{
public virtual ClientCountryConfig Config { get; set; }
}
}
namespace TasSyd.Model.Base
{
public partial class DatedEntity
: Entity, IDatedEntity
{
public virtual DateTime AsAt { get; set; }
}
public partial class Entity
: IEntity
{
public virtual string Id { get; set; }
}
}
namespace TasSyd.Model.Client
{
public partial class AnnuityConfig
{
public AnnuityConfig()
{
TableNames = new List<LifeTableName>{};
ImprFactorTableNames = new List<LifeTableName>{};
}
public virtual List<LifeTableName> TableNames { get; set; }
public virtual List<LifeTableName> ImprFactorTableNames { get; set; }
public virtual double? Reversion { get; set; }
public virtual double? Guarantee { get; set; }
public virtual double? Timing { get; set; }
public virtual bool? AllowDiscountPreRet { get; set; }
public virtual double? ScaleQx { get; set; }
public virtual double? ScaleImpr { get; set; }
public virtual int? AgeRating { get; set; }
public virtual int? SpouseAgeRating { get; set; }
public virtual double? Expense { get; set; }
public virtual double? PercBalanceSpent { get; set; }
public virtual double? AmountSpent { get; set; }
public virtual double? IncomePurchased { get; set; }
public virtual int? DeferralPeriod { get; set; }
public virtual string IndexationName { get; set; }
public virtual string DRStochastic { get; set; }
public virtual string ImpliedInflationStochasticSeries { get; set; }
public virtual double? TargetTpx { get; set; }
public virtual AnnuityPriceType PriceType { get; set; }
public virtual double Price { get; set; }
}
public partial class AssetConfig
{
public AssetConfig()
{
Investments = new List<string>{};
Contributions = new List<ContributionSpec>{};
}
public virtual string Code { get; set; }
public virtual string Name { get; set; }
public virtual bool Rebalance { get; set; }
public virtual bool CanEditInvestmentChoice { get; set; }
public virtual bool WillSpend { get; set; }
public virtual List<string> Investments { get; set; }
public virtual List<ContributionSpec> Contributions { get; set; }
public virtual bool IsOneOff { get; set; }
}
public partial class ClientCountryConfig
: DatedEntity
{
public ClientCountryConfig()
{
Assets = new List<AssetConfig>{};
ContTables = new List<ContributionTableSpec>{};
Investments = new List<InvestmentProduct>{};
Content = new Dictionary<string, List<Content>>{};
Environments = new Dictionary<string, string>{};
CustomNumericConstraints = new Dictionary<string, Constraint<Decimal>>{};
AssetReturnRates = new Dictionary<string, ReturnRates>{};
GetAssetClassFundDictionary = new Dictionary<string, bool>{};
GetTermBasedFundDictionary = new Dictionary<string, bool>{};
GetAllocationsDictionary = new Dictionary<string, Dictionary<Int32,Dictionary<String,Double>>>{};
AssetNameMap = new Dictionary<string, string>{};
AssetContNameMap = new Dictionary<string, Dictionary<String,String>>{};
}
public virtual string ClientCode { get; set; }
public virtual string ClientName { get; set; }
public virtual string CountryCode { get; set; }
public virtual DataSourceResult Source { get; set; }
public virtual int AgeRMin { get; set; }
public virtual int AgeRMax { get; set; }
public virtual string PrimarySalary { get; set; }
public virtual AnnuityConfig AnnuityConfig { get; set; }
public virtual List<AssetConfig> Assets { get; set; }
public virtual List<ContributionTableSpec> ContTables { get; set; }
public virtual List<InvestmentProduct> Investments { get; set; }
public virtual Dictionary<string, List<Content>> Content { get; set; }
public virtual Dictionary<string, string> Environments { get; set; }
public virtual Dictionary<string, Constraint<Decimal>> CustomNumericConstraints { get; set; }
public virtual Dictionary<string, ReturnRates> AssetReturnRates { get; set; }
public virtual double InvestmentPropertyRates { get; set; }
public virtual Dictionary<string, bool> GetAssetClassFundDictionary { get; set; }
public virtual Dictionary<string, bool> GetTermBasedFundDictionary { get; set; }
public virtual Dictionary<string, Dictionary<Int32,Dictionary<String,Double>>> GetAllocationsDictionary { get; set; }
public virtual Dictionary<string, string> AssetNameMap { get; set; }
public virtual Dictionary<string, Dictionary<String,String>> AssetContNameMap { get; set; }
public virtual string CacheKey { get; set; }
}
public partial class LifeTableName
{
public virtual string Name { get; set; }
public virtual Gender Gender { get; set; }
}
}
namespace TasSyd.Model.Core
{
public partial class InvestmentProduct
{
public InvestmentProduct()
{
Allocs = new List<InvestmentProductAllocationsSpec>{};
AllocationsDictionary = new Dictionary<int, Dictionary<String,Double>>{};
}
public virtual string Code { get; set; }
public virtual string Name { get; set; }
public virtual string Group { get; set; }
public virtual bool IsAssetClassFund { get; set; }
public virtual List<InvestmentProductAllocationsSpec> Allocs { get; set; }
public virtual int Order { get; set; }
public virtual Dictionary<int, Dictionary<String,Double>> AllocationsDictionary { get; set; }
}
public partial class InvestmentProductAllocationsSpec
{
public InvestmentProductAllocationsSpec()
{
Allocs = new Dictionary<string, double>{};
}
public virtual int FromAge { get; set; }
public virtual int? Term { get; set; }
public virtual Dictionary<string, double> Allocs { get; set; }
public virtual double TotalAlloc { get; set; }
}
public partial class ReturnRates
{
public ReturnRates()
{
EarningRates = new List<double>{};
TaxRates = new List<double>{};
}
public virtual List<double> EarningRates { get; set; }
public virtual List<double> TaxRates { get; set; }
}
}
namespace TasSyd.Model.Core.Contributions
{
public partial class ContributionConstraint
{
public virtual int? FromAge { get; set; }
public virtual int? ToAge { get; set; }
public virtual double? Min { get; set; }
public virtual double? Max { get; set; }
public virtual double? Step { get; set; }
}
public partial class ContributionRateSpec
{
public virtual int? FromAge { get; set; }
public virtual int? ToAge { get; set; }
public virtual int? FromService { get; set; }
public virtual int? ToService { get; set; }
public virtual double? SourceRate { get; set; }
public virtual DateTime? DateFrom { get; set; }
public virtual DateTime? DateTo { get; set; }
public virtual double? UpperLimit { get; set; }
public virtual double Rate { get; set; }
public virtual double CoreRate { get; set; }
public virtual string LookupKey { get; set; }
}
public partial class ContributionSpec
{
public ContributionSpec()
{
Constraints = new List<ContributionConstraint>{};
}
public virtual string Code { get; set; }
public virtual string Name { get; set; }
public virtual ContributionType Type { get; set; }
public virtual bool IsEmployeeCont { get; set; }
public virtual string Table { get; set; }
public virtual string Ccy { get; set; }
public virtual int FromAge { get; set; }
public virtual int? ToAge { get; set; }
public virtual string IndexationType { get; set; }
public virtual string SalaryType { get; set; }
public virtual bool IsTaxable { get; set; }
public virtual string RelatedRate { get; set; }
public virtual int Order { get; set; }
public virtual bool Editable { get; set; }
public virtual List<ContributionConstraint> Constraints { get; set; }
public virtual AmountType AmountType { get; set; }
public virtual bool IsOneOff { get; set; }
}
public partial class ContributionTableSpec
{
public ContributionTableSpec()
{
Rates = new Dictionary<string, double>{};
RateSpecs = new List<ContributionRateSpec>{};
}
public virtual string Code { get; set; }
public virtual ContributionType Type { get; set; }
public virtual Dictionary<string, double> Rates { get; set; }
public virtual List<ContributionRateSpec> RateSpecs { get; set; }
public virtual string KeyTemplate { get; set; }
}
}
namespace TasSyd.Model.Enums
{
public enum AmountType
{
Any,
Amount,
Rate,
}
public enum AnnuityPriceType
{
Calc,
Table,
}
public enum ContributionType
{
Fixed,
Time,
Lookup,
Match,
}
public enum DataSource
{
Db,
Cache,
Parameter,
NA,
}
public enum Gender
{
Female,
Male,
Other,
}
}
namespace TasSyd.Model.Stochastic
{
public partial class DataSourceResult
{
public virtual DataSource D { get; set; }
public virtual long T { get; set; }
}
}
C# ClientCountryConfigValidateReq 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 /clientcountryconfig/validate HTTP/1.1
Host: hcbtas-q-albamfs-api.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
config:
{
clientCode: String,
clientName: String,
countryCode: String,
source:
{
d: Db,
t: 0
},
ageRMin: 0,
ageRMax: 0,
primarySalary: String,
annuityConfig:
{
tableNames:
[
{
name: String,
gender: Female
}
],
imprFactorTableNames:
[
{
name: String,
gender: Female
}
],
reversion: 0,
guarantee: 0,
timing: 0,
allowDiscountPreRet: False,
scaleQx: 0,
scaleImpr: 0,
ageRating: 0,
spouseAgeRating: 0,
expense: 0,
percBalanceSpent: 0,
amountSpent: 0,
incomePurchased: 0,
deferralPeriod: 0,
indexationName: String,
drStochastic: String,
impliedInflationStochasticSeries: String,
targetTpx: 0,
priceType: Calc,
price: 0
},
assets:
[
{
code: String,
name: String,
rebalance: False,
canEditInvestmentChoice: False,
willSpend: False,
investments:
[
String
],
contributions:
[
{
code: String,
name: String,
type: Fixed,
isEmployeeCont: False,
table: String,
ccy: String,
fromAge: 0,
toAge: 0,
indexationType: String,
salaryType: String,
isTaxable: False,
relatedRate: String,
order: 0,
editable: False,
constraints:
[
{
fromAge: 0,
toAge: 0,
min: 0,
max: 0,
step: 0
}
],
amountType: Any,
isOneOff: False
}
],
isOneOff: False
}
],
contTables:
[
{
code: String,
type: Fixed,
rates:
{
String: 0
},
rateSpecs:
[
{
fromAge: 0,
toAge: 0,
fromService: 0,
toService: 0,
sourceRate: 0,
dateFrom: 0001-01-01,
dateTo: 0001-01-01,
upperLimit: 0,
rate: 0,
coreRate: 0,
lookupKey: String
}
],
keyTemplate: age-service-rate
}
],
investments:
[
{
code: String,
name: String,
group: String,
isAssetClassFund: False,
allocs:
[
{
fromAge: 0,
term: 0,
allocs:
{
String: 0
},
totalAlloc: 0
}
],
order: 0,
allocationsDictionary:
{
0: {}
}
}
],
content:
{
String:
[
{
section: String,
itemId: String,
itemCode: String,
country: String,
lang: String,
app: String,
companyId: String,
company: String,
elements:
{
String: String
},
id: String
}
]
},
environments:
{
String: String
},
customNumericConstraints:
{
String:
{
min: 0,
max: 0,
step: 0
}
},
assetReturnRates:
{
String:
{
earningRates:
[
0
],
taxRates:
[
0
]
}
},
investmentPropertyRates: 0,
getAssetClassFundDictionary:
{
String: False
},
getTermBasedFundDictionary:
{
String: True
},
getAllocationsDictionary:
{
String:
{
0: {}
}
},
assetNameMap:
{
String: String
},
assetContNameMap:
{
String:
{
String: String
}
},
cacheKey: ClientCountryConfig-String-String,
asAt: 0001-01-01,
id: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { clientCode: String, clientName: String, countryCode: String, source: { d: Db, t: 0 }, ageRMin: 0, ageRMax: 0, primarySalary: String, annuityConfig: { tableNames: [ { name: String, gender: Female } ], imprFactorTableNames: [ { name: String, gender: Female } ], reversion: 0, guarantee: 0, timing: 0, allowDiscountPreRet: False, scaleQx: 0, scaleImpr: 0, ageRating: 0, spouseAgeRating: 0, expense: 0, percBalanceSpent: 0, amountSpent: 0, incomePurchased: 0, deferralPeriod: 0, indexationName: String, drStochastic: String, impliedInflationStochasticSeries: String, targetTpx: 0, priceType: Calc, price: 0 }, assets: [ { code: String, name: String, rebalance: False, canEditInvestmentChoice: False, willSpend: False, investments: [ String ], contributions: [ { code: String, name: String, type: Fixed, isEmployeeCont: False, table: String, ccy: String, fromAge: 0, toAge: 0, indexationType: String, salaryType: String, isTaxable: False, relatedRate: String, order: 0, editable: False, constraints: [ { fromAge: 0, toAge: 0, min: 0, max: 0, step: 0 } ], amountType: Any, isOneOff: False } ], isOneOff: False } ], contTables: [ { code: String, type: Fixed, rates: { String: 0 }, rateSpecs: [ { fromAge: 0, toAge: 0, fromService: 0, toService: 0, sourceRate: 0, dateFrom: 0001-01-01, dateTo: 0001-01-01, upperLimit: 0, rate: 0, coreRate: 0, lookupKey: String } ], keyTemplate: age-service-rate } ], investments: [ { code: String, name: String, group: String, isAssetClassFund: False, allocs: [ { fromAge: 0, term: 0, allocs: { String: 0 }, totalAlloc: 0 } ], order: 0, allocationsDictionary: { 0: {} } } ], content: { String: [ { section: String, itemId: String, itemCode: String, country: String, lang: String, app: String, companyId: String, company: String, elements: { String: String }, id: String } ] }, environments: { String: String }, customNumericConstraints: { String: { min: 0, max: 0, step: 0 } }, assetReturnRates: { String: { earningRates: [ 0 ], taxRates: [ 0 ] } }, investmentPropertyRates: 0, getAssetClassFundDictionary: { String: False }, getTermBasedFundDictionary: { String: True }, getAllocationsDictionary: { String: { 0: {} } }, assetNameMap: { String: String }, assetContNameMap: { String: { String: String } }, cacheKey: ClientCountryConfig-String-String, asAt: 0001-01-01, id: String }