/* Options: Date: 2025-07-18 00:02:13 SwiftVersion: 5.0 Version: 6.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://hcbtas-q-albamfs-api.azurewebsites.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: ClientCountryConfigValidateReq.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/clientcountryconfig/validate", "POST") public class ClientCountryConfigValidateReq : IReturn, Codable { public typealias Return = ClientCountryConfig public var config:ClientCountryConfig? required public init(){} } public class ClientCountryConfig : DatedEntity { public var clientCode:String? public var clientName:String? public var countryCode:String? public var source:DataSourceResult? public var ageRMin:Int? public var ageRMax:Int? public var primarySalary:String? public var annuityConfig:AnnuityConfig? public var assets:[AssetConfig] = [] public var contTables:[ContributionTableSpec] = [] public var investments:[InvestmentProduct] = [] public var content:[String:[Content]] = [:] public var environments:[String:String] = [:] public var customNumericConstraints:[String:Constraint] = [:] public var assetReturnRates:[String:ReturnRates] = [:] public var investmentPropertyRates:Double? public var getAssetClassFundDictionary:[String:Bool] = [:] public var getTermBasedFundDictionary:[String:Bool] = [:] public var getAllocationsDictionary:[String:[Int:[String:Double]]] = [:] public var assetNameMap:[String:String] = [:] public var assetContNameMap:[String:[String:String]] = [:] public var cacheKey:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case clientCode case clientName case countryCode case source case ageRMin case ageRMax case primarySalary case annuityConfig case assets case contTables case investments case content case environments case customNumericConstraints case assetReturnRates case investmentPropertyRates case getAssetClassFundDictionary case getTermBasedFundDictionary case getAllocationsDictionary case assetNameMap case assetContNameMap case cacheKey } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) clientCode = try container.decodeIfPresent(String.self, forKey: .clientCode) clientName = try container.decodeIfPresent(String.self, forKey: .clientName) countryCode = try container.decodeIfPresent(String.self, forKey: .countryCode) source = try container.decodeIfPresent(DataSourceResult.self, forKey: .source) ageRMin = try container.decodeIfPresent(Int.self, forKey: .ageRMin) ageRMax = try container.decodeIfPresent(Int.self, forKey: .ageRMax) primarySalary = try container.decodeIfPresent(String.self, forKey: .primarySalary) annuityConfig = try container.decodeIfPresent(AnnuityConfig.self, forKey: .annuityConfig) assets = try container.decodeIfPresent([AssetConfig].self, forKey: .assets) ?? [] contTables = try container.decodeIfPresent([ContributionTableSpec].self, forKey: .contTables) ?? [] investments = try container.decodeIfPresent([InvestmentProduct].self, forKey: .investments) ?? [] content = try container.decodeIfPresent([String:[Content]].self, forKey: .content) ?? [:] environments = try container.decodeIfPresent([String:String].self, forKey: .environments) ?? [:] customNumericConstraints = try container.decodeIfPresent([String:Constraint].self, forKey: .customNumericConstraints) ?? [:] assetReturnRates = try container.decodeIfPresent([String:ReturnRates].self, forKey: .assetReturnRates) ?? [:] investmentPropertyRates = try container.decodeIfPresent(Double.self, forKey: .investmentPropertyRates) getAssetClassFundDictionary = try container.decodeIfPresent([String:Bool].self, forKey: .getAssetClassFundDictionary) ?? [:] getTermBasedFundDictionary = try container.decodeIfPresent([String:Bool].self, forKey: .getTermBasedFundDictionary) ?? [:] getAllocationsDictionary = try container.decodeIfPresent([String:[Int:[String:Double]]].self, forKey: .getAllocationsDictionary) ?? [:] assetNameMap = try container.decodeIfPresent([String:String].self, forKey: .assetNameMap) ?? [:] assetContNameMap = try container.decodeIfPresent([String:[String:String]].self, forKey: .assetContNameMap) ?? [:] cacheKey = try container.decodeIfPresent(String.self, forKey: .cacheKey) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if clientCode != nil { try container.encode(clientCode, forKey: .clientCode) } if clientName != nil { try container.encode(clientName, forKey: .clientName) } if countryCode != nil { try container.encode(countryCode, forKey: .countryCode) } if source != nil { try container.encode(source, forKey: .source) } if ageRMin != nil { try container.encode(ageRMin, forKey: .ageRMin) } if ageRMax != nil { try container.encode(ageRMax, forKey: .ageRMax) } if primarySalary != nil { try container.encode(primarySalary, forKey: .primarySalary) } if annuityConfig != nil { try container.encode(annuityConfig, forKey: .annuityConfig) } if assets.count > 0 { try container.encode(assets, forKey: .assets) } if contTables.count > 0 { try container.encode(contTables, forKey: .contTables) } if investments.count > 0 { try container.encode(investments, forKey: .investments) } if content.count > 0 { try container.encode(content, forKey: .content) } if environments.count > 0 { try container.encode(environments, forKey: .environments) } if customNumericConstraints.count > 0 { try container.encode(customNumericConstraints, forKey: .customNumericConstraints) } if assetReturnRates.count > 0 { try container.encode(assetReturnRates, forKey: .assetReturnRates) } if investmentPropertyRates != nil { try container.encode(investmentPropertyRates, forKey: .investmentPropertyRates) } if getAssetClassFundDictionary.count > 0 { try container.encode(getAssetClassFundDictionary, forKey: .getAssetClassFundDictionary) } if getTermBasedFundDictionary.count > 0 { try container.encode(getTermBasedFundDictionary, forKey: .getTermBasedFundDictionary) } if getAllocationsDictionary.count > 0 { try container.encode(getAllocationsDictionary, forKey: .getAllocationsDictionary) } if assetNameMap.count > 0 { try container.encode(assetNameMap, forKey: .assetNameMap) } if assetContNameMap.count > 0 { try container.encode(assetContNameMap, forKey: .assetContNameMap) } if cacheKey != nil { try container.encode(cacheKey, forKey: .cacheKey) } } } public class Entity : IEntity, Codable { public var id:String? required public init(){} } public protocol IEntity { var id:String? { get set } } public enum Gender : String, Codable { case Female case Male case Other } public class Entity : Codable { public var logoUri:String? public var name:String? public var contactDetails:ContactDetails? required public init(){} } public class DataSourceResult : Codable { public var d:DataSource? public var t:Int? required public init(){} } public class AnnuityConfig : Codable { public var tableNames:[LifeTableName] = [] public var imprFactorTableNames:[LifeTableName] = [] public var reversion:Double? public var guarantee:Double? public var timing:Double? public var allowDiscountPreRet:Bool? public var scaleQx:Double? public var scaleImpr:Double? public var ageRating:Int? public var spouseAgeRating:Int? public var expense:Double? public var percBalanceSpent:Double? public var amountSpent:Double? public var incomePurchased:Double? public var deferralPeriod:Int? public var indexationName:String? public var drStochastic:String? public var impliedInflationStochasticSeries:String? public var targetTpx:Double? public var priceType:AnnuityPriceType? public var price:Double? required public init(){} } public class AssetConfig : Codable { public var code:String? public var name:String? public var rebalance:Bool? public var canEditInvestmentChoice:Bool? public var willSpend:Bool? public var investments:[String] = [] public var contributions:[ContributionSpec] = [] public var isOneOff:Bool? required public init(){} } public class ContributionTableSpec : Codable { public var code:String? public var type:ContributionType? public var rates:[String:Double] = [:] public var rateSpecs:[ContributionRateSpec] = [] public var keyTemplate:String? required public init(){} } public class InvestmentProduct : Codable { public var code:String? public var name:String? public var group:String? public var isAssetClassFund:Bool? public var allocs:[InvestmentProductAllocationsSpec] = [] public var order:Int? public var allocationsDictionary:[Int:[String:Double]] = [:] required public init(){} } public class ReturnRates : Codable { public var earningRates:[Double] = [] public var taxRates:[Double] = [] required public init(){} } public class DatedEntity : Entity, IDatedEntity { public var asAt:Date? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case asAt } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) asAt = try container.decodeIfPresent(Date.self, forKey: .asAt) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if asAt != nil { try container.encode(asAt, forKey: .asAt) } } } public protocol IDatedEntity : IEntity { var asAt:Date? { get set } } public enum AnnuityPriceType : String, Codable { case Calc case Table } public enum ContributionType : String, Codable { case Employer case Employee case EmployerMatching } public enum DataSource : String, Codable { case Db case Cache case Parameter case NA } public class LifeTableName : Codable { public var name:String? public var gender:Gender? required public init(){} } public class ContributionSpec : Codable { public var code:String? public var name:String? public var type:ContributionType? public var isEmployeeCont:Bool? public var table:String? public var ccy:String? public var fromAge:Int? public var toAge:Int? public var indexationType:String? public var salaryType:String? public var isTaxable:Bool? public var relatedRate:String? public var order:Int? public var editable:Bool? public var constraints:[ContributionConstraint] = [] public var amountType:AmountType? public var isOneOff:Bool? required public init(){} } public enum ContributionType : String, Codable { case Fixed case Time case Lookup case Match } public class ContributionRateSpec : Codable { public var fromAge:Int? public var toAge:Int? public var fromService:Int? public var toService:Int? public var sourceRate:Double? public var dateFrom:Date? public var dateTo:Date? public var upperLimit:Double? public var rate:Double? public var coreRate:Double? public var lookupKey:String? required public init(){} } public class ContributionConstraint : Codable { public var fromAge:Int? public var toAge:Int? public var min:Double? public var max:Double? public var step:Double? required public init(){} } public enum AmountType : String, Codable { case Any case Amount case Rate } public class InvestmentProduct : Codable { public var riskId:String? public var riskName:String? required public init(){} }