From 0adf95494bb3ac8818a8ab3a087561d5a3f05639 Mon Sep 17 00:00:00 2001 From: amuolo Date: Thu, 9 Feb 2023 09:55:50 +0100 Subject: [PATCH 01/19] Reporting scenarios (#202) * version 1 with everything * much better performance * Including filters to cache datacubes efficiently * implement Daniel feedback --------- Co-authored-by: Andrea Muolo --- .../Test/Data/ExportReportVariables.ipynb | 3 +- ifrs17/Constants/Consts.ipynb | 26 -------- .../Report/ReportConfigurationAndUtils.ipynb | 10 ++-- ifrs17/Report/ReportMutableScopes.ipynb | 41 +++++++++---- ifrs17/Report/ReportStorage.ipynb | 60 +++++++++++-------- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/ifrs17-template/Test/Data/ExportReportVariables.ipynb b/ifrs17-template/Test/Data/ExportReportVariables.ipynb index bf06f205..71aa2cc1 100644 --- a/ifrs17-template/Test/Data/ExportReportVariables.ipynb +++ b/ifrs17-template/Test/Data/ExportReportVariables.ipynb @@ -144,8 +144,7 @@ "\n ((2020, 12), \"CH\", null, CurrencyType.Group), ", "\n ((2021, 3), \"CH\", null, CurrencyType.Contractual),", "\n ((2021, 3), \"CH\", null, CurrencyType.Functional),", - "\n ((2021, 3), \"CH\", null, CurrencyType.Group),", - "\n ((2020, 12), \"CH\", nameof(Scenarios.MTUP10pct), CurrencyType.Contractual)", + "\n ((2021, 3), \"CH\", null, CurrencyType.Group)", "\n};" ], "metadata": {}, diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 23d90c66..6bb2ba8f 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -361,32 +361,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public static class Scenarios{", - "\n public const string YCUP1pct = nameof(YCUP1pct); // Yield Curve Up 1.0pct", - "\n public const string YCDW1pct = nameof(YCDW1pct); // Yield Curve Down 1.0pct", - "\n public const string SRUP1pct = nameof(SRUP1pct); // Spread Rate Up 1.0pct", - "\n public const string SRDW1pct = nameof(SRDW1pct); // Spread Rate Down 1.0pct", - "\n public const string EUP1pct = nameof(EUP1pct); // Equity Up 1.0pct", - "\n public const string EDW1pct = nameof(EDW1pct); // Equity Down 1.0pct", - "\n public const string FXUP1pct = nameof(FXUP1pct); // Exchange Rate Up 1.0pct", - "\n public const string FXDW1pct = nameof(FXDW1pct); // Exchange Rate Down 1.0pct", - "\n public const string MTUP10pct = nameof(MTUP10pct); // Mortality Up 10pct", - "\n public const string MTDW10pct = nameof(MTDW10pct); // Mortality Down 10pct", - "\n public const string LUP10pct = nameof(LUP10pct); // Longevity Up 10pct", - "\n public const string LDW10pct = nameof(LDW10pct); // Longevity Down 10pct", - "\n public const string DUP10pct = nameof(DUP10pct); // Disability Up 10pct", - "\n public const string DDW10pct = nameof(DDW10pct); // Disability Down 10pct", - "\n public const string LICUP10pct = nameof(LICUP10pct); // Lic Up 10pct", - "\n public const string LICDW10pct = nameof(LICDW10pct); // Lic Down 10pct", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "markdown", "source": [ diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index aa805243..5d077303 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -172,11 +172,11 @@ "cell_type": "code", "source": [ "public static async Task> QueryReportVariablesAsync(this IWorkspace workspace, (int Year, int Month, string ReportingNode, string Scenario) args ) {", - "\n ReportVariable[] reportVariables = new ReportVariable[0];", - "\n if(args.Scenario != null) ", - "\n reportVariables = (await workspace.QueryReportVariablesSingleScenarioAsync((args.Year, args.Month, args.ReportingNode, null)));", - "\n return (await workspace.QueryReportVariablesSingleScenarioAsync((args.Year, args.Month, args.ReportingNode, args.Scenario)))", - "\n .Union(reportVariables.Select(x => x with {Scenario = args.Scenario}), EqualityComparer.Instance).ToArray();", + "\n var bestEstimate = (await workspace.QueryReportVariablesSingleScenarioAsync((args.Year, args.Month, args.ReportingNode, null)));", + "\n return (args.Scenario == null) ", + "\n ? bestEstimate", + "\n : (await workspace.QueryReportVariablesSingleScenarioAsync((args.Year, args.Month, args.ReportingNode, args.Scenario)))", + "\n .Union(bestEstimate.Select(x => x with {Scenario = args.Scenario}), EqualityComparer.Instance).ToArray();", "\n}" ], "metadata": {}, diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index 358bbe69..664a3c41 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -111,7 +111,8 @@ "\n int Year => ReportingPeriod.Year;", "\n int Month => ReportingPeriod.Month;", "\n string ReportingNode { get; set; }", - "\n string Scenario { get; set; }", + "\n string Scenario { get; set; } // TODO: Enable dropdown selection including All and Delta", + "\n string Comparison { get; set; } // TODO: only for scenario at the beginning, meant to enable general purpose comparisons ", "\n CurrencyType CurrencyType { get; set; }", "\n ", "\n ((int Year, int Month) ReportingPeriod, string ReportingNode, string Scenario, CurrencyType) ShowSettings => (ReportingPeriod, ReportingNode, Scenario, CurrencyType);", @@ -124,8 +125,15 @@ "\n protected string[] rowSlices => RowSlices is null ? defaultRowSlices : defaultRowSlices.Concat(RowSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", "\n", "\n IEnumerable ColumnSlices { get; set; }", - "\n protected string[] defaultColumnSlices => new string[] { };", - "\n protected string[] columnSlices => ColumnSlices is null ? defaultColumnSlices : defaultColumnSlices.Where(cs => !ColumnSlices.Contains(cs)).Concat(ColumnSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", + "\n protected string[] defaultColumnSlices => new string[] { };", + "\n protected string[] columnSlices { get{", + "\n var slices = ColumnSlices is null ? defaultColumnSlices : defaultColumnSlices.Where(cs => !ColumnSlices.Contains(cs)).Concat(ColumnSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", + "\n return Scenario == \"All\" || Scenario == \"Delta\"", + "\n ? slices.Concat(nameof(Scenario).RepeatOnce()).ToArray() ", + "\n : Scenario is null ? slices : nameof(Scenario).RepeatOnce().Concat(slices).ToArray();", + "\n }}", + "\n", + "\n // Identities", "\n protected HashSet<(ReportIdentity, CurrencyType)> GetIdentities() => GetStorage().GetIdentities(ReportingPeriod, ReportingNode, Scenario, CurrencyType);", "\n ", "\n // Filter", @@ -135,27 +143,26 @@ "\n // Scope Initialization", "\n async Task InitAsync() {", "\n var mostRecentPartition = (await workspace.Query().Where(x => x.Scenario == null).OrderBy(x => x.Year).ThenBy(x => x.Month).ToArrayAsync()).Last(); ", - "\n ", "\n ReportingPeriod = (mostRecentPartition.Year, mostRecentPartition.Month);", "\n ReportingNode = (await workspace.Query().Where(x => x.Parent == null).ToArrayAsync()).First().SystemName; // TODO: change once user permissions are available", "\n Scenario = null;", "\n CurrencyType = CurrencyType.Contractual;", "\n await GetStorage().InitializeReportIndependentCacheAsync();", - "\n }", + "\n } ", + "\n", + "\n //Report", "\n public IDataCube GetDataCube() => default;", "\n protected int headerColumnWidthValue => 250;", + "\n public Task ToReportAsync => GetReportTaskAsync();", "\n private async Task GetReportTaskAsync() {", - "\n await GetStorage().InitializeAsync(ReportingPeriod, ReportingNode, Scenario, CurrencyType);", - "\n ", - "\n return await report.ForDataCube(GetDataCube())", + "\n await GetStorage().InitializeAsync(ReportingPeriod, ReportingNode, Scenario, CurrencyType); ", + "\n return await report.ForDataCube(GetScope((ReportingPeriod, ReportingNode, Scenario, CurrencyType, Identity, dataFilter)).Cube)", "\n .WithQuerySource(workspace)", "\n .SliceRowsBy(rowSlices)", "\n .SliceColumnsBy(columnSlices)", "\n .ReportGridOptions(headerColumnWidth: headerColumnWidthValue)", "\n .ExecuteAsync();", "\n }", - "\n", - "\n Task ToReportAsync => GetReportTaskAsync();", "\n}", "\n", "\npublic interface PvReport : IIfrs17Report {", @@ -279,7 +286,19 @@ "\n IDataCube IIfrs17Report.GetDataCube() => DataFilter == null ", "\n ? GetScopes(GetIdentities()).Aggregate().FinancialPerformance", "\n : GetScopes(GetIdentities()).Aggregate().FinancialPerformance.Filter(dataFilter);", - "\n}" + "\n}", + "\n", + "\npublic interface Data : IMutableScope<((int year, int month) period, string reportingNode, string scenario, CurrencyType currencyType, ", + "\n string reportType, (string filterName, object filterValue)[] dataFilter)> ", + "\n{", + "\n IDataCube Cube { get{", + "\n var dataCube = GetScope(Identity.reportType).GetDataCube();", + "\n // TODO: suggestion to place the filter here instead of having it in every applicability scope", + "\n if(Identity.scenario != \"Delta\") return dataCube;", + "\n var bestEstimateById = dataCube.Where(x => x.Scenario == null).ToDictionary(x => x.ToIdentityString());", + "\n return dataCube.Select(x => x.Scenario == null ? x : x with { Value = x.Value - (bestEstimateById.TryGetValue((x with {Scenario = null}).ToIdentityString(), out var be)? be.Value : 0.0) }).ToDataCube();", + "\n }}", + "\n} " ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Report/ReportStorage.ipynb b/ifrs17/Report/ReportStorage.ipynb index 4effa761..e2f9e843 100644 --- a/ifrs17/Report/ReportStorage.ipynb +++ b/ifrs17/Report/ReportStorage.ipynb @@ -114,13 +114,15 @@ "\n // Current Storage Settings", "\n public ((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) Args {get; private set;}", "\n ", - "\n // Cache for Aux Data", + "\n // Aux Data", "\n private Dictionary<(int year, int month), Dictionary>> exchangeRatesByCurrencyByFxTypeAndPeriod = new(); // Fx Rates", "\n private Dictionary<(int year, int month), Dictionary> fxPeriodsByAocStepAndPeriod = new(); // FxParameter", "\n ", + "\n // Dimensions", "\n public HashSet EstimateTypesWithoutAoc {get; private set;}", + "\n public HashSet TargetScenarios {get; private set;}", "\n ", - "\n // Cache for Variables and Parameters", + "\n // Variables and Parameters", "\n private Dictionary<((int year, int month) period, string reportingNode, string scenario), Dictionary>>> variablesDictionary = new();", "\n ", "\n // Constructor", @@ -140,12 +142,11 @@ "\n }", "\n ", "\n public async Task InitializeAsync((int year, int month) period, string reportingNode, string scenario, CurrencyType currencyType) {", - "\n // Report Dependent Cache", - "\n", "\n // Setting the Args --> Temp for the moment", "\n Args = (period, reportingNode, scenario, currencyType);", "\n ", "\n EstimateTypesWithoutAoc = (await workspace.Query().Where(x => x.StructureType != StructureType.AoC).Select(x => x.SystemName).ToArrayAsync()).ToHashSet();", + "\n TargetScenarios = await GetScenariosAsync(scenario); ", "\n ", "\n // FX && Fx Parameters", "\n if(!exchangeRatesByCurrencyByFxTypeAndPeriod.TryGetValue(period, out var exchangeRatesByCurrencyByFxType) || !fxPeriodsByAocStepAndPeriod.TryGetValue(period, out var fxPeriodsByAocStep)) {", @@ -157,31 +158,34 @@ "\n ", "\n // Variables", "\n foreach(var rn in GetLeaves(reportingNode)) {", - "\n if(!variablesDictionary.TryGetValue((period, rn, scenario), out var variablesByIdentity)) {", - "\n variablesByIdentity = (await workspace.QueryReportVariablesAsync((period.year, period.month, rn, scenario)))", - "\n .ToDictionaryGrouped(x => new ReportIdentity {", - "\n Year = period.year,", - "\n Month = period.month,", - "\n ReportingNode = x.ReportingNode,", - "\n Scenario = x.Scenario,", - "\n Projection = x.Projection,", - "\n ContractualCurrency = x.ContractualCurrency,", - "\n FunctionalCurrency = x.FunctionalCurrency,", - "\n ValuationApproach = x.ValuationApproach,", - "\n LiabilityType = x.LiabilityType,", - "\n IsReinsurance = x.IsReinsurance,", - "\n IsOci = !string.IsNullOrWhiteSpace(x.OciType) },", - "\n x => x.ToDictionaryGrouped(y => y.EstimateType,", - "\n y => y.ToArray().ToDataCube()));", + "\n foreach(var scn in TargetScenarios) {", + "\n if(!variablesDictionary.TryGetValue((period, rn, scn), out var variablesByIdentity)) {", + "\n variablesByIdentity = (await workspace.QueryReportVariablesAsync((period.year, period.month, rn, scn)))", + "\n .ToDictionaryGrouped(x => new ReportIdentity {", + "\n Year = period.year,", + "\n Month = period.month,", + "\n ReportingNode = x.ReportingNode,", + "\n Scenario = scn,", + "\n Projection = x.Projection,", + "\n ContractualCurrency = x.ContractualCurrency,", + "\n FunctionalCurrency = x.FunctionalCurrency,", + "\n ValuationApproach = x.ValuationApproach,", + "\n LiabilityType = x.LiabilityType,", + "\n IsReinsurance = x.IsReinsurance,", + "\n IsOci = !string.IsNullOrWhiteSpace(x.OciType) },", + "\n x => x.ToDictionaryGrouped(y => y.EstimateType,", + "\n y => y.ToArray().ToDataCube()));", "\n ", - "\n variablesDictionary.Add((period, rn, scenario), variablesByIdentity);", + "\n variablesDictionary.Add((period, rn, scn), variablesByIdentity);", + "\n }", "\n }", "\n }", "\n }", "\n ", "\n // Getters for Data", "\n public IDataCube GetVariables(ReportIdentity reportIdentity, params string[] estimateTypes)", - "\n => (!variablesDictionary.TryGetValue(((reportIdentity.Year, reportIdentity.Month), reportIdentity.ReportingNode, reportIdentity.Scenario), out var variablesByIdentity) || !variablesByIdentity.TryGetValue(reportIdentity, out var variablesByEstimateType))", + "\n => (!variablesDictionary.TryGetValue(((reportIdentity.Year, reportIdentity.Month), reportIdentity.ReportingNode, reportIdentity.Scenario), out var variablesByIdentity) || ", + "\n !variablesByIdentity.TryGetValue(reportIdentity, out var variablesByEstimateType))", "\n ? Enumerable.Empty().ToDataCube()", "\n : estimateTypes.Length switch {", "\n 0 => variablesByEstimateType.SelectMany(x => x.Value).ToDataCube(),", @@ -202,16 +206,15 @@ "\n public Systemorph.Vertex.Hierarchies.IHierarchy GetHierarchy() where T : class, IHierarchicalDimension => hierarchicalDimensionCache.Get();", "\n ", "\n public HashSet<(ReportIdentity, CurrencyType)> GetIdentities((int year, int month) period, string reportingNode, string scenario, CurrencyType currencyType)", - "\n => GetLeaves(reportingNode)", - "\n .SelectMany(rn => variablesDictionary.TryGetValue((period, rn, scenario), out var inner) ? inner.Keys.Select(x => (x, currencyType)) : Enumerable.Empty<(ReportIdentity, CurrencyType)>())", - "\n .ToHashSet();", + "\n => GetLeaves(reportingNode).SelectMany(rn => TargetScenarios.SelectMany(scn =>", + "\n variablesDictionary.TryGetValue((period, rn, scn), out var inner) ? inner.Keys.Select(x => (x, currencyType)) : Enumerable.Empty<(ReportIdentity, CurrencyType)>())).ToHashSet();", "\n ", "\n public double GetFx((int year, int month) period, string currentCurrency, string targetCurrency, FxPeriod fxPeriod) {", "\n if (currentCurrency == targetCurrency) return 1;", "\n if(!exchangeRatesByCurrencyByFxTypeAndPeriod.TryGetValue(period, out var exchangeRatesByCurrencyByFxType))", "\n throw new Exception ($\"No exchange rates for Period {period} were found.\");", "\n return GetCurrencyToGroupFx(exchangeRatesByCurrencyByFxType, currentCurrency, fxPeriod, GroupCurrency)", - "\n / GetCurrencyToGroupFx(exchangeRatesByCurrencyByFxType, targetCurrency, fxPeriod, GroupCurrency);", + "\n / GetCurrencyToGroupFx(exchangeRatesByCurrencyByFxType, targetCurrency, fxPeriod, GroupCurrency);", "\n }", "\n ", "\n public FxPeriod GetFxPeriod((int year, int month) period, string aocType, string novelty) => fxPeriodsByAocStepAndPeriod[period][new AocStep(aocType, novelty)];", @@ -221,6 +224,11 @@ "\n var descendants = hierarchicalDimensionCache.Get(systemName).Descendants(includeSelf: true);", "\n return descendants.Where(x => !descendants.Select(y => y.Parent).Contains(x.SystemName)).Select(x => x.SystemName).ToHashSet();", "\n }", + "\n", + "\n public async Task> GetScenariosAsync(string scenario) => ", + "\n scenario == \"Delta\" || scenario == \"All\" ", + "\n ? (await workspace.Query().Select(x => x.Scenario).ToArrayAsync()).ToHashSet()", + "\n : scenario.RepeatOnce().ToHashSet();", "\n}" ], "metadata": {}, From 8d1eef904f258b99fe4c069cc6e50ab264cbcea2 Mon Sep 17 00:00:00 2001 From: Andrey Katz <118806207+andrey-katz-systemorph@users.noreply.github.com> Date: Thu, 9 Feb 2023 16:30:11 +0100 Subject: [PATCH 02/19] 138 migration (#193) * scaffolding, snapshot and scheme * migration flow and some comments * update Configure * explanation file * configure * explain * comments * All the comments added * Update ReadMe.ipynb typo fixed * address the comment * Update ReadMe.ipynb comments resolved * Update ReadMe.ipynb typos fixed * Update ReadMe.ipynb typo * Update ReadMe.ipynb wording change * Update Scaffold.ipynb wording * Title and some minor explanations added --------- Co-authored-by: akatz --- ifrs17-template/Database/Configure.ipynb | 5 +- .../MigrationAndScaffolding/Initial.ipynb | 728 +++++++++++ .../MigrationFlow.ipynb | 86 ++ .../MigrationAndScaffolding/ReadMe.ipynb | 126 ++ .../MigrationAndScaffolding/Scaffold.ipynb | 130 ++ .../MigrationAndScaffolding/Snapshot.ipynb | 1080 +++++++++++++++++ 6 files changed, 2154 insertions(+), 1 deletion(-) create mode 100644 ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb create mode 100644 ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb create mode 100644 ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb create mode 100644 ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb create mode 100644 ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb diff --git a/ifrs17-template/Database/Configure.ipynb b/ifrs17-template/Database/Configure.ipynb index c536ff36..4ede3cfe 100644 --- a/ifrs17-template/Database/Configure.ipynb +++ b/ifrs17-template/Database/Configure.ipynb @@ -81,7 +81,10 @@ "cell_type": "code", "source": [ "await DataSource.Configure().UseMsSql(opt => opt.WithConnectionString(connectionStringMsSql)", - "\n .WithTypes(allTypes)) .ConnectAsync();" + "\n .WithTypes(allTypes)", + "\n // .WithMigration() // uncomment if run with migration", + "\n ) ", + "\n .ConnectAsync();" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb new file mode 100644 index 00000000..e14369ba --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -0,0 +1,728 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

The Initial Migration Code

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This copy contains the copy of the initial migration code. It is a necessary input to execute the first migration flow. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[Migration(\"20230208105811_InitialTypes\")]", + "\npublic class InitialTypes : Migration", + "\n{", + "\n protected override void Up(MigrationBuilder migrationBuilder)", + "\n {", + "\n migrationBuilder.CreateTable(", + "\n name: \"AmountType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n PeriodType = table.Column(type: \"int\", nullable: false),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false),", + "\n ExternalId = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_AmountType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"AocConfiguration\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataType = table.Column(type: \"int\", nullable: false),", + "\n InputSource = table.Column(type: \"int\", nullable: false),", + "\n FxPeriod = table.Column(type: \"int\", nullable: false),", + "\n YcPeriod = table.Column(type: \"int\", nullable: false),", + "\n CdrPeriod = table.Column(type: \"int\", nullable: false),", + "\n ValuationPeriod = table.Column(type: \"int\", nullable: false),", + "\n RcPeriod = table.Column(type: \"int\", nullable: false),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_AocConfiguration\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"CreditDefaultRate\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreditRiskRating = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_CreditDefaultRate\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"CreditRiskRating\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_CreditRiskRating\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Currency\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Currency\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNode\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n ContractualCurrency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n FunctionalCurrency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n LineOfBusiness = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ValuationApproach = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n OciType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n AnnualCohort = table.Column(type: \"int\", nullable: true),", + "\n LiabilityType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Profitability = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Portfolio = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n YieldCurveName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNode\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNodeParameter\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n LinkedDataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ReinsuranceCoverage = table.Column(type: \"float\", nullable: true),", + "\n PremiumAllocation = table.Column(type: \"float\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNodeParameter\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"DataNodeState\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n State = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_DataNodeState\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"EconomicBasis\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_EconomicBasis\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"EstimateType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n InputSource = table.Column(type: \"int\", nullable: false),", + "\n StructureType = table.Column(type: \"int\", nullable: false),", + "\n PeriodType = table.Column(type: \"int\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false),", + "\n ExternalId = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_EstimateType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ExchangeRate\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n FxType = table.Column(type: \"int\", nullable: false),", + "\n FxToGroupCurrency = table.Column(type: \"float\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ExchangeRate\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ExportFile\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ContentType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ExportFile\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"IfrsVariable\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Value = table.Column(type: \"float\", nullable: false),", + "\n EstimateType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n EconomicBasis = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n AmountType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AccidentYear = table.Column(type: \"int\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_IfrsVariable\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportDataSet\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportDataSet\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportExportActivity\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Username = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n StartDateTime = table.Column(type: \"datetime2\", nullable: false),", + "\n EndDateTime = table.Column(type: \"datetime2\", nullable: false),", + "\n Status = table.Column(type: \"int\", nullable: false),", + "\n Category = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ExceptionMessage = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ErrorMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n WarningMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n InfoMessages = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n SourceId = table.Column(type: \"uniqueidentifier\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportExportActivity\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportFile\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Directory = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ContentType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Source = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportFile\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportStream\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportStream\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ImportString\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Content = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n CreationTime = table.Column(type: \"datetime2\", nullable: false),", + "\n SerializedContent = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n Length = table.Column(type: \"bigint\", nullable: true),", + "\n Format = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ImportString\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"LiabilityType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_LiabilityType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"LineOfBusiness\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_LineOfBusiness\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Novelty\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Novelty\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"OciType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_OciType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartitionByReportingNode\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n ReportingNode = table.Column(type: \"nvarchar(max)\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartitionByReportingNode\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartitionByReportingNodeAndPeriod\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n ReportingNode = table.Column(type: \"nvarchar(max)\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartitionByReportingNodeAndPeriod\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Partner\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Partner\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"PartnerRating\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Partner = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n CreditRiskRating = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_PartnerRating\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Profitability\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Profitability\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ProjectionConfiguration\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Shift = table.Column(type: \"int\", nullable: false),", + "\n TimeStep = table.Column(type: \"int\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ProjectionConfiguration\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"RawVariable\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true),", + "\n EstimateType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DataNode = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AocType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Novelty = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Partition = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n AmountType = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n AccidentYear = table.Column(type: \"int\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_RawVariable\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ReportingNode\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ReportingNode\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"RiskDriver\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_RiskDriver\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"Scenario\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_Scenario\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"ValuationApproach\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_ValuationApproach\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"VariableType\",", + "\n columns: table => new", + "\n {", + "\n SystemName = table.Column(type: \"nvarchar(16)\", maxLength: 16, nullable: false),", + "\n Parent = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Discriminator = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n DisplayName = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Order = table.Column(type: \"int\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_VariableType\", x => x.SystemName);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"YieldCurve\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: false),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Name = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Values = table.Column(type: \"varbinary(max)\", nullable: true)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_YieldCurve\", x => x.Id);", + "\n });", + "\n", + "\n migrationBuilder.CreateTable(", + "\n name: \"YieldCurveReport\",", + "\n columns: table => new", + "\n {", + "\n Id = table.Column(type: \"uniqueidentifier\", nullable: false),", + "\n Currency = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Year = table.Column(type: \"int\", nullable: false),", + "\n Month = table.Column(type: \"int\", nullable: false),", + "\n Scenario = table.Column(type: \"nvarchar(max)\", nullable: true),", + "\n Index = table.Column(type: \"int\", nullable: false),", + "\n Value = table.Column(type: \"float\", nullable: false)", + "\n },", + "\n constraints: table =>", + "\n {", + "\n table.PrimaryKey(\"PK_YieldCurveReport\", x => x.Id);", + "\n });", + "\n }", + "\n", + "\n protected override void Down(MigrationBuilder migrationBuilder)", + "\n {", + "\n migrationBuilder.DropTable(", + "\n name: \"AmountType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"AocConfiguration\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"CreditDefaultRate\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"CreditRiskRating\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Currency\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNodeParameter\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"DataNodeState\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"EconomicBasis\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"EstimateType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ExchangeRate\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ExportFile\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"IfrsVariable\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportDataSet\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportExportActivity\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportFile\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportStream\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ImportString\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"LiabilityType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"LineOfBusiness\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Novelty\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"OciType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartitionByReportingNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartitionByReportingNodeAndPeriod\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Partner\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"PartnerRating\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Profitability\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ProjectionConfiguration\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"RawVariable\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ReportingNode\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"RiskDriver\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"Scenario\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"ValuationApproach\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"VariableType\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"YieldCurve\");", + "\n", + "\n migrationBuilder.DropTable(", + "\n name: \"YieldCurveReport\");", + "\n }", + "\n}", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb new file mode 100644 index 00000000..99310591 --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb @@ -0,0 +1,86 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Migration Flow

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#r \"nuget:Systemorph.SchemaMigrations,1.6.3\"", + "\n#!import \"../PersonalConnectionExample\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "For the initial migration one needs a migration code from the Initial notebook, so we import it here. For any subsequent migrations please change the next cell to import the notebook, where your stored the relevant migration code." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"Initial\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Here is the migration of the data base. For all subsequent migrations, please replace the InitialTypes in the second row with the name, that you gave to your migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await SchemaMigrations", + "\n .Apply() // Change the class in <> for future migrations", + "\n .ToMsSql(connectionStringMsSql)", + "\n .MigrateAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb new file mode 100644 index 00000000..afde3c4f --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb @@ -0,0 +1,126 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Explanation of Migration and Scaffolding

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Brief Explanation of Migration" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Migration is a powerful tool that allows us to keep the same Database (DB) during the whole lifetime of the project, without any need to remove it if one needs to modify the DB, e.g. via addition or removing certain tables or columns. With the migration, if modification of the DB is needed, we do not remove the old DB, but rather migrate it incrementally. Note, however, that running a project with migration is a choice rather than a default option. If you are OK with removing the DB each time when some change in the tables structure is needed, migration is not necessary. ", + "\n", + "\nAt the first step we perform the [scaffolding](Scaffold). The scaffolding procedure naturally outputs the migration code and the model snapshot. The migration code is the code that we should run in order to change the DB according to our new requirements, or, alternatively, if we start from scratch, to create the DB. The snapshot contains all the information about the structure of the DB after the migration. It is necessary to have the snapshot, in order for us not to start from scratch at the next migration, but rather only *implement the changes*. Each time when the DB has to be changed, we should scaffold the new model, taking into account the snapshot of the previous step. The snapshot of the new scaffold should be copied manually without changes into the [Snapshot notebook](Snapshot). We have done it already for the initial migration, please do not forget to change the [Snapshot notebook](Snapshot) for any subsequent migration.", + "\n", + "\nAt the next step the migration code should be copied into a new notebook. The first one was copied into the [Initial notebook](Initial). Of course, it would make a lot of sense to add each new incremental migration into a new notebook inside this folder. ", + "\n", + "\nFinally, in order to update or initiate the DB, one should run the [Migration flow notebook](MigrationFlow) where we feed all the necessary information from the [personal connection](../PersonalConnectionExample) and the notebook that includes the migration code, which is the [Initial notebook](Initial) for the first migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# A Handful of Comments on Migration" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Do Not Delete " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Since the logic migration includes incremental changes, while adding or removing something from the DB, one should not delete the schema anymore. Therefore, the [schema deletion notebook](../SchemaDelete) must not be used. ", + "\n", + "\nSince migration is not a default mode, we are still leaving this notebook in the folder. However, note that now using it would contradict the logic of migration, so please do not do it light-headedly. Stick to migration if this is your choice." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Configure" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Before you execute the [Configure notebook](../Configure), please uncomment the row, that specifies that the Configuration is run with migration. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Initialize" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Note, that when the schema is created, it is not filled automatically via running the [Configure](../Configure) notebook. Therefore there is a need to initaliaze the DB manually via [this](../../Initialization/InitSystemorphToDatabase) notebook. Otherwise you will get a correctly structured, but completely empty DB " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb new file mode 100644 index 00000000..103c03ac --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb @@ -0,0 +1,130 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Scaffolding

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../../Constants/CalculationEngine\"", + "\n#!eval calculationEngine" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "At the first stage we generate an array of classes that we are about to scaffold. Here we scuffold old the suitable classes that have keys (we want to have a unique identifier of each object in the DB) and are not interfaces or abstract classes, because in general we are not going to have instance of such abstract objects like interface or abstract class. You personal choice might be even narrower than that, in this case just mofify the code in the cell below. Note that the array of types that you are going to scaffold must have no repetitions. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes())", + "\n .Where(t => (t.IsAssignableTo(typeof(IKeyed)) || t.IsAssignableTo(typeof(KeyedDimension)))", + "\n && !t.IsInterface", + "\n && !t.IsAbstract", + "\n ).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Start from the scaffolding of the initial types. Please make sure that you run this code *only at the first you create the DB*. For any subsequent changes, please comment this cell out and never use it again. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var migration = SchemaMigrations", + "\n .ConfigureScaffolder(allTypes)", + "\n .ForMsSql()", + "\n .Scaffold(\"InitialTypes\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "In order to perform any subsequent change in the DB, there is no need to erase the DB and create a new from the scratch. It is sufficient to erase the cell above and uncomment the following cell. Please do not forget to insert a proper array of classes that you'd like to scaffold in the third row, as well as to give your own unique name to this migration in the 5th line. This is exactly the name that are going to use in the migration flow. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "//#!import \"Snapshot\"", + "\n//var migration = SchemaMigrations", + "\n// .ConfigureScaffolder({your array of types here}, new DbModelSnapshot())", + "\n// .ForMsSql()", + "\n// .Scaffold({Your unique name here}); " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "migration.MigrationCode" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "migration.SnapshotCode" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb new file mode 100644 index 00000000..4f7e598d --- /dev/null +++ b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb @@ -0,0 +1,1080 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

The Current Snapshot

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Each time you produce a new migration, please copy and paste the snapshot code directly here. This must be the copy of the *most recent* migration snapshot. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using Microsoft.EntityFrameworkCore;", + "\nusing Microsoft.EntityFrameworkCore.Infrastructure;", + "\nusing Microsoft.EntityFrameworkCore.Metadata;", + "\n", + "\npublic class DbModelSnapshot : ModelSnapshot", + "\n{", + "\n protected override void BuildModel(ModelBuilder modelBuilder)", + "\n {", + "\n modelBuilder", + "\n .HasAnnotation(\"ProductVersion\", \"6.0.1\")", + "\n .HasAnnotation(\"Relational:MaxIdentifierLength\", 128);", + "\n", + "\n SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);", + "\n", + "\n modelBuilder.Entity(\"Submission_151+YieldCurveReport\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Index\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Value\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"YieldCurveReport\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_287+ImportExportActivity\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Category\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EndDateTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"ErrorMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExceptionMessage\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"InfoMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SourceId\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"StartDateTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Status\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Username\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"WarningMessages\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportExportActivity\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_289+ExportFile\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ContentType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ExportFile\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_291+ImportFile\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ContentType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Directory\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Source\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportFile\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_292+ImportString\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Content\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportString\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_293+ImportDataSet\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportDataSet\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_294+ImportStream\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreationTime\")", + "\n .HasColumnType(\"datetime2\");", + "\n", + "\n b.Property(\"Format\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Length\")", + "\n .HasColumnType(\"bigint\");", + "\n", + "\n b.Property(\"SerializedContent\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ImportStream\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_57+AmountType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExternalId\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"PeriodType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"AmountType\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"AmountType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_59+RiskDriver\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"RiskDriver\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_60+EstimateType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ExternalId\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"InputSource\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"PeriodType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"StructureType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"EstimateType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_61+Novelty\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Novelty\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_62+VariableType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"VariableType\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"VariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_68+Scenario\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Scenario\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_69+LineOfBusiness\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"LineOfBusiness\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_70+Currency\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Currency\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_71+EconomicBasis\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"EconomicBasis\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_72+ValuationApproach\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ValuationApproach\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_73+LiabilityType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"LiabilityType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_74+OciType\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"OciType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_75+Profitability\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Profitability\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_76+Partner\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"Partner\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_77+CreditRiskRating\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"CreditRiskRating\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_78+ReportingNode\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Parent\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ReportingNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_79+ProjectionConfiguration\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Shift\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"TimeStep\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"ProjectionConfiguration\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_80+AocConfiguration\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"CdrPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"DataType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"FxPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"InputSource\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Order\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"RcPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"ValuationPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"YcPeriod\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"AocConfiguration\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_81+ExchangeRate\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"FxToGroupCurrency\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.Property(\"FxType\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"ExchangeRate\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_82+CreditDefaultRate\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreditRiskRating\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"CreditDefaultRate\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_83+YieldCurve\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Currency\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Name\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"YieldCurve\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_84+PartnerRating\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"CreditRiskRating\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partner\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartnerRating\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_86+PartitionByReportingNode\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ReportingNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartitionByReportingNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_87+PartitionByReportingNodeAndPeriod\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"ReportingNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"PartitionByReportingNodeAndPeriod\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_88+DataNode\", b =>", + "\n {", + "\n b.Property(\"SystemName\")", + "\n .HasMaxLength(16)", + "\n .HasColumnType(\"nvarchar(16)\");", + "\n", + "\n b.Property(\"ContractualCurrency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DisplayName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"FunctionalCurrency\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"LineOfBusiness\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"OciType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"ValuationApproach\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasKey(\"SystemName\");", + "\n", + "\n b.ToTable(\"DataNode\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"DataNode\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_92+DataNodeState\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"State\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"DataNodeState\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_93+DataNodeParameter\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Discriminator\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Month\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Scenario\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Year\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"DataNodeParameter\");", + "\n", + "\n b.HasDiscriminator(\"Discriminator\").HasValue(\"DataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_98+RawVariable\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AccidentYear\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"AmountType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EstimateType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Values\")", + "\n .HasColumnType(\"varbinary(max)\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"RawVariable\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_99+IfrsVariable\", b =>", + "\n {", + "\n b.Property(\"Id\")", + "\n .ValueGeneratedOnAdd()", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"AccidentYear\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"AmountType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"AocType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"DataNode\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EconomicBasis\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"EstimateType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Novelty\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partition\")", + "\n .HasColumnType(\"uniqueidentifier\");", + "\n", + "\n b.Property(\"Value\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasKey(\"Id\");", + "\n", + "\n b.ToTable(\"IfrsVariable\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_58+DeferrableAmountType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_57+AmountType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"DeferrableAmountType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_63+AocType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"AocType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_65+PnlVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"PnlVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_66+BsVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"BsVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_67+AccountingVariableType\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_62+VariableType\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"AccountingVariableType\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+Portfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_88+DataNode\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"Portfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_90+GroupOfContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_88+DataNode\");", + "\n", + "\n b.Property(\"AnnualCohort\")", + "\n .HasColumnType(\"int\");", + "\n", + "\n b.Property(\"LiabilityType\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Partner\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Portfolio\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"Profitability\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"YieldCurveName\")", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfContract\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_94+InterDataNodeParameter\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_93+DataNodeParameter\");", + "\n", + "\n b.Property(\"LinkedDataNode\")", + "\n .IsRequired()", + "\n .HasColumnType(\"nvarchar(max)\");", + "\n", + "\n b.Property(\"ReinsuranceCoverage\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"InterDataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_94+SingleDataNodeParameter\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_93+DataNodeParameter\");", + "\n", + "\n b.Property(\"PremiumAllocation\")", + "\n .HasColumnType(\"float\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"SingleDataNodeParameter\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+InsurancePortfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_89+Portfolio\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"InsurancePortfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_89+ReinsurancePortfolio\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_89+Portfolio\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"ReinsurancePortfolio\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_91+GroupOfInsuranceContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_90+GroupOfContract\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfInsuranceContract\");", + "\n });", + "\n", + "\n modelBuilder.Entity(\"Submission_91+GroupOfReinsuranceContract\", b =>", + "\n {", + "\n b.HasBaseType(\"Submission_90+GroupOfContract\");", + "\n", + "\n b.HasDiscriminator().HasValue(\"GroupOfReinsuranceContract\");", + "\n });", + "\n }", + "\n}", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file From 37d3d14a8c3d58225431ab1751b9906b26ca2602 Mon Sep 17 00:00:00 2001 From: Andrey Katz <118806207+andrey-katz-systemorph@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:37:25 +0100 Subject: [PATCH 03/19] Improve logs v3 (#189) * generalization * more concise switch * typo * messages fixed * changed api one again * api update * new api * full update * new api * new API in tests * identation * Update ActivityLog.ipynb typo fixed * idents fixed --------- Co-authored-by: akatz --- ifrs17-template/Export/MapTemplate.ipynb | 6 +- .../Import/CloseImportTemplate.ipynb | 4 +- .../InitSystemorphBaseToMemory.ipynb | 6 +- .../InitSystemorphRefDataToMemory.ipynb | 26 +-- .../InitSystemorphToDatabase.ipynb | 44 ++-- .../InitSystemorphToMemory.ipynb | 14 +- .../ActualsUseCaseDataImport.ipynb | 18 +- .../CsmSwitchDataImport.ipynb | 18 +- .../InitSystemorphToMemoryForTesting.ipynb | 2 +- ifrs17-template/Test/SequenceImportTest.ipynb | 8 +- ifrs17/Utils/ActivityLog.ipynb | 206 ++++++++++-------- 11 files changed, 186 insertions(+), 166 deletions(-) diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index eb986486..9ac9a85b 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -155,7 +155,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -328,7 +328,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 4070701a..98e156c8 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -121,7 +121,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -170,7 +170,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 412f644a..de4c15af 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -80,7 +80,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -93,7 +93,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -106,7 +106,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index d406a80d..29276b04 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -118,7 +118,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,7 +131,7 @@ "await Import.FromFile(\"../Files/Dimensions.csv\")", "\n .WithFormat(ImportFormats.AocConfiguration)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -144,7 +144,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -166,42 +166,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync());", "\nlog" ], @@ -215,7 +215,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -228,7 +228,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index ecb29f00..e8bec1bd 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -96,7 +96,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,42 +131,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog" @@ -181,7 +181,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -229,7 +229,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -242,7 +242,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -255,7 +255,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -277,7 +277,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -290,7 +290,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -303,7 +303,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -316,7 +316,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -329,7 +329,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -342,7 +342,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -355,7 +355,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index f5a7d4bc..cb39d2f2 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -70,7 +70,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -83,7 +83,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -96,7 +96,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -122,7 +122,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -135,7 +135,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -148,7 +148,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index f3066174..e71da8f0 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -77,7 +77,7 @@ "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -90,7 +90,7 @@ "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -103,7 +103,7 @@ "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -134,7 +134,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -147,7 +147,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -169,7 +169,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -182,7 +182,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -204,7 +204,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -217,7 +217,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index a0d0556a..7f14af98 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -76,7 +76,7 @@ "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -89,7 +89,7 @@ "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -102,7 +102,7 @@ "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -133,7 +133,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -146,7 +146,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -159,7 +159,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -172,7 +172,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 36b1ed2a..47edc4ec 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -30,7 +30,7 @@ "await Import.FromFile(\"Actuals_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index fec21ac1..754e3954 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -58,7 +58,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -71,7 +71,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -132,7 +132,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -145,7 +145,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 4bd9a413..03176664 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -79,7 +79,7 @@ "cell_type": "markdown", "source": [ "## Import Export Activity ", - "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " + "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and the unique identifier which can be used to retrieve the data subject of the activity. " ], "metadata": {}, "execution_count": 0, @@ -157,6 +157,11 @@ "\n public string Format {get; init;}", "\n protected IDataSetImportVariable DataSetReader {get; set;}", "\n protected ISessionVariable Session {get; set;}", + "\n", + "\n public KeyedImportExport() ", + "\n { ", + "\n Id = Guid.NewGuid();", + "\n }", "\n}" ], "metadata": {}, @@ -220,6 +225,14 @@ "\n{", "\n protected ImportOptions Options {get; set;}", "\n", + "\n public KeyedImport() {Id = Guid.NewGuid();}", + "\n", + "\n public abstract KeyedImport WithOptions(ImportOptions options);", + "\n", + "\n public KeyedImport WithSession(ISessionVariable session) => this with {Session = session};", + "\n", + "\n public KeyedImport WithDataSetReader(IDataSetImportVariable importVariable) => this with {DataSetReader = importVariable};", + "\n", "\n public async Task InitializeImportDataAsync()", "\n {", "\n var stream = await GenerateStreamWrapperAsync();", @@ -287,6 +300,8 @@ "\n", "\n public string Source {get; init;}", "\n", + "\n public ImportFile() : base(){;}", + "\n", "\n public ImportFile(FileImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -299,7 +314,26 @@ "\n ContentType = Path.GetExtension(fileName);", "\n Source = options.Storage.GetType().Name; ", "\n Partition = GetInvolvedPartitions(options);", - "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrentPartitions(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n }", + "\n", + "\n public override ImportFile WithOptions(ImportOptions options)", + "\n {", + "\n if (options is FileImportOptions fio)", + "\n {", + "\n string fileName = fio.FileName;", + "\n return this with{Options = fio,", + "\n Name = Path.GetFileName(fileName),", + "\n Directory = Path.GetDirectoryName(fileName),", + "\n ContentType = Path.GetExtension(fileName),", + "\n Source = options.Storage.GetType().Name,", + "\n Partition = GetInvolvedPartitions(options)", + "\n };", + "\n }", + "\n else", + "\n {", + "\n throw new Exception(\"The import options must be of file import options type\");", + "\n }", "\n }", "\n", "\n public ImportFile(Guid id)", @@ -329,6 +363,8 @@ "\n{", "\n public string Content {get; init;}", "\n", + "\n public ImportString() : base(){;}", + "\n", "\n public ImportString(StringImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -338,6 +374,13 @@ "\n Content = options.Content;", "\n }", "\n", + "\n public override ImportString WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StringImportOptions sgio) return this with {Options = sgio, ", + "\n Content = sgio.Content};", + "\n else throw new Exception(\"The import options must be of string import options type\");", + "\n }", + "\n", "\n public ImportString(Guid id)", "\n {", "\n Id = id;", @@ -364,6 +407,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportDataSet() : base() {;}", + "\n", + "\n public override ImportDataSet WithOptions(ImportOptions options)", + "\n {", + "\n if (options is DataSetImportOptions dsio) return this with {Options = dsio};", + "\n else throw new Exception(\"The import options must be of data set import options type\");", + "\n }", + "\n", "\n public ImportDataSet(Guid id)", "\n {", "\n Id = id;", @@ -390,6 +441,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportStream() : base() {;}", + "\n", + "\n public override ImportStream WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StreamImportOptions smio) return this with {Options = smio};", + "\n else throw new Exception(\"The import options must be of stream import options type\");", + "\n }", + "\n", "\n public ImportStream(Guid id)", "\n {", "\n Id = id;", @@ -415,92 +474,58 @@ { "cell_type": "code", "source": [ - "public record ImportBuilderWriter(ImportOptionsBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ImportBuilderWriter(ImportOptionsBuilder Builder) ", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSource DataSource {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n", "\n public async Task ExecuteAsync()", "\n {", "\n var log = await Builder.ExecuteAsync();", "\n var options = Builder.GetImportOptions();", - "\n var activity = new ImportExportActivity(log, Session);", - "\n bool importSucceeded = true;", - "\n switch(options)", + "\n var activity = options switch", "\n {", - "\n case FileImportOptions fio:", - "\n var importFile = new ImportFile(Guid.NewGuid());", - "\n try", - "\n {", - "\n importFile = await (new ImportFile(fio, ImportVariable, Session)).InitializeImportDataAsync() as ImportFile;", - "\n activity = activity with {SourceId = importFile.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from File\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importFile.RepeatOnce());", - "\n break;", - "\n", - "\n case StringImportOptions sgio:", - "\n var importString = new ImportString(Guid.NewGuid());", - "\n try", - "\n {", - "\n importString = await (new ImportString(sgio, ImportVariable, Session)).InitializeImportDataAsync() as ImportString;", - "\n activity = activity with {SourceId = importString.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from String\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importString.RepeatOnce());", - "\n break;", - "\n ", - "\n case StreamImportOptions smio:", - "\n var importStream = new ImportStream(Guid.NewGuid());", - "\n try", - "\n {", - "\n importStream = await (new ImportStream(smio, ImportVariable, Session)).InitializeImportDataAsync() as ImportStream;", - "\n activity = activity with {SourceId = importStream.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Stream\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importStream.RepeatOnce());", - "\n break;", - "\n", - "\n case DataSetImportOptions dsio:", - "\n var importDataSet = new ImportDataSet(Guid.NewGuid());", - "\n try", - "\n {", - "\n importDataSet = await (new ImportDataSet(dsio, ImportVariable, Session)).InitializeImportDataAsync() as ImportDataSet;", - "\n activity = activity with {SourceId = importDataSet.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Data Set\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importDataSet.RepeatOnce());", - "\n break;", - "\n", - "\n default:", - "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", - "\n break;", - "\n }", + "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio, \"Import from File \"),", + "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio, \"Import from String\"),", + "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio, \"Import from Stream\"),", + "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio, \"Import from Data Set\"),", + "\n _ => null,", + "\n };", + "\n if (activity is null) throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", "\n await DataSource.UpdateAsync(activity.RepeatOnce());", "\n await DataSource.CommitAsync();", "\n return log;", "\n }", - "\n}" + "\n", + "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, TOptions options, string categoryMessage)", + "\n where TOptions: ImportOptions", + "\n where TImport: KeyedImport, new()", + "\n {", + "\n var activity = new ImportExportActivity(log, Session);", + "\n try", + "\n {", + "\n var import = new TImport();", + "\n import = await import.WithSession(Session)", + "\n .WithDataSetReader(ImportVariable)", + "\n .WithOptions(options)", + "\n .InitializeImportDataAsync() as TImport;", + "\n activity = activity with {SourceId = import.Id, Category = categoryMessage};", + "\n await DataSource.UpdateAsync(import.RepeatOnce());", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n activity = activity with {SourceId = null, ", + "\n Category = categoryMessage, ", + "\n ExceptionMessage = e.Message};", + "\n }", + "\n return activity;", + "\n }", + "\n}", + "\n", + "\nImportBuilderWriter.Session = Session;", + "\nImportBuilderWriter.DataSource = DataSource;", + "\nImportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -509,11 +534,11 @@ { "cell_type": "code", "source": [ - "public record ExportBuilderWriter(DocumentBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ExportBuilderWriter(DocumentBuilder Builder)", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n public static IDataSource DataSource {get; set;}", "\n public async Task ExecuteAsync()", "\n {", "\n var exportResult = await Builder.ExecuteAsync();", @@ -525,7 +550,10 @@ "\n await DataSource.CommitAsync();", "\n return exportResult;", "\n }", - "\n}" + "\n}", + "\nExportBuilderWriter.Session = Session;", + "\nExportBuilderWriter.DataSource = DataSource;", + "\nExportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -534,11 +562,7 @@ { "cell_type": "code", "source": [ - "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) => ", - "\n new ImportBuilderWriter(builder, session, dataSource, importVariable);" + "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder) => new ImportBuilderWriter(builder);" ], "metadata": {}, "execution_count": 0, @@ -547,11 +571,7 @@ { "cell_type": "code", "source": [ - "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) =>", - "\n new ExportBuilderWriter(builder as DocumentBuilder, session, dataSource, importVariable);" + "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder) => new ExportBuilderWriter(builder as DocumentBuilder);" ], "metadata": {}, "execution_count": 0, From 42cb66a0a84d2d7f2009915ad28af5f1fdb8ad66 Mon Sep 17 00:00:00 2001 From: Andrey Katz <118806207+andrey-katz-systemorph@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:58:46 +0100 Subject: [PATCH 04/19] 122 partitions (#204) * generalization * more concise switch * typo * messages fixed * changed api one again * api update * new api * full update * start debugging * first attempt to fix the opening format. Not yet sure if it works. The changes in the DataNode format must be reset * bug fix * fix * restore unnecessary changes * reset unnecessary changes * reset * reset * new api * new API in tests * identation * syntax change * Update ActivityLog.ipynb typo fixed * idents fixed * Update ActivityLog.ipynb restore the rows that were removed by mistake in the merger --------- Co-authored-by: akatz --- ifrs17/Import/Importers.ipynb | 20 ++++++++++++++++---- ifrs17/Utils/ActivityLog.ipynb | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index fe8f34ec..eafdf00c 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -464,10 +464,22 @@ "\n var dataNodeSingleParametersUndefined = dataNodesImported.Where(x => x != null &&", "\n !dataNodeParametersDefined.Contains(x) && ", "\n dataNodesDefined.SingleOrDefault(y => y.SystemName == x) is GroupOfInsuranceContract).ToHashSet();", - "\n await DataSource.UpdateAsync( dataNodeStatesUndefined.Select(x => ", - "\n new DataNodeState {DataNode = x, Year = args.Year, Month = DefaultDataNodeActivationMonth, State = State.Active, Partition = partition.Id}).ToArray() );", - "\n await DataSource.UpdateAsync( dataNodeSingleParametersUndefined.Select(x => ", - "\n new SingleDataNodeParameter {DataNode = x, Year = args.Year, Month = DefaultDataNodeActivationMonth, PremiumAllocation = DefaultPremiumExperienceAdjustmentFactor, Partition = partition.Id}).ToArray() );", + "\n if ((dataNodeStatesUndefined?.Any() ?? false))", + "\n await DataSource.UpdateAsync( dataNodeStatesUndefined.Select(x => ", + "\n new DataNodeState {DataNode = x, ", + "\n Year = args.Year, ", + "\n Month = DefaultDataNodeActivationMonth, ", + "\n State = State.Active, ", + "\n Partition = partition.Id})", + "\n .ToArray() );", + "\n if ((dataNodeSingleParametersUndefined?.Any() ?? false))", + "\n await DataSource.UpdateAsync( dataNodeSingleParametersUndefined.Select(x => ", + "\n new SingleDataNodeParameter {DataNode = x, ", + "\n Year = args.Year, ", + "\n Month = DefaultDataNodeActivationMonth, ", + "\n PremiumAllocation = DefaultPremiumExperienceAdjustmentFactor, ", + "\n Partition = partition.Id})", + "\n .ToArray() );", "\n await DataSource.CommitAsync();", "\n}" ], diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 03176664..1342eb57 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -587,4 +587,4 @@ "outputs": [] } ] -} \ No newline at end of file +} From 3d1ccc150826a3b6addf0c9b4443b524ab376840 Mon Sep 17 00:00:00 2001 From: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Date: Fri, 10 Feb 2023 12:32:16 +0100 Subject: [PATCH 05/19] Replace GetElementOrDefault with GetValidElement (#212) * Replace GetElementOrDefault with GetValidElement * Rename array to collection * Remove obsolete case * Create error for negative index and apply it * Better error message * Add .ToHashSet() in ApplicationMessage AcivityLog Mege * Implement feedback * Implement feedbackx2 --- ifrs17/Constants/Validations.ipynb | 4 ++++ ifrs17/Import/ImportScopeCalculation.ipynb | 10 +++++----- ifrs17/Utils/ApplicationMessage.ipynb | 6 +++--- ifrs17/Utils/Extensions.ipynb | 21 ++++++++++++--------- ifrs17/Utils/ImportCalculationMethods.ipynb | 10 +++++----- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 3fdcf95e..2072f37f 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -86,6 +86,8 @@ "\n NotSupportedAocStepReference, MultipleEoP,", "\n // Data completeness", "\n MissingDataAtPosting, MissingCombinedLiability, MissingCoverageUnit, ", + "\n // Index", + "\n NegativeIndex,", "\n // Default", "\n Generic", "\n};" @@ -169,6 +171,8 @@ "\n (Error.MissingDataAtPosting , 1) => $\"Missing imported data for {s[0]} DataNode.\",", "\n (Error.MissingCombinedLiability , 2) => $\"Missing Combined Liability AoC Type for DataNode {s[0]} and AmountType {s[1]}.\",", "\n (Error.MissingCoverageUnit , 1) => $\"Missing Coverage Unit cash flow for {s[0]} DataNode.\",", + "\n // Index", + "\n (Error.NegativeIndex , 0) => $\"Index was out of range. Must be non-negative.\",", "\n // Default", "\n (Error.Generic , _) => $\"{s[0]}\",", "\n (_ , _) => $\"Error not found.\"", diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index 5ea716a5..47c21764 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -805,11 +805,11 @@ "\n switch (periodType) {", "\n case PeriodType.BeginningOfPeriod :", "\n for (var i = 0; i < parentDiscountedValues.Length; i++)", - "\n ret[i] = -1d * (parentDiscountedValues[i] - parentNominalValues[i]) * (GetElementOrDefault(monthlyInterestFactor, i/12) - 1d );", + "\n ret[i] = -1d * (parentDiscountedValues[i] - parentNominalValues[i]) * (monthlyInterestFactor.GetValidElement(i/12) - 1d );", "\n break;", "\n default :", "\n for (var i = 0; i < parentDiscountedValues.Length; i++)", - "\n ret[i] = -1d * parentDiscountedValues[i] * (GetElementOrDefault(monthlyInterestFactor, i/12) - 1d );", + "\n ret[i] = -1d * parentDiscountedValues[i] * (monthlyInterestFactor.GetValidElement(i/12) - 1d );", "\n break;", "\n }", "\n ", @@ -830,8 +830,8 @@ "\n var interestOnClaimsCashflowCreditRisk = new double[nominalClaimsCashflow.Length];", "\n var effectCreditRisk = new double[nominalClaimsCashflow.Length];", "\n for (var i = nominalClaimsCashflow.Length - 1; i >= 0; i--) {", - "\n interestOnClaimsCashflow[i] = 1 / GetElementOrDefault(monthlyInterestFactor, i/12) * (interestOnClaimsCashflow.ElementAtOrDefault(i + 1) + nominalClaimsCashflow[i] - nominalClaimsCashflow.ElementAtOrDefault(i + 1));", - "\n interestOnClaimsCashflowCreditRisk[i] = 1 / GetElementOrDefault(monthlyInterestFactor, i/12) * (Math.Exp(-nonPerformanceRiskRate) * interestOnClaimsCashflowCreditRisk.ElementAtOrDefault(i + 1) + nominalClaimsCashflow[i] - nominalClaimsCashflow.ElementAtOrDefault(i + 1));", + "\n interestOnClaimsCashflow[i] = 1 / monthlyInterestFactor.GetValidElement(i/12) * (interestOnClaimsCashflow.ElementAtOrDefault(i + 1) + nominalClaimsCashflow[i] - nominalClaimsCashflow.ElementAtOrDefault(i + 1));", + "\n interestOnClaimsCashflowCreditRisk[i] = 1 / monthlyInterestFactor.GetValidElement(i/12) * (Math.Exp(-nonPerformanceRiskRate) * interestOnClaimsCashflowCreditRisk.ElementAtOrDefault(i + 1) + nominalClaimsCashflow[i] - nominalClaimsCashflow.ElementAtOrDefault(i + 1));", "\n effectCreditRisk[i] = interestOnClaimsCashflow[i] - interestOnClaimsCashflowCreditRisk[i];", "\n }", "\n ", @@ -1698,7 +1698,7 @@ "\n private double[] monthlyInterestFactor => GetScope(Identity, o => o.WithContext(EconomicBasis)).Interest;", "\n ", "\n private double interestAccretionFactor => Enumerable.Range(shift,timeStep)", - "\n .Select(i => GetElementOrDefault(monthlyInterestFactor, i/12))", + "\n .Select(i => monthlyInterestFactor.GetValidElement(i/12))", "\n .Aggregate(1d, (x, y) => x * y ) - 1d;", "\n ", "\n double TechnicalMargin.Value => AggregatedValue * interestAccretionFactor;", diff --git a/ifrs17/Utils/ApplicationMessage.ipynb b/ifrs17/Utils/ApplicationMessage.ipynb index 990dd62b..2d9e3d3e 100644 --- a/ifrs17/Utils/ApplicationMessage.ipynb +++ b/ifrs17/Utils/ApplicationMessage.ipynb @@ -110,9 +110,9 @@ "\n Status = a.Status == ActivityLogStatus.Failed || b.Status == ActivityLogStatus.Failed ? ActivityLogStatus.Failed : ActivityLogStatus.Succeeded,", "\n StartDateTime = a.StartDateTime < b.StartDateTime ? a.StartDateTime : b.StartDateTime,", "\n FinishDateTime = a.FinishDateTime > b.FinishDateTime ? a.FinishDateTime : b.FinishDateTime,", - "\n Errors = a.Errors.Concat(b.Errors).ToList(),", - "\n Warnings = a.Warnings.Concat(b.Warnings).ToList(),", - "\n Infos = a.Infos.Concat(b.Infos).ToList(),", + "\n Errors = a.Errors.Concat(b.Errors).ToHashSet().ToList(),", + "\n Warnings = a.Warnings.Concat(b.Warnings).ToHashSet().ToList(),", + "\n Infos = a.Infos.Concat(b.Infos).ToHashSet().ToList(),", "\n };", "\n}", "\n", diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index d23cd61e..beea37c7 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -75,18 +75,21 @@ { "cell_type": "code", "source": [ - "// because the default(T) is something else than the first/last element. What about \"static T GetValidElement(this IList array, int index)\"? ", - "\nstatic T GetElementOrDefault(this ICollection array, int index)", + "static T GetValidElement(this ICollection collection, int index)", "\n{ ", - "\n var count = array.Count;", - "\n if (array == null || count == 0)", + "\n var count = collection.Count;", + "\n if (collection == null || count == 0)", "\n return default(T);", "\n", - "\n return index < 0", - "\n ? array.ElementAt(0) // should this case be removed?", - "\n : index < count", - "\n ? array.ElementAt(index)", - "\n : array.ElementAt(count -1);", + "\n if (index < 0)", + "\n {", + "\n ApplicationMessage.Log(Error.NegativeIndex);", + "\n return default;", + "\n }", + "\n", + "\n return index < count", + "\n ? collection.ElementAt(index)", + "\n : collection.ElementAt(count -1);", "\n}" ], "metadata": {}, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 4e8270a2..02c03ab8 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -109,12 +109,12 @@ "\n if(periodType == PeriodType.BeginningOfPeriod)", "\n {", "\n for (var i = nominalValues.Length - 1; i >= 0; i--)", - "\n ret[i] = nominalValues[i] + GetElementOrDefault(ret, i + 1) * GetElementOrDefault(monthlyDiscounting, i/12);", + "\n ret[i] = nominalValues[i] + ret.GetValidElement(i + 1) * monthlyDiscounting.GetValidElement(i/12);", "\n return ret;", "\n }", "\n ", "\n for (var i = nominalValues.Length - 1; i >= 0; i--)", - "\n ret[i] = ( nominalValues[i] + GetElementOrDefault(ret, i + 1) ) * GetElementOrDefault(monthlyDiscounting, i/12);", + "\n ret[i] = ( nominalValues[i] + ret.GetValidElement(i + 1) ) * monthlyDiscounting.GetValidElement(i/12);", "\n ", "\n return ret;", "\n}" @@ -130,7 +130,7 @@ "\n{ ", "\n return Enumerable.Range(0, nominalValues.Length)", "\n .Select( t => Enumerable.Range(t, nominalValues.Length-t)", - "\n .Select( tau => nominalValues[tau] * Math.Pow(GetElementOrDefault(monthlyDiscounting, t/12), tau-t+1) * (Math.Exp(-nonPerformanceRiskRate*(tau-t)) - 1) )", + "\n .Select( tau => nominalValues[tau] * Math.Pow(monthlyDiscounting.GetValidElement(t/12), tau-t+1) * (Math.Exp(-nonPerformanceRiskRate*(tau-t)) - 1) )", "\n .Sum() )", "\n .ToArray();", "\n}" @@ -155,12 +155,12 @@ "\n if(period == PeriodType.BeginningOfPeriod)", "\n {", "\n for (var i = cdcf.Length - 1; i >= 0; i--)", - "\n cdcf[i] = values[i] + GetElementOrDefault(cdcf, i + 1) * GetElementOrDefault(yearlyDiscountRates, i/12);", + "\n cdcf[i] = values[i] + cdcf.GetValidElement(i + 1) * yearlyDiscountRates.GetValidElement(i/12);", "\n }", "\n else", "\n { ", "\n for (var i = cdcf.Length - 1; i >= 0; i--)", - "\n cdcf[i] = ( values[i] + GetElementOrDefault(cdcf, i + 1) ) * GetElementOrDefault(yearlyDiscountRates, i/12);", + "\n cdcf[i] = ( values[i] + cdcf.GetValidElement(i + 1) ) * yearlyDiscountRates.GetValidElement(i/12);", "\n }", "\n return rv with { Values = cdcf };", "\n })", From 54c1c563bb302385030e6a57c3a2f3456101facd Mon Sep 17 00:00:00 2001 From: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Date: Tue, 14 Feb 2023 17:06:13 +0100 Subject: [PATCH 06/19] Metadata (#219) * template * pv * CE --- PresentValueSeries/InitializeData.ipynb | 9 +++------ PresentValueSeries/PresentValue - Episode 2.ipynb | 7 ++----- PresentValueSeries/PresentValue - Episode 3.ipynb | 7 ++----- PresentValueSeries/Test.ipynb | 1 + ifrs17-template/Constants/CalculationEngine.ipynb | 1 + ifrs17-template/Database/Configure.ipynb | 6 ++---- .../Database/MigrationAndScaffolding/Initial.ipynb | 1 + .../Database/MigrationAndScaffolding/MigrationFlow.ipynb | 1 + .../Database/MigrationAndScaffolding/ReadMe.ipynb | 1 + .../Database/MigrationAndScaffolding/Scaffold.ipynb | 1 + .../Database/MigrationAndScaffolding/Snapshot.ipynb | 1 + ifrs17-template/Database/PersonalConnectionExample.ipynb | 1 + ifrs17-template/Database/Schema Delete.ipynb | 2 +- ifrs17-template/Export/MapTemplate.ipynb | 5 ++--- ifrs17-template/Import/CloseImportTemplate.ipynb | 1 + .../Initialization/InitSystemorphBaseToMemory.ipynb | 5 ++--- .../Initialization/InitSystemorphRefDataToMemory.ipynb | 5 ++--- .../Initialization/InitSystemorphToDatabase.ipynb | 5 ++--- .../Initialization/InitSystemorphToMemory.ipynb | 5 ++--- ifrs17-template/InputFormatDescription.ipynb | 5 ++--- ifrs17-template/OverviewIFRS17Template.ipynb | 5 ++--- .../ActualsUseCaseDataImport.ipynb | 5 ++--- .../ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb | 5 ++--- .../SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb | 1 + .../SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb | 5 ++--- ifrs17-template/Report/ParameterReports.ipynb | 1 + ifrs17-template/Report/Reports.ipynb | 5 ++--- ifrs17-template/Test/Data/ExportIfrsVariable.ipynb | 5 ++--- ifrs17-template/Test/Data/ExportReportVariables.ipynb | 5 ++--- .../Test/Data/InitSystemorphToMemoryForTesting.ipynb | 1 + ifrs17-template/Test/IfrsVariablesTest.ipynb | 5 ++--- ifrs17-template/Test/MapTemplateAndImportTest.ipynb | 5 ++--- ifrs17-template/Test/PracticalCasesTest.ipynb | 1 + .../Test/ReimportWithDifferentScopeTest.ipynb | 1 + ifrs17-template/Test/ReportVariablesTest.ipynb | 5 ++--- ifrs17-template/Test/ReportVariablesTestBase.ipynb | 5 ++--- ifrs17-template/Test/ScenarioDataImportTest.ipynb | 1 + ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb | 1 + ifrs17-template/Test/SequenceImportTest.ipynb | 1 + ifrs17-template/Test/Tests.ipynb | 5 ++--- ifrs17/CalculationEngine.ipynb | 1 + ifrs17/Constants/Consts.ipynb | 6 ++---- ifrs17/Constants/Enums.ipynb | 6 ++---- ifrs17/Constants/Validations.ipynb | 6 ++---- ifrs17/DataModel/DataStructure.ipynb | 6 ++---- ifrs17/Export/ExportConfiguration.ipynb | 5 ++--- ifrs17/Import/ImportScopeCalculation.ipynb | 5 ++--- ifrs17/Import/ImportStorage.ipynb | 5 ++--- ifrs17/Import/Importers.ipynb | 6 ++---- ifrs17/OverviewCalculationEngine.ipynb | 5 ++--- ifrs17/Report/ParameterReportsQueries.ipynb | 1 + ifrs17/Report/ReportConfigurationAndUtils.ipynb | 5 ++--- ifrs17/Report/ReportMutableScopes.ipynb | 1 + ifrs17/Report/ReportScopes.ipynb | 5 ++--- ifrs17/Report/ReportStorage.ipynb | 5 ++--- ifrs17/Test/AggregateDoubleArrayTest.ipynb | 1 + ifrs17/Test/AocConfigurationTest.ipynb | 1 + ifrs17/Test/AocStructureTest.ipynb | 5 ++--- ifrs17/Test/EqualityComparerTest.ipynb | 1 + ifrs17/Test/ImportStorageTest.ipynb | 5 ++--- ifrs17/Test/QueriesTest.ipynb | 5 ++--- ifrs17/Test/ReportStorageTest.ipynb | 5 ++--- ifrs17/Test/TechnicalMarginTest.ipynb | 5 ++--- ifrs17/Test/TestData.ipynb | 1 + ifrs17/Test/Tests.ipynb | 1 + ifrs17/Utils/ActivityLog.ipynb | 3 ++- ifrs17/Utils/ApplicationMessage.ipynb | 6 ++---- ifrs17/Utils/EqualityComparers.ipynb | 1 + ifrs17/Utils/Extensions.ipynb | 5 ++--- ifrs17/Utils/ImportCalculationMethods.ipynb | 5 ++--- ifrs17/Utils/Queries.ipynb | 5 ++--- ifrs17/Utils/TestHelper.ipynb | 5 ++--- 72 files changed, 118 insertions(+), 148 deletions(-) diff --git a/PresentValueSeries/InitializeData.ipynb b/PresentValueSeries/InitializeData.ipynb index eacf5385..20b3f9d6 100644 --- a/PresentValueSeries/InitializeData.ipynb +++ b/PresentValueSeries/InitializeData.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "HSWSJivQ9Uq-k7P9Ky6MAg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,11 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False", - "toc-showtags": "False" + } }, "nbformat": 4, "nbformat_minor": 5, @@ -108,4 +105,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/PresentValueSeries/PresentValue - Episode 2.ipynb b/PresentValueSeries/PresentValue - Episode 2.ipynb index 70a4c51a..c98811d5 100644 --- a/PresentValueSeries/PresentValue - Episode 2.ipynb +++ b/PresentValueSeries/PresentValue - Episode 2.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "HmaHGel-LEeFl0jOhE9pPw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,11 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False", - "toc-showtags": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/PresentValueSeries/PresentValue - Episode 3.ipynb b/PresentValueSeries/PresentValue - Episode 3.ipynb index 0c3d4211..02fb87e8 100644 --- a/PresentValueSeries/PresentValue - Episode 3.ipynb +++ b/PresentValueSeries/PresentValue - Episode 3.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "UQV1FkirrkmGCOCfpHVsEA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,11 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False", - "toc-showtags": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/PresentValueSeries/Test.ipynb b/PresentValueSeries/Test.ipynb index 25430e56..8d9e322a 100644 --- a/PresentValueSeries/Test.ipynb +++ b/PresentValueSeries/Test.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "t7h_PHrvb0GNmLCXuxb1kg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Constants/CalculationEngine.ipynb b/ifrs17-template/Constants/CalculationEngine.ipynb index 3b0bef01..93483434 100644 --- a/ifrs17-template/Constants/CalculationEngine.ipynb +++ b/ifrs17-template/Constants/CalculationEngine.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "ORrEbLR_T0C1aoQoVcXCpA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/Configure.ipynb b/ifrs17-template/Database/Configure.ipynb index 4ede3cfe..b613f520 100644 --- a/ifrs17-template/Database/Configure.ipynb +++ b/ifrs17-template/Database/Configure.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "NKif7XZ_00aa5ksgQlE6_g", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb index e14369ba..2a022334 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "vjKyjbrTjk-dDxMZiTA1Mg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb index 99310591..9e2d964b 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "oPiKSNUZMki5wrdUJlHjPQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb index afde3c4f..080885e2 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "bq9bMSDFR02hhSb_XpjkBQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb index 103c03ac..46caa8b2 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "6wyTMSMvdEK_4OlFd8bqJA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb index 4f7e598d..f0885c57 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "JQaVP3MiNEiUST8hRneHpQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/PersonalConnectionExample.ipynb b/ifrs17-template/Database/PersonalConnectionExample.ipynb index 58813866..83ae5110 100644 --- a/ifrs17-template/Database/PersonalConnectionExample.ipynb +++ b/ifrs17-template/Database/PersonalConnectionExample.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "iMY-rLl2BUa8lkYs0sDLqg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Database/Schema Delete.ipynb b/ifrs17-template/Database/Schema Delete.ipynb index 68be7e2c..455e789a 100644 --- a/ifrs17-template/Database/Schema Delete.ipynb +++ b/ifrs17-template/Database/Schema Delete.ipynb @@ -1,7 +1,7 @@ { "metadata": { "authors": [], - "documentInfo": "{\r\n \"authors\": [\r\n \"Peter Kunszt\"\r\n ],\r\n \"contributors\": [],\r\n \"tags\": [\r\n \"storage\",\r\n \"database\",\r\n \"persistence\",\r\n \"dependency\"\r\n ],\r\n \"title\": \"Multiple Storages with Persistence\",\r\n \"description\": \"Demo the usage of database backend to resolve a data dependency.\",\r\n \"createdDate\": \"Jan. 2022\",\r\n \"publishedDate\": \"Jan. 2022\",\r\n \"changelog\": [\r\n {\r\n \"version\": \"1.0\",\r\n \"description\": \"Initial Notebook\"\r\n }\r\n ]\r\n }", + "id": "5eRSY38YIEezOQrFaki93g", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index 9ac9a85b..6c811368 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "45_kgGyWikmokx6bcLybBA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 98e156c8..b9f3c33c 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "yMtBIgY0skapo5-0Kg-V1w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index de4c15af..425b716a 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "y9xL_svpDUiNzR7LMSA2BA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index 29276b04..0ecdf39c 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "VJIatQORbkmmRr7eJSpAjg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index e8bec1bd..b54f5f1c 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "QCMDxyUBBEyl3M18wFrgDA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index cb39d2f2..43ed45fe 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "6vRP2T2AiEq5rmfljOKoSQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/InputFormatDescription.ipynb b/ifrs17-template/InputFormatDescription.ipynb index 1087fa85..d9bf13e2 100644 --- a/ifrs17-template/InputFormatDescription.ipynb +++ b/ifrs17-template/InputFormatDescription.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "jHYsC7bG1kWZ1KUpb2B2nw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/OverviewIFRS17Template.ipynb b/ifrs17-template/OverviewIFRS17Template.ipynb index 95a010d7..a12205c3 100644 --- a/ifrs17-template/OverviewIFRS17Template.ipynb +++ b/ifrs17-template/OverviewIFRS17Template.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "x4yyGM3xMkujl6CbUMKyng", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index e71da8f0..29c878e3 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "B0gzeyIBW0-tm7A4o9ykGw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb index 133580d4..8477b81d 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "Z8P8Xunhp0ynikLIE1omWQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index 7f14af98..b6e114ba 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "YGWMnwRniU64QZaE1oBrFw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb index 2805affe..70f8e7b3 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "fSGCg4loXUOYruTUQPiNXg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb index 8b1c6d9c..c8f9851e 100644 --- a/ifrs17-template/Report/ParameterReports.ipynb +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "owrOOpusB0qEDMpG2Uj9hg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Report/Reports.ipynb b/ifrs17-template/Report/Reports.ipynb index d22f25e8..6a6d7352 100644 --- a/ifrs17-template/Report/Reports.ipynb +++ b/ifrs17-template/Report/Reports.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "DCgii_7-fECfGgqIf40f0w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb index f855a567..3cb7ebd8 100644 --- a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb +++ b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "zqa5Gis-qkCUXLkhzzM-LA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/Data/ExportReportVariables.ipynb b/ifrs17-template/Test/Data/ExportReportVariables.ipynb index 71aa2cc1..187ffd73 100644 --- a/ifrs17-template/Test/Data/ExportReportVariables.ipynb +++ b/ifrs17-template/Test/Data/ExportReportVariables.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "mQuQKO3zWUmlFaU6pRflbA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 47edc4ec..67171d72 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "bSinnaybPkGIZ8Km0b0H0Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb index 860c13ee..f10996ee 100644 --- a/ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "L-jO5zRc-0WHi8WTFkhcWQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 39134932..dbcf479d 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "P6NgZqj6e0-iv6Td2_aRaQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/PracticalCasesTest.ipynb b/ifrs17-template/Test/PracticalCasesTest.ipynb index 52e24619..5b4eab9d 100644 --- a/ifrs17-template/Test/PracticalCasesTest.ipynb +++ b/ifrs17-template/Test/PracticalCasesTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "bZ9mwrWya0Ox8CXAyFRn2Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb index 7e911369..84609e9c 100644 --- a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb +++ b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "MW1tEAQXFUyIZF05Nm_9sw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/ReportVariablesTest.ipynb b/ifrs17-template/Test/ReportVariablesTest.ipynb index d68c8116..f447c1d4 100644 --- a/ifrs17-template/Test/ReportVariablesTest.ipynb +++ b/ifrs17-template/Test/ReportVariablesTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "KQxwaFlDd0-4GXgvftROHA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/ReportVariablesTestBase.ipynb b/ifrs17-template/Test/ReportVariablesTestBase.ipynb index a41671c0..194adf0f 100644 --- a/ifrs17-template/Test/ReportVariablesTestBase.ipynb +++ b/ifrs17-template/Test/ReportVariablesTestBase.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "5CKjRei0rkqYmm9zIKqElw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index e6603fef..5b3c3ea9 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "RTdwhhLYx0Oqt3uP2hPqzg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index 002c811c..bd8e71e2 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "0sFHQY0OakSz69Zuyfsu4w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index 754e3954..4791c988 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "f_2RGX4ByU-R8P1CdIhJlg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index cf5f7611..969379fe 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "qEc2ZDMEhUGDoTw7upcthw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 49d163c6..92b9ee6a 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "3_nIwm38IECvWgOZZlFUPw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 6bb2ba8f..2bd61cb2 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "XKwOq8eRDkuYqDPJOmCi3w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Constants/Enums.ipynb b/ifrs17/Constants/Enums.ipynb index af20091f..aa5231be 100644 --- a/ifrs17/Constants/Enums.ipynb +++ b/ifrs17/Constants/Enums.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "miNXh_kJVE2HcvY8ujKdYw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 2072f37f..e214b58a 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "oGGkQrEJxUah7O388PTz2Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index d8992bc6..b3d65bdd 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "zcY4j_S910ekEPwNfp1dWA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index 1b94ed00..ffc11dfa 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "uk_-HpozgUOIpbUIynU8vw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index 47c21764..c24d824c 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "1-Sd2C2w2kaytthWS3cL1Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index e5136298..d2b8a07f 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "E1E3rDAmMkWNkvB-85BY8Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index eafdf00c..779968ba 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "-WSDeQyVl0Cc-rDGmPI73w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/OverviewCalculationEngine.ipynb b/ifrs17/OverviewCalculationEngine.ipynb index 482b71d8..2ba37ea6 100644 --- a/ifrs17/OverviewCalculationEngine.ipynb +++ b/ifrs17/OverviewCalculationEngine.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "GWa_XHVeh026hh_HafLWog", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Report/ParameterReportsQueries.ipynb b/ifrs17/Report/ParameterReportsQueries.ipynb index 229d5ae6..7e401112 100644 --- a/ifrs17/Report/ParameterReportsQueries.ipynb +++ b/ifrs17/Report/ParameterReportsQueries.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "GwzN3m9sLkuSwy-TfM130g", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index 5d077303..5920a2cb 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "6W4kCJVgzESvKeBwvjKoKA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index 664a3c41..91f9faf9 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "DRRKzr_vVUKWocwP6A9-vw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb index 44563155..af7efdf7 100644 --- a/ifrs17/Report/ReportScopes.ipynb +++ b/ifrs17/Report/ReportScopes.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "XO1MGMO6q0GBeTH0YLwIWA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Report/ReportStorage.ipynb b/ifrs17/Report/ReportStorage.ipynb index e2f9e843..7b381acd 100644 --- a/ifrs17/Report/ReportStorage.ipynb +++ b/ifrs17/Report/ReportStorage.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "jXPnCVjEo0-9rdyzYmEMfA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/AggregateDoubleArrayTest.ipynb b/ifrs17/Test/AggregateDoubleArrayTest.ipynb index 6849995e..9d9a9b35 100644 --- a/ifrs17/Test/AggregateDoubleArrayTest.ipynb +++ b/ifrs17/Test/AggregateDoubleArrayTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "9UoN9BW_ykyK_lnYPCgI_Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Test/AocConfigurationTest.ipynb b/ifrs17/Test/AocConfigurationTest.ipynb index 164cd950..16274ad5 100644 --- a/ifrs17/Test/AocConfigurationTest.ipynb +++ b/ifrs17/Test/AocConfigurationTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "VfWtlFCxmU6_3pZQBTUVxg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Test/AocStructureTest.ipynb b/ifrs17/Test/AocStructureTest.ipynb index a230366e..c3fbbd6b 100644 --- a/ifrs17/Test/AocStructureTest.ipynb +++ b/ifrs17/Test/AocStructureTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "zu2TE0r0G0-N-Fs0ghCaGg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/EqualityComparerTest.ipynb b/ifrs17/Test/EqualityComparerTest.ipynb index 444f18b3..0c567485 100644 --- a/ifrs17/Test/EqualityComparerTest.ipynb +++ b/ifrs17/Test/EqualityComparerTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "BLeYRQvV6kmFwHU_Sk6q4g", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Test/ImportStorageTest.ipynb b/ifrs17/Test/ImportStorageTest.ipynb index 67a9871f..d8294e5f 100644 --- a/ifrs17/Test/ImportStorageTest.ipynb +++ b/ifrs17/Test/ImportStorageTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "UBkQtzi400mCgXvIuhlVGw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/QueriesTest.ipynb b/ifrs17/Test/QueriesTest.ipynb index 7e87e8b6..17174543 100644 --- a/ifrs17/Test/QueriesTest.ipynb +++ b/ifrs17/Test/QueriesTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "UhYcUg0YDU2EVWpCprNDfg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/ReportStorageTest.ipynb b/ifrs17/Test/ReportStorageTest.ipynb index 277fca1c..c27442c0 100644 --- a/ifrs17/Test/ReportStorageTest.ipynb +++ b/ifrs17/Test/ReportStorageTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "5NqHf0icnEqXIEcMtfnNvQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/TechnicalMarginTest.ipynb b/ifrs17/Test/TechnicalMarginTest.ipynb index 1e60b92a..ecd85174 100644 --- a/ifrs17/Test/TechnicalMarginTest.ipynb +++ b/ifrs17/Test/TechnicalMarginTest.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "OJ1IUniidUKv0PyIHZFe6w", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Test/TestData.ipynb b/ifrs17/Test/TestData.ipynb index 1326997d..7a8e98b5 100644 --- a/ifrs17/Test/TestData.ipynb +++ b/ifrs17/Test/TestData.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "2te-PqA6Wk2b8-olomgbmA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index a52dc9e6..78db6a6f 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "OJcj8lGDvkqHTMyxkmDNxg", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 1342eb57..c522bc2d 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "bezRpR9290SNllQh6iRIhQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -587,4 +588,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/ifrs17/Utils/ApplicationMessage.ipynb b/ifrs17/Utils/ApplicationMessage.ipynb index 2d9e3d3e..64c766ed 100644 --- a/ifrs17/Utils/ApplicationMessage.ipynb +++ b/ifrs17/Utils/ApplicationMessage.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "qGIN50NW4UaWrmm2WP47VA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,10 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False", - "toc-showmarkdowntxt": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Utils/EqualityComparers.ipynb b/ifrs17/Utils/EqualityComparers.ipynb index 488dc6a8..98705583 100644 --- a/ifrs17/Utils/EqualityComparers.ipynb +++ b/ifrs17/Utils/EqualityComparers.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "mCSaKAKB_kOGU2Lj-Wovrw", "kernelspec": { "display_name": "Formula Framework", "language": "C#", diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index beea37c7..dec7c53d 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "NWvfpshro0mc6HFQvYxRaA", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 02c03ab8..c1c3de8a 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "IA3IvuUbk0atrL8OxJVZ2Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Utils/Queries.ipynb b/ifrs17/Utils/Queries.ipynb index e82f52b9..87c7706a 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "COS_CBLUh0Gf_bKIABIZ0Q", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, diff --git a/ifrs17/Utils/TestHelper.ipynb b/ifrs17/Utils/TestHelper.ipynb index 6ae41a17..79512a83 100644 --- a/ifrs17/Utils/TestHelper.ipynb +++ b/ifrs17/Utils/TestHelper.ipynb @@ -1,6 +1,7 @@ { "metadata": { "authors": [], + "id": "vk1KfKu5Z0ytQieh3azqFQ", "kernelspec": { "display_name": "Formula Framework", "language": "C#", @@ -10,9 +11,7 @@ "file_extension": ".cs", "mimetype": "text/plain", "name": "C#" - }, - "toc-autonumbering": "True", - "toc-showcode": "False" + } }, "nbformat": 4, "nbformat_minor": 5, From 47ffedd687dde100b77947be67a04a84eb709755 Mon Sep 17 00:00:00 2001 From: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Date: Mon, 20 Feb 2023 15:22:50 +0100 Subject: [PATCH 07/19] Clean up in Reports Notebook (#221) Remove with { Height } from Reports --- ifrs17-template/Report/Reports.ipynb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ifrs17-template/Report/Reports.ipynb b/ifrs17-template/Report/Reports.ipynb index 6a6d7352..f001b275 100644 --- a/ifrs17-template/Report/Reports.ipynb +++ b/ifrs17-template/Report/Reports.ipynb @@ -99,7 +99,7 @@ "\npv.CurrencyType = CurrencyType.Contractual;", "\npv.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\npv.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.2\"),(\"LiabilityType\", \"LIC\") };", - "\n(await pv.ToReportAsync) with {Height = 720}" + "\n(await pv.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -126,7 +126,7 @@ "\nra.ReportingPeriod = (2021, 3);", "\nra.ColumnSlices = new string[]{};//\"GroupOfContract\", \"EconomicBasis\"", "\nra.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.2\")};", - "\n(await ra.ToReportAsync) with {Height = 800}" + "\n(await ra.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -154,7 +154,7 @@ "\nwrittenActual.ReportingPeriod = (2021, 3);", "\nwrittenActual.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nwrittenActual.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await writtenActual.ToReportAsync) with {Height = 400}" + "\n(await writtenActual.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -182,7 +182,7 @@ "\naccrualActual.ReportingPeriod = (2021, 3);", "\naccrualActual.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\naccrualActual.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};", - "\n(await accrualActual.ToReportAsync) with {Height = 400}" + "\n(await accrualActual.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -207,7 +207,7 @@ "\ndeferrableActual.ReportingPeriod = (2021, 3);", "\ndeferrableActual.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\ndeferrableActual.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await deferrableActual.ToReportAsync) with {Height = 400}" + "\n(await deferrableActual.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -236,7 +236,7 @@ "\nfulfillmentCashflows.ReportingPeriod = (2021, 3);", "\nfulfillmentCashflows.ColumnSlices = new string[]{};//\"EstimateType\"", "\nfulfillmentCashflows.DataFilter = null;// new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await fulfillmentCashflows.ToReportAsync) with {Height = 750}" + "\n(await fulfillmentCashflows.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -261,7 +261,7 @@ "\nexperienceAdjustments.ReportingPeriod = (2021, 3);", "\nexperienceAdjustments.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nexperienceAdjustments.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await experienceAdjustments.ToReportAsync) with {Height = 300}" + "\n(await experienceAdjustments.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -287,7 +287,7 @@ "\ntechnicalMargins.ReportingPeriod = (2021, 3);", "\ntechnicalMargins.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\ntechnicalMargins.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await technicalMargins.ToReportAsync) with {Height = 600}" + "\n(await technicalMargins.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -314,7 +314,7 @@ "\nallocatedTechnicalMargins.ReportingPeriod = (2021, 3);", "\nallocatedTechnicalMargins.ColumnSlices = new string[]{};//\"GroupOfContract\", \"EstimateType\"", "\nallocatedTechnicalMargins.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + "\n(await allocatedTechnicalMargins.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -339,7 +339,7 @@ "\nactuarialLrc.ReportingPeriod = (2021, 3);", "\nactuarialLrc.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nactuarialLrc.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + "\n(await actuarialLrc.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -364,7 +364,7 @@ "\nlrc.ReportingPeriod = (2021, 3);", "\nlrc.ColumnSlices = new string[]{};//\"GroupOfContract\",", "\nlrc.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await lrc.ToReportAsync) with {Height = 250}" + "\n(await lrc.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -389,7 +389,7 @@ "\nactuarialLic.ReportingPeriod = (2021, 3);", "\nactuarialLic.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nactuarialLic.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await actuarialLic.ToReportAsync) with {Height = 750}" + "\n(await actuarialLic.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -414,7 +414,7 @@ "\nlic.ReportingPeriod = (2021, 3);", "\nlic.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nlic.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await lic.ToReportAsync) with {Height = 250}" + "\n(await lic.ToReportAsync)" ], "metadata": {}, "execution_count": 0, @@ -441,7 +441,7 @@ "\nfinancialPerformance.ReportingPeriod = (2021, 3);", "\nfinancialPerformance.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nfinancialPerformance.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", - "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + "\n(await financialPerformance.ToReportAsync) with {GroupDefaultExpanded = 3}" ], "metadata": {}, "execution_count": 0, From 3ea64d0bf68fd523496b830761e60032395d95e3 Mon Sep 17 00:00:00 2001 From: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Date: Mon, 20 Feb 2023 15:38:49 +0100 Subject: [PATCH 08/19] Import With Define Format Fix For With Target Option (#215) * Replace DataSource with options.TargetDataSource for A and CF and adjust SequenceImportTest * Fix .WithActivityLog() * Replace DataSource with options.TargetDataSource except in CommitPartitionAsync (remove empty cell and fix markdown typo) * Fix MapTemplateAndImportTest * Use disposable Workspaces --- .../Test/MapTemplateAndImportTest.ipynb | 53 +++++-- .../Test/ReimportWithDifferentScopeTest.ipynb | 4 +- ifrs17-template/Test/SequenceImportTest.ipynb | 20 --- ifrs17/Import/Importers.ipynb | 139 ++++++++---------- 4 files changed, 108 insertions(+), 108 deletions(-) diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index dbcf479d..60ac6284 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -165,7 +165,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" @@ -184,7 +184,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -266,7 +266,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" @@ -283,7 +283,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -360,7 +360,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" @@ -376,7 +376,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -542,11 +542,10 @@ { "cell_type": "code", "source": [ - "public async Task CheckErrors(string inputFileName, List errorBms)", + "public async Task CheckErrors(string inputFileName, List errorBms, IWorkspace workspace)", "\n{", "\n Activity.Start();", - "\n var log = await Import.FromFile(inputFileName).WithFormat(ImportFormats.DataNodeParameter).WithTarget(Workspace).ExecuteAsync();", - "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\n var log = await Import.FromFile(inputFileName).WithFormat(ImportFormats.DataNodeParameter).WithTarget(workspace).ExecuteAsync();", "\n errorBms.Intersect(log.Errors.Select(x => x.ToString().Substring(0,x.ToString().Length-2).Substring(40)).ToArray()).Count().Should().Be(errorBms.Count());", "\n return Activity.Finish();", "\n}" @@ -555,6 +554,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var ws1 = Workspace.CreateNew();", + "\nws1.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -562,32 +571,52 @@ "\nvar errorsBm = new List(){Get(Error.InvalidDataNode, \"DataNodeInvalid0\"),", "\n Get(Error.InvalidDataNode, \"DataNodeInvalid1\"),", "\n Get(Error.InvalidDataNode, \"DataNodeInvalid2\")};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm);", + "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws1);", "\nactivity" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var ws2 = Workspace.CreateNew();", + "\nws2.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ "var inputFileName = \"Data/DataNodeParameter_Duplicate.csv\";", "\nvar errorsBm = new List(){Get(Error.DuplicateSingleDataNode, \"DT1.1\"),", "\n Get(Error.DuplicateInterDataNode, \"DT1.1\",\"DTR1.1\"),};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm);", + "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws2);", "\nactivity" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var ws3 = Workspace.CreateNew();", + "\nws3.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ "var inputFileName = \"Data/DataNodeParameter_InvalidReinsCov.csv\";", "\nvar errorsBm = new List(){Get(Error.ReinsuranceCoverageDataNode, \"DT1.1\",\"DT1.1\")};", - "\nvar activity = await CheckErrors(inputFileName, errorsBm);", + "\nvar activity = await CheckErrors(inputFileName, errorsBm, ws3);", "\nactivity" ], "metadata": {}, diff --git a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb index 84609e9c..37e4280a 100644 --- a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb +++ b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb @@ -51,7 +51,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -86,7 +86,7 @@ "await Import.FromFile(\"Data/NominalCashflows_CH_2020_12_DT1.1NoPrem.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index 4791c988..aef67b5e 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -79,16 +79,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "ws1.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nws1.Initialize(x => x.FromSource(DataSource));" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ @@ -153,16 +143,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "ws2.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nws2.Initialize(x => x.FromSource(DataSource));" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 779968ba..3dc162d6 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -422,12 +422,12 @@ { "cell_type": "code", "source": [ - "public async Task GetArgsAndCommitPartitionAsync(IDataSet dataSet)", + "public async Task GetArgsAndCommitPartitionAsync(IDataSet dataSet, IDataSource targetDataSource)", "\n{", "\n var args = GetArgsFromMain(dataSet);", "\n if(ApplicationMessage.HasErrors()) return null;", "\n if(args.ReportingNode == default(string)) { ApplicationMessage.Log(Error.ReportingNodeInMainNotFound); return null; }", - "\n await CommitPartitionAsync(args, DataSource);", + "\n await CommitPartitionAsync(args, targetDataSource);", "\n return args;", "\n}" ], @@ -447,7 +447,7 @@ { "cell_type": "code", "source": [ - "public async Task DataNodeFactoryAsync(IDataSet dataSet, string tableName, ImportArgs args)", + "public async Task DataNodeFactoryAsync(IDataSet dataSet, string tableName, ImportArgs args, IDataSource targetDataSource)", "\n{", "\n var partition = (await DataSource.Query().Where(p => p.ReportingNode == args.ReportingNode).ToArrayAsync()).FirstOrDefault();", "\n if(partition == null) { ApplicationMessage.Log(Error.ParsedPartitionNotFound); return; }", @@ -455,15 +455,15 @@ "\n var table = dataSet.Tables[tableName];", "\n ", "\n var dataNodesImported = table.Rows.Select(x => x.Field(nameof(RawVariable.DataNode))).ToHashSet();", - "\n var dataNodesDefined = await DataSource.Query().Where(x => dataNodesImported.Contains(x.SystemName)).ToArrayAsync();", - "\n var dataNodeStatesDefined = await DataSource.Query().Select(x => x.DataNode).ToArrayAsync();", - "\n var dataNodeParametersDefined = await DataSource.Query().Select(x => x.DataNode).ToArrayAsync(); ", + "\n var dataNodesDefined = await targetDataSource.Query().Where(x => dataNodesImported.Contains(x.SystemName)).ToArrayAsync();", + "\n var dataNodeStatesDefined = await targetDataSource.Query().Select(x => x.DataNode).ToArrayAsync();", + "\n var dataNodeParametersDefined = await targetDataSource.Query().Select(x => x.DataNode).ToArrayAsync(); ", "\n var dataNodeStatesUndefined = dataNodesImported.Where(x => x != null && !dataNodeStatesDefined.Contains(x)).ToHashSet();", "\n var dataNodeSingleParametersUndefined = dataNodesImported.Where(x => x != null &&", "\n !dataNodeParametersDefined.Contains(x) && ", "\n dataNodesDefined.SingleOrDefault(y => y.SystemName == x) is GroupOfInsuranceContract).ToHashSet();", "\n if ((dataNodeStatesUndefined?.Any() ?? false))", - "\n await DataSource.UpdateAsync( dataNodeStatesUndefined.Select(x => ", + "\n await targetDataSource.UpdateAsync( dataNodeStatesUndefined.Select(x => ", "\n new DataNodeState {DataNode = x, ", "\n Year = args.Year, ", "\n Month = DefaultDataNodeActivationMonth, ", @@ -471,14 +471,14 @@ "\n Partition = partition.Id})", "\n .ToArray() );", "\n if ((dataNodeSingleParametersUndefined?.Any() ?? false))", - "\n await DataSource.UpdateAsync( dataNodeSingleParametersUndefined.Select(x => ", + "\n await targetDataSource.UpdateAsync( dataNodeSingleParametersUndefined.Select(x => ", "\n new SingleDataNodeParameter {DataNode = x, ", "\n Year = args.Year, ", "\n Month = DefaultDataNodeActivationMonth, ", "\n PremiumAllocation = DefaultPremiumExperienceAdjustmentFactor, ", "\n Partition = partition.Id})", "\n .ToArray() );", - "\n await DataSource.CommitAsync();", + "\n await targetDataSource.CommitAsync();", "\n}" ], "metadata": {}, @@ -503,7 +503,7 @@ { "cell_type": "code", "source": [ - "public async Task GetAllArgsAsync(ImportArgs args, IDataSource dataSource, string format)", + "public async Task GetAllArgsAsync(ImportArgs args, IDataSource dataSource, string format, IDataSource targetDataSource)", "\n{", "\n ImportArgs[] allArgs;", "\n switch(format)", @@ -529,7 +529,7 @@ "\n default : ", "\n {", "\n if(args.Scenario != null) return args.RepeatOnce().ToArray();", - "\n var secondaryArgs = await DataSource.Query() ", + "\n var secondaryArgs = await targetDataSource.Query() ", "\n .Where(x => x.ReportingNode == args.ReportingNode && x.Year == args.Year && x.Month == args.Month && x.Scenario != null)", "\n .Select(x => new ImportArgs(x.ReportingNode, x.Year, x.Month, default(Periodicity), x.Scenario, ImportFormats.Cashflow)).ToArrayAsync();", "\n ", @@ -797,7 +797,7 @@ "source": [ "# Yield Curves ", "\n", - "\n[Yield curves](../DataModel/DataStructure#yield-curve) are imported for a specific year, month, and scenario (not required if best estimate). This informations are collected in the main section of the file. ", + "\n[Yield curves](../DataModel/DataStructure#yield-curve) are imported for a specific year, month, and scenario (not required if best estimate). This information is collected in the main section of the file. ", "\n", "\nYield curves to be imported are compared against those already present in the DataSource and only the new ones are stored." ], @@ -839,7 +839,7 @@ "\n return Activity.Finish().Merge(importLog);", "\n }", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.YieldCurve);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.YieldCurve, options.TargetDataSource);", "\n var updatedCurrencies = toCommitYieldCurves.Select(x => x.Currency).Distinct();", "\n var dataNodesToUpdate = await workspace.Query().Where(x => updatedCurrencies.Contains(x.ContractualCurrency)).Select(x => x.SystemName).ToArrayAsync();", "\n var workspaceToCompute = Workspace.CreateNew();", @@ -900,20 +900,20 @@ { "cell_type": "code", "source": [ - "public async Task UploadDataNodesToWorkspaceAsync(IDataSet dataSet, IWorkspace workspace)", + "public async Task UploadDataNodesToWorkspaceAsync(IDataSet dataSet, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Initialize(x => x.FromSource(targetDataSource)", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet);", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, targetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", - "\n var storage = new ParsingStorage(args, DataSource, workspace);", + "\n var storage = new ParsingStorage(args, targetDataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", @@ -1009,12 +1009,12 @@ "source": [ "Import.DefineFormat(ImportFormats.DataNode, async (options, dataSet) => {", "\n var workspace = Workspace.CreateNew();", - "\n var log = await UploadDataNodesToWorkspaceAsync(dataSet, workspace);", + "\n var log = await UploadDataNodesToWorkspaceAsync(dataSet, workspace, options.TargetDataSource);", "\n var partition = (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode));", - "\n await workspace.CommitToAsync(DataSource, partition);", - "\n await workspace.CommitToAsync(DataSource, partition);", - "\n await workspace.CommitToAsync(DataSource, partition);", - "\n await workspace.CommitToAsync(DataSource, partition);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partition);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partition);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partition);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partition);", "\n return log;", "\n});" ], @@ -1034,27 +1034,18 @@ { "cell_type": "code", "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public async Task UploadDataNodeStateToWorkspaceAsync(IDataSet dataSet, IWorkspace workspace)", + "public async Task UploadDataNodeStateToWorkspaceAsync(IDataSet dataSet, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Initialize(x => x.FromSource(targetDataSource)", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeState};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, targetDataSource) with {ImportFormat = ImportFormats.DataNodeState};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", - "\n var storage = new ParsingStorage(args, DataSource, workspace);", + "\n var storage = new ParsingStorage(args, targetDataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -1081,8 +1072,8 @@ "source": [ "Import.DefineFormat(ImportFormats.DataNodeState, async (options, dataSet) => {", "\n var workspace = Workspace.CreateNew();", - "\n var log = await UploadDataNodeStateToWorkspaceAsync(dataSet, workspace);", - "\n await workspace.CommitToAsync(DataSource, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", + "\n var log = await UploadDataNodeStateToWorkspaceAsync(dataSet, workspace, options.TargetDataSource);", + "\n await workspace.CommitToAsync(options.TargetDataSource, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", "\n return log;", "\n});" ], @@ -1102,18 +1093,18 @@ { "cell_type": "code", "source": [ - "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId, IWorkspace workspace)", + "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Initialize(x => x.FromSource(targetDataSource)", "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, targetDataSource) with {ImportFormat = ImportFormats.DataNodeParameter};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var storage = new ParsingStorage(args, DataSource, workspace);", + "\n var storage = new ParsingStorage(args, targetDataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -1193,9 +1184,9 @@ "Import.DefineFormat(ImportFormats.DataNodeParameter, async (options, dataSet) => {", "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", - "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace);", - "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot: false);", - "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot: false); ", + "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace, options.TargetDataSource);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partitionId, snapshot: false);", + "\n await workspace.CommitToAsync(options.TargetDataSource, partitionId, snapshot: false); ", "\n ", "\n return log;", "\n});" @@ -1222,13 +1213,13 @@ { "cell_type": "code", "source": [ - "public async Task ParseCashflowsToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace)", + "public async Task ParseCashflowsToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());", + "\n workspace.Initialize(x => x.FromSource(targetDataSource).DisableInitialization().DisableInitialization());", "\n ", "\n Activity.Start();", - "\n var parsingStorage = new ParsingStorage(args, DataSource, workspace);", + "\n var parsingStorage = new ParsingStorage(args, targetDataSource, workspace);", "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", @@ -1296,24 +1287,24 @@ "source": [ "Import.DefineFormat(ImportFormats.Cashflow, async (options, dataSet) => {", "\n Activity.Start();", - "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Cashflow};", + "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.Cashflow};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Cashflow);", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Cashflow, primaryArgs);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Cashflow, options.TargetDataSource);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Cashflow, primaryArgs, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var workspace = Workspace.CreateNew();", - "\n var log = await ParseCashflowsToWorkspaceAsync(dataSet, primaryArgs, workspace);", + "\n var log = await ParseCashflowsToWorkspaceAsync(dataSet, primaryArgs, workspace, options.TargetDataSource);", "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", "\n", "\n var workspaceToCompute = Workspace.CreateNew();", - "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\n workspaceToCompute.Initialize(x => x.FromSource(options.TargetDataSource));", "\n foreach (var args in allArgs) {", "\n log = log.Merge(await ComputeAsync(args, workspace, workspaceToCompute, args == primaryArgs));", "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", "\n }", - "\n await workspaceToCompute.CommitToTargetAsync(DataSource);", + "\n await workspaceToCompute.CommitToTargetAsync(options.TargetDataSource);", "\n return Activity.Finish().Merge(log); ", "\n});" ], @@ -1341,15 +1332,15 @@ { "cell_type": "code", "source": [ - "public async Task ParseActualsToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace)", + "public async Task ParseActualsToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Initialize(x => x.FromSource(targetDataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", "\n Activity.Start();", - "\n var parsingStorage = new ParsingStorage(args, DataSource, workspace);", + "\n var parsingStorage = new ParsingStorage(args, targetDataSource, workspace);", "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", @@ -1397,24 +1388,24 @@ "source": [ "Import.DefineFormat(ImportFormats.Actual, async (options, dataSet) => {", "\n Activity.Start();", - "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Actual};", + "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.Actual};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Actual);", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, primaryArgs);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Actual, options.TargetDataSource);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, primaryArgs, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", "\n var workspace = Workspace.CreateNew();", - "\n var log = await ParseActualsToWorkspaceAsync(dataSet, primaryArgs, workspace);", + "\n var log = await ParseActualsToWorkspaceAsync(dataSet, primaryArgs, workspace, options.TargetDataSource);", "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", "\n", "\n var workspaceToCompute = Workspace.CreateNew();", - "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\n workspaceToCompute.Initialize(x => x.FromSource(options.TargetDataSource));", "\n foreach (var args in allArgs) {", "\n log = log.Merge(await ComputeAsync(args, workspace, workspaceToCompute, false)); ", "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", "\n }", - "\n await workspaceToCompute.CommitToTargetAsync(DataSource);", + "\n await workspaceToCompute.CommitToTargetAsync(options.TargetDataSource);", "\n return Activity.Finish().Merge(log);", "\n});" ], @@ -1437,16 +1428,16 @@ { "cell_type": "code", "source": [ - "public async Task ParseSimpleValueToWorkspaceAsync(IDataSet dataSet, ImportArgs args, Guid targetPartitionByReportingNodeAndPeriodId, IWorkspace workspace)", + "public async Task ParseSimpleValueToWorkspaceAsync(IDataSet dataSet, ImportArgs args, Guid targetPartitionByReportingNodeAndPeriodId, IWorkspace workspace, IDataSource targetDataSource)", "\n{", "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(DataSource)", + "\n workspace.Initialize(x => x.FromSource(targetDataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());", "\n ", "\n Activity.Start();", "\n var importFormat = args.ImportFormat;", - "\n var parsingStorage = new ParsingStorage(args, DataSource, workspace);", + "\n var parsingStorage = new ParsingStorage(args, targetDataSource, workspace);", "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish(); ", "\n", @@ -1506,20 +1497,20 @@ "source": [ "Import.DefineFormat(ImportFormats.SimpleValue, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.SimpleValue};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.SimpleValue};", "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.SimpleValue, args);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.SimpleValue, args, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", - "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", + "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace, options.TargetDataSource);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n", "\n workspace.Query().Select(v => new {v.DataNode, v.AccidentYear}).Distinct();", "\n", "\n var targetDataNodes = workspace.Query().Select(v => v.DataNode).Distinct().ToArray();", - "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot : true,", + "\n await workspace.CommitToAsync(options.TargetDataSource, partitionId, snapshot : true,", "\n filter : x => targetDataNodes.Contains(x.DataNode));", "\n return Activity.Finish().Merge(parsingLog);", "\n});" @@ -1544,21 +1535,21 @@ "source": [ "Import.DefineFormat(ImportFormats.Opening, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Opening};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.Opening};", "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Opening, args);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Opening, args, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", - "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", + "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace, options.TargetDataSource);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", "\n", "\n var workspaceToCompute = Workspace.CreateNew();", - "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\n workspaceToCompute.Initialize(x => x.FromSource(options.TargetDataSource));", "\n var calculationLog = await ComputeAsync(args, workspace, workspaceToCompute, false); ", "\n if(calculationLog.Errors.Any()) return Activity.Finish().Merge(calculationLog);", - "\n await workspaceToCompute.CommitToTargetAsync(DataSource, x => x.SnapshotMode());", + "\n await workspaceToCompute.CommitToTargetAsync(options.TargetDataSource, x => x.SnapshotMode());", "\n return Activity.Finish().Merge(parsingLog).Merge(calculationLog);", "\n})" ], From 07b2bc1bb640c5c648cd0fe2cc8f44aa2ede34b8 Mon Sep 17 00:00:00 2001 From: Andrey Katz <118806207+andrey-katz-systemorph@users.noreply.github.com> Date: Thu, 23 Feb 2023 09:34:31 +0100 Subject: [PATCH 09/19] versions change (#223) Co-authored-by: akatz --- ifrs17/DataModel/DataStructure.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index b3d65bdd..6c4ba188 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -57,10 +57,10 @@ "\n#r \"nuget:Systemorph.SharePoint,1.6.2\"", "\n#r \"nuget:Systemorph.OneDrive,1.6.2\"", "\n#r \"nuget:Systemorph.Scopes,1.6.2\"", - "\n#r \"nuget:Systemorph.Import,1.6.4\"", + "\n#r \"nuget:Systemorph.Import,1.6.6\"", "\n#r \"nuget:Systemorph.Test,1.6.2\"", - "\n#r \"nuget:Systemorph.Export,1.6.4\"", - "\n#r \"nuget:Systemorph.DataSetReader,1.6.4\"", + "\n#r \"nuget:Systemorph.Export,1.6.6\"", + "\n#r \"nuget:Systemorph.DataSetReader,1.6.6\"", "\n#r \"nuget:Systemorph.DataSource,1.6.3\"", "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.3\"", "\n#r \"nuget:Systemorph.Reporting,1.6.2\"", From d467aaaed63d1c2b726591bcabc9a0e278db8547 Mon Sep 17 00:00:00 2001 From: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Date: Thu, 2 Mar 2023 09:24:13 +0100 Subject: [PATCH 10/19] Hot fix loreco (#226) * Develop (with removed Arithmetic) to Main (#63) * base code * correct broken links * fixed Opening re-import * Rename "PvBase" to "PresentValue" (#32) * include new default spaces * reorder global metadata using alphabetical order * Break utils nb (#33) * working on reports doc * metadata * break down utils * remove preview * update references to utils * fix image paths * reset doc around reports * fixing test + a ton of metadata * Cleanup redundant comments and import /Tests/TestHelper in SpecificationsFinancialPerformance * Move Export.ipynb inside the Export folder, fix import /Export/Export statement and comments cleanup in Utils/Extensions.ipynb * Empty commit to refresh the meta-data * Remove all *.orig files Co-authored-by: nnikolopoulos * Including FX positions to FP scope * FP specification nb - add FX aoc step * Rename calculation type with estimate type (#34) * Replace CalculationType with EstimateType * Correct estimateType capitalization error in Test/SpecificationsImportCashflows.ipynb * Clean up notebooks spaces * Empty commit to refresh the meta-data * Cleanup comments in Import/ImportStorage.ipynb * Fix capitalization in Importers & ImportStorage NB * Fix column order in csv * Add blank cell DataNodeParameters link * new data node factory * metadata * metadata x2 * metadata x3 * implement feedback * split directories * fix tests + add readme + seperate overview nb * include changes on factory * adapt to the split * update packages and fix csm with bm * approaching * better * implement feedback * final feedback * fix * const version ce * Update links (#51) * working on links * read me * remove redundant code * clean up * AocConfiguration ImportFormat * remove reference to init from Overview * removal arithmetics * Simple value test data (#54) * Adding data files * Fix input * Fix input * change to importers test * Fix to sign * Int convention * reset consts * implement feedback part 1 * Overview texts (#53) * Overview (Template), revised text * Reports of template with small adjustments * Overview IFRS17, some adjustments * finalized + hot fixes * ReportGridOptions * final fixes and feedback implementations Co-authored-by: Sara Busato Co-authored-by: sbusato <103484221+sbusato@users.noreply.github.com> Co-authored-by: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Co-authored-by: nnikolopoulos Co-authored-by: Andrea Muolo Co-authored-by: amuolo Co-authored-by: Daniel Trzesniak Co-authored-by: UMueller1 <108468853+UMueller1@users.noreply.github.com> * Dev to main (#66) * base code * correct broken links * fixed Opening re-import * Rename "PvBase" to "PresentValue" (#32) * include new default spaces * reorder global metadata using alphabetical order * Break utils nb (#33) * working on reports doc * metadata * break down utils * remove preview * update references to utils * fix image paths * reset doc around reports * fixing test + a ton of metadata * Cleanup redundant comments and import /Tests/TestHelper in SpecificationsFinancialPerformance * Move Export.ipynb inside the Export folder, fix import /Export/Export statement and comments cleanup in Utils/Extensions.ipynb * Empty commit to refresh the meta-data * Remove all *.orig files Co-authored-by: nnikolopoulos * Including FX positions to FP scope * FP specification nb - add FX aoc step * Rename calculation type with estimate type (#34) * Replace CalculationType with EstimateType * Correct estimateType capitalization error in Test/SpecificationsImportCashflows.ipynb * Clean up notebooks spaces * Empty commit to refresh the meta-data * Cleanup comments in Import/ImportStorage.ipynb * Fix capitalization in Importers & ImportStorage NB * Fix column order in csv * Add blank cell DataNodeParameters link * new data node factory * metadata * metadata x2 * metadata x3 * implement feedback * split directories * fix tests + add readme + seperate overview nb * include changes on factory * adapt to the split * update packages and fix csm with bm * approaching * better * implement feedback * final feedback * fix * const version ce * Update links (#51) * working on links * read me * remove redundant code * clean up * AocConfiguration ImportFormat * remove reference to init from Overview * removal arithmetics * Simple value test data (#54) * Adding data files * Fix input * Fix input * change to importers test * Fix to sign * Int convention * reset consts * implement feedback part 1 * Overview texts (#53) * Overview (Template), revised text * Reports of template with small adjustments * Overview IFRS17, some adjustments * finalized + hot fixes * ReportGridOptions * final fixes and feedback implementations * Interactive reports (#58) * Ifrs17ReportScopes * wip * latest * add other reports * start with pv * filter does not work * clean up * clean up reports * clean up * typo * move it ce * remove partition set * adjust reporting * test readme with relative path for image * back to absolute path - bug in the portal - * wip * settle with identities * some more docs * adding rn and period selector * New format design in importers (#62) * Define new ImportFormats * Apply import w format in DN, DNS, DP, CF * Apply import w format in A, SV and O * Correct Import statements * Replace abs link with var link * Adjust naming convention * Adjust new import format in full-template * Package update (#65) * update packages * add anchors Co-authored-by: Sara Busato Co-authored-by: sbusato <103484221+sbusato@users.noreply.github.com> Co-authored-by: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Co-authored-by: nnikolopoulos Co-authored-by: Andrea Muolo Co-authored-by: amuolo Co-authored-by: Daniel Trzesniak Co-authored-by: UMueller1 <108468853+UMueller1@users.noreply.github.com> * Update issue templates (#69) * Dev to main (#84) * base code * correct broken links * fixed Opening re-import * Rename "PvBase" to "PresentValue" (#32) * include new default spaces * reorder global metadata using alphabetical order * Break utils nb (#33) * working on reports doc * metadata * break down utils * remove preview * update references to utils * fix image paths * reset doc around reports * fixing test + a ton of metadata * Cleanup redundant comments and import /Tests/TestHelper in SpecificationsFinancialPerformance * Move Export.ipynb inside the Export folder, fix import /Export/Export statement and comments cleanup in Utils/Extensions.ipynb * Empty commit to refresh the meta-data * Remove all *.orig files Co-authored-by: nnikolopoulos * Including FX positions to FP scope * FP specification nb - add FX aoc step * Rename calculation type with estimate type (#34) * Replace CalculationType with EstimateType * Correct estimateType capitalization error in Test/SpecificationsImportCashflows.ipynb * Clean up notebooks spaces * Empty commit to refresh the meta-data * Cleanup comments in Import/ImportStorage.ipynb * Fix capitalization in Importers & ImportStorage NB * Fix column order in csv * Add blank cell DataNodeParameters link * new data node factory * metadata * metadata x2 * metadata x3 * implement feedback * split directories * fix tests + add readme + seperate overview nb * include changes on factory * adapt to the split * still not working properly * code cleanup * new file creation * update packages and fix csm with bm * approaching * better * testing ifrsvariables * implement feedback * final feedback * fix * const version ce * testing IfrsVariables calculations * new partition added * implementing new test * test cleaned * Update links (#51) * working on links * read me * remove redundant code * clean up * AocConfiguration ImportFormat * remove reference to init from Overview * removal arithmetics * testing queries * Simple value test data (#54) * Adding data files * Fix input * Fix input * change to importers test * Fix to sign * Int convention * reset consts * implement feedback part 1 * Overview texts (#53) * Overview (Template), revised text * Reports of template with small adjustments * Overview IFRS17, some adjustments * finalized + hot fixes * ReportGridOptions * checking multiple import of the same scenario * final fixes and feedback implementations * dynamic problems solved * fixing aoctype for scenario * Interactive reports (#58) * Ifrs17ReportScopes * wip * latest * add other reports * start with pv * filter does not work * clean up * clean up reports * clean up * typo * move it ce * remove partition set * adjust reporting * test readme with relative path for image * back to absolute path - bug in the portal - * wip * settle with identities * some more docs * adding rn and period selector * test for actualsr * code cleanup * New format design in importers (#62) * Define new ImportFormats * Apply import w format in DN, DNS, DP, CF * Apply import w format in A, SV and O * Correct Import statements * Replace abs link with var link * Adjust naming convention * Adjust new import format in full-template * forward * Package update (#65) * update packages * add anchors * cleanups * Fixing AA and OA opening and benchmark simple importer (#57) * Fixing input data * Workaround for bm generation * Fixed GetSign * Inputs * Fixed Importers * add some doc * fixed CU * Dirty fix on signs * undo CU sign * wip * Fix signs * Init * fix * fix * exclude simple value from test * some partial fix * Full fix * much better * implemented * Aggregate by in report variable (#67) * included back AggregateBy * included Currency column in ReportVariable benchmarks * Clean up doc (#71) * remove spec tests * read me and big picture * help review * code of conduct. Readme. Remove Spec tests * env for go live * rename of directories in file * overview template * improve template readme * calculation engine and reports in template * more on ifrs17ce * NB titles * clean up display order * improve validation * fix links * fix link * Close import template * additions to report guide * solve conflicts * implement feedback * cleanups * cleanups x2 * fixes needed after merge * all tests are green * implement feedback * Doc cleanup2 (#76) * forbiddenSlices and chose init or db connection * clean ups * small letters to capital * complete sentence about filters * implement all feedbacks * packages + withGridOption + await HierarchyCache init (#83) Co-authored-by: Sara Busato Co-authored-by: sbusato <103484221+sbusato@users.noreply.github.com> Co-authored-by: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Co-authored-by: nnikolopoulos Co-authored-by: Andrea Muolo Co-authored-by: amuolo Co-authored-by: Danilo Calderini Co-authored-by: Daniel Trzesniak Co-authored-by: UMueller1 <108468853+UMueller1@users.noreply.github.com> * Dev to main (#86) * base code * correct broken links * fixed Opening re-import * Rename "PvBase" to "PresentValue" (#32) * include new default spaces * reorder global metadata using alphabetical order * Break utils nb (#33) * working on reports doc * metadata * break down utils * remove preview * update references to utils * fix image paths * reset doc around reports * fixing test + a ton of metadata * Cleanup redundant comments and import /Tests/TestHelper in SpecificationsFinancialPerformance * Move Export.ipynb inside the Export folder, fix import /Export/Export statement and comments cleanup in Utils/Extensions.ipynb * Empty commit to refresh the meta-data * Remove all *.orig files Co-authored-by: nnikolopoulos * Including FX positions to FP scope * FP specification nb - add FX aoc step * Rename calculation type with estimate type (#34) * Replace CalculationType with EstimateType * Correct estimateType capitalization error in Test/SpecificationsImportCashflows.ipynb * Clean up notebooks spaces * Empty commit to refresh the meta-data * Cleanup comments in Import/ImportStorage.ipynb * Fix capitalization in Importers & ImportStorage NB * Fix column order in csv * Add blank cell DataNodeParameters link * new data node factory * metadata * metadata x2 * metadata x3 * implement feedback * split directories * fix tests + add readme + seperate overview nb * include changes on factory * adapt to the split * still not working properly * code cleanup * new file creation * update packages and fix csm with bm * approaching * better * testing ifrsvariables * implement feedback * final feedback * fix * const version ce * testing IfrsVariables calculations * new partition added * implementing new test * test cleaned * Update links (#51) * working on links * read me * remove redundant code * clean up * AocConfiguration ImportFormat * remove reference to init from Overview * removal arithmetics * testing queries * Simple value test data (#54) * Adding data files * Fix input * Fix input * change to importers test * Fix to sign * Int convention * reset consts * implement feedback part 1 * Overview texts (#53) * Overview (Template), revised text * Reports of template with small adjustments * Overview IFRS17, some adjustments * finalized + hot fixes * ReportGridOptions * checking multiple import of the same scenario * final fixes and feedback implementations * dynamic problems solved * fixing aoctype for scenario * Interactive reports (#58) * Ifrs17ReportScopes * wip * latest * add other reports * start with pv * filter does not work * clean up * clean up reports * clean up * typo * move it ce * remove partition set * adjust reporting * test readme with relative path for image * back to absolute path - bug in the portal - * wip * settle with identities * some more docs * adding rn and period selector * test for actualsr * code cleanup * New format design in importers (#62) * Define new ImportFormats * Apply import w format in DN, DNS, DP, CF * Apply import w format in A, SV and O * Correct Import statements * Replace abs link with var link * Adjust naming convention * Adjust new import format in full-template * forward * Package update (#65) * update packages * add anchors * cleanups * Fixing AA and OA opening and benchmark simple importer (#57) * Fixing input data * Workaround for bm generation * Fixed GetSign * Inputs * Fixed Importers * add some doc * fixed CU * Dirty fix on signs * undo CU sign * wip * Fix signs * Init * fix * fix * exclude simple value from test * some partial fix * Full fix * much better * implemented * Aggregate by in report variable (#67) * included back AggregateBy * included Currency column in ReportVariable benchmarks * Clean up doc (#71) * remove spec tests * read me and big picture * help review * code of conduct. Readme. Remove Spec tests * env for go live * rename of directories in file * overview template * improve template readme * calculation engine and reports in template * more on ifrs17ce * NB titles * clean up display order * improve validation * fix links * fix link * Close import template * additions to report guide * solve conflicts * implement feedback * cleanups * cleanups x2 * fixes needed after merge * all tests are green * implement feedback * Doc cleanup2 (#76) * forbiddenSlices and chose init or db connection * clean ups * small letters to capital * complete sentence about filters * implement all feedbacks * packages + withGridOption + await HierarchyCache init (#83) * Change in ReportMutableScopes NB * Change in ReportMutableScopes NB (#85) Co-authored-by: Davide Colleoni Co-authored-by: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Co-authored-by: Sara Busato Co-authored-by: sbusato <103484221+sbusato@users.noreply.github.com> Co-authored-by: Andrea Muolo Co-authored-by: amuolo Co-authored-by: Danilo Calderini Co-authored-by: Daniel Trzesniak Co-authored-by: UMueller1 <108468853+UMueller1@users.noreply.github.com> * delete full template dir * remove images * Openings: remove reimport duplicates (#150) * fixed ImportStorage queries for openings * clean up * debug import scopes * enhance technical margin test - reproduce the bug - * fix and increase test coverage * clean up * typos --------- Co-authored-by: Sara Busato Co-authored-by: sbusato <103484221+sbusato@users.noreply.github.com> Co-authored-by: nnikolopoulos <114566025+nnikolopoulos@users.noreply.github.com> Co-authored-by: nnikolopoulos Co-authored-by: Andrea Muolo Co-authored-by: amuolo Co-authored-by: Daniel Trzesniak Co-authored-by: UMueller1 <108468853+UMueller1@users.noreply.github.com> Co-authored-by: Danilo Calderini --- ifrs17/Import/ImportScopeCalculation.ipynb | 16 +- ifrs17/Test/TechnicalMarginTest.ipynb | 482 +++++++++++++++++++-- 2 files changed, 453 insertions(+), 45 deletions(-) diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index c24d824c..7189319a 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -1868,7 +1868,7 @@ "\n //Switch", "\n static ApplicabilityBuilder ScopeApplicabilityBuilder(ApplicabilityBuilder builder) => ", "\n builder.ForScope(s => s", - "\n .WithApplicability(x => x.Identity.IsReinsurance && x.Identity.AocType == AocTypes.CL) ", + "\n .WithApplicability(x => x.Identity.IsReinsurance && x.Identity.AocType == AocTypes.CL)", "\n .WithApplicability(x => x.Identity.IsReinsurance, ", "\n p => p.ForMember(s => s.ComputedEstimateType)", "\n .ForMember(s => s.HasSwitch))", @@ -1880,11 +1880,10 @@ "\n ", "\n [NotVisible] double AggregatedTechnicalMargin => GetScope(Identity).AggregatedValue; ", "\n [NotVisible] double TechnicalMargin => GetScope(Identity).Value;", - "\n ", "\n [NotVisible] string ComputedEstimateType => ComputeEstimateType(GetScope(Identity).AggregatedValue + TechnicalMargin);", "\n [NotVisible] bool HasSwitch => ComputedEstimateType != ComputeEstimateType(GetScope(Identity).AggregatedValue);", "\n ", - "\n //Allocate ", + "\n //Allocate", "\n [NotVisible] string EstimateType => GetContext();", "\n ", "\n double Value => (HasSwitch, EstimateType == ComputedEstimateType) switch {", @@ -1913,14 +1912,14 @@ "\n", "\npublic interface AllocateTechnicalMarginForReinsurance : AllocateTechnicalMargin", "\n{ ", - "\n //TODO add Reinsurance Coverage Update (RCU, Novelty=I) AocStep", + "\n //TODO add Reinsurance Coverage Update (RCU, Novelty=I) AocStep", "\n private IEnumerable underlyingGic => GetStorage().GetUnderlyingGic(Identity);", "\n ", "\n private double weightedUnderlyingTM => underlyingGic.Sum(gic => GetStorage().GetReinsuranceCoverage(Identity, gic) * ", - "\n GetScope(Identity with {DataNode = gic}).TechnicalMargin);", + "\n GetScope(Identity with {DataNode = gic}).Value);", "\n ", "\n private double weightedUnderlyingAggregatedTM => underlyingGic.Sum(gic => GetStorage().GetReinsuranceCoverage(Identity, gic) * ", - "\n GetScope(Identity with {DataNode = gic}).AggregatedTechnicalMargin);", + "\n GetScope(Identity with {DataNode = gic}).AggregatedValue);", "\n ", "\n private string ComputeReinsuranceEstimateType(double aggregatedFcf) => aggregatedFcf > Precision ? EstimateTypes.LR : EstimateTypes.C;", "\n ", @@ -1934,10 +1933,10 @@ "\n private IEnumerable underlyingGic => GetStorage().GetUnderlyingGic(Identity);", "\n ", "\n private double weightedUnderlyingTM => underlyingGic.Sum(gic => GetStorage().GetReinsuranceCoverage(Identity, gic) * ", - "\n GetScope(Identity with {DataNode = gic}).TechnicalMargin);", + "\n GetScope(Identity with {DataNode = gic}).Value);", "\n ", "\n private double weightedUnderlyingAggregatedTM => underlyingGic.Sum(gic => GetStorage().GetReinsuranceCoverage(Identity, gic) * ", - "\n GetScope(Identity with {DataNode = gic}).AggregatedTechnicalMargin);", + "\n GetScope(Identity with {DataNode = gic}).AggregatedValue);", "\n private string ComputeReinsuranceEstimateType(double aggregatedFcf) => aggregatedFcf > Precision ? EstimateTypes.LR : EstimateTypes.C;", "\n ", "\n string AllocateTechnicalMargin.ComputedEstimateType => ComputeReinsuranceEstimateType(weightedUnderlyingAggregatedTM + weightedUnderlyingTM);", @@ -1969,7 +1968,6 @@ "\n : (double)default; });", "\n", "\n [NotVisible] bool AllocateTechnicalMargin.HasSwitch => Math.Abs(balancingValue) > Precision;", - "\n ", "\n [NotVisible] double AllocateTechnicalMargin.AggregatedTechnicalMargin => balancingValue;", "\n}", "\n", diff --git a/ifrs17/Test/TechnicalMarginTest.ipynb b/ifrs17/Test/TechnicalMarginTest.ipynb index ecd85174..fa5138a7 100644 --- a/ifrs17/Test/TechnicalMarginTest.ipynb +++ b/ifrs17/Test/TechnicalMarginTest.ipynb @@ -58,10 +58,12 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(dt1.RepeatOnce());", + "await DataSource.UpdateAsync(new []{dt1, dtr1});", "\nawait DataSource.UpdateAsync(new[]{dt11});", - "\nawait DataSource.UpdateAsync(new[]{dt11State});", - "\nawait DataSource.UpdateAsync(new[]{dt11SingleParameter});" + "\nawait DataSource.UpdateAsync(new[]{dtr11});", + "\nawait DataSource.UpdateAsync(new[]{dt11State, dtr11State});", + "\nawait DataSource.UpdateAsync(new[]{dt11SingleParameter});", + "\nawait DataSource.UpdateAsync(new[]{dt11Inter});" ], "metadata": {}, "execution_count": 0, @@ -107,8 +109,9 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(previousPeriodPartition.RepeatOnce());", - "\nawait DataSource.UpdateAsync(partitionReportingNode.RepeatOnce());" + "await DataSource.UpdateAsync(partitionReportingNode.RepeatOnce());", + "\nawait DataSource.UpdateAsync(previousPeriodPartition.RepeatOnce());", + "\nawait DataSource.UpdateAsync(partition.RepeatOnce());" ], "metadata": {}, "execution_count": 0, @@ -117,7 +120,17 @@ { "cell_type": "markdown", "source": [ - "# Test" + "# Test Runner" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Error logger", + "\nIt compares the result of a calculation of a single Group of Contract against benchmarks and logs the errors." ], "metadata": {}, "execution_count": 0, @@ -126,27 +139,11 @@ { "cell_type": "code", "source": [ - "public async Task CheckSwitchLogicAsync(IEnumerable inputDataSet, Dictionary csmLcSwitchBenchmark)", + "public async Task> ErrorLoggerAsync(IEnumerable csm, ", + "\n IEnumerable loss, ", + "\n Dictionary csmBenchmark, ", + "\n Dictionary lossBenchmark)", "\n{", - "\n Activity.Start();", - "\n //Save test input data", - "\n await Workspace.UpdateAsync(inputDataSet);", - "\n ", - "\n //Set up import storage and test universe", - "\n var testStorage = new ImportStorage(previousArgs, DataSource, Workspace);", - "\n await testStorage.InitializeAsync();", - "\n var testUniverse = Scopes.ForStorage(testStorage).ToScope();", - "\n ", - "\n var identities = testUniverse.GetScopes(testStorage.DataNodesByImportScope[ImportScope.Primary].Where(dn => dn == groupOfInsuranceContracts)).SelectMany(s => s.Identities);", - "\n var csm = testUniverse.GetScopes(identities, o => o.WithContext(\"C\")).Where(x => Math.Abs(x.Value) > Precision);", - "\n var lc = testUniverse.GetScopes(identities, o => o.WithContext(\"L\")).Where(x => Math.Abs(x.Value) > Precision);", - "\n //Clean up Workspace", - "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync()); ", - "\n ", - "\n var csmBenchmark = csmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueCsm) > Precision).ToDictionary(x => x.Key, x => x.Value);", - "\n var lcBenchmark = csmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueLc) > Precision).ToDictionary(x => x.Key, x => x.Value);", - "\n ", - "\n ", "\n var errors = new List();", "\n if(csm.Count() > csmBenchmark.Count()) ", "\n {", @@ -154,11 +151,11 @@ "\n .Select(x => $\"AocType:{x.Identity.AocType}, Novelty:{x.Identity.Novelty}, EstimateType:{x.EstimateType}, Value:{x.Value}.\");", "\n errors.Add( $\"{nameof(AllocateTechnicalMargin)} scope for CSM has more non zero items than benchmark. Extra computed variables : \\n {string.Join(\"\\n\", extraVariables)}.\" );", "\n }", - "\n if(lc.Count() > lcBenchmark.Count()) ", + "\n if(loss.Count() > lossBenchmark.Count()) ", "\n {", - "\n var extraVariables = lc.Where(x => !lcBenchmark.Keys.Contains(new AocStep(x.Identity.AocType, x.Identity.Novelty)))", + "\n var extraVariables = loss.Where(x => !lossBenchmark.Keys.Contains(new AocStep(x.Identity.AocType, x.Identity.Novelty)))", "\n .Select(x => $\"AocType:{x.Identity.AocType}, Novelty:{x.Identity.Novelty}, EstimateType:{x.EstimateType}, Value:{x.Value}, \");", - "\n errors.Add( $\"{nameof(AllocateTechnicalMargin)} scope for LC has more non zero items compared to benchmark: \\n {string.Join(\"\\n\", extraVariables)}.\" );", + "\n errors.Add( $\"{nameof(AllocateTechnicalMargin)} scope for LOSS(LC/LoReCo) has more non zero items compared to benchmark: \\n {string.Join(\"\\n\", extraVariables)}.\" );", "\n }", "\n ", "\n //Check ValueCsm", @@ -175,10 +172,10 @@ "\n if(Math.Abs(-1.0 * scopeSwitch.Value - kvp.Value.valueCsm) > Precision) ", "\n errors.Add( $\"Values not matching for AocType {kvp.Key.AocType} and Novelty {kvp.Key.Novelty}. Scope: Csm {-1 * scopeSwitch.Value}; Benchmark: Csm {kvp.Value.valueCsm}.\" );", "\n }", - "\n //Check ValueLc", - "\n foreach(var kvp in lcBenchmark)", + "\n //Check ValueLoss", + "\n foreach(var kvp in lossBenchmark)", "\n {", - "\n var scopeSwitch = lc.SingleOrDefault(y => y.Identity.AocType == kvp.Key.AocType && y.Identity.Novelty == kvp.Key.Novelty);", + "\n var scopeSwitch = loss.SingleOrDefault(y => y.Identity.AocType == kvp.Key.AocType && y.Identity.Novelty == kvp.Key.Novelty);", "\n ", "\n if(scopeSwitch == null)", "\n {", @@ -186,11 +183,109 @@ "\n continue;", "\n }", "\n ", - "\n if(Math.Abs(scopeSwitch.Value - kvp.Value.valueLc) > Precision) ", - "\n errors.Add( $\"Values not matching for AocType {kvp.Key.AocType} and Novelty {kvp.Key.Novelty}. Scope: Lc {scopeSwitch.Value}; Benchmark: Lc {kvp.Value.valueLc}.\" );", + "\n if(Math.Abs(scopeSwitch.Value - kvp.Value.valueLoss) > Precision) ", + "\n errors.Add( $\"Values not matching for AocType {kvp.Key.AocType} and Novelty {kvp.Key.Novelty}. Scope: Lc/LoReCo {scopeSwitch.Value}; Benchmark: Lc/LoReCo {kvp.Value.valueLoss}.\" );", "\n }", "\n ", - "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", + "\n return errors;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Computation runner" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task<(IEnumerable,IEnumerable)> ComputeScopesAsync (IEnumerable inputDataSet,", + "\n Guid partitionId, ", + "\n string primaryDataNode)", + "\n{", + "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync());", + "\n await Workspace.UpdateAsync(inputDataSet);", + "\n", + "\n var partition = (await Workspace.Query().ToArrayAsync()).Single(x => x.Id == partitionId);", + "\n var args = new ImportArgs(partition.ReportingNode, partition.Year, partition.Month, Periodicity.Quarterly, partition.Scenario, ImportFormats.Actual);", + "\n var testStorage = new ImportStorage(args, DataSource, Workspace);", + "\n await testStorage.InitializeAsync();", + "\n var testUniverse = Scopes.ForStorage(testStorage).ToScope();", + "\n var identities = testUniverse.GetScopes(testStorage.DataNodesByImportScope[ImportScope.Primary].Where(dn => dn == primaryDataNode)).SelectMany(s => s.Identities);", + "\n var csm = testUniverse.GetScopes(identities, o => o.WithContext(EstimateTypes.C)).Where(x => Math.Abs(x.Value) > Precision);", + "\n IEnumerable loss = Enumerable.Empty();", + "\n if (primaryDataNode == groupOfInsuranceContracts) loss = testUniverse.GetScopes(identities, o => o.WithContext(EstimateTypes.L)).Where(x => Math.Abs(x.Value) > Precision);", + "\n if (primaryDataNode == groupOfReinsuranceContracts) loss = testUniverse.GetScopes(identities, o => o.WithContext(EstimateTypes.LR)).Where(x => Math.Abs(x.Value) > Precision);", + "\n ", + "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync());", + "\n", + "\n return (csm, loss);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Test runner ", + "\nProvided inputs and benchmarks computes the results and calls the error logger routine." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task CheckSwitchLogicAsync(IEnumerable inputDataSet, ", + "\n Dictionary csmLcSwitchBenchmark,", + "\n Dictionary reinsuranceCsmLcSwitchBenchmark = null)", + "\n{", + "\n Activity.Start();", + "\n //SET UP COMPUTATION", + "\n var gross = (await DataSource.Query().ToArrayAsync()).Select(x => x.SystemName);", + "\n var dn = inputDataSet.Select(x => x.DataNode).ToHashSet();", + "\n var dnByType = dn.ToDictionary(x => gross.Contains(x) ? nameof(GroupOfInsuranceContract) : nameof(GroupOfReinsuranceContract), x => x);", + "\n var partitionId = inputDataSet.First().Partition;", + "\n ", + "\n //Gross", + "\n var errorsGross = new List();", + "\n if(dnByType.TryGetValue(nameof(GroupOfInsuranceContract), out var primaryDataNode)){", + "\n //set up bm", + "\n var csmBenchmark = csmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueCsm) > Precision).ToDictionary(x => x.Key, x => x.Value);", + "\n var lossBenchmark = csmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueLoss) > Precision).ToDictionary(x => x.Key, x => x.Value);", + "\n //Set up import storage and test universe", + "\n var (csm, loss) = await ComputeScopesAsync(inputDataSet, partitionId, primaryDataNode);", + "\n errorsGross = await ErrorLoggerAsync(csm, loss, csmBenchmark, lossBenchmark);", + "\n }", + "\n", + "\n //Reinsurance ", + "\n var errorsReins = new List();", + "\n if(dnByType.TryGetValue(nameof(GroupOfReinsuranceContract), out primaryDataNode)){", + "\n //set up bm", + "\n var csmBenchmark = reinsuranceCsmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueCsm) > Precision).ToDictionary(x => x.Key, x => x.Value);", + "\n var lossBenchmark = reinsuranceCsmLcSwitchBenchmark.Where(x => Math.Abs(x.Value.valueLoss) > Precision).ToDictionary(x => x.Key, x => x.Value);", + "\n //Set up import storage and test universe", + "\n var (csm, loss) = await ComputeScopesAsync(inputDataSet, partitionId, primaryDataNode);", + "\n errorsReins = await ErrorLoggerAsync(csm, loss, csmBenchmark, lossBenchmark);", + "\n }", + "\n", + "\n //Clean up Workspace", + "\n await Workspace.DeleteAsync(await Workspace.Query().ToArrayAsync());", + "\n //await Workspace.DeleteAsync(inputDataSet);", + "\n ", + "\n if(errorsGross.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"Gross Errors: \\n\", errorsGross));", + "\n if(errorsReins.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"Reinsurance Errors : \\n\", errorsReins));", + "\n ", "\n return Activity.Finish();", "\n}" ], @@ -198,6 +293,24 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Use cases" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Gross, no switch " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -238,6 +351,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Gross switch at CL" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -278,6 +400,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Gross with switch without CL" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -314,6 +445,17 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Gross : multiple switch", + "\n", + "\nSwitch in the in force component, opposite switch in the new business component. CL AoC Step to correct the allocation of the combined section." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -363,10 +505,278 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Reinsurance no LoReCo with Gross no switch" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reinsBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar grossBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = \"Cl\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar inputDataSet = new IfrsVariable[]{", + "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = -100.0},", + "\n grossBasicIfrsVariable with {AocType = \"CF\", Novelty = \"N\", Value = 10.0},", + "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -15.0},", + "\n grossBasicIfrsVariable with {AocType = \"EV\", Novelty = \"N\", Value = -100.0},", + "\n grossBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Value = +100.0},", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n", + "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = 100.0},", + "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -10.0},", + "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Value = -30.0},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n };", + "\n", + "\nvar csmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"),(100d, 0d)},", + "\n {new AocStep(\"IA\",\"N\"), (15d, 0d)},", + "\n {new AocStep(\"EV\",\"N\"), (100d, 0d)},", + "\n {new AocStep(\"CL\",\"C\"), (-100d, 0d)},", + "\n {new AocStep(\"AM\",\"C\"), (-57.5, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"),(57.5, 0d)},", + "\n };", + "\n", + "\nvar reinsCsmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"),(-100d, 0d)},", + "\n {new AocStep(\"IA\",\"N\"),(+10d, 0d)},", + "\n {new AocStep(\"CL\",\"C\"), (+30d, 0d)},", + "\n {new AocStep(\"AM\",\"C\"), (+30d, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"),(-30d, 0d)},", + "\n };", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark, reinsCsmLcSwitch_benchmark);", + "\n activity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reinsurance with Gross from [one switch](#gross-with-switch-without-cl) use case" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reinsBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar grossBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar basicIfrsVariable = new IfrsVariable{Partition = previousPeriodPartition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar inputDataSet = new IfrsVariable[]{", + "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = 100.0},", + "\n grossBasicIfrsVariable with {AocType = \"CF\", Novelty = \"N\", Value = -10.0},", + "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -150.0}, ", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n", + "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = -100.0},", + "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -10.0},", + "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Value = -30.0},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n };", + "\n", + "\n//Gross CSM-LC", + "\nvar csmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"), (0d, 100d)},", + "\n {new AocStep(\"IA\",\"N\"), (50d, -100d)},", + "\n {new AocStep(\"EA\",\"C\"), (8d, 0d)},", + "\n {new AocStep(\"AM\",\"C\"), (-29d, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"), (29d, 0d)},", + "\n };", + "\n", + "\nvar reinsCsmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"),(0d, -100d)},", + "\n {new AocStep(\"IA\",\"N\"),(110d, 100d)},", + "\n {new AocStep(\"CL\",\"C\"), (+30d, 0d)},", + "\n {new AocStep(\"AM\",\"C\"), (-70d, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"),(+70d, 0d)},", + "\n };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark, reinsCsmLcSwitch_benchmark);", + "\n activity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reinsurance with Gross all LC" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reinsBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar grossBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = \"Cl\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar inputDataSet = new IfrsVariable[]{", + "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = 100.0},", + "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -50.0}, ", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n", + "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = -100.0},", + "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -10.0},", + "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Value = -30.0},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n };", + "\n", + "\n//Gross CSM-LC", + "\nvar csmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"), (0d, 100d)},", + "\n {new AocStep(\"IA\",\"N\"), (0d, -50d)}, //IA of the gross has opposite sign wrt the others (triggers switching)", + "\n {new AocStep(\"AM\",\"C\"), (0d, -25d)},", + "\n {new AocStep(\"EOP\",\"C\"),(0d, 25d)},", + "\n };", + "\n", + "\nvar reinsCsmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"),(0d, -100d)},", + "\n {new AocStep(\"IA\",\"N\"),(0d, -10d)},", + "\n {new AocStep(\"CL\",\"C\"), (0d, -30d)},", + "\n {new AocStep(\"AM\",\"C\"), (0d, 70d)},", + "\n {new AocStep(\"EOP\",\"C\"),(0d, -70d)},", + "\n };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var activity = await CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark, reinsCsmLcSwitch_benchmark);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reinsurance with Gross with CL balancing item" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reinsBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar grossBasicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = \"Cl\", EstimateType = \"BE\", EconomicBasis = \"L\"};", + "\nvar inputDataSet = new IfrsVariable[]{", + "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"I\", Value = 100.0, EstimateType = \"C\", AmountType = null},", + "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"I\", Value = 10.0}, ", + "\n grossBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = 50.0},", + "\n grossBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -10.0}, ", + "\n grossBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n", + "\n reinsBasicIfrsVariable with {AocType = \"BOP\", Novelty = \"N\", Value = -100.0},", + "\n reinsBasicIfrsVariable with {AocType = \"IA\", Novelty = \"N\", Value = -10.0},", + "\n reinsBasicIfrsVariable with {AocType = \"CL\", Novelty = \"C\", Value = -30.0},", + "\n reinsBasicIfrsVariable with {AocType = \"AM\", Novelty = \"C\", Value = 0.5, EstimateType = \"F\", AmountType = null},", + "\n };", + "\n", + "\n//Gross CSM-LC", + "\nvar csmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"I\"), (100d, 0d)},", + "\n {new AocStep(\"IA\",\"I\"), (0.049962543d, 0d)},", + "\n {new AocStep(\"BOP\",\"N\"), (0d, 50d)},", + "\n {new AocStep(\"IA\",\"N\"), (0d, -10d)},", + "\n {new AocStep(\"CL\",\"C\"), (-40d, -40d)},", + "\n {new AocStep(\"AM\",\"C\"), (-30.024981271d, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"),(30.024981271d, 0d)},", + "\n };", + "\n", + "\nvar reinsCsmLcSwitch_benchmark = new Dictionary()", + "\n {", + "\n {new AocStep(\"BOP\",\"N\"),(0d, -100d)},", + "\n {new AocStep(\"IA\",\"N\"), (0d, -10d)},", + "\n {new AocStep(\"CL\",\"C\"), (140d, 110d)},", + "\n {new AocStep(\"AM\",\"C\"), (-70d, 0d)},", + "\n {new AocStep(\"EOP\",\"C\"),(70d, 0d)},", + "\n };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "" + "var activity = await CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark, reinsCsmLcSwitch_benchmark);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" ], "metadata": {}, "execution_count": 0, From e0cc9dc788f9b700932460c46474734fddcdf519 Mon Sep 17 00:00:00 2001 From: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Date: Mon, 6 Mar 2023 15:44:18 +0100 Subject: [PATCH 11/19] update to v1.1.1 (#228) --- .../Constants/CalculationEngine.ipynb | 2 +- ifrs17-template/Export/MapTemplate.ipynb | 6 ++-- .../Import/CloseImportTemplate.ipynb | 8 ++--- ifrs17-template/InputFormatDescription.ipynb | 32 +++++++++---------- ifrs17-template/Report/ParameterReports.ipynb | 16 +++++----- ifrs17-template/Report/Reports.ipynb | 30 ++++++++--------- 6 files changed, 47 insertions(+), 47 deletions(-) diff --git a/ifrs17-template/Constants/CalculationEngine.ipynb b/ifrs17-template/Constants/CalculationEngine.ipynb index 93483434..d72611fb 100644 --- a/ifrs17-template/Constants/CalculationEngine.ipynb +++ b/ifrs17-template/Constants/CalculationEngine.ipynb @@ -20,7 +20,7 @@ "cell_type": "code", "source": [ "var projectName = \"ifrs17\";", - "\nvar environmentName = \"v1.1.0\";", + "\nvar environmentName = \"v1.1.1\";", "\nvar notebookName = \"CalculationEngine\";", "\nvar calculationEngine = $\"#!import \\\"//{projectName}/{environmentName}/{notebookName}\\\"\";" ], diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index 6c811368..a67b3b81 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -110,7 +110,7 @@ "source": [ "# Map Template: Data Node", "\n", - "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#group-of-contracts)." + "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts)." ], "metadata": {}, "execution_count": 0, @@ -166,7 +166,7 @@ "source": [ "# Map Template: Data Node State", "\n", - "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)." + "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)." ], "metadata": {}, "execution_count": 0, @@ -252,7 +252,7 @@ "source": [ "# Map Template: Data Node Parameter", "\n", - "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. " + "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. " ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index b9f3c33c..f1a2bded 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -39,7 +39,7 @@ "source": [ "All imports are triggered via the Import command. Several options can be fluently appended to customize the import action:", "\n- FromFile() : accepts a string as input (eg. \"../Files/TransactionalData/Openings_CH_2020_12.csv\"). It corresponds the file to be imported complete with the path", - "\n- WithFormat() : accepts a string as input (eg. \"Cashflow\" or \"Actual\"). It is used to trigger the desired import logic for the current file. Full list of avalaible ImportFormats can be found [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Constants/Consts#import-formats)", + "\n- WithFormat() : accepts a string as input (eg. \"Cashflow\" or \"Actual\"). It is used to trigger the desired import logic for the current file. Full list of avalaible ImportFormats can be found [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Constants/Consts#import-formats)", "\n- WithFileStorage() : defined the drive from where the input files is retrieved. In this example we use the project file storage (new files have to be uploaded into the project), other options are SharePoint and OneDrive. ", "\n- WithTarget() : target drive where the results are stored. In this example we use our in-memory set up", "\n" @@ -89,9 +89,9 @@ "\nNew Data Nodes and Parameters are imported here.", "\n
To easily generate these files, please refer to the **Map Template** files exported [here](../Export/MapTemplate). Edit them at your wish and import them back into the solution through the following cells. ", "\n
For the **ImportFormat**, the following options are expected:", - "\n- ImportFormats.DataNode : [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#group-of-contracts)", - "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-state) can be either active or inactive.", - "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.", + "\n- ImportFormats.DataNode : [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts)", + "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state) can be either active or inactive.", + "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.", "\n" ], "metadata": {}, diff --git a/ifrs17-template/InputFormatDescription.ipynb b/ifrs17-template/InputFormatDescription.ipynb index d9bf13e2..c3b73c7e 100644 --- a/ifrs17-template/InputFormatDescription.ipynb +++ b/ifrs17-template/InputFormatDescription.ipynb @@ -38,17 +38,17 @@ "source": [ "A cash flow file is named **NominalCashflows** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Cashflow**.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#partitions) to which the data belongs.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partitions) to which the data belongs.", "\n", "\nThe **Cashflow** section contains the cash flow data. Several pieces of information are required to characterize a cash flow correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", - "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", - "\n- [Novelty](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#novelty) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-type) : entered with its SystemName,", + "\n- [Novelty](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#novelty) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims.", "\n", - "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.", + "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.", "\n
The cash flow is entered in the columns named ValuesN where N goes from 0 to the length of cash flow. The Value0 corresponds to January of the Year entered in the **Main** section for every combination of AocType and Novelty. " ], "metadata": {}, @@ -73,13 +73,13 @@ "source": [ "An Actuals file is named **Actuals** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Actual**.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#partition) to which the data belong.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partition) to which the data belong.", "\n", "\nThe **Actual** section contains the actuals data. Several pieces of information are required to to characterize an Actuals amount correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-type) : entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "metadata": {}, @@ -104,12 +104,12 @@ "source": [ "An Openings file is named **Openings** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Opening**. In an AoC for one period, we only need one file with the year/month combination of the beginning of the period. Some GICs do not need any entries in Openings.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#partition) to which the data belong.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partition) to which the data belong.", "\n", "\nThe **Opening** section contains values at opening of an analysis. Several pieces of information are required to to characterize an Opening amount correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "metadata": {}, diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb index c8f9851e..acf6f761 100644 --- a/ifrs17-template/Report/ParameterReports.ipynb +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -102,7 +102,7 @@ "# Retrieve data ", "\n", "\nThe parameters used for calculation of the provided period are here retrieved through queries.", - "\nThe queries and the data model of the reported objects can be foud in the [ParameterReportQueries](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ParameterReportsQueries#queries)" + "\nThe queries and the data model of the reported objects can be foud in the [ParameterReportQueries](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ParameterReportsQueries#queries)" ], "metadata": {}, "execution_count": 0, @@ -184,7 +184,7 @@ "cell_type": "markdown", "source": [ "## Data node", - "\nProperties of the Group of Contracts and corresponding Portfolios are merged to provide a full description of the [Data Node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructureDataStructure#data-node)" + "\nProperties of the Group of Contracts and corresponding Portfolios are merged to provide a full description of the [Data Node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructureDataStructure#data-node)" ], "metadata": {}, "execution_count": 0, @@ -208,7 +208,7 @@ "source": [ "## Data node state", "\n", - "\nCurrent and previous period [data node state](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-state)." + "\nCurrent and previous period [data node state](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state)." ], "metadata": {}, "execution_count": 0, @@ -233,7 +233,7 @@ "cell_type": "markdown", "source": [ "## Yield curve", - "\n[Yield Curve](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#yield-curve) used for locked-in discounting and current rating discouning (curret period and previous period) are shown." + "\n[Yield Curve](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#yield-curve) used for locked-in discounting and current rating discouning (curret period and previous period) are shown." ], "metadata": {}, "execution_count": 0, @@ -257,7 +257,7 @@ "cell_type": "markdown", "source": [ "## Single data node parameter", - "\n[Single data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " + "\n[Single data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) for current and previous period. " ], "metadata": {}, "execution_count": 0, @@ -281,7 +281,7 @@ "cell_type": "markdown", "source": [ "## Inter data node parameter", - "\n[Inter data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " + "\n[Inter data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) for current and previous period. " ], "metadata": {}, "execution_count": 0, @@ -305,7 +305,7 @@ "cell_type": "markdown", "source": [ "## Partner ratings", - "\n[Partner ratings](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#partner-rating) for current and previous period." + "\n[Partner ratings](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partner-rating) for current and previous period." ], "metadata": {}, "execution_count": 0, @@ -329,7 +329,7 @@ "cell_type": "markdown", "source": [ "## Partner default rates", - "\n[Partner default rates](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/DataModel/DataStructure#credit-default-rate) for current and previous period." + "\n[Partner default rates](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#credit-default-rate) for current and previous period." ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Report/Reports.ipynb b/ifrs17-template/Report/Reports.ipynb index f001b275..c195e876 100644 --- a/ifrs17-template/Report/Reports.ipynb +++ b/ifrs17-template/Report/Reports.ipynb @@ -79,7 +79,7 @@ "source": [ "# Best Estimate", "\n", - "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#best-estimate) future cash flows are shown here in an Analysis of Change report.", + "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#best-estimate) future cash flows are shown here in an Analysis of Change report.", "\n", "\nThe granularity of the reported figures can be modified by changing the Column Slices options.", "\nFor example one can add \"GroupOfContract\" to separate the contributions of the individual Group of Contracts.", @@ -110,7 +110,7 @@ "source": [ "# Risk Adjustment", "\n", - "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#risk-adjustment) future cash flows are shown here.", + "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#risk-adjustment) future cash flows are shown here.", "\n", "\nThe additional ColumnSlices are added to the view as the inner column. This can dicrease the readability of the report. For example, adding the slice by \"GroupOfContract\" leaves the lock-in and current rate contributions far apart and difficult to compare. The re-order of default slices with custom slices is achieved by esplicitly add the default slice among the custom slices. In our case, you can try entering both \"GroupOfContract\" and \"EconomicBasis\" separated by a comma in the ColumnSlices." ], @@ -137,7 +137,7 @@ "source": [ "# Written Actuals", "\n", - "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#written-accrual-deferral) are shown here. ", + "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here. ", "\n", "\nIn this case, the analysis of change view is replaced with a default slice by the **AmountTypes**. Only the amount type with non zero value are displayed. ", "\n
Filters can be applied to reports in order to isolate a sub-set of the data. They are specified by the name of the dimension to filter and the system name of the desired value. For example, to investigate the contribution of a single Group of Contract the following filter can be applied: new [] {(\"GroupOfContract\", \"DT1.1\")}." @@ -165,8 +165,8 @@ "source": [ "## Advance, Overdue Actuals", "\n", - "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#written-accrual-deferral)", - "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ", + "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral)", + "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ", "\n", "\nCombining Filters and ColumnSlices facilitate the report analysis. For example, you can select \"GroupOfContract\" as column slices with a Filter on EstimateType \"AA\" to analyse the Advance Actuals for all Group of Contract. " ], @@ -193,7 +193,7 @@ "source": [ "## Deferrable Actuals", "\n", - "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. " + "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. " ], "metadata": {}, "execution_count": 0, @@ -218,7 +218,7 @@ "source": [ "# Fulfilment Cash flow", "\n", - "\nPresent Value of the [Fulfilment Cash flow](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#fulfillment-cash-flows) are shown here. ", + "\nPresent Value of the [Fulfilment Cash flow](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#fulfillment-cash-flows) are shown here. ", "\n
The individual contributions from Best Estimate and Risk Adjustment can be visualized slicing by **EstimateType**.", "\n", "\nFilters can be applied to report to isolate a sub-set of the data. For example you can Filter by a specific Group of Contract using its system name using : new [] {(\"GroupOfContract\", \"DT1.1\")}.", @@ -247,7 +247,7 @@ "source": [ "# Actuarial Experience Adjustment", "\n", - "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#experience-adjustment)." + "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#experience-adjustment)." ], "metadata": {}, "execution_count": 0, @@ -272,7 +272,7 @@ "source": [ "# LRC Technical Margin", "\n", - "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", + "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", "\n
The Analysis of Change is expanded with few more steps such as **Experience Adjustment** and **Amortization**." ], "metadata": {}, @@ -298,7 +298,7 @@ "source": [ "# Contractual Service Margin / Loss Component / Loss Recovery Component", "\n", - "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ", + "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ", "\n", "\nA default slice by EstimateType - which distinguish between CSM, LC and LR contributions - is automatically enforced. " ], @@ -325,7 +325,7 @@ "source": [ "# LRC Actuarial", "\n", - "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cash flow discounted with current yield curve, and the allocated techinical margin. " + "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cash flow discounted with current yield curve, and the allocated techinical margin. " ], "metadata": {}, "execution_count": 0, @@ -350,7 +350,7 @@ "source": [ "# LRC", "\n", - "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified AoC Chain is used to allow comparison of the balance change between Actuals and Present Values. " + "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified AoC Chain is used to allow comparison of the balance change between Actuals and Present Values. " ], "metadata": {}, "execution_count": 0, @@ -375,7 +375,7 @@ "source": [ "# LIC Actuarial", "\n", - "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cash flow discounted with current yield curve. " + "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cash flow discounted with current yield curve. " ], "metadata": {}, "execution_count": 0, @@ -400,7 +400,7 @@ "source": [ "# LIC", "\n", - "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals." + "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals." ], "metadata": {}, "execution_count": 0, @@ -425,7 +425,7 @@ "source": [ "# Financial Performance", "\n", - "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.0/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cash flows (Premiums, Claims, Expenses, etc...) for the given period.", + "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cash flows (Premiums, Claims, Expenses, etc...) for the given period.", "\n", "\nUse the expand and collapse buttons in the report rows to change the granularity of the figures displayed." ], From 9c9fa42709d170fc9a95de3bcdb1b5694fb54879 Mon Sep 17 00:00:00 2001 From: amuolo Date: Thu, 9 Mar 2023 16:44:33 +0100 Subject: [PATCH 12/19] Fixes scenarios (#232) * enable scenario switch * fix and improve existing scenario tests * bug fix import yield curve * only fixes and tests * fix scenario reports --------- Co-authored-by: Andrea Muolo --- .../Test/ScenarioDataImportTest.ipynb | 99 ++++--- .../Test/ScenarioYieldCurveImportTest.ipynb | 273 ++++++++++++++++-- ifrs17-template/Test/Tests.ipynb | 2 +- ifrs17/Constants/Consts.ipynb | 54 +++- ifrs17/Import/ImportStorage.ipynb | 2 +- ifrs17/Import/Importers.ipynb | 14 +- ifrs17/Report/ReportMutableScopes.ipynb | 10 +- ifrs17/Utils/Queries.ipynb | 5 +- 8 files changed, 367 insertions(+), 92 deletions(-) diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index 5b3c3ea9..3c558fcd 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -52,6 +52,24 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var EnableScenarioBackup = EnableScenario;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "EnableScenario = true;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -226,11 +244,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().Be(0);", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n diffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);", - "\n}" + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -286,11 +302,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().NotBe(0);", - "\n cashflowVars.Length.Should().Be(0);", - "\n diffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);", - "\n}" + "actualVars.Length.Should().NotBe(0);", + "\ncashflowVars.Length.Should().Be(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -355,11 +369,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().Be(0);", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n diffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);", - "\n}" + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -416,11 +428,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n diffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", - "\n diffs.Where(x => x.EstimateType == EstimateTypes.F).ToArray().Length.Should().Be(0);", - "\n diffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);", - "\n}" + "diffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", + "\ndiffs.Where(x => x.EstimateType == EstimateTypes.F).ToArray().Length.Should().Be(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -483,11 +493,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n diffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", - "\n ivsScenarioActualNoACAAEA.Where(x => x.EstimateType == EstimateTypes.F).Count().Should().NotBe(0);", - "\n ivsScenarioActualNoACAAEA.Where(x => x.EstimateType == EstimateTypes.DA && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", - "\n}" + "diffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", + "\nivsScenarioActualNoACAAEA.Where(x => x.EstimateType == EstimateTypes.F).Count().Should().NotBe(0);", + "\nivsScenarioActualNoACAAEA.Where(x => x.EstimateType == EstimateTypes.DA && Math.Abs(x.Value) > Precision).Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -569,7 +577,7 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) diffs.Count().Should().Be(0);" + "diffs.Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -663,10 +671,8 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType) && x.EstimateType != EstimateTypes.F && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", - "\n diffs.Where(x => onlyActualETs.Contains(x.EstimateType) && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", - "\n}" + "diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType) && x.EstimateType != EstimateTypes.F && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", + "\ndiffs.Where(x => onlyActualETs.Contains(x.EstimateType) && Math.Abs(x.Value) > Precision).Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -726,11 +732,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n actualVars.Length.Should().Be(0);", - "\n diffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);", - "\n}" + "cashflowVars.Length.Should().NotBe(0);", + "\nactualVars.Length.Should().Be(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -810,11 +814,9 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().Be(0);", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n cashflowVars.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().Be(0);", - "\n}" + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);", + "\ncashflowVars.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -927,10 +929,17 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().Be(0);", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n}" + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Restore Constants" ], "metadata": {}, "execution_count": 0, @@ -939,7 +948,7 @@ { "cell_type": "code", "source": [ - "" + "EnableScenario = EnableScenarioBackup;" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index bd8e71e2..5e870b40 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -55,8 +55,7 @@ { "cell_type": "code", "source": [ - "var ws = Workspace.CreateNew();", - "\nws.InitializeFrom(DataSource);" + "var EnableScenarioBackup = EnableScenario;" ], "metadata": {}, "execution_count": 0, @@ -65,9 +64,7 @@ { "cell_type": "code", "source": [ - "var argsBestEstimate = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, null, ImportFormats.Cashflow);", - "\nvar argsScenarioYieldCurve = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"YCUP1.0pct\", ImportFormats.Cashflow);", - "\nvar argsScenarioTransactionalData = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"SRUP1.0pct\", ImportFormats.Cashflow);" + "EnableScenario = true;" ], "metadata": {}, "execution_count": 0, @@ -76,8 +73,11 @@ { "cell_type": "code", "source": [ - "var initStorage = new ImportStorage(argsBestEstimate, DataSource, ws);", - "\nawait initStorage.InitializeAsync();" + "var argsBestEstimate = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, null, ImportFormats.Cashflow);", + "\nvar argsScenarioYieldCurve = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"YCUP1.0pct\", ImportFormats.Cashflow);", + "\nvar argsScenarioTransactionalData = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"SRUP1.0pct\", ImportFormats.Cashflow);", + "\nvar argsBestEstimateNextPeriod = new ImportArgs (\"CH\", 2021, 3, Periodicity.Quarterly, null, ImportFormats.Cashflow);", + "\nvar argsScenarioYieldCurveNextPeriod = new ImportArgs (\"CH\", 2021, 3, Periodicity.Quarterly, \"YCDW1.0pct\", ImportFormats.Cashflow);" ], "metadata": {}, "execution_count": 0, @@ -86,8 +86,9 @@ { "cell_type": "code", "source": [ - "var actualEstimateTypes = initStorage.EstimateTypesByImportFormat[ImportFormats.Actual];", - "\nvar cashflowEstimateTypes = initStorage.EstimateTypesByImportFormat[ImportFormats.Cashflow];", + "var estimateTypes = (await DataSource.Query().ToArrayAsync());", + "\nvar actualEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Actual)).Select(x => x.SystemName);", + "\nvar cashflowEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Cashflow)).Select(x => x.SystemName);", "\nvar actualAndCashflowEstimateTypes = actualEstimateTypes.Intersect(cashflowEstimateTypes);", "\nvar onlyActualEstimateTypes = actualEstimateTypes.Except(cashflowEstimateTypes);", "\nvar onlyCashflowEstimateTypes = cashflowEstimateTypes.Except(actualEstimateTypes);" @@ -258,10 +259,8 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) {", - "\n actualVars.Length.Should().Be(0);", - "\n cashflowVars.Length.Should().NotBe(0);", - "\n}" + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);" ], "metadata": {}, "execution_count": 0, @@ -270,7 +269,7 @@ { "cell_type": "markdown", "source": [ - "# Re-Import of the same Yield Curve does not trigger IFRS17 Calculations" + "# Re-Import of the same yield curve should not trigger IFRS17 Calculations" ], "metadata": {}, "execution_count": 0, @@ -307,7 +306,7 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) diffs.Count().Should().Be(0);" + "diffs.Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -316,7 +315,7 @@ { "cell_type": "markdown", "source": [ - "# Multiple Scenarios ", + "# Multiple Scenarios: re-import of Best Estimate yield curve", "\n", "\nIn this example, a new Cashflow for a different Scenario - SRUP1.0pct - is imported. ", "\nThe aim is to check how the Yield Curve importer behaves when a new Best Estimate Yield Curve is imported. ", @@ -373,9 +372,7 @@ "\n2020,12", "\n@@YieldCurve", "\nCurrency,Values0,Values1,Values2,Values3", - "\nEUR,0.108,0.108,0.118,0.119", - "\nCHF,0.103,0.103,0.103,0.103", - "\nUSD,0.903,0.103,0.103,0.103\";" + "\nUSD,0.006,0.004,0.004,0.005\";" ], "metadata": {}, "execution_count": 0, @@ -421,7 +418,7 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) if(EnableScenario) diffs.Count().Should().NotBe(0);" + "diffs.Count().Should().NotBe(0);" ], "metadata": {}, "execution_count": 0, @@ -458,7 +455,7 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) diffs.Count().Should().Be(0);" + "diffs.Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -495,7 +492,239 @@ { "cell_type": "code", "source": [ - "if(EnableScenario) diffs.Count().Should().NotBe(0);" + "diffs.Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Influence on the future: import of yield curve for previous month should not update current results" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var bestEstimateYieldCurvePast = @\"", + "\n@@Main", + "\nYear,Month", + "\n2020,6", + "\n@@YieldCurve", + "\nCurrency,Values0,Values1,Values2,Values3", + "\nUSD,0.123,0.123,0.123,0.123\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(bestEstimateYieldCurvePast).WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Best Estimate should not change" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsBestEstimate);", + "\nvar ivsBestEstimateImportPast = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsBestEstimateImportPast.Except(ivsBestEstimateUpdated, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario should not change" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioYieldCurve);", + "\nvar ivsScenarioYieldCurveImportPast = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioYieldCurveImportPast.Except(ivsScenarioYieldCurveUpdated, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Next period imports" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowBestEstimateNextPeriod = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2021,3", + "\n@@Cashflow", + "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", + "\nDT1.1,PR,BE,CL,C,,80,0,0,80,0,0,80,0,0,80,0,0,0,80,0,0,80,0,0,80,0,0,80,0", + "\nDT1.1,NIC,BE,CL,C,,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3,-22.3", + "\nDT1.1,,RA,CL,C,,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40,-2.40\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var yieldCurveScenarioNextPeriod = @\"", + "\n@@Main", + "\nYear,Month,Scenario", + "\n2021,3,YCDW1.0pct", + "\n@@YieldCurve", + "\nCurrency,Values0,Values1,Values2,Values3", + "\nUSD,0.007,0.004,0.004,0.005\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowBestEstimateNextPeriod).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(yieldCurveScenarioNextPeriod).WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Results with economic basis locked in basis should not be affected" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsBestEstimateNextPeriod);", + "\nvar ivsBestEstimateNextPeriod = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioYieldCurveNextPeriod);", + "\nvar ivsScenarioYieldCurveNextPeriod = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioYieldCurveNextPeriod.Except(ivsBestEstimateNextPeriod, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Where(x => x.EconomicBasis == EconomicBases.C).Count().Should().NotBe(0);", + "\ndiffs.Where(x => x.EconomicBasis == EconomicBases.L).Count().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Restore Constants" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "EnableScenario = EnableScenarioBackup;" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index 969379fe..7cc5ce85 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -135,4 +135,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 2bd61cb2..b3889647 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -25,15 +25,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public const bool EnableScenario = false;" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "markdown", "source": [ @@ -379,6 +370,51 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Sensitivities" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public bool EnableScenario = false;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public const string ScenarioDefault = \"Best Estimate\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public const string ScenariosAll = \"All\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public const string ScenariosDelta = \"Delta\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index d2b8a07f..7b3bd562 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -132,7 +132,7 @@ "\n public async Task InitializeAsync()", "\n { ", "\n //Dimensions", - "\n var estimateTypes = (await workspace.Query().ToArrayAsync());", + "\n var estimateTypes = await workspace.Query().ToArrayAsync();", "\n ", "\n EstimateTypeDimension = estimateTypes.ToDictionary(x => x.SystemName);", "\n AmountTypeDimension = (await workspace.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 3dc162d6..9c4db10f 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -814,13 +814,12 @@ "\n primaryArgs.ValidateArgsForPeriod();", "\n if(ApplicationMessage.HasErrors()) return Activity.Finish();", "\n var workspace = Workspace.CreateNew();", - "\n workspace.Initialize(x => x.FromSource(options.TargetDataSource).DisableInitialization()", - "\n .DisableInitialization().DisableInitialization());", + "\n workspace.Initialize(x => x.FromSource(options.TargetDataSource).DisableInitialization().DisableInitialization());", "\n", "\n var committedYieldCurves = await options.TargetDataSource.Query().ToArrayAsync();", "\n var hasNameColumn = dataSet.Tables[ImportFormats.YieldCurve].Columns.Any(x => x.ColumnName == nameof(YieldCurve.Name));", - "\n var importLog = await Import.FromDataSet(dataSet).WithType((dataset, datarow) => { ", - "\n var yieldCurve = new YieldCurve { ", + "\n var importLog = await Import.FromDataSet(dataSet).WithType(", + "\n (dataset, datarow) => new YieldCurve {", "\n Currency = datarow.Field(nameof(YieldCurve.Currency)),", "\n Year = primaryArgs.Year,", "\n Month = primaryArgs.Month, ", @@ -828,12 +827,11 @@ "\n Values = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(YieldCurve.Values))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray(),", "\n Name = hasNameColumn ? datarow.Field(nameof(YieldCurve.Name)) : default(string)", - "\n };", - "\n return committedYieldCurves.Contains(yieldCurve, YieldCurveComparer.Instance()) ? null : yieldCurve;", - "\n }).WithTarget(workspace).ExecuteAsync(); ", + "\n }", + "\n ).WithTarget(workspace).ExecuteAsync(); ", "\n", "\n if(importLog.Errors.Any()) return Activity.Finish().Merge(importLog); ", - "\n var toCommitYieldCurves = await workspace.Query().ToArrayAsync();", + "\n var toCommitYieldCurves = (await workspace.Query().ToArrayAsync()).Except(committedYieldCurves, YieldCurveComparer.Instance());", "\n if (!toCommitYieldCurves.Any()) {", "\n ApplicationMessage.Log(Warning.VariablesAlreadyImported); ", "\n return Activity.Finish().Merge(importLog);", diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index 91f9faf9..f6cb212f 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -293,11 +293,13 @@ "\n string reportType, (string filterName, object filterValue)[] dataFilter)> ", "\n{", "\n IDataCube Cube { get{", - "\n var dataCube = GetScope(Identity.reportType).GetDataCube();", + "\n var data = GetScope(Identity.reportType).GetDataCube();", "\n // TODO: suggestion to place the filter here instead of having it in every applicability scope", - "\n if(Identity.scenario != \"Delta\") return dataCube;", - "\n var bestEstimateById = dataCube.Where(x => x.Scenario == null).ToDictionary(x => x.ToIdentityString());", - "\n return dataCube.Select(x => x.Scenario == null ? x : x with { Value = x.Value - (bestEstimateById.TryGetValue((x with {Scenario = null}).ToIdentityString(), out var be)? be.Value : 0.0) }).ToDataCube();", + "\n if(Identity.scenario != ScenariosAll && Identity.scenario != ScenariosDelta) return data;", + "\n if(Identity.scenario == ScenariosAll) return data.Select(x => x.Scenario == null? x with {Scenario = ScenarioDefault } : x).ToDataCube();", + "\n var bestEstimateById = data.Where(x => x.Scenario == null).ToDictionary(x => x.ToIdentityString());", + "\n return data.Select(x => x.Scenario == null ? x with { Scenario = ScenarioDefault } ", + "\n : x with { Value = x.Value - (bestEstimateById.TryGetValue((x with {Scenario = null}).ToIdentityString(), out var be)? be.Value : 0.0) }).ToDataCube();", "\n }}", "\n} " ], diff --git a/ifrs17/Utils/Queries.ipynb b/ifrs17/Utils/Queries.ipynb index 87c7706a..af7021f4 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -436,11 +436,12 @@ "\n where T : IPartitioned", "\n where P : IPartition", "\n{", - "\n var partitionBackup = (Guid)querySource.Partition.GetCurrent(typeof(P).Name);", + "\n var partitionBackup = (Guid)(querySource.Partition.GetCurrent(typeof(P).Name)?? default(Guid));", "\n await querySource.Partition.SetAsync

(partition);", "\n // Temporary workaround for physical database: where clause is necessary", "\n var data = await querySource.Query().Where(x => x.Partition == partition).ToArrayAsync();", - "\n await querySource.Partition.SetAsync

(partitionBackup);", + "\n if(partitionBackup == default(Guid)) await querySource.Partition.SetAsync

(null);", + "\n else await querySource.Partition.SetAsync

(partitionBackup);", "\n return data;", "\n}" ], From 0e0021b8c705018e000655fb634e648e25ff9953 Mon Sep 17 00:00:00 2001 From: amuolo Date: Fri, 17 Mar 2023 14:07:44 +0100 Subject: [PATCH 13/19] Coverage parameter scenario (#229) * enable scenario switch * fix and improve existing scenario tests * bug fix import yield curve * parameter import done, tests green * implement feedback * remove simple value * implement feedback * update benchmark * rounding digit when exporting ifrs vars * openings format for reimport best estimate * implement improvements suggested from Davide --------- Co-authored-by: Andrea Muolo --- .../Test/Data/ExportIfrsVariable.ipynb | 20 +- .../BM_CH_2020_12_MTUP10pct_A.csv | 16 +- .../BM_CH_2020_12_MTUP10pct_AA.csv | 5 + .../BM_CH_2020_12_MTUP10pct_APA.csv | 5 +- .../BM_CH_2020_12_MTUP10pct_BE.csv | 93 ++-- .../BM_CH_2020_12_MTUP10pct_BEPA.csv | 3 +- .../BM_CH_2020_12_MTUP10pct_C.csv | 23 +- .../BM_CH_2020_12_MTUP10pct_DA.csv | 11 +- .../BM_CH_2020_12_MTUP10pct_F.csv | 6 +- .../BM_CH_2020_12_MTUP10pct_OA.csv | 5 + .../BM_CH_2020_12_MTUP10pct_RA.csv | 34 +- ifrs17-template/Test/IfrsVariablesTest.ipynb | 11 +- .../Test/ScenarioDataImportTest.ipynb | 176 +++--- .../Test/ScenarioParametersImportTest.ipynb | 503 ++++++++++++++++++ .../Test/ScenarioYieldCurveImportTest.ipynb | 14 +- ifrs17-template/Test/Tests.ipynb | 9 + ifrs17/Import/Importers.ipynb | 121 +++-- ifrs17/Utils/EqualityComparers.ipynb | 32 ++ ifrs17/Utils/Queries.ipynb | 4 +- 19 files changed, 816 insertions(+), 275 deletions(-) create mode 100644 ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_AA.csv create mode 100644 ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_OA.csv create mode 100644 ifrs17-template/Test/ScenarioParametersImportTest.ipynb diff --git a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb index 3cb7ebd8..7eb4f123 100644 --- a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb +++ b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb @@ -46,8 +46,8 @@ { "cell_type": "code", "source": [ - "//#!eval-notebook \"InitSystemorphToMemoryForTesting\"", - "\n#!eval-notebook \"../../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport\"" + "#!eval-notebook \"InitSystemorphToMemoryForTesting\"", + "\n//#!eval-notebook \"../../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport\"" ], "metadata": {}, "execution_count": 0, @@ -103,7 +103,8 @@ "source": [ "var exportScope = new ImportArgs[]{", "\n new ImportArgs (\"CH\", 2020, 12, (Periodicity)default, null, null),", - "\n new ImportArgs (\"CH\", 2021, 3, (Periodicity)default, null, null)", + "\n new ImportArgs (\"CH\", 2021, 3, (Periodicity)default, null, null),", + "\n new ImportArgs (\"CH\", 2020, 12, (Periodicity)default, \"MTUP10pct\", null)", "\n };" ], "metadata": {}, @@ -122,7 +123,7 @@ { "cell_type": "code", "source": [ - "var args = exportScope[0];", + "var args = exportScope[2];", "\nargs" ], "metadata": {}, @@ -215,7 +216,7 @@ { "cell_type": "code", "source": [ - "var estimateType = \"BE\";" + "var estimateType = \"RA\";" ], "metadata": {}, "execution_count": 0, @@ -244,6 +245,15 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_A.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_A.csv index b950aba6..016b5edf 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_A.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_A.csv @@ -4,21 +4,9 @@ Month,ReportingNode,Scenario,Year @@A AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value ,NIC,CF,DT1.1,,A,C,-310 -,PR,CF,DT1.1,,A,C,400 -,ACA,CF,DT1.1,,A,C,-10 -,AEA,CF,DT1.1,,A,C,-5 2020,NIC,CF,DT1.2,,A,C,-310 -,NIC,CF,DT2.1,,A,C,-310 -,PR,CF,DT2.1,,A,C,400 -,ACA,CF,DT2.1,,A,C,-10 -,AEA,CF,DT2.1,,A,C,-5 ,NIC,CF,DT1.3,,A,C,-310 -,PR,CF,DT1.3,,A,C,400 -,ACA,CF,DT1.3,,A,C,-10 -,AEA,CF,DT1.3,,A,C,-5 +,NIC,CF,DT2.1,,A,C,-310 2020,NIC,CF,DT2.2,,A,C,-310 ,NIC,CF,DTR1.1,,A,C,170 -,PR,CF,DTR1.1,,A,C,-200 -2020,NIC,CF,DTR1.2,,A,C,170 -,PR,CF,DTR2.1,,A,C,-200 -,NIC,CF,DTR2.1,,A,C,140 \ No newline at end of file +2020,NIC,CF,DTR1.2,,A,C,170 \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_AA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_AA.csv new file mode 100644 index 00000000..da193d4d --- /dev/null +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_AA.csv @@ -0,0 +1,5 @@ +@@Main +Month,ReportingNode,Scenario,Year +12,CH,MTUP10pct,2020 +@@AA +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_APA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_APA.csv index 98071041..fcfb044a 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_APA.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_APA.csv @@ -2,7 +2,4 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@APA -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,PR,CF,DT1.1,,APA,C,320 -,PR,CF,DT2.1,,APA,C,320 -,PR,CF,DT1.3,,APA,C,400 \ No newline at end of file +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BE.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BE.csv index 97f1efee..c40053de 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BE.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BE.csv @@ -3,67 +3,60 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@BE AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,NIC,BOP,DT1.1,L,BE,N,658.62824 -,PR,BOP,DT1.1,L,BE,N,-798.53673 -,NIC,BOP,DT1.1,C,BE,N,658.62824 -,PR,BOP,DT1.1,C,BE,N,-798.53673 -,NIC,EOP,DT1.1,L,BE,C,329.6431 -,PR,EOP,DT1.1,L,BE,C,-399.63393 ,NIC,EOP,DT1.1,C,BE,C,329.6431 -,PR,EOP,DT1.1,C,BE,C,-399.63393 -,NIC,IA,DT1.1,L,BE,N,1.01487 -,PR,IA,DT1.1,L,BE,N,-1.0972 +,NIC,BOP,DT1.1,C,BE,N,658.62824 +,NIC,CF,DT1.1,C,BE,N,-330 ,NIC,IA,DT1.1,C,BE,N,1.01487 -,PR,IA,DT1.1,C,BE,N,-1.0972 +,NIC,EOP,DT1.1,L,BE,C,329.6431 +,NIC,BOP,DT1.1,L,BE,N,658.62824 ,NIC,CF,DT1.1,L,BE,N,-330 -,PR,CF,DT1.1,L,BE,N,400 -,NIC,CF,DT1.1,C,BE,N,-330 -,PR,CF,DT1.1,C,BE,N,400 -2020,NIC,BOP,DT1.2,L,BE,N,658.62824 -2020,NIC,BOP,DT1.2,C,BE,N,658.62824 -2020,NIC,EOP,DT1.2,L,BE,C,329.6431 +,NIC,IA,DT1.1,L,BE,N,1.01487 2020,NIC,EOP,DT1.2,C,BE,C,329.6431 -2020,NIC,IA,DT1.2,L,BE,N,1.01487 +2020,NIC,BOP,DT1.2,C,BE,N,658.62824 +2020,NIC,CF,DT1.2,C,BE,N,-330 2020,NIC,IA,DT1.2,C,BE,N,1.01487 +2020,NIC,EOP,DT1.2,L,BE,C,329.6431 +2020,NIC,BOP,DT1.2,L,BE,N,658.62824 2020,NIC,CF,DT1.2,L,BE,N,-330 -2020,NIC,CF,DT1.2,C,BE,N,-330 -,NIC,BOP,DTR1.1,L,BE,N,-329.31412 -,PR,BOP,DTR1.1,L,BE,N,399.26837 -,CDR,BOP,DTR1.1,L,BE,N,0.52925 -,NIC,BOP,DTR1.1,C,BE,N,-329.31412 -,PR,BOP,DTR1.1,C,BE,N,399.26837 +2020,NIC,IA,DT1.2,L,BE,N,1.01487 +,CDR,EOP,DTR1.1,C,BE,C,0.1268 ,CDR,BOP,DTR1.1,C,BE,N,0.52925 -,NIC,EOP,DTR1.1,L,BE,C,-164.82155 -,PR,EOP,DTR1.1,L,BE,C,199.81696 -,CDR,EOP,DTR1.1,L,BE,C,0.1268 +,CDR,CF,DTR1.1,C,BE,N,-0.40374 +,CDR,IA,DTR1.1,C,BE,N,0.00129 ,NIC,EOP,DTR1.1,C,BE,C,-164.82155 -,PR,EOP,DTR1.1,C,BE,C,199.81696 -,CDR,EOP,DTR1.1,C,BE,C,0.1268 -,NIC,IA,DTR1.1,L,BE,N,-0.50743 -,PR,IA,DTR1.1,L,BE,N,0.5486 -,CDR,IA,DTR1.1,L,BE,N,0.00129 +,NIC,BOP,DTR1.1,C,BE,N,-329.31412 +,NIC,CF,DTR1.1,C,BE,N,165 ,NIC,IA,DTR1.1,C,BE,N,-0.50743 -,PR,IA,DTR1.1,C,BE,N,0.5486 -,CDR,IA,DTR1.1,C,BE,N,0.00129 -,NIC,CF,DTR1.1,L,BE,N,165 -,PR,CF,DTR1.1,L,BE,N,-200 +,CDR,EOP,DTR1.1,L,BE,C,0.1268 +,CDR,BOP,DTR1.1,L,BE,N,0.52925 ,CDR,CF,DTR1.1,L,BE,N,-0.40374 -,NIC,CF,DTR1.1,C,BE,N,165 -,PR,CF,DTR1.1,C,BE,N,-200 -,CDR,CF,DTR1.1,C,BE,N,-0.40374 -2020,NIC,BOP,DTR1.2,L,BE,N,-329.31412 -2020,CDR,BOP,DTR1.2,L,BE,N,0.52925 -2020,NIC,BOP,DTR1.2,C,BE,N,-329.31412 +,CDR,IA,DTR1.1,L,BE,N,0.00129 +,NIC,EOP,DTR1.1,L,BE,C,-164.82155 +,NIC,BOP,DTR1.1,L,BE,N,-329.31412 +,NIC,CF,DTR1.1,L,BE,N,165 +,NIC,IA,DTR1.1,L,BE,N,-0.50743 +2020,CDR,EOP,DTR1.2,C,BE,C,0.1268 2020,CDR,BOP,DTR1.2,C,BE,N,0.52925 -2020,NIC,EOP,DTR1.2,L,BE,C,-164.82155 -2020,CDR,EOP,DTR1.2,L,BE,C,0.1268 +2020,CDR,CF,DTR1.2,C,BE,N,-0.40374 +2020,CDR,IA,DTR1.2,C,BE,N,0.00129 2020,NIC,EOP,DTR1.2,C,BE,C,-164.82155 -2020,CDR,EOP,DTR1.2,C,BE,C,0.1268 -2020,NIC,IA,DTR1.2,L,BE,N,-0.50743 -2020,CDR,IA,DTR1.2,L,BE,N,0.00129 +2020,NIC,BOP,DTR1.2,C,BE,N,-329.31412 +2020,NIC,CF,DTR1.2,C,BE,N,165 2020,NIC,IA,DTR1.2,C,BE,N,-0.50743 -2020,CDR,IA,DTR1.2,C,BE,N,0.00129 -2020,NIC,CF,DTR1.2,L,BE,N,165 +2020,CDR,EOP,DTR1.2,L,BE,C,0.1268 +2020,CDR,BOP,DTR1.2,L,BE,N,0.52925 2020,CDR,CF,DTR1.2,L,BE,N,-0.40374 -2020,NIC,CF,DTR1.2,C,BE,N,165 -2020,CDR,CF,DTR1.2,C,BE,N,-0.40374 \ No newline at end of file +2020,CDR,IA,DTR1.2,L,BE,N,0.00129 +2020,NIC,EOP,DTR1.2,L,BE,C,-164.82155 +2020,NIC,BOP,DTR1.2,L,BE,N,-329.31412 +2020,NIC,CF,DTR1.2,L,BE,N,165 +2020,NIC,IA,DTR1.2,L,BE,N,-0.50743,N,165 +2020,NIC,IA,DTR1.2,C,BE,N,-0.5074328025652143 +2020,CDR,EOP,DTR1.2,L,BE,C,0.12679876434718015 +2020,CDR,BOP,DTR1.2,L,BE,N,0.5292475300191577 +2020,CDR,CF,DTR1.2,L,BE,N,-0.40373597582193455 +2020,CDR,IA,DTR1.2,L,BE,N,0.001287210150087148 +2020,NIC,EOP,DTR1.2,L,BE,C,-164.8215523318298 +2020,NIC,BOP,DTR1.2,L,BE,N,-329.3141195292647 +2020,NIC,CF,DTR1.2,L,BE,N,165 +2020,NIC,IA,DTR1.2,L,BE,N,-0.5074328025652143 \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BEPA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BEPA.csv index 4674e6db..afd6e7c6 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BEPA.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_BEPA.csv @@ -2,5 +2,4 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@BEPA -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,PR,CF,DT1.1,L,BEPA,N,320 \ No newline at end of file +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_C.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_C.csv index dcfc1f10..b9f6ed7f 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_C.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_C.csv @@ -3,26 +3,13 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@C AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,BOP,DT1.1,,C,N,80.0332 -,,EOP,DT1.1,,C,C,22.35306 ,,AM,DT1.1,,C,C,-42.67021 -,,EA,DT1.1,,C,C,-15 +,,EOP,DT1.1,,C,C,22.35306 +,,BOP,DT1.1,,C,N,80.0332 ,,IA,DT1.1,,C,N,-0.00993 -,,EA,DT2.1,,C,C,-15 -,,AM,DT2.1,,C,C,-82.02271 -,,EOP,DT2.1,,C,C,42.96811 -,,BOP,DT2.1,,C,N,139.90849 -,,IA,DT2.1,,C,N,0.08233 -,,EA,DT1.3,,C,C,-15 -,,AM,DT1.3,,C,C,-82.02271 -,,EOP,DT1.3,,C,C,42.96811 -,,BOP,DT1.3,,C,N,139.90849 -,,IA,DT1.3,,C,N,0.08233 ,,AM,DTR1.1,,C,C,26.60498 ,,EOP,DTR1.1,,C,C,-13.93719 ,,BOP,DTR1.1,,C,N,-40.54585 -,,IA,DTR1.1,,C,N,0.00368 -,,AM,DTR2.1,,C,C,46.24958 -,,EOP,DTR2.1,,C,C,-24.22813 -,,BOP,DTR2.1,,C,N,-70.43538 -,,IA,DTR2.1,,C,N,-0.04234 \ No newline at end of file +,,IA,DTR1.1,,C,N,0.0036888043 +,,BOP,DTR1.1,,C,N,-40.545846351508814 +,,IA,DTR1.1,,C,N,0.003676678453477744 \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_DA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_DA.csv index 4ad94e50..60cc80c2 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_DA.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_DA.csv @@ -2,13 +2,4 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@DA -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,EOP,DT1.1,,DA,C,-5.15655 -,,AM,DT1.1,,DA,C,9.84345 -,,CF,DT1.1,,DA,C,-15 -,,CF,DT2.1,,DA,C,-15 -,,AM,DT2.1,,DA,C,9.84345 -,,EOP,DT2.1,,DA,C,-5.15655 -,,CF,DT1.3,,DA,C,-15 -,,AM,DT1.3,,DA,C,9.84345 -,,EOP,DT1.3,,DA,C,-5.15655 \ No newline at end of file +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_F.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_F.csv index 20a47c21..ffe034ac 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_F.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_F.csv @@ -2,8 +2,4 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@F -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,AM,DT1.1,L,F,C,0.65623 -,,AM,DT1.2,L,F,C,1 -,,AM,DTR1.1,L,F,C,0.65623 -,,AM,DTR1.2,L,F,C,1 \ No newline at end of file +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_OA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_OA.csv new file mode 100644 index 00000000..6ebb2b89 --- /dev/null +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_OA.csv @@ -0,0 +1,5 @@ +@@Main +Month,ReportingNode,Scenario,Year +12,CH,MTUP10pct,2020 +@@OA +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_RA.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_RA.csv index 9b1cb78e..cf55d925 100644 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_RA.csv +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_RA.csv @@ -2,36 +2,4 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@RA -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,BOP,DT1.1,C,RA,N,59.87529 -,,BOP,DT1.1,L,RA,N,59.87529 -,,EOP,DT1.1,C,RA,C,29.96755 -,,EOP,DT1.1,L,RA,C,29.96755 -,,IA,DT1.1,C,RA,N,0.09226 -,,IA,DT1.1,L,RA,N,0.09226 -,,CF,DT1.1,C,RA,N,-30 -,,CF,DT1.1,L,RA,N,-30 -2020,,BOP,DT1.2,C,RA,N,59.87529 -2020,,BOP,DT1.2,L,RA,N,59.87529 -2020,,EOP,DT1.2,C,RA,C,29.96755 -2020,,EOP,DT1.2,L,RA,C,29.96755 -2020,,IA,DT1.2,C,RA,N,0.09226 -2020,,IA,DT1.2,L,RA,N,0.09226 -2020,,CF,DT1.2,C,RA,N,-30 -2020,,CF,DT1.2,L,RA,N,-30 -,,BOP,DTR1.1,C,RA,N,-29.93765 -,,BOP,DTR1.1,L,RA,N,-29.93765 -,,EOP,DTR1.1,C,RA,C,-14.98378 -,,EOP,DTR1.1,L,RA,C,-14.98378 -,,IA,DTR1.1,C,RA,N,-0.04613 -,,IA,DTR1.1,L,RA,N,-0.04613 -,,CF,DTR1.1,C,RA,N,15 -,,CF,DTR1.1,L,RA,N,15 -2020,,BOP,DTR1.2,C,RA,N,-29.93765 -2020,,BOP,DTR1.2,L,RA,N,-29.93765 -2020,,EOP,DTR1.2,C,RA,C,-14.98378 -2020,,EOP,DTR1.2,L,RA,C,-14.98378 -2020,,IA,DTR1.2,C,RA,N,-0.04613 -2020,,IA,DTR1.2,L,RA,N,-0.04613 -2020,,CF,DTR1.2,C,RA,N,15 -2020,,CF,DTR1.2,L,RA,N,15 \ No newline at end of file +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value \ No newline at end of file diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb index f10996ee..fc9772ba 100644 --- a/ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -271,7 +271,7 @@ "\n //Get the computed Data", "\n var computedVariables = computedVariablesByEstimateType.TryGetValue(bmTableName, out var ret) ? ret : Enumerable.Empty();", "\n", - "\n if(!computedVariables.Any())", + "\n if(!computedVariables.Any() && bmVariables.Any())", "\n errorList.Add(new BenchmarkTestResult(\"No variables are computed for EstimateType: \" + bmTableName, 0, 0));", "\n //CompareAgainstBm", "\n if (bmVariables.Any() && computedVariables.Any()) //TODO we are adding duplicates here", @@ -291,6 +291,15 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index 3c558fcd..594b996c 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -70,16 +70,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "var ws = Workspace.CreateNew();", - "\nws.InitializeFrom(DataSource);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ @@ -93,21 +83,12 @@ { "cell_type": "code", "source": [ - "var initStorage = new ImportStorage(argsBestEstimate, DataSource, ws);", - "\nawait initStorage.InitializeAsync();" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var actualETs = initStorage.EstimateTypesByImportFormat[ImportFormats.Actual];", - "\nvar cashflowETs = initStorage.EstimateTypesByImportFormat[ImportFormats.Cashflow];", - "\nvar actualOrCashflowETs = actualETs.Intersect(cashflowETs);", - "\nvar onlyActualETs = actualETs.Except(cashflowETs);", - "\nvar onlyCashflowETs = cashflowETs.Except(actualETs);" + "var estimateTypes = (await DataSource.Query().ToArrayAsync());", + "\nvar actualEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Actual)).Select(x => x.SystemName);", + "\nvar cashflowEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Cashflow)).Select(x => x.SystemName);", + "\nvar actualAndCashflowEstimateTypes = actualEstimateTypes.Intersect(cashflowEstimateTypes);", + "\nvar onlyActualEstimateTypes = actualEstimateTypes.Except(cashflowEstimateTypes);", + "\nvar onlyCashflowEstimateTypes = cashflowEstimateTypes.Except(actualEstimateTypes);" ], "metadata": {}, "execution_count": 0, @@ -233,9 +214,9 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioInitCashFlows = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsScenarioInitCashFlows.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -246,7 +227,7 @@ "source": [ "actualVars.Length.Should().Be(0);", "\ncashflowVars.Length.Should().NotBe(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -291,9 +272,9 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioInitActuals = DataSource.Query().ToArray();", "\nvar diffs = ivsScenarioInitActuals.Except(ivsScenarioInitCashFlows, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -304,7 +285,7 @@ "source": [ "actualVars.Length.Should().NotBe(0);", "\ncashflowVars.Length.Should().Be(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -358,9 +339,9 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioCashflowUpdateCU = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsScenarioCashflowUpdateCU.Except(ivsScenarioInitActuals, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -370,8 +351,10 @@ "cell_type": "code", "source": [ "actualVars.Length.Should().Be(0);", - "\ncashflowVars.Length.Should().NotBe(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ncashflowVars.Where(x => x.EstimateType == EstimateTypes.F).Count().Should().NotBe(0);", + "\ndiffs.Where(x => x.EstimateType == EstimateTypes.C).Count().Should().NotBe(0);", + "\ndiffs.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().NotBe(0);", + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -417,9 +400,9 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioActualUpdateACAAEA = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsScenarioActualUpdateACAAEA.Except(ivsScenarioCashflowUpdateCU, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -428,9 +411,10 @@ { "cell_type": "code", "source": [ - "diffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", + "cashflowVars.Count().Should().Be(0);", + "\ndiffs.Where(x => x.EstimateType == EstimateTypes.DA).ToArray().Length.Should().NotBe(0);", "\ndiffs.Where(x => x.EstimateType == EstimateTypes.F).ToArray().Length.Should().Be(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -504,7 +488,7 @@ { "cell_type": "markdown", "source": [ - "# Robustness: back to Best Estimate" + "# Robustness: scenario back to Best Estimate" ], "metadata": {}, "execution_count": 0, @@ -577,7 +561,7 @@ { "cell_type": "code", "source": [ - "diffs.Count().Should().Be(0);" + "ivsScenarioReimportEqualToBestEstimate.Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -636,11 +620,11 @@ "cell_type": "code", "source": [ "await DataSource.Partition.SetAsync(argsBestEstimate);", - "\nvar ivsBestEstimateReimportCashFlows = await DataSource.Query().ToArrayAsync();", - "\nvar diffs = ivsBestEstimateReimportCashFlows.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar ivsBestEstimateReimportCashFlowsNoImpactScenario = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsBestEstimateReimportCashFlowsNoImpactScenario.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());", + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -651,7 +635,7 @@ "source": [ "diffs.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().NotBe(0);", "\nactualVars.Length.Should().Be(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -661,8 +645,8 @@ "cell_type": "code", "source": [ "await DataSource.Partition.SetAsync(argsScenario);", - "\nvar ivsScenarioReimportCashFlows = await DataSource.Query().ToArrayAsync();", - "\nvar diffs = ivsScenarioReimportCashFlows.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());" + "\nvar ivsScenarioReimportCashFlowsNoImpactScenario = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsScenarioReimportCashFlowsNoImpactScenario.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());" ], "metadata": {}, "execution_count": 0, @@ -671,8 +655,8 @@ { "cell_type": "code", "source": [ - "diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType) && x.EstimateType != EstimateTypes.F && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", - "\ndiffs.Where(x => onlyActualETs.Contains(x.EstimateType) && Math.Abs(x.Value) > Precision).Count().Should().Be(0);" + "diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType) && x.EstimateType != EstimateTypes.F && Math.Abs(x.Value) > Precision).Count().Should().Be(0);", + "\ndiffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType) && Math.Abs(x.Value) > Precision).Count().Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -681,7 +665,7 @@ { "cell_type": "markdown", "source": [ - "# Reimport of Best Estimate Cashflow: impact on Scenario" + "# Reimport of Best Estimate Cashflow" ], "metadata": {}, "execution_count": 0, @@ -715,15 +699,35 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsBestEstimate);", + "\nvar ivsBestEstimateReimportCashFlows = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsBestEstimateReimportCashFlows.Except(ivsBestEstimateReimportCashFlowsNoImpactScenario, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ "await DataSource.Partition.SetAsync(argsScenario);", - "\nvar ivsScenarioReimportCashFlowsImpact = await DataSource.Query().ToArrayAsync();", - "\nvar diffs = ivsScenarioReimportCashFlowsImpact.Except(ivsScenarioReimportCashFlows, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();", - "\nvar actualOrCashflowVars = diffs.Where(x => actualOrCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar ivsScenarioReimportCashFlows = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsScenarioReimportCashFlows.Except(ivsScenarioReimportCashFlowsNoImpactScenario, IfrsVariableComparer.Instance());", + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar actualAndCashflowVars = diffs.Where(x => actualAndCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -734,7 +738,7 @@ "source": [ "cashflowVars.Length.Should().NotBe(0);", "\nactualVars.Length.Should().Be(0);", - "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualOrCashflowVars)).ToArray().Length.Should().Be(0);" + "\ndiffs.Except(actualVars.Union(cashflowVars).Union(actualAndCashflowVars)).ToArray().Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -759,7 +763,8 @@ "\n@@Actual", "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", "\nDT1.1,CF,NIC,A,,-2000", - "\nDT1.1,CF,PR,A,,-4000\";" + "\nDT1.1,CF,PR,A,,4000", + "\nDT1.1,CF,CL,A,,-3000\";" ], "metadata": {}, "execution_count": 0, @@ -780,8 +785,8 @@ "await DataSource.Partition.SetAsync(argsBestEstimate);", "\nvar ivsBestEstimateReimportActuals = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsBestEstimateReimportActuals.Except(ivsBestEstimateReimportCashFlows, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -791,8 +796,7 @@ "cell_type": "code", "source": [ "actualVars.Length.Should().NotBe(0);", - "\ncashflowVars.Length.Should().NotBe(0);", - "\ncashflowVars.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().Be(0);" + "\ncashflowVars.Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -804,8 +808,8 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioReimportActuals = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsScenarioReimportActuals.Except(ivsScenarioReimportCashFlows, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -814,9 +818,9 @@ { "cell_type": "code", "source": [ - "actualVars.Length.Should().Be(0);", - "\ncashflowVars.Length.Should().NotBe(0);", - "\ncashflowVars.Where(x => x.EstimateType == EstimateTypes.DA).Count().Should().Be(0);" + "diffs.Where(x => x.EstimateType == EstimateTypes.C).Count().Should().NotBe(0);", + "\nactualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().Be(0);" ], "metadata": {}, "execution_count": 0, @@ -840,16 +844,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "await DataSource.Partition.SetAsync(argsScenario);", - "\nawait DataSource.DeleteAsync(await DataSource.Query().ToArrayAsync());" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ @@ -878,13 +872,23 @@ "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", "\nDT1.1,PR,BE,CL,C,,200,0,0,200,0,0,200,0,0,200,0,0,0,200,0,0,200,0,0,200,0,0,200,0", "\nDT1.1,NIC,BE,CL,C,,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33,-33", - "\nDT1.1,,CU,CL,C,,-71,-71,-70,-70,-69,-69,-68,-68,-67,-67,-66,-66,-65,-65,-64,-64,-63,-63,-62,-62,-61,-61,-60,-60", + "\nDT1.1,,CU,CL,C,,-719,-71,-70,-70,-69,-69,-68,-68,-67,-67,-66,-66,-65,-65,-64,-64,-63,-63,-62,-62,-61,-61,-60,-60", "\nDT1.1,,RA,CL,C,,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45,-45\";" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenario);", + "\nawait DataSource.DeleteAsync(await DataSource.Query().ToArrayAsync());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -919,8 +923,8 @@ "await DataSource.Partition.SetAsync(argsScenario);", "\nvar ivsScenarioReimportCashFlowsWithCU = await DataSource.Query().ToArrayAsync();", "\nvar diffs = ivsScenarioReimportCashFlowsWithCU.Except(ivsScenarioReimportCashflowNoCU, IfrsVariableComparer.Instance());", - "\nvar actualVars = diffs.Where(x => onlyActualETs.Contains(x.EstimateType)).ToArray();", - "\nvar cashflowVars = diffs.Where(x => onlyCashflowETs.Contains(x.EstimateType)).ToArray();" + "\nvar actualVars = diffs.Where(x => onlyActualEstimateTypes.Contains(x.EstimateType)).ToArray();", + "\nvar cashflowVars = diffs.Where(x => onlyCashflowEstimateTypes.Contains(x.EstimateType)).ToArray();" ], "metadata": {}, "execution_count": 0, @@ -930,7 +934,7 @@ "cell_type": "code", "source": [ "actualVars.Length.Should().Be(0);", - "\ncashflowVars.Length.Should().NotBe(0);" + "\ndiffs.Count().Should().NotBe(0);" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb new file mode 100644 index 00000000..a65ecdd9 --- /dev/null +++ b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb @@ -0,0 +1,503 @@ +{ + "metadata": { + "authors": [], + "id": "8AGRn6EDjEm0Kvo27RJFPw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Scenario Parameters Import Test

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "DataSource.Reset(x => x.ResetType().ResetType());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Setting Constants" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var EnableScenarioBackup = EnableScenario;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "EnableScenario = true;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var argsBestEstimate = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, null, ImportFormats.Cashflow);", + "\nvar argsScenarioParameter = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"DUP10pct\", ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var estimateTypes = (await DataSource.Query().ToArrayAsync());", + "\nvar actualEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Actual)).Select(x => x.SystemName);", + "\nvar cashflowEstimateTypes = estimateTypes.Where(et => et.InputSource.Contains(InputSource.Cashflow)).Select(x => x.SystemName);", + "\nvar actualAndCashflowEstimateTypes = actualEstimateTypes.Intersect(cashflowEstimateTypes);", + "\nvar onlyActualEstimateTypes = actualEstimateTypes.Except(cashflowEstimateTypes);", + "\nvar onlyCashflowEstimateTypes = cashflowEstimateTypes.Except(actualEstimateTypes);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Best Estimate initialization" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowBestEstimateInit = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,", + "\n@@Cashflow", + "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", + "\nDT1.1,PR,BE,CL,C,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0", + "\nDT1.1,NIC,BE,CL,C,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25", + "\nDT1.1,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,,RA,CL,C,,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5", + "\nDTR1.1,PR,BE,CL,C,,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0,50,0,0", + "\nDTR1.1,NIC,BE,CL,C,,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.5", + "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,,RA,CL,C,,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25,1.25\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowBestEstimateInit).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actualsBestEstimateInit = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,", + "\n@@Actual", + "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", + "\nDT1.1,CF,ACA,A,,-10", + "\nDT1.1,CF,AEA,A,,-5", + "\nDT1.1,CF,NIC,A,,-280", + "\nDT1.1,CF,PR,A,,400", + "\nDTR1.1,CF,PR,A,,-200", + "\nDTR1.1,CF,NIC,A,,140\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(actualsBestEstimateInit).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsBestEstimate);", + "\nvar ivsBestEstimateInit = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Scenario parameters import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var parametersScenarios = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,DUP10pct", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation", + "\nDT1.1,0.52", + "\n@@InterDataNodeParameter", + "\nDataNode,LinkedDataNode,ReinsuranceCoverage", + "\nDT1.1,DTR1.1,0.62\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(parametersScenarios).WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioParameter);", + "\nvar ivsScenarioParameter = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioParameter.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance()).ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().NotBe(0);", + "\ndiffs.Where(x => x.EstimateType == EstimateTypes.C).Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Re-import of the same parameters should not trigger calculations " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var log = await Import.FromString(parametersScenarios).WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync();", + "\nlog" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Get(Warning.VariablesAlreadyImported)).Should().Be(true);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioParameter);", + "\nvar ivsScenarioParameterSameReimport = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioParameterSameReimport.Except(ivsScenarioParameter, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Re-import of best estimate cashflow" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowBestEstimateReImport = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,", + "\n@@Cashflow", + "\nDataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23", + "\nDT1.1,PR,BE,CL,C,,131,0,0,111,0,0,111,0,0,111,0,0,0,111,0,0,111,0,0,111,0,0,111,0", + "\nDT1.1,NIC,BE,CL,C,,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31,-31", + "\nDT1.1,,CU,CL,C,,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-11,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3", + "\nDT1.1,,RA,CL,C,,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6,-2.6", + "\nDTR1.1,PR,BE,CL,C,,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0,51,0,0", + "\nDTR1.1,NIC,BE,CL,C,,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13", + "\nDTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5", + "\nDTR1.1,,RA,CL,C,,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31,1.31\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowBestEstimateReImport).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Best Estimate change" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsBestEstimate);", + "\nvar ivsBestEstimateReimport = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsBestEstimateReimport.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario should change" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioParameter);", + "\nvar ivsScenarioParameterReimportBestEstimateCashflow = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioParameterReimportBestEstimateCashflow.Except(ivsScenarioParameter, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Re-import of scenario parameters" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var parametersScenariosReimport = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,DUP10pct", + "\n@@SingleDataNodeParameter", + "\nDataNode,PremiumAllocation", + "\nDT1.1,0.23", + "\n@@InterDataNodeParameter", + "\nDataNode,LinkedDataNode,ReinsuranceCoverage", + "\nDT1.1,DTR1.1,0.23\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(parametersScenariosReimport).WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenarioParameter);", + "\nvar ivsScenarioParameterReimport = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var diffs = ivsScenarioParameterReimport.Except(ivsScenarioParameterReimportBestEstimateCashflow, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Restore constants" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "EnableScenario = EnableScenarioBackup;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index 5e870b40..6fce00f2 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -269,7 +269,7 @@ { "cell_type": "markdown", "source": [ - "# Re-Import of the same yield curve should not trigger IFRS17 Calculations" + "# Re-import of the same yield curve should not trigger calculations" ], "metadata": {}, "execution_count": 0, @@ -278,7 +278,17 @@ { "cell_type": "code", "source": [ - "await Import.FromString(yieldCurveScenario).WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync()" + "var log = await Import.FromString(yieldCurveScenario).WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync();", + "\nlog" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "((log.Warnings.FirstOrDefault()?.ToString().Remove(0,40).Remove(125,2)?? \"\") == Get(Warning.VariablesAlreadyImported)).Should().Be(true);" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index 7cc5ce85..c70f9674 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -71,6 +71,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"ScenarioParametersImportTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 9c4db10f..a5b2932b 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -503,18 +503,33 @@ { "cell_type": "code", "source": [ - "public async Task GetAllArgsAsync(ImportArgs args, IDataSource dataSource, string format, IDataSource targetDataSource)", + "public async Task GetAllArgsAsync(ImportArgs args, IDataSource dataSource, string format)", "\n{", "\n ImportArgs[] allArgs;", "\n switch(format)", "\n {", - "\n case ImportFormats.YieldCurve : ", + "\n case ImportFormats.Cashflow:", + "\n case ImportFormats.Actual: ", + "\n case ImportFormats.Opening:", + "\n {", + "\n if(args.Scenario != null) return args.RepeatOnce().ToArray();", + "\n var secondaryArgs = await dataSource.Query() ", + "\n .Where(x => x.ReportingNode == args.ReportingNode && x.Year == args.Year && x.Month == args.Month && x.Scenario != null)", + "\n .Select(x => new ImportArgs(x.ReportingNode, x.Year, x.Month, default(Periodicity), x.Scenario, format)).ToArrayAsync();", + "\n ", + "\n if(secondaryArgs.Any()) ApplicationMessage.Log(Warning.ScenarioReCalculations, String.Join(\", \", secondaryArgs.Select(x => x.Scenario)));", + "\n allArgs = args.RepeatOnce().Concat(secondaryArgs).ToArray();", + "\n break;", + "\n }", + "\n default: ", "\n {", "\n if(args.Scenario == null) {", - "\n var scenariosWithYieldCurves = await dataSource.Query().Where(x => x.Year == args.Year && x.Month == args.Month && x.Scenario != null)", - "\n .Select(x => x.Scenario).Distinct().ToArrayAsync();", + "\n var scenarios = format switch {", + "\n ImportFormats.YieldCurve => await dataSource.Query().Where(x => x.Year == args.Year && x.Month == args.Month && x.Scenario != null).Select(x => x.Scenario).Distinct().ToArrayAsync(),", + "\n ImportFormats.DataNodeParameter => await dataSource.Query().Where(x => x.Year == args.Year && x.Month == args.Month && x.Scenario != null).Select(x => x.Scenario).Distinct().ToArrayAsync()", + "\n };", "\n var targetPartitions = await dataSource.Query()", - "\n .Where(x => x.Year == args.Year && x.Month == args.Month && !scenariosWithYieldCurves.Contains(x.Scenario)).OrderBy(x => x.Scenario).ToArrayAsync();", + "\n .Where(x => x.Year == args.Year && x.Month == args.Month && !scenarios.Contains(x.Scenario)).OrderBy(x => x.Scenario).ToArrayAsync();", "\n var targetScenarios = targetPartitions.Where(x => x.Scenario != null).Select(x => x.Scenario);", "\n if(targetScenarios.Any()) ApplicationMessage.Log(Warning.ScenarioReCalculations, String.Join(\", \", targetScenarios));", "\n allArgs = targetPartitions.Select(x => new ImportArgs(x.ReportingNode, x.Year, x.Month, default(Periodicity), x.Scenario, ImportFormats.Cashflow)).ToArray();", @@ -526,17 +541,6 @@ "\n }", "\n break;", "\n }", - "\n default : ", - "\n {", - "\n if(args.Scenario != null) return args.RepeatOnce().ToArray();", - "\n var secondaryArgs = await targetDataSource.Query() ", - "\n .Where(x => x.ReportingNode == args.ReportingNode && x.Year == args.Year && x.Month == args.Month && x.Scenario != null)", - "\n .Select(x => new ImportArgs(x.ReportingNode, x.Year, x.Month, default(Periodicity), x.Scenario, ImportFormats.Cashflow)).ToArrayAsync();", - "\n ", - "\n if(secondaryArgs.Any()) ApplicationMessage.Log(Warning.ScenarioReCalculations, String.Join(\", \", secondaryArgs.Select(x => x.Scenario)));", - "\n allArgs = args.RepeatOnce().Concat(secondaryArgs).ToArray();", - "\n break;", - "\n }", "\n }", "\n return allArgs.Where(x => (!EnableScenario && x.Scenario == null) || EnableScenario).ToArray();", "\n}" @@ -560,10 +564,11 @@ "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n if(storage.DefaultPartition != storage.TargetPartition){", - "\n var bestEstimateIvs = await DataSource.LoadPartitionedDataAsync(storage.DefaultPartition);", - "\n ivs = ivs.Where(iv => Math.Abs(iv.Value) >= Precision).ToArray().Concat(", - "\n ivs.Where(iv => Math.Abs(iv.Value) < Precision).Intersect(bestEstimateIvs, EqualityComparer.Instance).Select(iv => iv with {Value = 0.0}).ToArray());", + "\n if(storage.DefaultPartition != storage.TargetPartition) {", + "\n var bestEstimateIvs = await workspaceToCompute.LoadPartitionedDataAsync(storage.DefaultPartition);", + "\n ivs = ivs.Where(iv => Math.Abs(iv.Value) >= Precision).ToArray()", + "\n .Except(bestEstimateIvs, IfrsVariableComparer.Instance(ignoreValue: false))", + "\n .Concat(ivs.Where(x => Math.Abs(x.Value) < Precision).Intersect(bestEstimateIvs, EqualityComparer.Instance).Select(x => x with {Value = 0.0}).ToArray());", "\n }", "\n", "\n workspace.Reset(x => x.ResetType());", @@ -837,7 +842,7 @@ "\n return Activity.Finish().Merge(importLog);", "\n }", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.YieldCurve, options.TargetDataSource);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.YieldCurve);", "\n var updatedCurrencies = toCommitYieldCurves.Select(x => x.Currency).Distinct();", "\n var dataNodesToUpdate = await workspace.Query().Where(x => updatedCurrencies.Contains(x.ContractualCurrency)).Select(x => x.SystemName).ToArrayAsync();", "\n var workspaceToCompute = Workspace.CreateNew();", @@ -846,8 +851,7 @@ "\n foreach (var args in allArgs) {", "\n await CommitPartitionAsync(args, workspace, workspaceToCompute);", "\n var targetPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(args));", - "\n var defaultPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(", - "\n new ImportArgs(args.ReportingNode, args.Year, args.Month, default(Periodicity), null, ImportFormats.Cashflow) ));", + "\n var defaultPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(args with {Scenario = null}));", "\n if(ApplicationMessage.HasErrors()) return Activity.Finish().Merge(importLog);", "\n ", "\n // Avoid starting the computation if no best estimate cash flow has ever been imported ", @@ -1091,21 +1095,12 @@ { "cell_type": "code", "source": [ - "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId, IWorkspace workspace, IDataSource targetDataSource)", + "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, ImportArgs args, IWorkspace workspace, IDataSource targetDataSource)", "\n{", - "\n workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\n workspace.Initialize(x => x.FromSource(targetDataSource)", - "\n .DisableInitialization()", - "\n .DisableInitialization()", - "\n .DisableInitialization());", "\n Activity.Start();", - "\n var args = await GetArgsAndCommitPartitionAsync(dataSet, targetDataSource) with {ImportFormat = ImportFormats.DataNodeParameter};", - "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n", "\n var storage = new ParsingStorage(args, targetDataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n", "\n var singleDataNode = new List();", "\n var interDataNode = new List<(string,string)>();", "\n ", @@ -1124,8 +1119,8 @@ "\n return new SingleDataNodeParameter {", "\n Year = args.Year,", "\n Month = args.Month,", + "\n Scenario = args.Scenario,", "\n Partition = storage.TargetPartitionByReportingNode.Id,", - "\n", "\n DataNode = dataNode,", "\n PremiumAllocation = (datarow.Field(nameof(SingleDataNodeParameter.PremiumAllocation)))", "\n .ToString().CheckStringForExponentialAndConvertToDouble(),", @@ -1159,6 +1154,7 @@ "\n return new InterDataNodeParameter {", "\n Year = args.Year,", "\n Month = args.Month,", + "\n Scenario = args.Scenario,", "\n Partition = storage.TargetPartitionByReportingNode.Id,", "\n DataNode = dataNodes[0],", "\n LinkedDataNode = dataNodes[1],", @@ -1168,7 +1164,6 @@ "\n .WithTarget(workspace)", "\n .ExecuteAsync();", "\n ", - "\n targetPartitionByReportingNodeId = storage.TargetPartitionByReportingNode.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" ], @@ -1180,13 +1175,53 @@ "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNodeParameter, async (options, dataSet) => {", - "\n Guid partitionId = new Guid();", + "\n Activity.Start();", + "\n var primaryArgs = GetArgsFromMain(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", + "\n primaryArgs.ValidateArgsForPeriod();", + "\n if(ApplicationMessage.HasErrors()) return Activity.Finish();", "\n var workspace = Workspace.CreateNew();", - "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace, options.TargetDataSource);", - "\n await workspace.CommitToAsync(options.TargetDataSource, partitionId, snapshot: false);", - "\n await workspace.CommitToAsync(options.TargetDataSource, partitionId, snapshot: false); ", - "\n ", - "\n return log;", + "\n workspace.Initialize(x => x.FromSource(options.TargetDataSource).DisableInitialization().DisableInitialization());", + "\n", + "\n var committedParameters = await options.TargetDataSource.Query().ToArrayAsync();", + "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, primaryArgs, workspace, options.TargetDataSource); ", + "\n", + "\n if(log.Errors.Any()) return Activity.Finish().Merge(log); ", + "\n var toCommitParameters = (await workspace.Query().ToArrayAsync()).Except(committedParameters, ParametersComparer.Instance());", + "\n if (!toCommitParameters.Any()) {", + "\n ApplicationMessage.Log(Warning.VariablesAlreadyImported); ", + "\n return Activity.Finish().Merge(log);", + "\n }", + "\n", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.DataNodeParameter);", + "\n var targetDataNodes = toCommitParameters.Select(x => x.DataNode)", + "\n .Concat(toCommitParameters.Where(x => x is InterDataNodeParameter).Select(x => ((InterDataNodeParameter)x).LinkedDataNode)).ToHashSet();", + "\n var workspaceToCompute = Workspace.CreateNew();", + "\n workspaceToCompute.Initialize(x => x.FromSource(options.TargetDataSource).DisableInitialization());", + "\n", + "\n foreach (var args in allArgs) { ", + "\n await CommitPartitionAsync(args, workspace, workspaceToCompute);", + "\n var targetPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(args));", + "\n var defaultPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(args with {Scenario = null}));", + "\n var previousPartition = (Guid)(await options.TargetDataSource.Partition.GetKeyForInstanceAsync(args with {Scenario = null, Year = args.Year-1, Month = 12}));", + "\n await options.TargetDataSource.Partition.SetAsync(null);", + "\n if(ApplicationMessage.HasErrors()) return Activity.Finish().Merge(log);", + "\n ", + "\n // Avoid starting the computation if no best estimate cash flow and actuals has ever been imported ", + "\n if(args.Scenario == null && !(await options.TargetDataSource.Query().Where(x => x.Partition == targetPartition).Take(1).ToArrayAsync()).Any() &&", + "\n !(await options.TargetDataSource.Query().Where(x => x.Partition == targetPartition).Take(1).ToArrayAsync()).Any()) continue;", + "\n", + "\n // Only nominals corresponding to the target data nodes are added to the workspace", + "\n var nominals = await options.TargetDataSource.Query().Where(x => targetDataNodes.Contains(x.DataNode) && ", + "\n (x.Partition == targetPartition || x.Partition == defaultPartition || x.Partition == previousPartition)).ToArrayAsync();", + "\n if(nominals.Any()) await workspaceToCompute.UpdateAsync(nominals);", + "\n", + "\n log = log.Merge(await ComputeAsync(args, workspace, workspaceToCompute, false));", + "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", + "\n }", + "\n", + "\n await workspaceToCompute.UpdateAsync(toCommitParameters);", + "\n await workspaceToCompute.CommitToTargetAsync(options.TargetDataSource);", + "\n return Activity.Finish().Merge(log);", "\n});" ], "metadata": {}, @@ -1288,7 +1323,7 @@ "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.Cashflow};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Cashflow, options.TargetDataSource);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Cashflow);", "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Cashflow, primaryArgs, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", @@ -1389,7 +1424,7 @@ "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet, options.TargetDataSource) with {ImportFormat = ImportFormats.Actual};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Actual, options.TargetDataSource);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs, options.TargetDataSource, ImportFormats.Actual);", "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, primaryArgs, options.TargetDataSource);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", diff --git a/ifrs17/Utils/EqualityComparers.ipynb b/ifrs17/Utils/EqualityComparers.ipynb index 98705583..95c8b455 100644 --- a/ifrs17/Utils/EqualityComparers.ipynb +++ b/ifrs17/Utils/EqualityComparers.ipynb @@ -140,6 +140,38 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "class ParametersComparer: IEqualityComparer", + "\n{", + "\n private ParametersComparer(){}", + "\n", + "\n public bool Equals(DataNodeParameter x, DataNodeParameter y) {", + "\n if (x == null && y == null) return true; ", + "\n if (x == null || y == null) return false; ", + "\n if (!(x.Year == y.Year && x.Month == y.Month && x.Scenario == y.Scenario)) return false; ", + "\n if (x is SingleDataNodeParameter && y is SingleDataNodeParameter && x.DataNode == y.DataNode &&", + "\n ((SingleDataNodeParameter)x).PremiumAllocation == ((SingleDataNodeParameter)y).PremiumAllocation) return true; ", + "\n if (x is InterDataNodeParameter && y is InterDataNodeParameter) {", + "\n var xi = (InterDataNodeParameter)x;", + "\n var yi = (InterDataNodeParameter)y;", + "\n if (xi.ReinsuranceCoverage != yi.ReinsuranceCoverage) return false;", + "\n if ((xi.LinkedDataNode == yi.LinkedDataNode && xi.DataNode == yi.DataNode) ||", + "\n (xi.LinkedDataNode == yi.DataNode && xi.DataNode == yi.LinkedDataNode)) return true;", + "\n }", + "\n return false;", + "\n }", + "\n\t", + "\n public int GetHashCode (DataNodeParameter x) => 0;", + "\n", + "\n public static ParametersComparer Instance() => new ParametersComparer();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Utils/Queries.ipynb b/ifrs17/Utils/Queries.ipynb index af7021f4..809fe695 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -372,8 +372,8 @@ "\n .GroupBy(x => x.DataNode != p.Key ? x.DataNode : x.LinkedDataNode)", "\n .Select(gg =>", "\n {", - "\n var currentCandidate = gg.Where(x => x.Year == args.Year).OrderByDescending(x => x.Month).FirstOrDefault();", - "\n var previousCandidate = gg.Where(x => x.Year < args.Year).OrderByDescending(x => x.Year).ThenByDescending(x => x.Month).FirstOrDefault();", + "\n var currentCandidate = gg.Where(x => x.Year == args.Year).OrderByDescending(x => x.Month).ThenByDescending(x => x.Scenario).FirstOrDefault();", + "\n var previousCandidate = gg.Where(x => x.Year < args.Year && x.Scenario == null).OrderByDescending(x => x.Year).ThenByDescending(x => x.Month).FirstOrDefault();", "\n return (key: p.Key,", "\n currentPeriod: currentCandidate != null ? currentCandidate : previousCandidate,", "\n previousPeriod: previousCandidate != null ? previousCandidate : currentCandidate);", From d68e6da76353ba41107e639658d988031b958729 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan <116903719+tkukuljan@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:24:54 +0100 Subject: [PATCH 14/19] Grouping scenario constants (#241) * Refactors * Replacing ToIdentityString with the ToStringWith. * Renaming the method ToStringWith * Adding IdentityPropertyReader and adapting the code * IdentityPropertyReader with Expressions --- .../Test/ScenarioDataImportTest.ipynb | 6 +-- .../Test/ScenarioYieldCurveImportTest.ipynb | 6 +-- ifrs17/Constants/Consts.ipynb | 34 +++----------- ifrs17/Import/Importers.ipynb | 7 ++- ifrs17/Report/ReportMutableScopes.ipynb | 6 +-- ifrs17/Utils/Extensions.ipynb | 45 ++++++++++++------- 6 files changed, 47 insertions(+), 57 deletions(-) diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index 594b996c..b0419970 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -55,7 +55,7 @@ { "cell_type": "code", "source": [ - "var EnableScenarioBackup = EnableScenario;" + "var EnableScenarioBackup = Scenarios.EnableScenario;" ], "metadata": {}, "execution_count": 0, @@ -64,7 +64,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = true;" + "Scenarios.EnableScenario = true;" ], "metadata": {}, "execution_count": 0, @@ -952,7 +952,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = EnableScenarioBackup;" + "Scenarios.EnableScenario = EnableScenarioBackup;" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index 6fce00f2..843dbf9f 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -55,7 +55,7 @@ { "cell_type": "code", "source": [ - "var EnableScenarioBackup = EnableScenario;" + "var EnableScenarioBackup = Scenarios.EnableScenario;" ], "metadata": {}, "execution_count": 0, @@ -64,7 +64,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = true;" + "Scenarios.EnableScenario = true;" ], "metadata": {}, "execution_count": 0, @@ -734,7 +734,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = EnableScenarioBackup;" + "Scenarios.EnableScenario = EnableScenarioBackup;" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index b3889647..d3077e10 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -383,34 +383,12 @@ { "cell_type": "code", "source": [ - "public bool EnableScenario = false;" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public const string ScenarioDefault = \"Best Estimate\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public const string ScenariosAll = \"All\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public const string ScenariosDelta = \"Delta\";" + "public static class Scenarios{", + "\n public static bool EnableScenario = false;", + "\n public const string Default = \"Best Estimate\";", + "\n public const string All = nameof(All);", + "\n public const string Delta = nameof(Delta);", + "\n}" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index a5b2932b..87a517db 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -542,7 +542,7 @@ "\n break;", "\n }", "\n }", - "\n return allArgs.Where(x => (!EnableScenario && x.Scenario == null) || EnableScenario).ToArray();", + "\n return allArgs.Where(x => (!Scenarios.EnableScenario && x.Scenario == null) || Scenarios.EnableScenario).ToArray();", "\n}" ], "metadata": {}, @@ -669,10 +669,9 @@ "using static Systemorph.Vertex.Equality.IdentityPropertyExtensions;", "\npublic async static Task ValidateForMandatoryAocSteps(this IWorkspace workspace, IDataSet dataSet, HashSet mandatoryAocSteps)", "\n{ ", - "\n var excludedProperties = new[]{nameof(AocType), nameof(Novelty)};", - "\n var includingProperties = typeof(RawVariable).GetIdentityProperties().Select(x=>x.Name).Except(excludedProperties).ToArray();", + "\n var ignoreProperties = new[]{nameof(AocType), nameof(Novelty)};", "\n var missingAocStepsByIdentityProperties = (await workspace.Query().ToListAsync())", - "\n .GroupBy(x => x.ToStringWith(properties: includingProperties),", + "\n .GroupBy(x => x.ToIdentityString(ignoreProperties),", "\n x => new AocStep(x.AocType, x.Novelty),", "\n (properties, parsedAocSteps) => (properties, mandatoryAocSteps.Except(parsedAocSteps))", "\n );", diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index f6cb212f..d77923d7 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -295,10 +295,10 @@ "\n IDataCube Cube { get{", "\n var data = GetScope(Identity.reportType).GetDataCube();", "\n // TODO: suggestion to place the filter here instead of having it in every applicability scope", - "\n if(Identity.scenario != ScenariosAll && Identity.scenario != ScenariosDelta) return data;", - "\n if(Identity.scenario == ScenariosAll) return data.Select(x => x.Scenario == null? x with {Scenario = ScenarioDefault } : x).ToDataCube();", + "\n if(Identity.scenario != Scenarios.All && Identity.scenario != Scenarios.Delta) return data;", + "\n if(Identity.scenario == Scenarios.All) return data.Select(x => x.Scenario == null? x with {Scenario = Scenarios.Default } : x).ToDataCube();", "\n var bestEstimateById = data.Where(x => x.Scenario == null).ToDictionary(x => x.ToIdentityString());", - "\n return data.Select(x => x.Scenario == null ? x with { Scenario = ScenarioDefault } ", + "\n return data.Select(x => x.Scenario == null ? x with { Scenario = Scenarios.Default } ", "\n : x with { Value = x.Value - (bestEstimateById.TryGetValue((x with {Scenario = null}).ToIdentityString(), out var be)? be.Value : 0.0) }).ToDataCube();", "\n }}", "\n} " diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index dec7c53d..c3587cec 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -199,7 +199,7 @@ { "cell_type": "markdown", "source": [ - "# ToIdentityString" + "# Identity property reader" ], "metadata": {}, "execution_count": 0, @@ -208,16 +208,30 @@ { "cell_type": "code", "source": [ - "using System.Text;", - "\npublic static string ToIdentityString(this T v, params string[] excludingProperties) where T : class", - "\n{", - "\n StringBuilder sb = new StringBuilder();", - "\n var propertyInfos = v.GetType()", - "\n .GetProperties()", - "\n .Where(x => Attribute.IsDefined(x, typeof(IdentityPropertyAttribute)) && !excludingProperties.Contains(x.Name))", - "\n .OrderByDescending(x => x.PropertyType.Name).ThenByDescending(x => x.Name)", - "\n .Select(x => sb.Append(x.Name).Append(\":\").Append(v.GetType().GetProperty(x.Name)?.GetValue(v, null)).Append(\", \")).ToArray();", - "\n return propertyInfos.Count() == 0? v.ToString() : propertyInfos.Select(p => p.ToString()).ToArray().Last();", + "using static Systemorph.Vertex.Equality.IdentityPropertyExtensions;", + "\nusing System.Linq.Expressions;", + "\npublic static class IdentityReader where T : class {", + "\n private static Dictionary> ExpressionsByExcludedProperties = new();", + "\n public static string Concat(string first, string second) => first + \" \" + second;", + "\n public static string GetString(Object item) => (item == null) ? \"\" : item.ToString();", + "\n", + "\n private static Func GetToIdentityExpression(string[] excludedProperties) {", + "\n var pm = Expression.Parameter(typeof(T));", + "\n var expression = typeof(T).GetIdentityProperties().Where(x => !excludedProperties.Contains(x.Name))", + "\n .SelectMany(x => new Expression[]{ Expression.Constant(x.Name.ToString()+\":\"),", + "\n Expression.Call(typeof(IdentityReader).GetMethod(nameof(GetString)), Expression.Convert(Expression.Property(pm, x.Name), typeof(Object))) }", + "\n ).Aggregate((x, y) => Expression.Call(typeof(IdentityReader).GetMethod(nameof(IdentityReader.Concat)), x, y));", + "\n return Expression.Lambda>(expression, pm).Compile();", + "\n }", + "\n", + "\n public static string ToString(T x, string[] excludedProperties) {", + "\n var key = string.Join(\",\", excludedProperties.OrderBy(x => x));", + "\n if(!ExpressionsByExcludedProperties.TryGetValue(key, out var expression)) {", + "\n ExpressionsByExcludedProperties[key] = GetToIdentityExpression(excludedProperties);", + "\n return ExpressionsByExcludedProperties[key](x);", + "\n }", + "\n return expression(x);", + "\n }", "\n}" ], "metadata": {}, @@ -227,7 +241,7 @@ { "cell_type": "markdown", "source": [ - "# ToString with including properties" + "# ToString with excluding properties" ], "metadata": {}, "execution_count": 0, @@ -236,11 +250,10 @@ { "cell_type": "code", "source": [ - "public static string ToStringWith(this T variable, string[] properties) where T : BaseVariableIdentity", + "public static string ToIdentityString(this T variable, string[] ignoreProperties = null) where T : class", "\n{", - "\n var propertiesRead = variable.ToString().Split('{', '}')[1].Split(',');", - "\n var propertiesFiltered = propertiesRead.Where(x=> properties.Contains(x.Split('=')[0].Trim()));", - "\n return string.Join(\", \", propertiesFiltered).Trim();", + "\n if (ignoreProperties == null) ignoreProperties = new string[0];", + "\n return IdentityReader.ToString(variable, ignoreProperties);", "\n}" ], "metadata": {}, From 6c819da8a86b01569856a02b941bdf6b8383a706 Mon Sep 17 00:00:00 2001 From: Daniel Trzesniak Date: Thu, 23 Mar 2023 23:28:02 +0100 Subject: [PATCH 15/19] Int obj rep (#217) * copying over * end of week version * update * safe state? * working version * Some clean up * adding reports * update * adding comments and todos * Allow overwriting filter names. Add Delta and all to the scenarios list (hardcoded at this point) * all the filters are separately defined * incorporate exports. Appropriate changes to the report storage are made * filter changes + adapt old api * for objects: almost works, it is an advanced sketch * merge changes * incorporates parameter report -- for object * stopgap solution for csv and excel reports included. * resolve merge conflict * add filters * reference to disposable workspaces * filters, scenario, slices * Reports split to notebook per each report + some modifications * minor fix in parameter mutable reports * Typos fixed, pseudo-fix for the threading issue removed and added slices to the parameter reports * filters fix * filter fix * some changes to the reports * interactive reports * solve merge conflicts in tests * fixes a nasty bug that shows up when there is no data. * Some comments addressed and moved the types of parameter reports into an enum * Changed to FirstOrDefault() / LastOrDefault() * syntax simplificattion * routines renamed * typo fixed * syntax change to Any() * move import types and forms into the CE * small refactor of specific filter * fix failing tests * increase memory recommended * enums moved to classes + routine to query constant attributes of a class * bug fixed + produce param reports menu from method rather than enum * Added a comment about null reports * Generalization of the interactive mutable scopes * Align with the API * Move initializations to the LoadData and add exports to excel * Initialization to ParameterReportScope * parameter interactive some refinement * export description * report markdown * comment ToExcelInteractive * switch case in the data scope * remove treatment of annual cohort * with activity log * remove hardcoded --------- Co-authored-by: akatz Co-authored-by: Davide Colleoni --- .../Report/InteractiveParameterReport.ipynb | 106 ++ .../Report/InteractiveReports/Accruals.ipynb | 92 ++ .../InteractiveReports/Csm-Lc-LoReCo.ipynb | 92 ++ .../Report/InteractiveReports/Deferrals.ipynb | 92 ++ .../ExperienceAdjustment.ipynb | 92 ++ .../FinancialPerformance.ipynb | 92 ++ .../FulfilmentCashflow.ipynb | 92 ++ .../Report/InteractiveReports/LIC.ipynb | 92 ++ .../Report/InteractiveReports/LRC.ipynb | 92 ++ .../InteractiveReports/LicActuarial.ipynb | 92 ++ .../Report/InteractiveReports/LoadData.ipynb | 65 + .../InteractiveReports/LrcActuarial.ipynb | 92 ++ .../InteractiveReports/PresentValue.ipynb | 92 ++ .../InteractiveReports/RiskAdjustment.ipynb | 92 ++ .../InteractiveReports/TechnicalMargin.ipynb | 92 ++ .../InteractiveReports/WrittenActual.ipynb | 92 ++ .../Test/ReportVariablesTest.ipynb | 2 +- ifrs17-template/Test/Tests.ipynb | 4 +- ifrs17/CalculationEngine.ipynb | 31 +- ifrs17/Constants/Consts.ipynb | 48 + ifrs17/DataModel/DataStructure.ipynb | 30 +- ...rameterReportMutableScopeInteractive.ipynb | 281 +++++ .../Report/ReportConfigurationAndUtils.ipynb | 44 +- ifrs17/Report/ReportMutableScopes.ipynb | 13 +- .../ReportMutableScopesInteractive.ipynb | 1104 +++++++++++++++++ ifrs17/Report/ReportScopes.ipynb | 31 + ifrs17/Report/ReportStorage.ipynb | 20 +- ifrs17/Test/ReportStorageTest.ipynb | 2 +- 28 files changed, 3042 insertions(+), 27 deletions(-) create mode 100644 ifrs17-template/Report/InteractiveParameterReport.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/Accruals.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/Deferrals.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/LIC.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/LRC.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/LoadData.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/PresentValue.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb create mode 100644 ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb create mode 100644 ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb create mode 100644 ifrs17/Report/ReportMutableScopesInteractive.ipynb diff --git a/ifrs17-template/Report/InteractiveParameterReport.ipynb b/ifrs17-template/Report/InteractiveParameterReport.ipynb new file mode 100644 index 00000000..82c1d443 --- /dev/null +++ b/ifrs17-template/Report/InteractiveParameterReport.ipynb @@ -0,0 +1,106 @@ +{ + "metadata": { + "authors": [], + "id": "SB2KH3IeJ0ayzI-af7eReA", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "", + "\n

Interactive Parameter Reports

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This notebook is the interactive version of [Parameter Reports](./ParameterReports). For demonstration purposes we import here data for some *Group of Insurance Contract* (GIC) and *Group of Reinsurance Contract* (GRIC) - the import is triggered in the [Set up data and configuration](#set-up-data-and-configuration) section.", + "\n
The imported data set consists of cash flows, actuals, and parameters.", + "\n
Input files can be found in the **File** directory. You are invited to change them or upload your own or add new data in the [CloseImportTemplate](../Import/CloseImportTemplate) notebook. ", + "\n", + "\nIn this notebook we show the parameters (provided to the calculation engine as inputs) used to performe the calculation of the reports shown in [Reports](Reports) notebook.", + "\n", + "\nSelect from the dropdown which *Report Type* you are interested in and the report adjust to the desired selection. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Set up data and configuration", + "\n", + "\nChoose to run the Reports notebook either with the set of Systemorph data in memory or with the data present in the Database: ", + "\n- #!eval-notebook \"../Database/Configure\" : connects to a physical Database", + "\n- #!eval-notebook \"../Import/CloseImportTemplate\" : uses the in-memory set up", + "\n", + "\nWe use here the in-memory set up." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"../Import/CloseImportTemplate\"", + "\nWorkspace.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "parameterInteractive.Reset(Workspace);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive view" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "parameterInteractive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "parameterInteractive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/Accruals.ipynb b/ifrs17-template/Report/InteractiveReports/Accruals.ipynb new file mode 100644 index 00000000..c2b3eb39 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/Accruals.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "oKYWmrRFfU2e9YTd1Vj9iw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Accruals

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"Accruals\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb b/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb new file mode 100644 index 00000000..605fccf9 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "YfxenPHy6ky0dq9nEONroA", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Contractual Service Margin / Loss Component / Loss Recovery Component

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"CsmLcLorecoReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb b/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb new file mode 100644 index 00000000..74ed4bbe --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "T4bL4ggXtUu8qf7OrBY7lg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Deferrals

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"DeferralsReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb b/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb new file mode 100644 index 00000000..bca1a5d0 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "AXPivUdMuE-lUwK-q-qUPg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Experience Adjustment

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"ExpAdjReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb b/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb new file mode 100644 index 00000000..f6d93cd9 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "AmrSZNq9YUqkLnbEjLUpkw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Financial Performance

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"FpReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb b/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb new file mode 100644 index 00000000..e9eb2257 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "SJ5ZNXF0EkSstU_pWIG2Kg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Fulfilment Cash flow

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"FcfReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/LIC.ipynb b/ifrs17-template/Report/InteractiveReports/LIC.ipynb new file mode 100644 index 00000000..e7080f53 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/LIC.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "qorXFtJ_gE2BGWjTnWDHAg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

LIC

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"LicReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/LRC.ipynb b/ifrs17-template/Report/InteractiveReports/LRC.ipynb new file mode 100644 index 00000000..b33382f5 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/LRC.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "e-MbqoKGUEaq_uBz7npwPQ", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

LRC

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"LrcReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb b/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb new file mode 100644 index 00000000..a7ceb1a8 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "dVthm2DPB0qGOEC02sxPsA", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

LIC Actuarial

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"LicActualReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/LoadData.ipynb b/ifrs17-template/Report/InteractiveReports/LoadData.ipynb new file mode 100644 index 00000000..0b97f90a --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/LoadData.ipynb @@ -0,0 +1,65 @@ +{ + "metadata": { + "authors": [], + "id": "HX-3ABD14UaeXjlLLekeNw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Set up and configurations

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Choose to run the Report notebooks either with the set of Systemorph data in memory or with the data present in the Database:", + "\n", + "\n- #!eval-notebook \"../Database/Configure\" : connects to a physical Database", + "\n- #!eval-notebook \"../Import/CloseImportTemplate\" : uses the in-memory set up", + "\n", + "\nWe use here the in-memory set up.", + "\n", + "\nThe current notebook is used by all interactive reports and any change made here is going to affect all interactive reports.", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../../Import/CloseImportTemplate\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.InitializeFrom(DataSource);", + "\nifrs17Interactive.Reset(Workspace)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb b/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb new file mode 100644 index 00000000..760172db --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "6W4aDEXW4kGr7_GR8uVx6g", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

LRC Actuarial

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"LrcActualReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb b/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb new file mode 100644 index 00000000..8695c9e8 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "PTEWug2t60Cim-6iwrIVGg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Present Value of Best Estimate

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"PvReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb b/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb new file mode 100644 index 00000000..c34ad162 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "BBEqtQSGT0CHl8YpJC18hw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Risk Adjustment

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"RiskAdjReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb b/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb new file mode 100644 index 00000000..62b7e671 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "c9ui1BTJv0-wnUoEiBU1pw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Technical Margin

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"TmReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb b/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb new file mode 100644 index 00000000..b03d6226 --- /dev/null +++ b/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb @@ -0,0 +1,92 @@ +{ + "metadata": { + "authors": [], + "id": "WzfGMeugkEGQTanwpQJcTg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Written Actuarial

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Load Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"LoadData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive report and export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetFormsEntity()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17Interactive.GetReport()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Export the report to excel format using the next cell. Change the file name using the input string and disable appending UTC export time by chaging true to false. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ifrs17Interactive.ExportToExcelAsync(\"WrittenReport\", addDateTime : true)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Test/ReportVariablesTest.ipynb b/ifrs17-template/Test/ReportVariablesTest.ipynb index f447c1d4..2d6351fe 100644 --- a/ifrs17-template/Test/ReportVariablesTest.ipynb +++ b/ifrs17-template/Test/ReportVariablesTest.ipynb @@ -91,7 +91,7 @@ { "cell_type": "code", "source": [ - "var reportStorage = new ReportStorage(Workspace, Report);", + "var reportStorage = new ReportStorage(Workspace, Report, Export);", "\nawait reportStorage.InitializeReportIndependentCacheAsync();" ], "metadata": {}, diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index c70f9674..0e535198 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -29,7 +29,7 @@ "cell_type": "markdown", "source": [ "Comprehensive collection of tests executed on top of the Systemorph use cases (initialization).", - "\n
Execute this Notebook using at least 14Gb RAM." + "\n
Execute this Notebook using at least 18Gb RAM." ], "metadata": {}, "execution_count": 0, @@ -144,4 +144,4 @@ "outputs": [] } ] -} +} \ No newline at end of file diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 92b9ee6a..1a320c63 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -21,6 +21,8 @@ "source": [ "#!import \"DataModel/DataStructure\"", "\n#!import \"Report/ReportMutableScopes\"", + "\n#!import \"Report/ReportMutableScopesInteractive\"", + "\n#!import \"Report/ParameterReportMutableScopeInteractive\"", "\n#!import \"Import/Importers\"", "\n#!import \"Export/ExportConfiguration\"", "\n#!import \"Utils/TestHelper\"", @@ -34,7 +36,34 @@ { "cell_type": "code", "source": [ - "var ifrs17 = new Ifrs17(Workspace, Scopes, Report);" + "var ifrs17 = new Ifrs17(Workspace, Scopes, Report, Export);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ifrs17Interactive = new Ifrs17Interactive(Workspace, Report, Export, InteractiveObject);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var parameterInteractive = new InteractiveParameterReports(Workspace, Report, Export, InteractiveObject);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index d3077e10..42f05dcd 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -217,6 +217,28 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Import Types" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static class ImportTypes{", + "\n public const string ExchangeRate = nameof(ExchangeRate);", + "\n public const string PartnerRating = nameof(PartnerRating);", + "\n public const string CreditDefaultRate = nameof(CreditDefaultRate);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ @@ -393,6 +415,32 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Parameter Reports" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static class ParameterReportType{", + "\n public const string DataNodeReport = nameof(DataNodeReport);", + "\n public const string DataNodeStateReport = nameof(DataNodeStateReport);", + "\n public const string YieldCurves = nameof(YieldCurves);", + "\n public const string SingleDataNodeReport = nameof(SingleDataNodeReport);", + "\n public const string InterDataNodeParameters = nameof(InterDataNodeParameters);", + "\n public const string PartnerRating = nameof(PartnerRating);", + "\n public const string PartnerDefaultRates = nameof(PartnerDefaultRates);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 6c4ba188..87a2a4a0 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -50,22 +50,22 @@ { "cell_type": "code", "source": [ - "#r \"nuget:Systemorph.Activities,1.6.2\"", - "\n#r \"nuget:Systemorph.Arithmetics,1.6.2\"", - "\n#r \"nuget:Systemorph.Workspace,1.6.3\"", - "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.2\"", - "\n#r \"nuget:Systemorph.SharePoint,1.6.2\"", - "\n#r \"nuget:Systemorph.OneDrive,1.6.2\"", - "\n#r \"nuget:Systemorph.Scopes,1.6.2\"", - "\n#r \"nuget:Systemorph.Import,1.6.6\"", - "\n#r \"nuget:Systemorph.Test,1.6.2\"", - "\n#r \"nuget:Systemorph.Export,1.6.6\"", + "#r \"nuget:Systemorph.Activities,1.6.5\"", + "\n#r \"nuget:Systemorph.Arithmetics,1.6.5\"", + "\n#r \"nuget:Systemorph.Workspace,1.6.4\"", + "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.5\"", + "\n#r \"nuget:Systemorph.SharePoint,1.6.5\"", + "\n#r \"nuget:Systemorph.OneDrive,1.6.5\"", + "\n#r \"nuget:Systemorph.Scopes,1.6.5\"", + "\n#r \"nuget:Systemorph.Import,1.6.7\"", + "\n#r \"nuget:Systemorph.Test,1.6.5\"", + "\n#r \"nuget:Systemorph.Export,1.6.7\"", "\n#r \"nuget:Systemorph.DataSetReader,1.6.6\"", - "\n#r \"nuget:Systemorph.DataSource,1.6.3\"", - "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.3\"", - "\n#r \"nuget:Systemorph.Reporting,1.6.2\"", - "\n#r \"nuget:Systemorph.Charting,1.6.2\"", - "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.3\"" + "\n#r \"nuget:Systemorph.DataSource,1.6.4\"", + "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.4\"", + "\n#r \"nuget:Systemorph.Reporting,1.6.5\"", + "\n#r \"nuget:Systemorph.Charting,1.6.5\"", + "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.4\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb new file mode 100644 index 00000000..199703ff --- /dev/null +++ b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb @@ -0,0 +1,281 @@ +{ + "metadata": { + "authors": [], + "id": "XdWtZAfDUkKgJxSlrhCSSw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Import References" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"ReportMutableScopesInteractive\"", + "\n#!import \"ParameterReportsQueries\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Parameter Forms Entity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface ParameterReportFormsEntity : MutableScopeWithWorkspace", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [DropdownMethod(nameof(GetParameterReportTypes))]", + "\n string ReportType{get; set;}", + "\n", + "\n string[] GetParameterReportTypes() => typeof(ParameterReportType).GetAllPublicConstantValues();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Parameter Report Scope" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface ParameterReportScope: IMutableScope, ", + "\n ReportingNodeFormsEntity, ", + "\n MonthlyPeriodFormsEntity, ", + "\n ScenarioParameterFormsEntity,", + "\n CurrencyFormsEntity, ", + "\n ParameterReportFormsEntity", + "\n{", + "\n protected IPivotFactory report => GetStorage().Report;", + "\n protected IExportVariable export => GetStorage().Export;", + "\n protected int headerColumnWidthValue => 250;", + "\n", + "\n HashSet<(ReportIdentity, CurrencyType)> GetDataIdentities() => GetStorage().GetIdentities((Year, Month), ReportingNode, Scenario, CurrencyType); ", + "\n", + "\n", + "\n ImportArgs GetArgs() => new ImportArgs(ReportingNode, Year, Month, default, Scenario, default); ", + "\n", + "\n async Task GetDataNodeReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetDataNodeDataReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.Portfolio)", + "\n .GroupRowsBy(x => x.DataNode)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetDataNodeStatesReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetDataNodeStateReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetYieldCurvesReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetYieldCurveReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.YieldCurveType)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetSingleDataNodeReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetSingleDataNodeReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetInterDataNodeParametersReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetInterDataNodeParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupRowsBy(x => x.LinkedDataNode)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetPartnerRatingReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetPartnerRatingsReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.Partner)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task GetDefaultRatesReport()", + "\n {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var data = await workspace.GetCreditDefaultRatesReportParametersAsync(GetArgs());", + "\n return await report.ForObjects(data)", + "\n .WithQuerySource(workspace)", + "\n .GroupRowsBy(x => x.CreditRiskRating)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task ToReport() => ReportType switch", + "\n {", + "\n ParameterReportType.DataNodeReport => await GetDataNodeReport(), ", + "\n ParameterReportType.DataNodeStateReport => await GetDataNodeStatesReport(), ", + "\n ParameterReportType.YieldCurves => await GetYieldCurvesReport(), ", + "\n ParameterReportType.SingleDataNodeReport => await GetSingleDataNodeReport(), ", + "\n ParameterReportType.InterDataNodeParameters => await GetInterDataNodeParametersReport(), ", + "\n ParameterReportType.PartnerRating => await GetPartnerRatingReport(), ", + "\n ParameterReportType.PartnerDefaultRates => await GetDefaultRatesReport(),", + "\n _ => null", + "\n };", + "\n", + "\n void Init(){", + "\n var task = InitReportStorageScopeAsync();", + "\n task.Wait();", + "\n }", + "\n", + "\n async Task InitReportStorageScopeAsync() { ", + "\n await GetStorage().InitializeReportIndependentCacheAsync();", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Interactive Parameter " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "class InteractiveParameterReports", + "\n{", + "\n private IPivotFactory report;", + "\n private IExportVariable export;", + "\n private InteractiveObjectVariable interactiveObject;", + "\n public ReportStorage storage;", + "\n", + "\n private IDictionary interactiveObjectCache = new Dictionary();", + "\n ", + "\n public InteractiveParameterReports(IWorkspace workspace, ", + "\n IPivotFactory report, ", + "\n IExportVariable export, ", + "\n InteractiveObjectVariable interactiveObject)", + "\n {", + "\n this.report = report;", + "\n this.export = export;", + "\n this.interactiveObject = interactiveObject;", + "\n this.storage = new ReportStorage(workspace, report, export);", + "\n }", + "\n", + "\n public void Reset(IWorkspace workspace)", + "\n {", + "\n storage = new ReportStorage(workspace, report, export);", + "\n interactiveObjectCache = new Dictionary() {};", + "\n }", + "\n", + "\n public ParameterReportScope GetReportScope(string name = null) where T : ParameterReportScope => ", + "\n interactiveObject.State.GetScope(name ?? typeof(T).Name, o => o.WithStorage(storage));", + "\n", + "\n public InteractiveObjectView GetFormsEntity(string name = null)", + "\n where T : ParameterReportScope", + "\n {", + "\n var key = name ?? typeof(T).Name;", + "\n if (!interactiveObjectCache.TryGetValue($\"{key}FormsEntity\", out var ret))", + "\n ret = interactiveObjectCache[$\"{key}FormsEntity\"] = interactiveObject.CreateView($\"{key}FormsEntity\", ", + "\n _ => GetReportScope(name : \"ParameterReports\"));", + "\n return ret;", + "\n }", + "\n", + "\n public InteractiveObjectView GetReport(string name = null)", + "\n where T : ParameterReportScope", + "\n {", + "\n var key = name ?? typeof(T).Name;", + "\n if (!interactiveObjectCache.TryGetValue(key, out var ret))", + "\n ret = interactiveObjectCache[key] = interactiveObject.CreateView(key, ", + "\n _ => GetReportScope(name : \"ParameterReports\").ToReport());", + "\n return ret;", + "\n }", + "\n", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index 5920a2cb..2a93bd7a 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -29,7 +29,8 @@ "cell_type": "code", "source": [ "#!import \"../Utils/EqualityComparers\"", - "\n#!import \"../Utils/Queries\"" + "\n#!import \"../Utils/Queries\"", + "\n#!import \"../Utils/ActivityLog\"" ], "metadata": {}, "execution_count": 0, @@ -182,6 +183,47 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Mutable Reporting Scopes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static string ParseReportingPeriodToDisplayString(int year, int periodOfYear, char separator) => $\"{year} {separator}{periodOfYear}\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static string ParseDimensionToDisplayString(string systemName, string displayName) => $\"{displayName} ({systemName})\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task<(IDictionary, IReadOnlyCollection)> GetAutocompleteMappings (this IQuerySource querySource, bool hasNullAsFirstValue = default) where T : KeyedDimension {", + "\n var query = await querySource.Query().Select(x => new { x.SystemName, GuiName = ParseDimensionToDisplayString(x.SystemName, x.DisplayName), Order = 0 }).ToArrayAsync(); //TODO extentions: populate order if type T is an orderedDimension. If it is a Hierarchical dimension then the order ", + "\n var mappingDictionary = query.SelectMany(x => new [] { new {GuiName = x.SystemName, x.SystemName}, new {GuiName = x.GuiName, x.SystemName} }).ToDictionary(x => x.GuiName, x => x.SystemName);", + "\n var orderedDropDownValues = query.OrderBy(x => x.Order).ThenBy(x => x.GuiName).Select(x => x.GuiName);", + "\n return (mappingDictionary, (hasNullAsFirstValue ? new string[]{ null }.Concat(orderedDropDownValues) : orderedDropDownValues).ToArray());", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index d77923d7..54f8d8f3 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -332,18 +332,23 @@ "\n{", "\n private Systemorph.Vertex.Scopes.Proxy.IScopeFactory scopes;", "\n private Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory report;", + "\n private IExportVariable export;", "\n private ReportStorage Storage;", "\n private ReportUniverse reportUniverse;", "\n ", "\n //reset", - "\n public void Reset(IWorkspace workspace) => Storage = new ReportStorage(workspace, report);", + "\n public void Reset(IWorkspace workspace) => Storage = new ReportStorage(workspace, report, export);", "\n", "\n //constructor", - "\n public Ifrs17 (IWorkspace workspace, Systemorph.Vertex.Scopes.Proxy.IScopeFactory scopes, Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory report)", + "\n public Ifrs17 (IWorkspace workspace, ", + "\n Systemorph.Vertex.Scopes.Proxy.IScopeFactory scopes, ", + "\n Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory report,", + "\n IExportVariable export)", "\n {", "\n this.scopes = scopes; ", - "\n this.report = report; ", - "\n Storage = new ReportStorage(workspace, report);", + "\n this.report = report;", + "\n this.export = export;", + "\n Storage = new ReportStorage(workspace, report, export);", "\n reportUniverse = scopes.ForSingleton().WithStorage(Storage).ToScope();", "\n }", "\n", diff --git a/ifrs17/Report/ReportMutableScopesInteractive.ipynb b/ifrs17/Report/ReportMutableScopesInteractive.ipynb new file mode 100644 index 00000000..26fb0f69 --- /dev/null +++ b/ifrs17/Report/ReportMutableScopesInteractive.ipynb @@ -0,0 +1,1104 @@ +{ + "metadata": { + "authors": [], + "id": "SuppWclYnkyuC51Dlg-6Rg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "", + "\n

Report Mutable Scopes

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This notebook contains the set up of mutable scopes used to achieve high interactivity with reports." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# References", + "\nLibraries and other notebooks which are needed for this notebook are imported below." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"ReportScopes\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using Systemorph.Vertex.Pivot.Builder.Interfaces;", + "\nusing Systemorph.InteractiveObjects;", + "\nusing Systemorph.Vertex.Session;", + "\nusing Systemorph.Vertex.Export;", + "\nusing Systemorph.Vertex.Export.Factory;", + "\nusing Systemorph.Vertex.InteractiveObjects;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Form Entity Scopes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Helper Scopes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface MutableScopeWithWorkspace : IMutableScopeWithStorage ", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n protected IWorkspace workspace => GetStorage().Workspace; ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Currency Type" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface CurrencyFormsEntity : IMutableScope {", + "\n [DropdownEnum(typeof(CurrencyType))]", + "\n CurrencyType CurrencyType { get; set; } ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface ScenarioFormsEntity : MutableScopeWithWorkspace ", + "\nwhere TStorage : ReportStorage ", + "\n{", + "\n [DropdownMethod(nameof(GetScenarioAutocompleteAsync))]", + "\n [Display(Name = \"Scenario\")]", + "\n string ScenarioControl { get; set; }", + "\n", + "\n [NotVisible] IDictionary ScenarioMapping { get; set; }", + "\n protected string Scenario => !string.IsNullOrWhiteSpace(ScenarioControl) && ", + "\n ScenarioMapping is not null && ", + "\n ScenarioMapping.TryGetValue(ScenarioControl, out var value) ", + "\n ? value ", + "\n : null;", + "\n ", + "\n async Task> GetScenarioAutocompleteAsync(string userInput, int page, int pageSize) {", + "\n (ScenarioMapping, var orderedDropDownValues) = await workspace.GetAutocompleteMappings(true);", + "\n ScenarioMapping[Scenarios.Delta] = Scenarios.Delta; //TODO this behavior needs to be updated. PR#217", + "\n ScenarioMapping[Scenarios.All] = Scenarios.All;", + "\n return orderedDropDownValues.Concat(new string[] {Scenarios.Delta, Scenarios.All})", + "\n .Where(x => userInput == null || x.Contains(userInput, StringComparison.OrdinalIgnoreCase))", + "\n .ToArray(); ", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface ScenarioParameterFormsEntity : ScenarioFormsEntity", + "\nwhere TStorage : ReportStorage ", + "\n{", + "\n async Task> GetScenarioAutocompleteAsync(string userInput, int page, int pageSize) {", + "\n (ScenarioMapping, var orderedDropDownValues) = await workspace.GetAutocompleteMappings(true);", + "\n return orderedDropDownValues.Where(x => userInput == null || x.Contains(userInput, StringComparison.OrdinalIgnoreCase))", + "\n .ToArray(); ", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reporting Node" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(InitReportingNode))]", + "\npublic interface ReportingNodeFormsEntity : MutableScopeWithWorkspace ", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [DropdownMethod(nameof(GetReportingNodeAutocompleteAsync))]", + "\n [Display(Name = \"ReportingNode\")]", + "\n string ReportingNodeControl { get; set; }", + "\n", + "\n [NotVisible] IDictionary ReportingNodeMapping { get; set; }", + "\n protected string ReportingNode => !string.IsNullOrWhiteSpace(ReportingNodeControl) && ", + "\n ReportingNodeMapping is not null && ", + "\n ReportingNodeMapping.TryGetValue(ReportingNodeControl, out var value)", + "\n ? value", + "\n : GetStorage().InitialReportingNode.SystemName; // Maybe these cases can be more specific", + "\n", + "\n async Task> GetReportingNodeAutocompleteAsync(string userInput, int page, int pageSize) {", + "\n (ReportingNodeMapping, var orderedDropDownValues) = await workspace.GetAutocompleteMappings();", + "\n return orderedDropDownValues.Where(x => userInput == null || x.Contains(userInput, StringComparison.OrdinalIgnoreCase)).ToArray(); ", + "\n }", + "\n", + "\n void InitReportingNode() {", + "\n ReportingNodeControl = ParseDimensionToDisplayString(GetStorage().InitialReportingNode.SystemName, GetStorage().InitialReportingNode.DisplayName);", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reporting Period" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Monthly Period" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(InitReportingPeriod))]", + "\npublic interface MonthlyPeriodFormsEntity : MutableScopeWithWorkspace ", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [DropdownMethod(nameof(GetReportingPeriodAutocompleteAsync))]", + "\n string ReportingPeriod { get; set; }", + "\n", + "\n private char separator => 'M';", + "\n private string[] ReportingPeriodSplit => ReportingPeriod.Split(separator);", + "\n private int ParseReportingPeriod(int index) => !string.IsNullOrWhiteSpace(ReportingPeriod) && ReportingPeriodSplit is not null && Int32.TryParse(ReportingPeriodSplit.ElementAtOrDefault(index), out int value)", + "\n ? value", + "\n : default;", + "\n", + "\n protected int Year => ParseReportingPeriod(0);", + "\n protected int Month => ParseReportingPeriod(1);", + "\n", + "\n async Task> GetReportingPeriodAutocompleteAsync(string userInput, int page, int pageSize) => ", + "\n await workspace.Query()", + "\n .Where(x => x.Scenario == null)", + "\n .OrderByDescending(x => x.Year)", + "\n .ThenByDescending(x => x.Month)", + "\n .Select(x => ParseReportingPeriodToDisplayString(x.Year, x.Month, separator))", + "\n .Where(x => userInput == null || x.Contains(userInput, StringComparison.OrdinalIgnoreCase))", + "\n .ToArrayAsync();", + "\n", + "\n void InitReportingPeriod() {", + "\n ReportingPeriod = ParseReportingPeriodToDisplayString(GetStorage().InitialReportingPeriod.Year, GetStorage().InitialReportingPeriod.Month, separator);", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Filters" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(InitFilters))]", + "\npublic interface BasicFilterFormsEntity : MutableScopeWithWorkspace", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [DropdownMethod(nameof(GetFilterName))]", + "\n string FilterName { get; set; }", + "\n", + "\n [DropdownMethod(nameof(GetBasicFilterAsync))]", + "\n [Display(Name = \"Filter Value\")]", + "\n string FilterValueControl { get; set; }", + "\n", + "\n [DropdownValues(\"\", \"Add\", \"Remove\")]", + "\n string FilterAction { get; set; }", + "\n", + "\n protected string[] defaultFilters => new string[] {", + "\n \"\",", + "\n nameof(ReportVariable.GroupOfContract),", + "\n nameof(ReportVariable.Portfolio),", + "\n nameof(ReportVariable.LineOfBusiness),", + "\n //nameof(ReportVariable.AnnualCohort),", + "\n nameof(ReportVariable.LiabilityType),", + "\n nameof(ReportVariable.ValuationApproach),", + "\n nameof(ReportVariable.OciType),", + "\n nameof(ReportVariable.InitialProfitability), //(\\\"Profitability\\\")", + "\n };", + "\n", + "\n [NotVisible] IReadOnlyCollection specificFilters { get; set; }", + "\n IReadOnlyCollection GetFilterName() => defaultFilters.Union(specificFilters).ToArray();", + "\n", + "\n [NotVisible] IDictionary> FilterMapping { get; set; }", + "\n protected string FilterValue => !string.IsNullOrWhiteSpace(FilterName) && !string.IsNullOrWhiteSpace(FilterValueControl) && ", + "\n FilterMapping is not null && FilterMapping.TryGetValue(FilterName, out var inner) &&", + "\n inner.TryGetValue(FilterValueControl, out var value)", + "\n ? value", + "\n : null;", + "\n", + "\n async Task> GetFilterAutocompleteAsync() where T : KeyedDimension {", + "\n (var filterMapping, var orderedDropDownValues) = await workspace.GetAutocompleteMappings();", + "\n FilterMapping[typeof(T).Name] = filterMapping;", + "\n return orderedDropDownValues;", + "\n }", + "\n", + "\n async Task> GetBasicFilterAsync(string userInput, int page, int pageSize) =>", + "\n new string[]{ null }.Concat(", + "\n (FilterName switch", + "\n {", + "\n //GetAutocompleteMappings", + "\n nameof(ReportVariable.Portfolio) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.GroupOfContract) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.LineOfBusiness) => await GetFilterAutocompleteAsync(),", + "\n //nameof(ReportVariable.AnnualCohort) => //TODO the filter is not applied because the prop is an Int", + "\n nameof(ReportVariable.LiabilityType) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.ValuationApproach) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.OciType) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.InitialProfitability) => await GetFilterAutocompleteAsync(),", + "\n", + "\n nameof(ReportVariable.Novelty) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.VariableType) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.EconomicBasis) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.AmountType) => await GetFilterAutocompleteAsync(),", + "\n nameof(ReportVariable.EstimateType) => await GetFilterAutocompleteAsync(),", + "\n _ => Enumerable.Empty().ToArray()", + "\n }).Where(x => userInput == null || x.Contains(userInput, StringComparison.OrdinalIgnoreCase)).OrderBy(x => x)).ToArray();", + "\n ", + "\n [NotVisible] IReadOnlyCollection<(string filterName, string filterValue)> InputDataFilter { get; set; }", + "\n ", + "\n protected (string fileName, object filterValue)[] dataFilter => InputDataFilter.Select(x => (x.filterName, (object)x.filterValue)).ToArray(); //TODO this cast is needed by the Filter func", + "\n", + "\n IReadOnlyCollection<(string filterName, string filterValue)> GetFilters()", + "\n {", + "\n if(FilterAction == \"Add\")", + "\n AddFilter(FilterName, FilterValue);", + "\n if(FilterAction == \"Remove\")", + "\n RemoveFilter(FilterName, FilterValue);", + "\n return InputDataFilter;", + "\n }", + "\n", + "\n private void AddFilter(string filterName, string filterValue)", + "\n {", + "\n if(!InputDataFilter.Contains((filterName, filterValue)))", + "\n InputDataFilter = InputDataFilter.Append((filterName, filterValue)).ToArray();", + "\n }", + "\n ", + "\n private void RemoveFilter(string filterName, string filterValue)", + "\n {", + "\n if(InputDataFilter.Contains((filterName, filterValue)))", + "\n { var f = InputDataFilter.ToList();", + "\n f.Remove((filterName, filterValue));", + "\n InputDataFilter = f.ToArray();", + "\n }", + "\n }", + "\n", + "\n void InitFilters() {", + "\n FilterMapping = new Dictionary>() ;", + "\n InputDataFilter = Enumerable.Empty<(string, string)>().ToArray();", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Slice and Dice" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface BasicSliceAndDiceRowsFormsEntity : MutableScopeWithWorkspace ", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [NotVisible] string SliceRowName { get; set; }", + "\n", + "\n protected IReadOnlyCollection InputRowSlices => (SliceRowName is null ? Enumerable.Empty() : SliceRowName.RepeatOnce()).ToArray();", + "\n [NotVisible] IReadOnlyCollection defaultRowSlices { get; set; }", + "\n protected string[] rowSlices => defaultRowSlices.Union(InputRowSlices).ToArray();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface BasicSliceAndDiceColumnsFormsEntity : MutableScopeWithWorkspace ", + "\nwhere TStorage : ReportStorage", + "\n{", + "\n [DropdownMethod(nameof(GetSliceColumnNameAutocomplete))]", + "\n string SliceColumnName { get; set; }", + "\n", + "\n protected IReadOnlyCollection InputColumnSlices => (SliceColumnName is null ? Enumerable.Empty() : SliceColumnName.RepeatOnce()).ToArray();", + "\n [NotVisible] IReadOnlyCollection defaultColumnSlices { get; set; }", + "\n protected string[] columnSlices => defaultColumnSlices.Union(InputColumnSlices).ToArray();", + "\n", + "\n IReadOnlyCollection GetSliceColumnNameAutocomplete() => new [] {\"\", ", + "\n nameof(ReportVariable.ReportingNode), ", + "\n nameof(ReportVariable.Scenario),", + "\n nameof(ReportVariable.Portfolio), ", + "\n nameof(ReportVariable.GroupOfContract), ", + "\n nameof(ReportVariable.LineOfBusiness),", + "\n nameof(ReportVariable.LiabilityType),", + "\n nameof(ReportVariable.InitialProfitability),", + "\n nameof(ReportVariable.ValuationApproach),", + "\n nameof(ReportVariable.AnnualCohort),", + "\n nameof(ReportVariable.OciType),", + "\n nameof(ReportVariable.IsReinsurance),", + "\n nameof(ReportVariable.AccidentYear),", + "\n ", + "\n nameof(ReportVariable.AmountType),", + "\n nameof(ReportVariable.EstimateType),", + "\n nameof(ReportVariable.EconomicBasis)};", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Generic Report Scope and Data Scope" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface Data : IMutableScope<((int year, int month) reportingPeriod, string reportingNode, string scenario, CurrencyType currencyType, (string filterName, object filterValue)[] dataFilter)> {", + "\n IDataCube InputDataCube { get; set; }", + "\n IDataCube DataCube { get {", + "\n if(InputDataCube is null) return Enumerable.Empty().ToDataCube();", + "\n var filteredDataCube = (Identity.dataFilter is null || Identity.dataFilter.Length == 0) ", + "\n ? InputDataCube ", + "\n : InputDataCube.Filter(Identity.dataFilter); ", + "\n switch (Identity.scenario)", + "\n {", + "\n case null : return filteredDataCube.Where(x => x.Scenario == null).ToDataCube();", + "\n case Scenarios.All : return filteredDataCube.Select(x => x.Scenario == null ? x with {Scenario = Scenarios.Default } : x).ToDataCube();", + "\n case Scenarios.Delta : ", + "\n var bestEstimateById = filteredDataCube.Where(x => x.Scenario == null).ToDictionary(x => x.ToIdentityString());", + "\n return filteredDataCube.Select(x => x.Scenario == null ", + "\n ? x with { Scenario = Scenarios.Default } ", + "\n : x with { Value = x.Value - (bestEstimateById.TryGetValue((x with {Scenario = null}).ToIdentityString(), out var be)? be.Value : 0.0) }).ToDataCube(); ", + "\n default : return filteredDataCube.Filter((nameof(ReportVariable.Scenario), Identity.scenario));", + "\n }", + "\n }}", + "\n} " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface ReportScope : IMutableScope, ", + "\n ReportingNodeFormsEntity, ", + "\n MonthlyPeriodFormsEntity, ", + "\n ScenarioFormsEntity, ", + "\n CurrencyFormsEntity, ", + "\n BasicSliceAndDiceRowsFormsEntity, ", + "\n BasicSliceAndDiceColumnsFormsEntity, ", + "\n BasicFilterFormsEntity {", + "\n protected IPivotFactory report => GetStorage().Report;", + "\n protected IExportVariable export => GetStorage().Export;", + "\n protected int headerColumnWidthValue => 250;", + "\n", + "\n HashSet<(ReportIdentity, CurrencyType)> GetDataIdentities() => GetStorage().GetIdentities((Year, Month), ReportingNode, Scenario, CurrencyType); // TODO, add filter for identities, if the property is exposed at this level", + "\n", + "\n IDataCube GetData() => default;", + "\n", + "\n async Task ToReportAsync() {", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var dataScope = GetScope(((Year, Month), ReportingNode, Scenario, CurrencyType, dataFilter));", + "\n var dataCube = GetData();", + "\n // This is a temporary solution to avoid an error from the empty report", + "\n // Remove when the issue is solved on the platform - A.K.", + "\n if (!dataCube.ToArray().Any()) return null;", + "\n dataScope.InputDataCube = dataCube;", + "\n return await GetReportTaskAsync(dataScope.DataCube);", + "\n }", + "\n", + "\n // Using this routine is highly discouraged due to the mutlithreading issue -A.K.", + "\n // Avoid using these methods if working with the DB -- it will trigger synchronization error in access to the DB", + "\n async Task ToCsvAsync(string fileName){", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var dataScope = GetScope(((Year, Month), ReportingNode, Scenario, CurrencyType, dataFilter));", + "\n dataScope.InputDataCube = GetData();", + "\n return await export.ToCsv(fileName)", + "\n .ForDataCube(dataScope.DataCube, config => config.WithQuerySource(workspace)", + "\n .SliceRowsBy(rowSlices)", + "\n .SliceColumnsBy(columnSlices))", + "\n .WithActivityLog()", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n async Task ToExcelAsync(string fileName){", + "\n await GetStorage().InitializeAsync((Year, Month), ReportingNode, Scenario, CurrencyType);", + "\n var dataScope = GetScope(((Year, Month), ReportingNode, Scenario, CurrencyType, dataFilter));", + "\n dataScope.InputDataCube = GetData();", + "\n return await export.ToExcel(fileName)", + "\n .ForDataCube(dataScope.DataCube, config => config.WithQuerySource(workspace) ", + "\n .SliceRowsBy(rowSlices)", + "\n .SliceColumnsBy(columnSlices))", + "\n .WithActivityLog()", + "\n .ExecuteAsync();", + "\n }", + "\n ", + "\n async Task GetReportTaskAsync(IDataCube data) {", + "\n return await report.ForDataCube(data)", + "\n .WithQuerySource(workspace)", + "\n .SliceRowsBy(rowSlices)", + "\n .SliceColumnsBy(columnSlices)", + "\n .ReportGridOptions(headerColumnWidth: headerColumnWidthValue)", + "\n .ExecuteAsync();", + "\n }", + "\n", + "\n void Init(){", + "\n var task = InitReportStorageScopeAsync();", + "\n task.Wait();", + "\n }", + "\n", + "\n async Task InitReportStorageScopeAsync() { // This has the Async issue, but imo it should come in the future", + "\n await GetStorage().InitializeReportIndependentCacheAsync();", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Report Scopes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Best Estimate PV" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface PvReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().LockedBestEstimate + GetScopes(GetDataIdentities()).Aggregate().CurrentBestEstimate;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EconomicBasis) };", + "\n // SpecificFiltersFormEntity", + "\n specificFilters = new string[] {nameof(ReportVariable.AmountType)};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Risk Adjustment PV" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface RaReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().LockedRiskAdjustment + GetScopes(GetDataIdentities()).Aggregate().CurrentRiskAdjustment;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EconomicBasis) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## FCF PV" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface FcfReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Fcf;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EconomicBasis) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Written" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface WrittenReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Written;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.AmountType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Accruals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface AccrualReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Advance + GetScopes(GetDataIdentities()).Aggregate().Overdue;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency) };", + "\n // SpecificFiltersFormEntity", + "\n specificFilters = new string[] {nameof(ReportVariable.AmountType)};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Deferrals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface DeferralReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Deferrals;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Experience Adjustment" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface ExpAdjReport: ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().ActuarialExperienceAdjustment;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.EstimateType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.AmountType) };", + "\n // SpecificFiltersFormEntity", + "\n specificFilters = new string[] {nameof(ReportVariable.AmountType)};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Technical Margin" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface TmReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().LrcTechnicalMargin;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## CSM" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface CsmReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Csm + GetScopes(GetDataIdentities()).Aggregate().Lc + GetScopes(GetDataIdentities()).Aggregate().Loreco;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EstimateType) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## LRC" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface ActLrcReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().LrcActuarial;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EstimateType) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface LrcReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() =>GetScopes(GetDataIdentities()).Aggregate().Lrc;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EstimateType) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## LIC" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface ActLicReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().LicActuarial;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.Novelty), nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EstimateType) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface LicReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().Lic;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.VariableType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency), nameof(ReportVariable.EstimateType) };", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "[InitializeScope(nameof(Init))]", + "\npublic interface FpReport : ReportScope {", + "\n ", + "\n IDataCube ReportScope.GetData() => GetScopes(GetDataIdentities()).Aggregate().FinancialPerformance;", + "\n", + "\n void Init() {", + "\n // BasicSliceAndDiceFormsEntity", + "\n defaultRowSlices = new string[] { nameof(ReportVariable.VariableType), nameof(ReportVariable.EstimateType) };", + "\n defaultColumnSlices = new string[] { nameof(ReportVariable.Currency)};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# IFRS 17 Interactive " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This class is used to trigger the calculation of the reports and it is exposed to the end-user in the reports." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using Systemorph.Vertex.Pivot.Builder.Interfaces;", + "\nusing Systemorph.InteractiveObjects;", + "\nusing Systemorph.Vertex.Session;", + "\npublic class Ifrs17Interactive {", + "\n private IPivotFactory report;", + "\n private IExportVariable export;", + "\n private InteractiveObjectVariable interactiveObject;", + "\n private ReportStorage storage;", + "\n", + "\n private IDictionary interactiveObjectCache = new Dictionary();", + "\n", + "\n public Ifrs17Interactive (IWorkspace workspace, ", + "\n IPivotFactory report, ", + "\n IExportVariable export,", + "\n InteractiveObjectVariable interactiveObject)", + "\n {", + "\n this.report = report;", + "\n this.export = export;", + "\n this.interactiveObject = interactiveObject;", + "\n storage = new ReportStorage(workspace, report, export);", + "\n }", + "\n", + "\n public void Reset(IWorkspace workspace) {", + "\n storage = new ReportStorage(workspace, report, export);", + "\n interactiveObjectCache = new Dictionary();", + "\n }", + "\n", + "\n public InteractiveObjectView GetFormsEntity(string name = null) where T : ReportScope {", + "\n var key = name ?? typeof(T).Name;", + "\n if(!interactiveObjectCache.TryGetValue($\"{key}FormsEntity\", out var ret))", + "\n ret = interactiveObjectCache[$\"{key}FormsEntity\"] = interactiveObject.CreateView($\"{key}FormsEntity\", _ => GetReportScope(key));", + "\n return ret;", + "\n }", + "\n", + "\n public InteractiveObjectView GetReport(string name = null) where T : ReportScope {", + "\n var key = name ?? typeof(T).Name;", + "\n if(!interactiveObjectCache.TryGetValue(key, out var ret)){", + "\n ret = interactiveObjectCache[key] = interactiveObject.CreateView(key,", + "\n _ => {", + "\n var scope = GetReportScope(key);", + "\n var filters = scope.GetFilters(); // Not used and should be improved", + "\n return scope.ToReportAsync(); ", + "\n }); ", + "\n }", + "\n return ret;", + "\n }", + "\n", + "\n public async Task ExportToCsvAsync(string fileName, bool addDateTime = false)", + "\n where T : ReportScope", + "\n {", + "\n var fullFileName = addDateTime ? AttachDateTime(fileName) : fileName; ", + "\n var scope = GetReportScope();", + "\n var _ = scope.GetFilters();", + "\n return await scope.ToCsvAsync(fullFileName);", + "\n } ", + "\n", + "\n", + "\n public async Task ExportToExcelAsync(string fileName, bool addDateTime = false)", + "\n where T : ReportScope", + "\n {", + "\n var fullFileName = addDateTime ? AttachDateTime(fileName) : fileName;", + "\n var scope = GetReportScope();", + "\n var _ = scope.GetFilters();", + "\n return await scope.ToExcelAsync(fullFileName);", + "\n }", + "\n", + "\n private string ToTwoDigitString(int number ) => number.ToString().Length == 1 ? \"0\" + number.ToString() : number.ToString();", + "\n", + "\n private string AttachDateTime(string fileName)", + "\n {", + "\n DateTime creationTime = DateTime.UtcNow;", + "\n return fileName + \"_\" + creationTime.Year.ToString() + ToTwoDigitString(creationTime.Month) + ToTwoDigitString(creationTime.Day) +", + "\n ToTwoDigitString(creationTime.Hour) + ToTwoDigitString(creationTime.Minute) + ToTwoDigitString(creationTime.Second);", + "\n }", + "\n", + "\n // This routine is still buggy, triggering an infinite loop. -- A.K.", + "\n // public InteractiveObjectView ToExcelInteractive(string fileName, bool addDateTime = false, string name = null)", + "\n // where T : ReportScope", + "\n // {", + "\n // var key = name ?? typeof(T).Name;", + "\n // var fullFileName = addDateTime ? AttachDateTime(fileName) : fileName; ", + "\n // if (!interactiveObjectCache.TryGetValue($\"{key}.xlsx\", out var ret))", + "\n // ret = interactiveObjectCache[$\"{key}.xlsx\"] = interactiveObject.CreateView($\"{key}.xlsx\", _ => ", + "\n // {", + "\n // var scope = GetReportScope();", + "\n // var filters = scope.GetFilters();", + "\n // return scope.ToExcelAsync(fullFileName);", + "\n // });", + "\n // return ret;", + "\n // }", + "\n ", + "\n ", + "\n public ReportScope GetReportScope(string name = null) where T : ReportScope => interactiveObject.State.GetScope(name ?? typeof(T).Name, o => o.WithStorage(storage));", + "\n", + "\n // Keeping the old API", + "\n public ReportScope PresentValues => GetReportScope();", + "\n public ReportScope RiskAdjustments => GetReportScope();", + "\n public ReportScope FulfillmentCashflows => GetReportScope();", + "\n public ReportScope WrittenActuals => GetReportScope();", + "\n public ReportScope AccrualActuals => GetReportScope();", + "\n public ReportScope DeferralActuals => GetReportScope();", + "\n public ReportScope ExperienceAdjustments => GetReportScope();", + "\n public ReportScope TechnicalMargins => GetReportScope();", + "\n public ReportScope AllocatedTechnicalMargins => GetReportScope();", + "\n public ReportScope ActuarialLrc => GetReportScope();", + "\n public ReportScope Lrc => GetReportScope();", + "\n public ReportScope ActuarialLic => GetReportScope();", + "\n public ReportScope Lic => GetReportScope();", + "\n public ReportScope FinancialPerformance => GetReportScope(); ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb index af7efdf7..525773c1 100644 --- a/ifrs17/Report/ReportScopes.ipynb +++ b/ifrs17/Report/ReportScopes.ipynb @@ -212,6 +212,37 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "### Retrieve constant elements from a class" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using System.Reflection;", + "\npublic static T[] GetAllPublicConstantValues(this Type type, ", + "\n IList excludedTerms = null)", + "\n{", + "\n var selection = type", + "\n .GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)", + "\n .Where(fi => fi.IsLiteral && !fi.IsInitOnly && fi.FieldType == typeof(T))", + "\n .Select(x => (T)x.GetRawConstantValue())", + "\n .ToArray();", + "\n if (excludedTerms == null)", + "\n return selection;", + "\n else ", + "\n return selection.Where(x => !excludedTerms.Contains(x)).ToArray();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ diff --git a/ifrs17/Report/ReportStorage.ipynb b/ifrs17/Report/ReportStorage.ipynb index 7b381acd..3af872a6 100644 --- a/ifrs17/Report/ReportStorage.ipynb +++ b/ifrs17/Report/ReportStorage.ipynb @@ -105,14 +105,20 @@ { "cell_type": "code", "source": [ - "public class ReportStorage {", + "using Systemorph.Vertex.Export.Factory;", + "\npublic class ReportStorage {", "\n protected readonly IWorkspace workspace;", + "\n protected readonly IExportVariable export;", "\n private readonly Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchicalDimensionCache;", "\n private readonly Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory reportFactory;", "\n ", "\n // Current Storage Settings", "\n public ((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) Args {get; private set;}", "\n ", + "\n // Initial Values for Scopes DropDowns", + "\n public (string DisplayName, string SystemName) InitialReportingNode {get; private set;}", + "\n public (int Year, int Month) InitialReportingPeriod {get; private set;}", + "\n", "\n // Aux Data", "\n private Dictionary<(int year, int month), Dictionary>> exchangeRatesByCurrencyByFxTypeAndPeriod = new(); // Fx Rates", "\n private Dictionary<(int year, int month), Dictionary> fxPeriodsByAocStepAndPeriod = new(); // FxParameter", @@ -125,10 +131,13 @@ "\n private Dictionary<((int year, int month) period, string reportingNode, string scenario), Dictionary>>> variablesDictionary = new();", "\n ", "\n // Constructor", - "\n public ReportStorage(IWorkspace workspace, Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory reportFactory) {", + "\n public ReportStorage(IWorkspace workspace, ", + "\n Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory reportFactory, ", + "\n IExportVariable export) {", "\n this.workspace = workspace;", "\n this.hierarchicalDimensionCache = workspace.ToHierarchicalDimensionCache();", "\n this.reportFactory = reportFactory;", + "\n this.export = export;", "\n }", "\n ", "\n // Initializers", @@ -138,6 +147,12 @@ "\n await hierarchicalDimensionCache.InitializeAsync(); ", "\n await hierarchicalDimensionCache.InitializeAsync();", "\n await hierarchicalDimensionCache.InitializeAsync();", + "\n", + "\n // Initial Values", + "\n var mostRecentPartition = (await workspace.Query().Where(x => x.Scenario == null).OrderBy(x => x.Year).ThenBy(x => x.Month).ToArrayAsync()).LastOrDefault();", + "\n InitialReportingPeriod = (mostRecentPartition.Year, mostRecentPartition.Month);", + "\n var rootReportingNode = (await workspace.Query().Where(x => x.Parent == null).ToArrayAsync()).FirstOrDefault();", + "\n InitialReportingNode = (rootReportingNode.DisplayName, rootReportingNode.SystemName);", "\n }", "\n ", "\n public async Task InitializeAsync((int year, int month) period, string reportingNode, string scenario, CurrencyType currencyType) {", @@ -201,6 +216,7 @@ "\n // Other getters", "\n public IWorkspace Workspace => workspace;", "\n public Systemorph.Vertex.Pivot.Builder.Interfaces.IPivotFactory Report => reportFactory;", + "\n public IExportVariable Export => export;", "\n", "\n public Systemorph.Vertex.Hierarchies.IHierarchy GetHierarchy() where T : class, IHierarchicalDimension => hierarchicalDimensionCache.Get();", "\n ", diff --git a/ifrs17/Test/ReportStorageTest.ipynb b/ifrs17/Test/ReportStorageTest.ipynb index c27442c0..8d2c9414 100644 --- a/ifrs17/Test/ReportStorageTest.ipynb +++ b/ifrs17/Test/ReportStorageTest.ipynb @@ -72,7 +72,7 @@ "\n ", "\n //Create report storage", "\n var period = (year, month);", - "\n var reportStorage = new ReportStorage(Workspace, Report);", + "\n var reportStorage = new ReportStorage(Workspace, Report, Export);", "\n await reportStorage.InitializeReportIndependentCacheAsync();", "\n await reportStorage.InitializeAsync(period, \"G\", null, CurrencyType.Contractual);", "\n ", From 2488481a2bf815b1d421f844e7763b3020e34fad Mon Sep 17 00:00:00 2001 From: Teo Kukuljan <116903719+tkukuljan@users.noreply.github.com> Date: Fri, 24 Mar 2023 09:35:00 +0100 Subject: [PATCH 16/19] Reinsurance demo (#246) * starting with some data * refine gross data * remove old files * more data in * some more * some more file review * Precision and Report Scopes * improving reports nb * refinement * Reverting the changes and renaming the nominals * Reseting the change * separating the practical case tests * Reverting the merge mistakes and updating the ScenarioParametersImportTest * Reseting the disposable workspace back to the DataSource. * small doc update * Typo and update of Ifrs17 creation --------- Co-authored-by: Davide Colleoni --- .../Images/QuotaShareReinsurance.png | Bin 0 -> 19971 bytes .../Images/QuotaShareReinsurance2.png | Bin 0 -> 23869 bytes .../Actual_CH_2020_12_BE.csv | 11 + .../Actual_CH_2020_12_ELR60A70.csv | 11 + .../Actual_CH_2020_12_ELR60A80.csv | 11 + .../Actual_CH_2020_12_LR70.csv | 11 + .../Actual_CH_2020_12_LR80.csv | 11 + .../DataImport.ipynb | 283 +++++++++++ .../DataNodeParameters_CH_2020_12.csv | 11 + .../DataNodeStates_CH_2020_12.csv | 8 + .../DataNodes_CH.csv | 15 + .../NominalCashflows_CH_2020_12_BE.csv | 19 + .../NominalCashflows_CH_2020_12_LR70.csv | 19 + .../NominalCashflows_CH_2020_12_LR80.csv | 19 + .../CompareReinsuranceContracts/Reports.ipynb | 471 ++++++++++++++++++ .../CompareReinsuranceContracts/Scenarios.csv | 22 + .../CsmSwitchDataImport.ipynb | 15 +- .../CsmSwitchReports.ipynb | 9 + ifrs17-template/README.md | 9 +- ...pynb => PracticalCase-CSMSwitchTest.ipynb} | 2 +- ...PracticalCase-CompareReinsuranceTest.ipynb | 355 +++++++++++++ .../Test/ScenarioParametersImportTest.ipynb | 6 +- ifrs17-template/Test/Tests.ipynb | 13 +- ifrs17/Constants/Consts.ipynb | 1 + ifrs17/DataModel/DataStructure.ipynb | 6 +- ifrs17/Import/ImportScopeCalculation.ipynb | 8 +- ifrs17/Report/ReportMutableScopes.ipynb | 10 +- ifrs17/Report/ReportScopes.ipynb | 2 +- 28 files changed, 1331 insertions(+), 27 deletions(-) create mode 100644 ifrs17-template/Images/QuotaShareReinsurance.png create mode 100644 ifrs17-template/Images/QuotaShareReinsurance2.png create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_BE.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A70.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A80.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR70.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR80.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeParameters_CH_2020_12.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeStates_CH_2020_12.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodes_CH.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb create mode 100644 ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Scenarios.csv rename ifrs17-template/Test/{PracticalCasesTest.ipynb => PracticalCase-CSMSwitchTest.ipynb} (98%) create mode 100644 ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb diff --git a/ifrs17-template/Images/QuotaShareReinsurance.png b/ifrs17-template/Images/QuotaShareReinsurance.png new file mode 100644 index 0000000000000000000000000000000000000000..242ca1344b6f169c47d994826cb3fda674a9a4bf GIT binary patch literal 19971 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 XsnC_V+a|jpzLye{6D<~g>-+x!M&xtb literal 0 HcmV?d00001 diff --git a/ifrs17-template/Images/QuotaShareReinsurance2.png b/ifrs17-template/Images/QuotaShareReinsurance2.png new file mode 100644 index 0000000000000000000000000000000000000000..5e504624cec97621d8a0aa3b7ed2ca7cabb92391 GIT binary patch literal 23869 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 z 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 literal 0 HcmV?d00001 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_BE.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_BE.csv new file mode 100644 index 00000000..14f9777c --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_BE.csv @@ -0,0 +1,11 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2020,12,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +RP1.1,CF,PR,A,,1000 +RP1.1,CF,NIC,A,,-600 +RP1.1,CF,AEM,A,,-300 +RPR1.1,CF,PR,A,,-300 +RPR1.1,CF,NIC,A,,180 +RPR1.1,CF,AC,A,,105 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A70.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A70.csv new file mode 100644 index 00000000..68943f13 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A70.csv @@ -0,0 +1,11 @@ +@@Main,,,,, +ReportingNode,Year,Month,Scenario,, +CH,2020,12,ELR60A70,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +RP1.1,CF,PR,A,,1000 +RP1.1,CF,NIC,A,,-700 +RP1.1,CF,AEM,A,,-300 +RPR1.1,CF,PR,A,,-300 +RPR1.1,CF,NIC,A,,210 +RPR1.1,CF,AC,A,,105 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A80.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A80.csv new file mode 100644 index 00000000..e58f9304 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_ELR60A80.csv @@ -0,0 +1,11 @@ +@@Main,,,,, +ReportingNode,Year,Month,Scenario,, +CH,2020,12,ELR60A80,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +RP1.1,CF,PR,A,,1000 +RP1.1,CF,NIC,A,,-800 +RP1.1,CF,AEM,A,,-300 +RPR1.1,CF,PR,A,,-300 +RPR1.1,CF,NIC,A,,240 +RPR1.1,CF,AC,A,,105 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR70.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR70.csv new file mode 100644 index 00000000..025df1ea --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR70.csv @@ -0,0 +1,11 @@ +@@Main,,,,, +ReportingNode,Year,Month,Scenario,, +CH,2020,12,LR70,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +RP1.1,CF,PR,A,,1000 +RP1.1,CF,NIC,A,,-700 +RP1.1,CF,AEM,A,,-300 +RPR1.1,CF,PR,A,,-300 +RPR1.1,CF,NIC,A,,210 +RPR1.1,CF,AC,A,,105 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR80.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR80.csv new file mode 100644 index 00000000..38aba505 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Actual_CH_2020_12_LR80.csv @@ -0,0 +1,11 @@ +@@Main,,,,, +ReportingNode,Year,Month,Scenario,, +CH,2020,12,LR80,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +RP1.1,CF,PR,A,,1000 +RP1.1,CF,NIC,A,,-800 +RP1.1,CF,AEM,A,,-300 +RPR1.1,CF,PR,A,,-300 +RPR1.1,CF,NIC,A,,240 +RPR1.1,CF,AC,A,,105 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb new file mode 100644 index 00000000..71c126c7 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb @@ -0,0 +1,283 @@ +{ + "metadata": { + "authors": [], + "id": "YGWMnwRniU64QZaE2oBrFw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Contractual Service Margin and Loss Component Switch Data Import

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This is the Data Import notebook for the Contractual Service Margin and Loss Component Switch case.", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Set up and data import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Reference Data and Parameters" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../../Initialization/InitSystemorphRefDataToMemory\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Scenarios" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Scenarios.csv\").WithType().WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Data Nodes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Best Estimate - Loss Ratio 60%" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### importing first GIC: 2020 12 for fully retrospective calculation and 2021 3 for the current calculation" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actual_CH_2020_12_BE.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_CH_2020_12_BE.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Import Scenarios" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Loss Ratio 70%" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actual_CH_2020_12_LR70.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_CH_2020_12_LR70.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Loss Ratio 80%" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actual_CH_2020_12_LR80.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_CH_2020_12_LR80.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Expected Loss Ratio 60% (BE) Actual 70%" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actual_CH_2020_12_ELR60A70.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Expected Loss Ratio 60% (BE) Actual 80%" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actual_CH_2020_12_ELR60A80.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).WithActivityLog().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Initialize Workspace" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\nWorkspace.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeParameters_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeParameters_CH_2020_12.csv new file mode 100644 index 00000000..bb53a8a8 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeParameters_CH_2020_12.csv @@ -0,0 +1,11 @@ +@@Main,, +ReportingNode,Year,Month,Scenario +CH,2020,12 +,, +@@SingleDataNodeParameter,, +DataNode,PremiumAllocation, +RP1.1,0.0 +,, +@@InterDataNodeParameter,, +DataNode,LinkedDataNode,ReinsuranceCoverage +RP1.1,RPR1.1,0.3 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeStates_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeStates_CH_2020_12.csv new file mode 100644 index 00000000..576d5bd0 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodeStates_CH_2020_12.csv @@ -0,0 +1,8 @@ +@@Main +ReportingNode,Year,Month,Scenario +CH,2020,12, + +@@DataNodeState,, +DataNode,State, +RP1.1,Active, +RPR1.1,Active, diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodes_CH.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodes_CH.csv new file mode 100644 index 00000000..ca3696e5 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataNodes_CH.csv @@ -0,0 +1,15 @@ +@@Main +ReportingNode +CH +@@InsurancePortfolio +SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType, +RP1,Insurance Portfolio,USD,ANN,BBA,Default, +@@GroupOfInsuranceContract +SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability, +RP1.1,Gross Business Reinsured,RP1,2020,LRC,O, +@@ReinsurancePortfolio +SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType, +RPR1,Reinsurance Portfolio,USD,ANN,BBA,Default, +@@GroupOfReinsuranceContract +SystemName,DisplayName,ReinsurancePortfolio,AnnualCohort,LiabilityType,Profitability,Partner +RPR1.1,Reinsurance Contract,RPR1,2020,LRC,P,PT1 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv new file mode 100644 index 00000000..11b389f9 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_BE.csv @@ -0,0 +1,19 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, +CH,2020,12,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,,CU,CL,C,,50,50,50,50,50,50,50,50,50,50,50,50 +RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,NIC,BE,BOP,N,,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50 +RP1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,AEM,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RP1.1,AEM,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,PR,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RPR1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,NIC,BE,BOP,N,,15,15,15,15,15,15,15,15,15,15,15,15 +RPR1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,AC,BE,BOP,N,,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75 +RPR1.1,AC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv new file mode 100644 index 00000000..c0bd388a --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR70.csv @@ -0,0 +1,19 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, +CH,2020,12,LR70,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,,CU,CL,C,,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333,58.33333333 +RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,NIC,BE,BOP,N,,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333,-58.33333333 +RP1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,AEM,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RP1.1,AEM,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,PR,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RPR1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,NIC,BE,BOP,N,,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5,17.5 +RPR1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,AC,BE,BOP,N,,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75 +RPR1.1,AC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv new file mode 100644 index 00000000..6f1d5cdb --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/NominalCashflows_CH_2020_12_LR80.csv @@ -0,0 +1,19 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,, +CH,2020,12,LR80,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +RP1.1,,CU,CL,C,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RPR1.1,,CU,CL,C,,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667,66.66666667 +RP1.1,PR,BE,BOP,N,,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333,83.33333333 +RP1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,NIC,BE,BOP,N,,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667,-66.66666667 +RP1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RP1.1,AEM,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RP1.1,AEM,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,PR,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +RPR1.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,NIC,BE,BOP,N,,20,20,20,20,20,20,20,20,20,20,20,20 +RPR1.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +RPR1.1,AC,BE,BOP,N,,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75,8.75 +RPR1.1,AC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb new file mode 100644 index 00000000..db07a7b7 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb @@ -0,0 +1,471 @@ +{ + "metadata": { + "authors": [], + "id": "fSGCg42oXUOYruTUQPiNXg", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Quota Share Reinsurance

", + "\n", + "\n

Loss Ratio analysis

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Case Study", + "\n", + "\n## Modelling Cash-flow inputs", + "\n", + "\nA simple Group of Insurance Contract with New Business and End Of Period runs is modeled over one year period with an expected Loss Ratio (LR) of 60%. We modeled the cashflows evenly distributed over time for both premium (1000 USD total), Claims, and Expenses (estimated to be 30% of Premiums). A Reinsurance Contract covers the above mentioned Insurance Contract. A Quota Share of 30% is considered and a Reinsurance Commission of 35% on the Reinsurance Premiums is modeled. Actual values entered matching the expected values. ", + "\n", + "\nAll these parameters are summarized in the following tables: ", + "\n

", + "\n| Insurance Contract | ||| Reinsurance Contract | |", + "\n|-----------------------|------|-|-----------------------|------|", + "\n| Total Premium (USD) | 1000 ||| Cession Share | 30% |", + "\n| Internal Expense | 30% ||| Commission | 35% |", + "\n
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenarios ", + "\n", + "\nThe inputs descibed in [Modelling Cash-flow inputs](#modelling-cash-flow-inputs) defines the so called \"Best Estimate\" Scenario. This corresponds to what is expected to happen in reality. A scenario analysis is required by IFRS 17 Standards and it can be useful in many cases to analyse risks and take decisions on the future. For example one can easily study how the profit of the Insurance and Reinsuance Contracts modelled with the above mentioned parameter would perform under different values of Loss Ratio. ", + "\n

", + "\n
", + "\n", + "\n", + "\n


", + "\n
", + "\nIn the best estimate scenario (Loss Ratio 60%) we expect the net result of the Insurance and Reinsurance Group Contracts to be profitable, but the costs of having a Reinsurance Contract lower the total profit of the Insurance Group of Contract stand alone. At Loss Ratio of 70% the Group of Insurance Contracts is very close to zero margin and raising futher the Loss Ratio to 80% a Loss making scenario is obtained, where the effect of the Reinsurance contract clearly mitigates the losses as shown by the Net view. ", + "\n

", + "\nIn the current use case, we analyse the impact of the Loss Ratio on the relevant figures computed under IFRS 17 using our standard solution implementation.", + "\nFor simplicity, we consider the contribution of Risk Adjustment to be zero and locked-in and current yield curves are the same. ", + "\nWe have defined four scenarios in addition to the best estimate. We considered variations to the Loss Ratio up to 70% and 80%. In addition, we also studied the cases of having modelled the input cash flow assuming a Loss Ratio of 60% but the incurred actual cash flow producing a Loss Ratio of 70% and 80%. ", + "\n

", + "\n", + "\n| Scenario | Expected Loss Ratio | Actual Loss Ratio |", + "\n|------------------------------|---------------------|--------------------|", + "\n| Best Estimate | 60% | as expected |", + "\n| Loss Ratio 70 | 70% | as expected |", + "\n| Loss Ratio 80 | 80% | as expected |", + "\n| Expected LR 60 Actual LR 70 | 60% | 70% |", + "\n| Expected LR 60 Actual LR 80 | 60% | 80% |", + "\n", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"DataImport\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "ifrs17 = new Ifrs17(Workspace, Scopes, Report, Export);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reportingYear = 2020; ", + "\nvar reportingMonth = 12;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Best Estimate", + "\n", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var pv = ifrs17.PresentValues;", + "\npv.ReportingNode = \"CH\";", + "\npv.ReportingPeriod = (reportingYear, reportingMonth);", + "\npv.CurrencyType = CurrencyType.Contractual;", + "\npv.ColumnSlices = new string[]{\"Scenario\",\"GroupOfContract\", \"AmountType\"};", + "\npv.DataFilter = new [] {(\"EconomicBasis\", \"L\")};//,(\"Scenario\",\"!ELR60A70\"),(\"Scenario\",\"!ELR60A80\")};", + "\npv.Scenario = \"All\";// null;//\"LR70\";//\"All\";", + "\n(await pv.ToReportAsync)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Written Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var writtenActual = ifrs17.WrittenActuals;", + "\nwrittenActual.ReportingNode = \"CH\";", + "\nwrittenActual.ReportingPeriod = (reportingYear, reportingMonth);", + "\nwrittenActual.ColumnSlices = new string[]{\"Scenario\", \"GroupOfContract\"};", + "\nwrittenActual.DataFilter = null;", + "\nwrittenActual.Scenario = \"All\";", + "\n(await writtenActual.ToReportAsync) with { GroupDefaultExpanded = 0}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Actuarial Experience Adjustment" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var experienceAdjustments = ifrs17.ExperienceAdjustments;", + "\nexperienceAdjustments.ReportingNode = \"CH\";", + "\nexperienceAdjustments.ReportingPeriod = (reportingYear, reportingMonth);", + "\nexperienceAdjustments.ColumnSlices = new string[]{\"Scenario\",\"GroupOfContract\"};//\"GroupOfContract\", \"AmountType\"", + "\nexperienceAdjustments.RowSlices = new string[]{\"AmountType\",\"EstimateType\"};//\"GroupOfContract\", \"AmountType\"", + "\nexperienceAdjustments.DataFilter = null; //new [] {(\"Scenario\", \"!LR70\"),(\"Scenario\", \"!LR80\")};", + "\nexperienceAdjustments.Scenario = \"All\";", + "\n(await experienceAdjustments.ToReportAsync) with { GroupDefaultExpanded = 0}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Contractual Service Margin / Loss Component" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allocatedTechnicalMargins = ifrs17.AllocatedTechnicalMargins;", + "\nallocatedTechnicalMargins.ReportingNode = \"CH\";", + "\nallocatedTechnicalMargins.ReportingPeriod = (reportingYear, reportingMonth);", + "\nallocatedTechnicalMargins.ColumnSlices = new string[]{\"Scenario\", \"GroupOfContract\", \"EstimateType\"};", + "\nallocatedTechnicalMargins.DataFilter = new [] {(\"Scenario\",\"!ELR60A70\"),(\"Scenario\",\"!ELR60A80\")}; //new [] {(\"Scenario\", \"!LR70\"),(\"Scenario\", \"!LR80\")};", + "\n//allocatedTechnicalMargins.Scenario = null;", + "\nallocatedTechnicalMargins.Scenario = \"All\";", + "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# LRC Actuarial", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuarialLrc = ifrs17.ActuarialLrc;", + "\nactuarialLrc.ReportingNode = \"CH\";", + "\nactuarialLrc.ReportingPeriod = (reportingYear, reportingMonth);", + "\nactuarialLrc.ColumnSlices = new string[]{\"Scenario\",\"GroupOfContract\",\"EstimateType\"};", + "\nactuarialLrc.DataFilter = new [] {(\"Scenario\",\"!ELR60A70\"),(\"Scenario\",\"!ELR60A80\")};", + "\nactuarialLrc.Scenario = \"All\";", + "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Financial Performance", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var financialPerformance = ifrs17.FinancialPerformance;", + "\nfinancialPerformance.ReportingNode = \"CH\";", + "\nfinancialPerformance.ReportingPeriod = (reportingYear, reportingMonth);", + "\nfinancialPerformance.ColumnSlices = new string[]{\"Scenario\", \"GroupOfContract\"};", + "\nfinancialPerformance.RowSlices = new string[]{\"AmountType\"};", + "\nfinancialPerformance.DataFilter = null; //new []{(\"Scenario\",\"!LR70\"),(\"Scenario\",\"!ELR60A70\")};//new []{(\"Scenario\",\"!ELR60A70\"),(\"Scenario\",\"!ELR60A80\")};", + "\nfinancialPerformance.Scenario = \"All\";", + "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Key Performance Indicators (KPIs)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Contractual Service Margine : value creation" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### New Business" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var csmNb = allocatedTechnicalMargins.GetDataCube().Where(x => x.VariableType == \"BOP\")", + "\n .Select(x => x.Scenario == null ? x with {Scenario = \"Best Estimate\"} : x);", + "\n // .Select(x => x.Scenario == null ? x with {Scenario = \"Best Estimate\", ", + "\n // Value = x.EstimateType == \"C\" ? -x.Value : x.Value} : x with {Value = x.EstimateType == \"C\" ? -x.Value : x.Value});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForDataCube(csmNb.ToDataCube()).WithQuerySource(Workspace)", + "\n .SliceRowsBy(\"VariableType\",\"GroupOfContract\")", + "\n .SliceColumnsBy(new[]{\"Currency\",\"Scenario\"})", + "\n .ReportGridOptions().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Amortization" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var csmAM = allocatedTechnicalMargins.GetDataCube().Where(x => x.VariableType == \"AM\" && Math.Abs(x.Value) > 10E-5)", + "\n .Select(x => x.Scenario == null ? x with {Scenario = \"Best Estimate\", ", + "\n Value = x.EstimateType == \"C\" ? -x.Value : x.Value} : x with {Value = x.EstimateType == \"C\" ? -x.Value : x.Value});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForDataCube(csmAM.ToDataCube()).WithQuerySource(Workspace)", + "\n .SliceRowsBy(\"VariableType\",\"GroupOfContract\")", + "\n .SliceColumnsBy(new[]{\"Currency\",\"Scenario\",\"EstimateType\"})", + "\n .ReportGridOptions(headerColumnWidth: 300).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Total Comprehensive Income : profitability", + "\nIn absence of the Other Comprehensive Income (OCI) this corresponds to the Profit and Loss as locked-in and current yield curves are the same. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var tci = financialPerformance.GetDataCube().Select(x => x.Scenario == null ? x with {Scenario = \"Best Estimate\"} : x);", + "\nvar hierarchicalDimension = Workspace.ToHierarchicalDimensionCache();", + "\nawait hierarchicalDimension.InitializeAsync(); ", + "\nvar pnl = tci.Where(x => hierarchicalDimension.Get().Ancestors(x.VariableType, includeSelf: true).Any(x => x.SystemName == \"PNL\"));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForDataCube(pnl.ToDataCube()).WithQuerySource(Workspace)", + "\n .SliceRowsBy(\"Scenario\")", + "\n .SliceColumnsBy(new[]{\"Currency\",\"GroupOfContract\"}) //\"GroupOfContract\"", + "\n .ReportGridOptions().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### Insurance Revenue : business growth" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var insRev = tci.Where(x => hierarchicalDimension.Get().Ancestors(x.VariableType, includeSelf: true).Any(x => x.SystemName == \"IR\"));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForDataCube(insRev.ToDataCube()).WithQuerySource(Workspace)", + "\n .SliceRowsBy(\"Scenario\")", + "\n .SliceColumnsBy(new[]{\"Currency\",\"GroupOfContract\"})", + "\n .ReportGridOptions().ExecuteAsync() " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Experience Variance : business strategy", + "\nThis indicator represent how well the expected values match the actual. It is not a financial key performance indicator rather a modelling key performance indicator, indicating how well the company expectations are met by the actual figures." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "experienceAdjustments.DataFilter = null;", + "\nvar expAdj = experienceAdjustments.GetDataCube().Where(x => x.VariableType == \"CF\" && Math.Abs(x.Value) > 10E-5).Select(x => x.Scenario == null ? x with {Scenario = \"Best Estimate\"} : x);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForDataCube(expAdj.ToDataCube()).WithQuerySource(Workspace)", + "\n .SliceRowsBy(\"Scenario\")", + "\n .SliceColumnsBy(new[]{\"Currency\",\"GroupOfContract\"})", + "\n .ReportGridOptions().ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Scenarios.csv b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Scenarios.csv new file mode 100644 index 00000000..ad34991d --- /dev/null +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Scenarios.csv @@ -0,0 +1,22 @@ +@@Scenario,,,,,,,,,,, +SystemName,DisplayName,,,,,,,,,, +LR70,Loss Ratio 70, +LR80,Loss Ratio 80, +ELR60A70,Expected Loss Ratio 60 Actual 70, +ELR60A80,Expected Loss Ratio 60 Actual 80, +YCUP1.0pct,Yield Curve Up 1.0pct,,,,,,,,,, +YCDW1.0pct,Yield Curve Down 1.0pct,,,,,,,,,, +SRUP1.0pct,Spread Rate Up 1.0pct,,,,,,,,,, +SRDW1.0pct,Spread Rate Down 1.0pct,,,,,,,,,, +EUP1.0pct,Equity Up 1.0pct,,,,,,,,,, +EDW1.0pct,Equity Down 1.0pct,,,,,,,,,, +FXUP1.0pct,Exchange Rate Up 1.0pct,,,,,,,,,, +FXDW1.0pct,Exchange Rate Down 1.0pct,,,,,,,,,, +MTUP10pct,Mortality Up 10pct,,,,,,,,,, +MTDW10pct,Mortality Down 10pct,,,,,,,,,, +LUP10pct,Longevity Up 10pct,,,,,,,,,, +LDW10pct,Longevity Down 10pct,,,,,,,,,, +DUP10pct,Disability Up 10pct,,,,,,,,,, +DDW10pct,Disability Down 10pct,,,,,,,,,, +LICUP10pct,Lic Up 10pct,,,,,,,,,, +LICDW10pct,Lic Down 10pct,,,,,,,,,, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index b6e114ba..69bbb85e 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -218,7 +218,7 @@ { "cell_type": "markdown", "source": [ - "# Reset Workspace" + "# Initialize Workspace" ], "metadata": {}, "execution_count": 0, @@ -227,17 +227,8 @@ { "cell_type": "code", "source": [ - "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "Workspace.InitializeFrom(DataSource);", - "\nifrs17.Reset(Workspace)" + "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", + "\nWorkspace.InitializeFrom(DataSource);" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb index 70f8e7b3..976270bc 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb @@ -94,6 +94,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "ifrs17 = new Ifrs17(Workspace, Scopes, Report, Export);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17-template/README.md b/ifrs17-template/README.md index e6033e6a..34d33c99 100644 --- a/ifrs17-template/README.md +++ b/ifrs17-template/README.md @@ -63,7 +63,7 @@ For more information on our IFRS 17 initiative check out our [IFRS 17 page](http Interact with our IFRS 17 practical use cases. Analyze your data and create new use cases. -
+
@@ -78,6 +78,13 @@ Compare use-cases of [actuals](./PracticalUseCases/ActualsOutsideThePeriod/Actua Compare the effects of modelling the [CSM - LC switch](./PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports) with a single vs multiple switch logic. +
+
+ +### Scenario analysis for re-insured contracts + +Compare Net results under IFRS 17 obtained for different [loss ratio](./PracticalUseCases/CompareReinsuranceContracts/Reports). +
diff --git a/ifrs17-template/Test/PracticalCasesTest.ipynb b/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb similarity index 98% rename from ifrs17-template/Test/PracticalCasesTest.ipynb rename to ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb index 5b4eab9d..1dd309db 100644 --- a/ifrs17-template/Test/PracticalCasesTest.ipynb +++ b/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb @@ -37,7 +37,7 @@ { "cell_type": "code", "source": [ - "#!import \"../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports\"" + "#!eval-notebook \"../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb b/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb new file mode 100644 index 00000000..779c4d80 --- /dev/null +++ b/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb @@ -0,0 +1,355 @@ +{ + "metadata": { + "authors": [], + "id": "cZ9mwrWya0Ox8CXAyFRn2Q", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Test Practical Cases

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Compare Reinsurance Contracts" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"../PracticalUseCases/CompareReinsuranceContracts/Reports\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using FluentAssertions;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var grossBusinessReinsured = \"RP1.1\";", + "\nvar reinsuranceContract = \"RPR1.1\";", + "\nvar groupsOfContracts = new[] {grossBusinessReinsured, reinsuranceContract};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Best Estimate" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var bops = pv.GetDataCube().Where(x => x.Novelty==\"N\" && x.VariableType==\"BOP\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==grossBusinessReinsured && x.Scenario==null).Sum(x=>x.Value).Should().BeApproximately(-100.00828, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==grossBusinessReinsured && x.Scenario==\"LR70\").Sum(x=>x.Value).Should().BeApproximately(-0.11643, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==grossBusinessReinsured && x.Scenario==\"LR80\").Sum(x=>x.Value).Should().BeApproximately(99.77541, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==grossBusinessReinsured && x.Scenario==\"ELR60A70\").Sum(x=>x.Value).Should().BeApproximately(-100.00828, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==grossBusinessReinsured && x.Scenario==\"ELR60A80\").Sum(x=>x.Value).Should().BeApproximately(-100.00828, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==reinsuranceContract && x.Scenario==null).Sum(x=>x.Value).Should().BeApproximately(15.15453, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==reinsuranceContract && x.Scenario==\"LR70\").Sum(x=>x.Value).Should().BeApproximately(-14.78996, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==reinsuranceContract && x.Scenario==\"LR80\").Sum(x=>x.Value).Should().BeApproximately(-44.73446, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==reinsuranceContract && x.Scenario==\"ELR60A70\").Sum(x=>x.Value).Should().BeApproximately(15.15453, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "bops.Where(x => x.GroupOfContract==reinsuranceContract && x.Scenario==\"ELR60A80\").Sum(x=>x.Value).Should().BeApproximately(15.15453, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Experience Adjustments" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var eAs = experienceAdjustments.GetDataCube().Where(x => groupsOfContracts.Contains(x.GroupOfContract));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eAs.Where(x => x.Scenario == null).Sum(x => x.Value).Should().BeApproximately(0, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eAs.Where(x => x.Scenario == \"LR70\").Sum(x => x.Value).Should().BeApproximately(0, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eAs.Where(x => x.Scenario == \"LR80\").Sum(x => x.Value).Should().BeApproximately(0, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eAs.Where(x => x.Scenario == \"ELR60A70\").Sum(x => x.Value).Should().BeApproximately(-70, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eAs.Where(x => x.Scenario == \"ELR60A80\").Sum(x => x.Value).Should().BeApproximately(-140, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Csm/Loss Component" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var csmAM = allocatedTechnicalMargins.GetDataCube().Where(x => groupsOfContracts.Contains(x.GroupOfContract) && x.VariableType == \"AM\" && Math.Abs(x.Value) > Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "csmAM.Where(x => x.Scenario == null).Sum(x => x.Value).Should().BeApproximately(-84.86029, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "csmAM.Where(x => x.Scenario == \"LR70\").Sum(x => x.Value).Should().BeApproximately(-14.83859, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "csmAM.Where(x => x.Scenario == \"LR80\").Sum(x => x.Value).Should().BeApproximately(-55.18393, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl = pnl.Where(x => groupsOfContracts.Contains(x.GroupOfContract));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl.Where(x => x.Scenario == \"Best Estimate\").Sum(x => x.Value).Should().BeApproximately(84.99882, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl.Where(x => x.Scenario == \"LR70\").Sum(x => x.Value).Should().BeApproximately(15.00020, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl.Where(x => x.Scenario == \"LR80\").Sum(x => x.Value).Should().BeApproximately(-55.00076, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl.Where(x => x.Scenario == \"ELR60A70\").Sum(x => x.Value).Should().BeApproximately(14.99882, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "pnl.Where(x => x.Scenario == \"ELR60A80\").Sum(x => x.Value).Should().BeApproximately(-55.00117, Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb index a65ecdd9..5dd27700 100644 --- a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb @@ -55,7 +55,7 @@ { "cell_type": "code", "source": [ - "var EnableScenarioBackup = EnableScenario;" + "var EnableScenarioBackup = Scenarios.EnableScenario;" ], "metadata": {}, "execution_count": 0, @@ -64,7 +64,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = true;" + "Scenarios.EnableScenario = true;" ], "metadata": {}, "execution_count": 0, @@ -484,7 +484,7 @@ { "cell_type": "code", "source": [ - "EnableScenario = EnableScenarioBackup;" + "Scenarios.EnableScenario = EnableScenarioBackup;" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index 0e535198..c6c44706 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -29,7 +29,7 @@ "cell_type": "markdown", "source": [ "Comprehensive collection of tests executed on top of the Systemorph use cases (initialization).", - "\n
Execute this Notebook using at least 18Gb RAM." + "\n
Execute this Notebook using at least 20Gb RAM." ], "metadata": {}, "execution_count": 0, @@ -128,7 +128,16 @@ { "cell_type": "code", "source": [ - "#!eval-notebook \"PracticalCasesTest\"" + "#!eval-notebook \"PracticalCase-CSMSwitchTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"PracticalCase-CompareReinsuranceTest\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 42f05dcd..cb4b750d 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -366,6 +366,7 @@ "\n public const string AEM = nameof(AEM); // Attributable Expenses Maintenance", "\n public const string AC = nameof(AC); // Attributable Commissions", "\n public const string AE = nameof(AE); // Attributable Expenses", + "\n public const string ULE = nameof(ULE); // Unallocated Loss Adjustment Expenses", "\n}" ], "metadata": {}, diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 87a2a4a0..a27687cb 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1062,7 +1062,7 @@ "\n", "\nThe Credit Default Rate values must be entered with monthly granularity, i.e. every value corresponds to the default rate for a certain month. The first month entered in column Values0 always corresponds to January of the year entered in column Year. The last value is considered valid also for the following years (for which no value has been provided). ", "\n", - "\nThe latest Credit Default Rate available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation." + "\nThe latest Credit Default Rate available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation. When the current period Credit Default Rate differs from previous period value, the analysis of change for the Credit Default Rate amount type computes the contribution of such update as an additional step (Credit Risk Update)." ], "metadata": {}, "execution_count": 0, @@ -1114,7 +1114,7 @@ "\n", "\nThe Yield Curve values must be entered with **yearly** granularity, i.e. every value corresponds to the rate of the whole year starting from the year entered in column Year. The last value is considered valid also for the following years (for which no value has been provided). ", "\n", - "\nDuring calculation, the Yield Curve values are retrieved from the DataSource. The Yield Curve Name defined for each group-of-contracts will be used to match the Name of the Yield Curve to be considered. This occurs only for the curve that is used in the computation of the Contractual Service Margin (locked-in for BBA valuation approach, current otherwise). The calculation engine allows the update of the locked-in curve during the entire inception year of the group-of-contracts. When the locked-in Yield Curve is used, the latest Yield Curve available in the system with Year earlier or equal to the inception Year of the group-of-contracts will be used. When the current Yield Curve is used in the calculation, the latest Yield Curve available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used." + "\nDuring calculation, the Yield Curve values are retrieved from the DataSource. The Yield Curve Name defined for each group-of-contracts will be used to match the Name of the Yield Curve to be considered. This occurs only for the curve that is used in the computation of the Contractual Service Margin (locked-in for BBA valuation approach, current otherwise). The calculation engine allows the update of the locked-in curve during the entire inception year of the group-of-contracts. When the locked-in Yield Curve is used, the latest Yield Curve available in the system with Year earlier or equal to the inception Year of the group-of-contracts will be used. When the current Yield Curve is used in the calculation, the latest Yield Curve available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used. When the current period Yield Curve differs from previous period value, the analysis of change computes the contribution of such update as an additional step (Yield Curve Update)." ], "metadata": {}, "execution_count": 0, @@ -1541,7 +1541,7 @@ "\n", "\nData Node Parameters are used to keep track of other parameters pertaining to each Data Node, and their movements in time (year and month).", "\n
PremiumAllocation : defines the weight of Premium to be included in the Experience Adjustement AoC Type of the Technical Margin and is valid only for Group of Insurance Contract with LiabilityType : Liability for Remaining Coverage.", - "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case.", + "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case. In other words, it represents the percentage to which claims in the underlying GICs are expected to be reinboursed by the Reinsurance Contracts belonging to the GRIC. For proportional contracts, this factor is given by the cession while for other contracts it should be estimated. ", "\n", "\nThe latest Data Node Parameters available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation." ], diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index 7189319a..3a357622 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -1854,7 +1854,13 @@ "\n", "\n### Reinsurance case", "\n", - "\nFor the reinsurance case, the switch logic is identical to the one described above, except that it uses the gross Technical Margins multiplied by the weights coming from the Reinsurance Coverage Parameter (see [Data Node Parameters](../DataModel/DataStructure#data-node-parameters)). In case a GRIC has multiple GICs, then these weighted $TM$s are aggregated." + "\nFor the reinsurance case, the switch logic is identical to the one described above, except that it uses the gross Technical Margins multiplied by the weights coming from the Reinsurance Coverage (RC) Parameter (see [Data Node Parameters](../DataModel/DataStructure#data-node-parameters)). In case a GRIC ($r$) has multiple GICs ($g$), then these weighted $TM$s are aggregated.", + "\n", + "\n$$", + "\n\\text{Weighted TM}(\\text{r}) = \\sum_{g~\\in~\\text{underlying GICs}} \\text{RC}_{g,r} \\text{TM}(g)", + "\n$$", + "\n", + "\nA Loss Recovery Component (LoReCo) for GRIC $r$ is going to be opened in case the $\\text{Weighted TM}(r)$ would be allocated to Loss Component following the above mentioned switch logic. The amount allocated to the Reinsurance CSM or LoReCo follows the computed Technical Margin computed for GRIC r as described in [Technical Margin](#technical-margin)." ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index 54f8d8f3..2689ec60 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -123,12 +123,16 @@ "\n", "\n IEnumerable RowSlices { get; set; }", "\n protected string[] defaultRowSlices => new string[] { };", - "\n protected string[] rowSlices => RowSlices is null ? defaultRowSlices : defaultRowSlices.Concat(RowSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", + "\n protected string[] rowSlices => RowSlices is null ", + "\n ? defaultRowSlices ", + "\n : defaultRowSlices.Where(cs => !RowSlices.Contains(cs)).Concat(RowSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", "\n", "\n IEnumerable ColumnSlices { get; set; }", "\n protected string[] defaultColumnSlices => new string[] { };", "\n protected string[] columnSlices { get{", - "\n var slices = ColumnSlices is null ? defaultColumnSlices : defaultColumnSlices.Where(cs => !ColumnSlices.Contains(cs)).Concat(ColumnSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", + "\n var slices = ColumnSlices is null ", + "\n ? defaultColumnSlices ", + "\n : defaultColumnSlices.Where(cs => !ColumnSlices.Contains(cs)).Concat(ColumnSlices).Where(x => !forbiddenSlices.Contains(x)).ToArray();", "\n return Scenario == \"All\" || Scenario == \"Delta\"", "\n ? slices.Concat(nameof(Scenario).RepeatOnce()).ToArray() ", "\n : Scenario is null ? slices : nameof(Scenario).RepeatOnce().Concat(slices).ToArray();", @@ -222,7 +226,7 @@ "\n", "\npublic interface ExpAdjReport : IIfrs17Report {", "\n string[] IIfrs17Report.defaultRowSlices => new string[] {\"EstimateType\"};", - "\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\", \"AmountType\" };", + "\n string[] IIfrs17Report.defaultColumnSlices => new string[] { \"Currency\"};", "\n IDataCube IIfrs17Report.GetDataCube() => DataFilter == null ", "\n ? GetScopes(GetIdentities()).Aggregate().ActuarialExperienceAdjustment", "\n : GetScopes(GetIdentities()).Aggregate().ActuarialExperienceAdjustment.Filter(dataFilter);", diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb index 525773c1..fd8e37c1 100644 --- a/ifrs17/Report/ReportScopes.ipynb +++ b/ifrs17/Report/ReportScopes.ipynb @@ -478,7 +478,7 @@ "\n .Filter((\"VariableType\", AocTypes.CF));", "\n ", "\n private IDataCube BestEstimateCashflow => GetScope(Identity).BestEstimate", - "\n .Filter((\"VariableType\", AocTypes.CF))", + "\n .Filter((\"VariableType\", AocTypes.CF), (\"AmountType\",\"!CDR\"))", "\n .SelectToDataCube(rv => rv with { EconomicBasis = null, Novelty = Novelties.C });", "\n", "\n IDataCube ActuarialExperienceAdjustment => WrittenCashflow - BestEstimateCashflow;", From d10b7cc8e34d9c5ad9139b521b488ee54051097d Mon Sep 17 00:00:00 2001 From: amuolo Date: Fri, 24 Mar 2023 12:43:45 +0100 Subject: [PATCH 17/19] new scenario data queries tests (#218) * new scenario data queries tests * add yield curve for scenarios test * implement Davide feedback * more tests * add small description to use cases --------- Co-authored-by: Andrea Muolo Co-authored-by: Davide Colleoni --- .../Report/ReportConfigurationAndUtils.ipynb | 2 +- ifrs17/Test/ImportStorageTest.ipynb | 241 +++++- ifrs17/Test/QueriesScenarioDataTest.ipynb | 743 ++++++++++++++++++ ifrs17/Test/QueriesTest.ipynb | 91 ++- ifrs17/Test/TestData.ipynb | 36 +- ifrs17/Test/Tests.ipynb | 9 + 6 files changed, 1079 insertions(+), 43 deletions(-) create mode 100644 ifrs17/Test/QueriesScenarioDataTest.ipynb diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index 2a93bd7a..069c2f44 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -116,7 +116,7 @@ "source": [ "public static async Task QueryReportVariablesSingleScenarioAsync(this IWorkspace workspace, (int Year, int Month, string ReportingNode, string Scenario) args ) {", "\n", - "\n await workspace.Partition.SetAsync(new { ReportingNode = args.ReportingNode, Scenario = (string)null}); // TODO: Scenario from args + relaxed query ", + "\n await workspace.Partition.SetAsync(new { ReportingNode = args.ReportingNode, Scenario = (string)null});", "\n await workspace.Partition.SetAsync(new { ReportingNode = args.ReportingNode, Scenario = args.Scenario, Year = args.Year, Month = args.Month });", "\n ", "\n var reportVariables = await workspace.Query()", diff --git a/ifrs17/Test/ImportStorageTest.ipynb b/ifrs17/Test/ImportStorageTest.ipynb index d8294e5f..b6827a63 100644 --- a/ifrs17/Test/ImportStorageTest.ipynb +++ b/ifrs17/Test/ImportStorageTest.ipynb @@ -38,7 +38,17 @@ { "cell_type": "markdown", "source": [ - "# Workspace Initialization " + "# Initialization " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.SetAsync();", + "\nDataSource.Reset(x => x.ResetCurrentPartitions());" ], "metadata": {}, "execution_count": 0, @@ -58,10 +68,10 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(dt1.RepeatOnce());", - "\nawait DataSource.UpdateAsync(dtr1.RepeatOnce());", - "\nawait DataSource.UpdateAsync(new [] {dt11});", - "\nawait DataSource.UpdateAsync(new [] {dtr11});" + "await DataSource.UpdateAsync(new[]{ dt1 });", + "\nawait DataSource.UpdateAsync(new[]{ dtr1 });", + "\nawait DataSource.UpdateAsync(new[]{ dt11 });", + "\nawait DataSource.UpdateAsync(new[]{ dtr11 });" ], "metadata": {}, "execution_count": 0, @@ -70,8 +80,8 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(new [ ] {dt11State, dtr11State});", - "\nawait DataSource.UpdateAsync(new [ ] {dt11Inter});" + "await DataSource.UpdateAsync(new[]{ dt11State, dtr11State });", + "\nawait DataSource.UpdateAsync(new[]{ dt11Inter });" ], "metadata": {}, "execution_count": 0, @@ -80,7 +90,7 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(new [ ] {yieldCurve, yieldCurvePrevious});" + "await DataSource.UpdateAsync(new[]{ yieldCurve, yieldCurvePrevious });" ], "metadata": {}, "execution_count": 0, @@ -107,7 +117,7 @@ { "cell_type": "code", "source": [ - "await DataSource.UpdateAsync(new[]{partition, previousPeriodPartition});", + "await DataSource.UpdateAsync(new[]{partition, previousPeriodPartition, partitionScenarioMTUP});", "\nawait DataSource.UpdateAsync(new[]{partitionReportingNode});" ], "metadata": {}, @@ -117,7 +127,7 @@ { "cell_type": "markdown", "source": [ - "# Test" + "# Check method" ], "metadata": {}, "execution_count": 0, @@ -126,7 +136,7 @@ { "cell_type": "code", "source": [ - "public async Task CheckIfrsVariablesFromImportStorageAsync(string importFormat, IEnumerable inputDataSetForWorkspace, IEnumerable inputDataSetForDataSource, IEnumerable ivsBenchmark)", + "public async Task CheckIfrsVariablesFromImportStorageAsync(string importFormat, IEnumerable inputDataSetForWorkspace, IEnumerable inputDataSetForDataSource, IEnumerable ivsBenchmark, ImportArgs args)", "\n{", "\n Activity.Start();", "\n //Prepare Workspace and DataSource", @@ -164,11 +174,31 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Test Best Estimate" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## A", + "\n", + "\nThere is a previous year, and it's the first time Actuals are imported for the current year." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "//There is a previous year, and it's the first time Actuals are imported for the current year", - "\nvar basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "\n", "\nvar inputDataSetForDataSource = new IfrsVariable[]{", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, Value = 100.0},", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", @@ -185,7 +215,7 @@ "\n basicIfrsVariable with {AocType = AocTypes.CF, Value = -10.0},", "\n basicIfrsVariable with {AocType = AocTypes.WO, Value = 15.0},", "\n };", - "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, args);", "\nactivity" ], "metadata": {}, @@ -201,11 +231,22 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## B", + "\n", + "\nThere is a previous year, and it's the second time Actuals are imported for the current year (reimport)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "//There is a previous year, and it's the second time Actuals are imported for the current year (reimport)", - "\nvar basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "\n", "\nvar inputDataSetForDataSource = new IfrsVariable[]{", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, Value = 100.0},", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", @@ -228,7 +269,7 @@ "\n basicIfrsVariable with {AocType = AocTypes.WO, Value = -20.0},", "\n };", "\n", - "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, args);", "\nactivity" ], "metadata": {}, @@ -244,11 +285,22 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## C", + "\n", + "\nThere is a previous year, cash flow were already imported and actuals are imported for the first time." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "//There is a previous year, Cash flows were already imported and Actuals are imported for the first time", - "\nvar basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.I, EstimateType = EstimateTypes.BE};", + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.I, EstimateType = EstimateTypes.BE};", + "\n", "\nvar inputDataSetForDataSource = new IfrsVariable[]{", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, EstimateType = EstimateTypes.AA, Novelty = Novelties.C, Value = 100.0},", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, Value = 1000.0},", @@ -273,7 +325,7 @@ "\n basicIfrsVariable with {AocType = AocTypes.WO, EstimateType = EstimateTypes.AA, Novelty = Novelties.C, Value = -20.0},", "\n };", "\n", - "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, args);", "\nactivity" ], "metadata": {}, @@ -289,12 +341,23 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## D", + "\n", + "\nThere is a previous year, Cash flows and Actuals were already imported and Actuals are imported again." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "//There is a previous year, Cash flows and Actuals were already imported and Actuals are imported again", - "\nvar basicAdvanceActualIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "var basicAdvanceActualIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", "\nvar basicBeIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.I, EstimateType = EstimateTypes.BE};", + "\n", "\nvar inputDataSetForDataSource = new IfrsVariable[]{", "\n basicBeIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, Value = 1000.0},", "\n basicBeIfrsVariable with {AocType = AocTypes.BOP, Novelty = Novelties.I, Value = 1000.0},", @@ -326,7 +389,7 @@ "\n basicAdvanceActualIfrsVariable with {AocType = AocTypes.WO, Value = -20.0},", "\n };", "\n", - "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, args);", "\nactivity" ], "metadata": {}, @@ -342,14 +405,26 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## E", + "\n", + "\nThere is a previous year for Primary Scope (GRIC10) ", + "\n", + "\nThere is a previous and current year for Secondary Scope (GIC10), ", + "\n", + "\nIt's the first time Actuals are imported for the current year" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "//There is a previous year for Primary Scope (GRIC10) ", - "\n//There is a previous and current year for Secondary Scope (GIC10), ", - "\n//It's the first time Actuals are imported for the current year", + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", "\n", - "\nvar basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfReinsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", "\nvar inputDataSetForDataSource = new IfrsVariable[]{", "\n //Year", "\n basicIfrsVariable with {Partition = previousPeriodPartition.Id, AocType = AocTypes.EOP, Value = 100.0},", @@ -389,7 +464,117 @@ "\n basicIfrsVariable with {AocType = AocTypes.WO, Value = 15.0},", "\n };", "\n", - "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, args);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Test Scenario" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## A", + "\n", + "\nFor the current year Actuals are imported for Best Estimate and a given Scenario. The Relaxed query should return the union of the 2 giving priority to scenario data. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "\n", + "\nvar inputDataSetForDataSource = new IfrsVariable[]{", + "\n basicIfrsVariable with {AocType = AocTypes.BOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", + "\n basicIfrsVariable with {AocType = AocTypes.BOP, Value = 100.0},", + "\n basicIfrsVariable with {AocType = AocTypes.CL, Value = 150.0},", + "\n };", + "\n", + "\nvar inputDataSetForWorkspace = new IfrsVariable[]{", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, AocType = AocTypes.CL, Value = -15.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, AmountType = AmountTypes.CL, AocType = AocTypes.CL, Value = -99.0},", + "\n };", + "\n", + "\nvar ivsBenchmark = new IfrsVariable[]{", + "\n basicIfrsVariable with {Partition = partition.Id, AocType = AocTypes.BOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", + "\n basicIfrsVariable with {Partition = partition.Id, AocType = AocTypes.BOP, Value = 100.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, AocType = AocTypes.CL, Value = -15.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, AmountType = AmountTypes.CL, AocType = AocTypes.CL, Value = -99.0},", + "\n };", + "\n", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, argsScenarioMTUP);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## B", + "\n", + "\nThe primary scope is a GRIC scenario while the underlying GIC is Best Estimate." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfInsuranceContracts, AccidentYear = null, AmountType = AmountTypes.PR, Novelty = Novelties.C, EstimateType = EstimateTypes.AA};", + "\n", + "\nvar inputDataSetForDataSource = new IfrsVariable[]{", + "\n basicIfrsVariable with {AocType = AocTypes.BOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", + "\n basicIfrsVariable with {AocType = AocTypes.BOP, Value = 100.0},", + "\n basicIfrsVariable with {AocType = AocTypes.CL, Value = 150.0},", + "\n};", + "\n", + "\nvar inputDataSetForWorkspace = new IfrsVariable[]{", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, DataNode = groupOfReinsuranceContracts, AocType = AocTypes.CL, Value = -15.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, DataNode = groupOfReinsuranceContracts, AmountType = AmountTypes.CL, AocType = AocTypes.CL, Value = -99.0},", + "\n};", + "\n", + "\nvar ivsBenchmark = new IfrsVariable[]{", + "\n basicIfrsVariable with {Partition = partition.Id, AocType = AocTypes.BOP, EstimateType = EstimateTypes.DA, Value = 1000.0},", + "\n basicIfrsVariable with {Partition = partition.Id, AocType = AocTypes.BOP, Value = 100.0},", + "\n basicIfrsVariable with {Partition = partition.Id, AocType = AocTypes.CL, Value = 150.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, DataNode = groupOfReinsuranceContracts, AocType = AocTypes.CL, Value = -15.0},", + "\n basicIfrsVariable with {Partition = partitionScenarioMTUP.Id, DataNode = groupOfReinsuranceContracts, AmountType = AmountTypes.CL, AocType = AocTypes.CL, Value = -99.0},", + "\n};", + "\n", + "\nvar activity = await CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark, argsScenarioMTUP);", "\nactivity" ], "metadata": {}, diff --git a/ifrs17/Test/QueriesScenarioDataTest.ipynb b/ifrs17/Test/QueriesScenarioDataTest.ipynb new file mode 100644 index 00000000..6caa9e49 --- /dev/null +++ b/ifrs17/Test/QueriesScenarioDataTest.ipynb @@ -0,0 +1,743 @@ +{ + "metadata": { + "authors": [], + "id": "rHk2-5mImky-sdiEfRUCdw", + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "code", + "source": [ + "#!import \"../Utils/Queries\"", + "\n#!import \"../Report/ReportConfigurationAndUtils\"", + "\n#!import \"TestData\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Initialization" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.UpdateAsync( new[] { partitionReportingNode } );", + "\nawait DataSource.UpdateAsync( new[] { partition, previousPeriodPartition, partitionScenarioMTUP, previousPeriodPartitionScenarioMTUP } );", + "\nawait DataSource.UpdateAsync( new[] { dt11 } );" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Import Queries: Raw Variables" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Data definition" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var bestEstimateRawVars = new[] { new RawVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Values = new[] {1.0} }, ", + "\n new RawVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Values = new[] {2.0} },", + "\n new RawVariable { AmountType = \"PR\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Values = new[] {3.0} },", + "\n new RawVariable { AmountType = \"CL\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Values = new[] {4.0} },", + "\n new RawVariable { AmountType = \"CL\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Values = new[] {5.0} },", + "\n new RawVariable { AmountType = \"CL\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Values = new[] {6.0} } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var previousScenarioRawVars = new[] { new RawVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = previousPeriodPartitionScenarioMTUP.Id, Values = new[] {3.15} }, ", + "\n new RawVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = previousPeriodPartitionScenarioMTUP.Id, Values = new[] {7.17} } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var scenarioRawVars = new[] { new RawVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Values = new[] {1.1} }, ", + "\n new RawVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Values = new[] {2.1} } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var newScenarioRawVars = new[] { new RawVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Values = new[] {11.0} }, ", + "\n new RawVariable { AmountType = \"CL\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Values = new[] {41.0} } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario Query and Workspace with new scenario", + "\n", + "\nRaw variable query test.
", + "\nScenario cashflow re-import.
", + "\nDataSource with BestEstimate and Scenario raw variable, Workspace with new raw variable for Scenario.
", + "\n " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateRawVars.Concat(scenarioRawVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());", + "\nawait ws.UpdateAsync(newScenarioRawVars);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedRawVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedRawVars.SelectMany(x => x.Values).Sum().Should().Be(52.0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario, mismatching format", + "\n", + "\nRaw variable query test.
", + "\nScenario Actual import.
", + "\nDataSource with BestEstimate and Scenario raw variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateRawVars.Concat(scenarioRawVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedRawVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Actual);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedRawVars.SelectMany(x => x.Values).Sum().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario and DataSource with scenario", + "\n", + "\nRaw variable query test.
", + "\nScenario parameter (re-)import.
", + "\nDataSource with BestEstimate and Scenario raw variable, Workspace without any raw variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateRawVars.Concat(scenarioRawVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedRawVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedRawVars.SelectMany(x => x.Values).Sum().Should().Be(3.2);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario and DataSource with only Best Estimate", + "\n", + "\nRaw variable query test.
", + "\nScenario parameter (re-)import.
", + "\nDataSource with BestEstimate raw variable, Workspace without any raw variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateRawVars.ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedRawVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedRawVars.SelectMany(x => x.Values).Sum().Should().Be(21);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario and DataSource with Best Estimate and previous period scenario", + "\n", + "\nRaw variable query test.
", + "\nScenario parameter (re-)import.
", + "\nDataSource with BestEstimate and previous period Scenario raw variable, Workspace without any raw variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateRawVars.Concat(previousScenarioRawVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedRawVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedRawVars.SelectMany(x => x.Values).Sum().Should().Be(21);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Import Queries: Ifrs Variables" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Data definition" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var bestEstimateIfrsVars = new[] { new IfrsVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Value = 1.0 }, ", + "\n new IfrsVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Value = 2.0 },", + "\n new IfrsVariable { AmountType = \"PR\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Value = 3.0 },", + "\n new IfrsVariable { AmountType = \"CL\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Value = 4.0 },", + "\n new IfrsVariable { AmountType = \"CL\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Value = 5.0 },", + "\n new IfrsVariable { AmountType = \"CL\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Value = 6.0 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var previousScenarioIfrsVars = new[] { new IfrsVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = previousPeriodPartitionScenarioMTUP.Id, Value = 3.15 }, ", + "\n new IfrsVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = previousPeriodPartitionScenarioMTUP.Id, Value = 7.17 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var scenarioIfrsVars = new[] { new IfrsVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 1.1 }, ", + "\n new IfrsVariable { AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 2.1 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var newScenarioIfrsVars = new[] { new IfrsVariable { AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 11.0 }, ", + "\n new IfrsVariable { AmountType = \"CL\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 41.0 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario Query and Workspace with new scenario", + "\n", + "\nIfrs variable query test.
", + "\nScenario Actual re-import.
", + "\nDataSource with BestEstimate and Scenario ifrs variable, Workspace with new ifrs variable for Scenario.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateIfrsVars.Concat(scenarioIfrsVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());", + "\nawait ws.UpdateAsync(newScenarioIfrsVars);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedIfrsVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Actual);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedIfrsVars.Select(x => x.Value).Sum().Should().Be(52.0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario, mismatching format", + "\n", + "\nIfrs variable query test.
", + "\nScenario parameter (re-)import.
", + "\nDataSource with BestEstimate and Scenario ifrs variable, Workspace without any ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateIfrsVars.Concat(scenarioIfrsVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedIfrsVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Cashflow);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedIfrsVars.Select(x => x.Value).Sum().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario and DataSource with scenario", + "\n", + "\nIfrs variable query test.
", + "\nScenario Actual import of an empty file.
", + "\nDataSource with BestEstimate and Scenario ifrs variable, Workspace without any ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateIfrsVars.Concat(scenarioIfrsVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedIfrsVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Actual);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedIfrsVars.Select(x => x.Value).Sum().Should().Be(3.2);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no new scenario and DataSource with only Best Estimate", + "\n", + "\nIfrs variable query test.
", + "\nScenario Actual import of an empty file.
", + "\nDataSource with BestEstimate ifrs variable, Workspace without any ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateIfrsVars.ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedIfrsVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Actual);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedIfrsVars.Select(x => x.Value).Sum().Should().Be(21);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query, Workspace with no scenario and DataSource with Best Estimate and previous period scenario", + "\n", + "\nIfrs variable query test.
", + "\nScenario Actual import of an empty file.
", + "\nDataSource with BestEstimate and previous period Scenario ifrs variable, Workspace without any ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.DeleteAsync( await DataSource.Query().ToArrayAsync() );", + "\nawait DataSource.UpdateAsync( bestEstimateIfrsVars.Concat(previousScenarioIfrsVars).ToArray() );", + "\nvar ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var queriedIfrsVars = await ws.QueryPartitionedDataAsync(DataSource, partitionScenarioMTUP.Id, partition.Id, ImportFormats.Actual);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "queriedIfrsVars.Select(x => x.Value).Sum().Should().Be(21);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Report" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var bestEstimateIfrsVars = new[] { new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Value = 1.0 }, ", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Value = 2.0 },", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"PR\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Value = 3.0 },", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"CL\", AocType = \"CL\", Novelty = \"I\", Partition = partition.Id, Value = 4.0 },", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"CL\", AocType = \"AU\", Novelty = \"I\", Partition = partition.Id, Value = 5.0 },", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"CL\", AocType = \"EV\", Novelty = \"I\", Partition = partition.Id, Value = 6.0 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var scenarioIfrsVars = new[] { new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"PR\", AocType = \"CL\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 1.1 }, ", + "\n new IfrsVariable { DataNode = \"DT1.1\", AmountType = \"PR\", AocType = \"AU\", Novelty = \"I\", Partition = partitionScenarioMTUP.Id, Value = 2.1 } };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Best estimate query", + "\n", + "\nReport variable query test.
", + "\nReport for Best Estimate ( or Scenario Delta and Scenario All).
", + "\nDataSource and Workspace with BestEstimate and Scenario ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ws.UpdateAsync(bestEstimateIfrsVars);", + "\nawait ws.UpdateAsync(scenarioIfrsVars);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "(await ws.QueryReportVariablesAsync((args.Year, args.Month, args.ReportingNode, args.Scenario))).Select(x => x.Value).Sum().Should().Be(21);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Scenario query", + "\n", + "\nReport variable query test.
", + "\nReport for Scenario.
", + "\nDataSource and Workspace with BestEstimate and Scenario ifrs variable.
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ws = Workspace.CreateNew();", + "\nws.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await ws.UpdateAsync(bestEstimateIfrsVars);", + "\nawait ws.UpdateAsync(scenarioIfrsVars);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "(await ws.QueryReportVariablesAsync((args.Year, args.Month, args.ReportingNode, argsScenarioMTUP.Scenario))).Select(x => x.Value).Sum().Should().Be(21.2);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17/Test/QueriesTest.ipynb b/ifrs17/Test/QueriesTest.ipynb index 17174543..ed804833 100644 --- a/ifrs17/Test/QueriesTest.ipynb +++ b/ifrs17/Test/QueriesTest.ipynb @@ -588,6 +588,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -607,6 +616,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -745,7 +763,6 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"B\", Values = new double[]{6.1,6.2,6.3,6.4,6.5,6.6} }};", "\n", "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 2, \"A\", \"BBA\");", - "\n", "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 10.1, 10.1);", "\nactivity" ], @@ -768,7 +785,7 @@ "source": [ "var expectedErrorMessage = Get(Error.YieldCurveNotFound, \"EUR\",\"2016\",\"12\",\"Best Estimate\",\"A\");", "\nvar errorMessage = activity.Errors.First().ToString();", - "\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true)" + "\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true);" ], "metadata": {}, "execution_count": 0, @@ -785,7 +802,6 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"B\", Values = new double[]{6.1,6.2,6.3,6.4,6.5,6.6} }};", "\n", "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 2, \"A\", \"BBA\");", - "\n", "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 10.1, 10.1);", "\nactivity" ], @@ -797,7 +813,7 @@ "cell_type": "code", "source": [ "activity.Status.Should().Be(ActivityLogStatus.Failed);", - "\nactivity.Errors.Count().Should().Be(1)" + "\nactivity.Errors.Count().Should().Be(1);" ], "metadata": {}, "execution_count": 0, @@ -808,7 +824,70 @@ "source": [ "var expectedErrorMessage = Get(Error.YieldCurveNotFound, \"EUR\",\"2016\",\"9\",\"Best Estimate\",\"A\");", "\nvar errorMessage = activity.Errors.First().ToString();", - "\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true)" + "\nerrorMessage.Contains(expectedErrorMessage).Should().Be(true);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,\"YCUP\");", + "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{0.1,0.2,0.3,0.4,0.5,0.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Values = new double[]{1.1,1.2,1.3,1.4,1.5,1.6} }, ", + "\n new YieldCurve{ Currency = \"CHF\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{3.1,3.2,3.3,3.4,3.5,3.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"B\", Values = new double[]{2.1,2.2,2.3,2.4,2.5,2.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"A\", Values = new double[]{6.1,6.2,6.3,6.4,6.5,6.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Values = new double[]{9.1,9.2,9.3,9.4,9.5,9.6} },", + "\n new YieldCurve{ Currency = \"CHF\", Year = 2016, Month = 3, Name = \"A\", Values = new double[]{8.1,8.2,8.3,8.4,8.5,8.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"B\", Values = new double[]{7.1,7.2,7.3,7.4,7.5,7.6} }};", + "\n", + "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 6, \"A\", \"BBA\");", + "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 9.1, 1.1, 6.1);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,\"YCUP\");", + "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{0.1,0.2,0.3,0.4,0.5,0.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Values = new double[]{1.1,1.2,1.3,1.4,1.5,1.6} }, ", + "\n new YieldCurve{ Currency = \"CHF\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{3.1,3.2,3.3,3.4,3.5,3.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"B\", Values = new double[]{2.1,2.2,2.3,2.4,2.5,2.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"A\", Values = new double[]{6.1,6.2,6.3,6.4,6.5,6.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Values = new double[]{9.1,9.2,9.3,9.4,9.5,9.6} },", + "\n new YieldCurve{ Currency = \"CHF\", Year = 2016, Month = 3, Name = \"A\", Values = new double[]{8.1,8.2,8.3,8.4,8.5,8.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"B\", Values = new double[]{7.1,7.2,7.3,7.4,7.5,7.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Scenario = \"YCUP\", Values = new double[]{90.1,9.2,9.3} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Scenario = \"YCUP\", Values = new double[]{10.1,1.2,1.3} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"A\", Scenario = \"YCUP\", Values = new double[]{60.1,6.2,6.3} }, };", + "\n", + "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 6, \"A\", \"BBA\");", + "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 9.1, 10.1, 60.1);", + "\nactivity" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Succeeded);" ], "metadata": {}, "execution_count": 0, @@ -1052,4 +1131,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/ifrs17/Test/TestData.ipynb b/ifrs17/Test/TestData.ipynb index 7a8e98b5..e660e2a6 100644 --- a/ifrs17/Test/TestData.ipynb +++ b/ifrs17/Test/TestData.ipynb @@ -222,7 +222,8 @@ "var groupOfInsuranceContracts = \"DT1.1\";", "\nvar groupOfReinsuranceContracts = \"DTR1.1\";", "\nvar reportingNode = \"CH\";", - "\nvar scenario = (string)null;" + "\nvar scenarioBestEstimate = (string)null;", + "\nvar scenarioMortalityUp = \"MTUP\";" ], "metadata": {}, "execution_count": 0, @@ -231,8 +232,10 @@ { "cell_type": "code", "source": [ - "var args = new ImportArgs(reportingNode, 2021, 3, Periodicity.Quarterly, scenario, ImportFormats.Actual);", - "\nvar previousArgs = new ImportArgs(reportingNode, 2020, 12, Periodicity.Quarterly, scenario, ImportFormats.Actual);" + "var args = new ImportArgs(reportingNode, 2021, 3, Periodicity.Quarterly, scenarioBestEstimate, ImportFormats.Actual);", + "\nvar previousArgs = new ImportArgs(reportingNode, 2020, 12, Periodicity.Quarterly, scenarioBestEstimate, ImportFormats.Actual);", + "\nvar argsScenarioMTUP = new ImportArgs(reportingNode, 2021, 3, Periodicity.Quarterly, scenarioMortalityUp, ImportFormats.Actual);", + "\nvar previousScenarioArgsMTUP = new ImportArgs(reportingNode, 2020, 12, Periodicity.Quarterly, scenarioMortalityUp, ImportFormats.Actual);" ], "metadata": {}, "execution_count": 0, @@ -247,22 +250,39 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var partitionReportingNode = new PartitionByReportingNode { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", + "\n ReportingNode = args.ReportingNode};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ "var partition = new PartitionByReportingNodeAndPeriod { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario, ", + "\n Scenario = scenarioBestEstimate, ", "\n Year = args.Year,", "\n Month = args.Month };", "\nvar previousPeriodPartition = new PartitionByReportingNodeAndPeriod { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(previousArgs)),", "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario, ", + "\n Scenario = scenarioBestEstimate, ", "\n Year = previousArgs.Year,", "\n Month = previousArgs.Month };", - "\nvar partitionReportingNode = new PartitionByReportingNode { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", - "\n ReportingNode = args.ReportingNode};", - "\n" + "\nvar partitionScenarioMTUP = new PartitionByReportingNodeAndPeriod { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(argsScenarioMTUP)),", + "\n ReportingNode = reportingNode, ", + "\n Scenario = scenarioMortalityUp, ", + "\n Year = args.Year,", + "\n Month = args.Month };", + "\nvar previousPeriodPartitionScenarioMTUP = new PartitionByReportingNodeAndPeriod { Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(previousScenarioArgsMTUP)),", + "\n ReportingNode = reportingNode, ", + "\n Scenario = scenarioMortalityUp, ", + "\n Year = previousScenarioArgsMTUP.Year,", + "\n Month = previousScenarioArgsMTUP.Month };" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index 78db6a6f..5a6b070d 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -43,6 +43,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"QueriesScenarioDataTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ From 0f695c248067296379599749a045b768308675f3 Mon Sep 17 00:00:00 2001 From: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:31:13 +0100 Subject: [PATCH 18/19] Reference v1.2.0 in Template project (#249) reference v1.2.0 in Template proj --- .../Constants/CalculationEngine.ipynb | 2 +- ifrs17-template/Export/MapTemplate.ipynb | 6 ++-- .../Import/CloseImportTemplate.ipynb | 8 ++--- ifrs17-template/InputFormatDescription.ipynb | 32 +++++++++---------- ifrs17-template/Report/ParameterReports.ipynb | 16 +++++----- ifrs17-template/Report/Reports.ipynb | 30 ++++++++--------- 6 files changed, 47 insertions(+), 47 deletions(-) diff --git a/ifrs17-template/Constants/CalculationEngine.ipynb b/ifrs17-template/Constants/CalculationEngine.ipynb index d72611fb..b03048c8 100644 --- a/ifrs17-template/Constants/CalculationEngine.ipynb +++ b/ifrs17-template/Constants/CalculationEngine.ipynb @@ -20,7 +20,7 @@ "cell_type": "code", "source": [ "var projectName = \"ifrs17\";", - "\nvar environmentName = \"v1.1.1\";", + "\nvar environmentName = \"v1.2.0\";", "\nvar notebookName = \"CalculationEngine\";", "\nvar calculationEngine = $\"#!import \\\"//{projectName}/{environmentName}/{notebookName}\\\"\";" ], diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index a67b3b81..f3f04f63 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -110,7 +110,7 @@ "source": [ "# Map Template: Data Node", "\n", - "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts)." + "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#group-of-contracts)." ], "metadata": {}, "execution_count": 0, @@ -166,7 +166,7 @@ "source": [ "# Map Template: Data Node State", "\n", - "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)." + "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)." ], "metadata": {}, "execution_count": 0, @@ -252,7 +252,7 @@ "source": [ "# Map Template: Data Node Parameter", "\n", - "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. " + "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. " ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index f1a2bded..92d5cc1f 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -39,7 +39,7 @@ "source": [ "All imports are triggered via the Import command. Several options can be fluently appended to customize the import action:", "\n- FromFile() : accepts a string as input (eg. \"../Files/TransactionalData/Openings_CH_2020_12.csv\"). It corresponds the file to be imported complete with the path", - "\n- WithFormat() : accepts a string as input (eg. \"Cashflow\" or \"Actual\"). It is used to trigger the desired import logic for the current file. Full list of avalaible ImportFormats can be found [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Constants/Consts#import-formats)", + "\n- WithFormat() : accepts a string as input (eg. \"Cashflow\" or \"Actual\"). It is used to trigger the desired import logic for the current file. Full list of avalaible ImportFormats can be found [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Constants/Consts#import-formats)", "\n- WithFileStorage() : defined the drive from where the input files is retrieved. In this example we use the project file storage (new files have to be uploaded into the project), other options are SharePoint and OneDrive. ", "\n- WithTarget() : target drive where the results are stored. In this example we use our in-memory set up", "\n" @@ -89,9 +89,9 @@ "\nNew Data Nodes and Parameters are imported here.", "\n
To easily generate these files, please refer to the **Map Template** files exported [here](../Export/MapTemplate). Edit them at your wish and import them back into the solution through the following cells. ", "\n
For the **ImportFormat**, the following options are expected:", - "\n- ImportFormats.DataNode : [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts)", - "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state) can be either active or inactive.", - "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.", + "\n- ImportFormats.DataNode : [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#group-of-contracts)", + "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-state) can be either active or inactive.", + "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.", "\n" ], "metadata": {}, diff --git a/ifrs17-template/InputFormatDescription.ipynb b/ifrs17-template/InputFormatDescription.ipynb index c3b73c7e..ba37efad 100644 --- a/ifrs17-template/InputFormatDescription.ipynb +++ b/ifrs17-template/InputFormatDescription.ipynb @@ -38,17 +38,17 @@ "source": [ "A cash flow file is named **NominalCashflows** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Cashflow**.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partitions) to which the data belongs.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month and Scenario for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#partitions) to which the data belongs.", "\n", "\nThe **Cashflow** section contains the cash flow data. Several pieces of information are required to characterize a cash flow correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", - "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-type) : entered with its SystemName,", - "\n- [Novelty](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#novelty) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", + "\n- [Novelty](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#novelty) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims.", "\n", - "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.", + "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.", "\n
The cash flow is entered in the columns named ValuesN where N goes from 0 to the length of cash flow. The Value0 corresponds to January of the Year entered in the **Main** section for every combination of AocType and Novelty. " ], "metadata": {}, @@ -73,13 +73,13 @@ "source": [ "An Actuals file is named **Actuals** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Actual**.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partition) to which the data belong.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#partition) to which the data belong.", "\n", "\nThe **Actual** section contains the actuals data. Several pieces of information are required to to characterize an Actuals amount correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#aoc-type) : entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "metadata": {}, @@ -104,12 +104,12 @@ "source": [ "An Openings file is named **Openings** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Opening**. In an AoC for one period, we only need one file with the year/month combination of the beginning of the period. Some GICs do not need any entries in Openings.", "\n", - "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partition) to which the data belong.", + "\nThe **Main** section contains information such as: Reporting Node, Year, Month for which the data is being imported. This information is used to define the [partition](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#partition) to which the data belong.", "\n", "\nThe **Opening** section contains values at opening of an analysis. Several pieces of information are required to to characterize an Opening amount correctly:", - "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#amount-type) : entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#estimate-type) : entered with its SystemName,", + "\n- [DataNode](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "metadata": {}, diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb index acf6f761..d89cd3a0 100644 --- a/ifrs17-template/Report/ParameterReports.ipynb +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -102,7 +102,7 @@ "# Retrieve data ", "\n", "\nThe parameters used for calculation of the provided period are here retrieved through queries.", - "\nThe queries and the data model of the reported objects can be foud in the [ParameterReportQueries](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ParameterReportsQueries#queries)" + "\nThe queries and the data model of the reported objects can be foud in the [ParameterReportQueries](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ParameterReportsQueries#queries)" ], "metadata": {}, "execution_count": 0, @@ -184,7 +184,7 @@ "cell_type": "markdown", "source": [ "## Data node", - "\nProperties of the Group of Contracts and corresponding Portfolios are merged to provide a full description of the [Data Node](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructureDataStructure#data-node)" + "\nProperties of the Group of Contracts and corresponding Portfolios are merged to provide a full description of the [Data Node](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructureDataStructure#data-node)" ], "metadata": {}, "execution_count": 0, @@ -208,7 +208,7 @@ "source": [ "## Data node state", "\n", - "\nCurrent and previous period [data node state](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-state)." + "\nCurrent and previous period [data node state](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-state)." ], "metadata": {}, "execution_count": 0, @@ -233,7 +233,7 @@ "cell_type": "markdown", "source": [ "## Yield curve", - "\n[Yield Curve](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#yield-curve) used for locked-in discounting and current rating discouning (curret period and previous period) are shown." + "\n[Yield Curve](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#yield-curve) used for locked-in discounting and current rating discouning (curret period and previous period) are shown." ], "metadata": {}, "execution_count": 0, @@ -257,7 +257,7 @@ "cell_type": "markdown", "source": [ "## Single data node parameter", - "\n[Single data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) for current and previous period. " + "\n[Single data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " ], "metadata": {}, "execution_count": 0, @@ -281,7 +281,7 @@ "cell_type": "markdown", "source": [ "## Inter data node parameter", - "\n[Inter data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#data-node-parameters) for current and previous period. " + "\n[Inter data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " ], "metadata": {}, "execution_count": 0, @@ -305,7 +305,7 @@ "cell_type": "markdown", "source": [ "## Partner ratings", - "\n[Partner ratings](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#partner-rating) for current and previous period." + "\n[Partner ratings](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#partner-rating) for current and previous period." ], "metadata": {}, "execution_count": 0, @@ -329,7 +329,7 @@ "cell_type": "markdown", "source": [ "## Partner default rates", - "\n[Partner default rates](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/DataModel/DataStructure#credit-default-rate) for current and previous period." + "\n[Partner default rates](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/DataModel/DataStructure#credit-default-rate) for current and previous period." ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Report/Reports.ipynb b/ifrs17-template/Report/Reports.ipynb index c195e876..b9dc29aa 100644 --- a/ifrs17-template/Report/Reports.ipynb +++ b/ifrs17-template/Report/Reports.ipynb @@ -79,7 +79,7 @@ "source": [ "# Best Estimate", "\n", - "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#best-estimate) future cash flows are shown here in an Analysis of Change report.", + "\nPresent values of the [best-estimate](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#best-estimate) future cash flows are shown here in an Analysis of Change report.", "\n", "\nThe granularity of the reported figures can be modified by changing the Column Slices options.", "\nFor example one can add \"GroupOfContract\" to separate the contributions of the individual Group of Contracts.", @@ -110,7 +110,7 @@ "source": [ "# Risk Adjustment", "\n", - "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#risk-adjustment) future cash flows are shown here.", + "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#risk-adjustment) future cash flows are shown here.", "\n", "\nThe additional ColumnSlices are added to the view as the inner column. This can dicrease the readability of the report. For example, adding the slice by \"GroupOfContract\" leaves the lock-in and current rate contributions far apart and difficult to compare. The re-order of default slices with custom slices is achieved by esplicitly add the default slice among the custom slices. In our case, you can try entering both \"GroupOfContract\" and \"EconomicBasis\" separated by a comma in the ColumnSlices." ], @@ -137,7 +137,7 @@ "source": [ "# Written Actuals", "\n", - "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here. ", + "\n[Written Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#written-accrual-deferral) are shown here. ", "\n", "\nIn this case, the analysis of change view is replaced with a default slice by the **AmountTypes**. Only the amount type with non zero value are displayed. ", "\n
Filters can be applied to reports in order to isolate a sub-set of the data. They are specified by the name of the dimension to filter and the system name of the desired value. For example, to investigate the contribution of a single Group of Contract the following filter can be applied: new [] {(\"GroupOfContract\", \"DT1.1\")}." @@ -165,8 +165,8 @@ "source": [ "## Advance, Overdue Actuals", "\n", - "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral)", - "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ", + "\nActuals payed in [Advance](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#written-accrual-deferral)", + "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ", "\n", "\nCombining Filters and ColumnSlices facilitate the report analysis. For example, you can select \"GroupOfContract\" as column slices with a Filter on EstimateType \"AA\" to analyse the Advance Actuals for all Group of Contract. " ], @@ -193,7 +193,7 @@ "source": [ "## Deferrable Actuals", "\n", - "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. " + "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. " ], "metadata": {}, "execution_count": 0, @@ -218,7 +218,7 @@ "source": [ "# Fulfilment Cash flow", "\n", - "\nPresent Value of the [Fulfilment Cash flow](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#fulfillment-cash-flows) are shown here. ", + "\nPresent Value of the [Fulfilment Cash flow](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#fulfillment-cash-flows) are shown here. ", "\n
The individual contributions from Best Estimate and Risk Adjustment can be visualized slicing by **EstimateType**.", "\n", "\nFilters can be applied to report to isolate a sub-set of the data. For example you can Filter by a specific Group of Contract using its system name using : new [] {(\"GroupOfContract\", \"DT1.1\")}.", @@ -247,7 +247,7 @@ "source": [ "# Actuarial Experience Adjustment", "\n", - "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#experience-adjustment)." + "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#experience-adjustment)." ], "metadata": {}, "execution_count": 0, @@ -272,7 +272,7 @@ "source": [ "# LRC Technical Margin", "\n", - "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", + "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", "\n
The Analysis of Change is expanded with few more steps such as **Experience Adjustment** and **Amortization**." ], "metadata": {}, @@ -298,7 +298,7 @@ "source": [ "# Contractual Service Margin / Loss Component / Loss Recovery Component", "\n", - "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ", + "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ", "\n", "\nA default slice by EstimateType - which distinguish between CSM, LC and LR contributions - is automatically enforced. " ], @@ -325,7 +325,7 @@ "source": [ "# LRC Actuarial", "\n", - "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cash flow discounted with current yield curve, and the allocated techinical margin. " + "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cash flow discounted with current yield curve, and the allocated techinical margin. " ], "metadata": {}, "execution_count": 0, @@ -350,7 +350,7 @@ "source": [ "# LRC", "\n", - "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified AoC Chain is used to allow comparison of the balance change between Actuals and Present Values. " + "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified AoC Chain is used to allow comparison of the balance change between Actuals and Present Values. " ], "metadata": {}, "execution_count": 0, @@ -375,7 +375,7 @@ "source": [ "# LIC Actuarial", "\n", - "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cash flow discounted with current yield curve. " + "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cash flow discounted with current yield curve. " ], "metadata": {}, "execution_count": 0, @@ -400,7 +400,7 @@ "source": [ "# LIC", "\n", - "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals." + "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals." ], "metadata": {}, "execution_count": 0, @@ -425,7 +425,7 @@ "source": [ "# Financial Performance", "\n", - "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.1.1/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cash flows (Premiums, Claims, Expenses, etc...) for the given period.", + "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.2.0/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cash flows (Premiums, Claims, Expenses, etc...) for the given period.", "\n", "\nUse the expand and collapse buttons in the report rows to change the granularity of the figures displayed." ], From a1d18f20774824eeaef2a2847ffb69c7087cfb77 Mon Sep 17 00:00:00 2001 From: Davide Colleoni <103409906+dcolleoni@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:30:29 +0100 Subject: [PATCH 19/19] Move NB Format from 4.5 to 4.8 (#250) --- PresentValueSeries/InitializeData.ipynb | 2 +- PresentValueSeries/PresentValue - Episode 2.ipynb | 2 +- PresentValueSeries/PresentValue - Episode 3.ipynb | 2 +- PresentValueSeries/Test.ipynb | 2 +- ifrs17-template/Constants/CalculationEngine.ipynb | 2 +- ifrs17-template/Database/Configure.ipynb | 2 +- ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb | 2 +- .../Database/MigrationAndScaffolding/MigrationFlow.ipynb | 2 +- ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb | 2 +- ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb | 2 +- ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb | 2 +- ifrs17-template/Database/PersonalConnectionExample.ipynb | 2 +- ifrs17-template/Database/Schema Delete.ipynb | 2 +- ifrs17-template/Export/MapTemplate.ipynb | 2 +- ifrs17-template/Import/CloseImportTemplate.ipynb | 2 +- ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb | 2 +- .../Initialization/InitSystemorphRefDataToMemory.ipynb | 2 +- ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb | 2 +- ifrs17-template/Initialization/InitSystemorphToMemory.ipynb | 2 +- ifrs17-template/InputFormatDescription.ipynb | 2 +- ifrs17-template/OverviewIFRS17Template.ipynb | 2 +- .../ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb | 2 +- .../ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb | 2 +- .../CompareReinsuranceContracts/DataImport.ipynb | 2 +- .../PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb | 2 +- .../SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb | 2 +- .../SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb | 2 +- ifrs17-template/Report/InteractiveParameterReport.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/Accruals.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/Deferrals.ipynb | 2 +- .../Report/InteractiveReports/ExperienceAdjustment.ipynb | 2 +- .../Report/InteractiveReports/FinancialPerformance.ipynb | 2 +- .../Report/InteractiveReports/FulfilmentCashflow.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/LIC.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/LRC.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/LoadData.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/PresentValue.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb | 2 +- ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb | 2 +- ifrs17-template/Report/ParameterReports.ipynb | 2 +- ifrs17-template/Report/Reports.ipynb | 2 +- ifrs17-template/Test/Data/ExportIfrsVariable.ipynb | 2 +- ifrs17-template/Test/Data/ExportReportVariables.ipynb | 2 +- .../Test/Data/InitSystemorphToMemoryForTesting.ipynb | 2 +- ifrs17-template/Test/IfrsVariablesTest.ipynb | 2 +- ifrs17-template/Test/MapTemplateAndImportTest.ipynb | 2 +- ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb | 2 +- ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb | 2 +- ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb | 2 +- ifrs17-template/Test/ReportVariablesTest.ipynb | 2 +- ifrs17-template/Test/ReportVariablesTestBase.ipynb | 2 +- ifrs17-template/Test/ScenarioDataImportTest.ipynb | 2 +- ifrs17-template/Test/ScenarioParametersImportTest.ipynb | 2 +- ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb | 2 +- ifrs17-template/Test/SequenceImportTest.ipynb | 2 +- ifrs17-template/Test/Tests.ipynb | 2 +- ifrs17/CalculationEngine.ipynb | 2 +- ifrs17/Constants/Consts.ipynb | 2 +- ifrs17/Constants/Enums.ipynb | 2 +- ifrs17/Constants/Validations.ipynb | 2 +- ifrs17/DataModel/DataStructure.ipynb | 2 +- ifrs17/Export/ExportConfiguration.ipynb | 2 +- ifrs17/Import/ImportScopeCalculation.ipynb | 2 +- ifrs17/Import/ImportStorage.ipynb | 2 +- ifrs17/Import/Importers.ipynb | 2 +- ifrs17/OverviewCalculationEngine.ipynb | 2 +- ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb | 2 +- ifrs17/Report/ParameterReportsQueries.ipynb | 2 +- ifrs17/Report/ReportConfigurationAndUtils.ipynb | 2 +- ifrs17/Report/ReportMutableScopes.ipynb | 2 +- ifrs17/Report/ReportMutableScopesInteractive.ipynb | 2 +- ifrs17/Report/ReportScopes.ipynb | 2 +- ifrs17/Report/ReportStorage.ipynb | 2 +- ifrs17/Test/AggregateDoubleArrayTest.ipynb | 2 +- ifrs17/Test/AocConfigurationTest.ipynb | 2 +- ifrs17/Test/AocStructureTest.ipynb | 2 +- ifrs17/Test/EqualityComparerTest.ipynb | 2 +- ifrs17/Test/ImportStorageTest.ipynb | 2 +- ifrs17/Test/QueriesScenarioDataTest.ipynb | 2 +- ifrs17/Test/QueriesTest.ipynb | 2 +- ifrs17/Test/ReportStorageTest.ipynb | 2 +- ifrs17/Test/TechnicalMarginTest.ipynb | 2 +- ifrs17/Test/TestData.ipynb | 2 +- ifrs17/Test/Tests.ipynb | 2 +- ifrs17/Utils/ActivityLog.ipynb | 2 +- ifrs17/Utils/ApplicationMessage.ipynb | 2 +- ifrs17/Utils/EqualityComparers.ipynb | 2 +- ifrs17/Utils/Extensions.ipynb | 2 +- ifrs17/Utils/ImportCalculationMethods.ipynb | 2 +- ifrs17/Utils/Queries.ipynb | 2 +- ifrs17/Utils/TestHelper.ipynb | 2 +- 95 files changed, 95 insertions(+), 95 deletions(-) diff --git a/PresentValueSeries/InitializeData.ipynb b/PresentValueSeries/InitializeData.ipynb index 20b3f9d6..a7dc504d 100644 --- a/PresentValueSeries/InitializeData.ipynb +++ b/PresentValueSeries/InitializeData.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/PresentValueSeries/PresentValue - Episode 2.ipynb b/PresentValueSeries/PresentValue - Episode 2.ipynb index c98811d5..2a33a1c7 100644 --- a/PresentValueSeries/PresentValue - Episode 2.ipynb +++ b/PresentValueSeries/PresentValue - Episode 2.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/PresentValueSeries/PresentValue - Episode 3.ipynb b/PresentValueSeries/PresentValue - Episode 3.ipynb index 02fb87e8..a8b09155 100644 --- a/PresentValueSeries/PresentValue - Episode 3.ipynb +++ b/PresentValueSeries/PresentValue - Episode 3.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/PresentValueSeries/Test.ipynb b/PresentValueSeries/Test.ipynb index 8d9e322a..049a72e7 100644 --- a/PresentValueSeries/Test.ipynb +++ b/PresentValueSeries/Test.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Constants/CalculationEngine.ipynb b/ifrs17-template/Constants/CalculationEngine.ipynb index b03048c8..c3f4e015 100644 --- a/ifrs17-template/Constants/CalculationEngine.ipynb +++ b/ifrs17-template/Constants/CalculationEngine.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17-template/Database/Configure.ipynb b/ifrs17-template/Database/Configure.ipynb index b613f520..2ff22d3b 100644 --- a/ifrs17-template/Database/Configure.ipynb +++ b/ifrs17-template/Database/Configure.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb index 2a022334..223e80bd 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Initial.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb index 9e2d964b..d7bbb00c 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/MigrationFlow.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb index 080885e2..3863c81d 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/ReadMe.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb index 46caa8b2..435abf39 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Scaffold.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb index f0885c57..532ff740 100644 --- a/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb +++ b/ifrs17-template/Database/MigrationAndScaffolding/Snapshot.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Database/PersonalConnectionExample.ipynb b/ifrs17-template/Database/PersonalConnectionExample.ipynb index 83ae5110..203c0cd1 100644 --- a/ifrs17-template/Database/PersonalConnectionExample.ipynb +++ b/ifrs17-template/Database/PersonalConnectionExample.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17-template/Database/Schema Delete.ipynb b/ifrs17-template/Database/Schema Delete.ipynb index 455e789a..9695bf66 100644 --- a/ifrs17-template/Database/Schema Delete.ipynb +++ b/ifrs17-template/Database/Schema Delete.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index f3f04f63..a4538e72 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 92d5cc1f..9662ac57 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 425b716a..59a4f805 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index 0ecdf39c..9ee80c7a 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index b54f5f1c..fae6f837 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index 43ed45fe..b196f3e8 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/InputFormatDescription.ipynb b/ifrs17-template/InputFormatDescription.ipynb index ba37efad..79563031 100644 --- a/ifrs17-template/InputFormatDescription.ipynb +++ b/ifrs17-template/InputFormatDescription.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/OverviewIFRS17Template.ipynb b/ifrs17-template/OverviewIFRS17Template.ipynb index a12205c3..5bb78de2 100644 --- a/ifrs17-template/OverviewIFRS17Template.ipynb +++ b/ifrs17-template/OverviewIFRS17Template.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index 29c878e3..87fd4e02 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb index 8477b81d..6c493cd4 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb index 71c126c7..fe076312 100644 --- a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/DataImport.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb index db07a7b7..209e4d2d 100644 --- a/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb +++ b/ifrs17-template/PracticalUseCases/CompareReinsuranceContracts/Reports.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index 69bbb85e..74524f7c 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb index 976270bc..51ab27b4 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveParameterReport.ipynb b/ifrs17-template/Report/InteractiveParameterReport.ipynb index 82c1d443..d0a57990 100644 --- a/ifrs17-template/Report/InteractiveParameterReport.ipynb +++ b/ifrs17-template/Report/InteractiveParameterReport.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/Accruals.ipynb b/ifrs17-template/Report/InteractiveReports/Accruals.ipynb index c2b3eb39..75dc7156 100644 --- a/ifrs17-template/Report/InteractiveReports/Accruals.ipynb +++ b/ifrs17-template/Report/InteractiveReports/Accruals.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb b/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb index 605fccf9..79e91b5d 100644 --- a/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb +++ b/ifrs17-template/Report/InteractiveReports/Csm-Lc-LoReCo.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb b/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb index 74ed4bbe..ca2df7be 100644 --- a/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb +++ b/ifrs17-template/Report/InteractiveReports/Deferrals.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb b/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb index bca1a5d0..deb117cf 100644 --- a/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb +++ b/ifrs17-template/Report/InteractiveReports/ExperienceAdjustment.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb b/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb index f6d93cd9..a9362ec3 100644 --- a/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb +++ b/ifrs17-template/Report/InteractiveReports/FinancialPerformance.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb b/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb index e9eb2257..1d236eb3 100644 --- a/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb +++ b/ifrs17-template/Report/InteractiveReports/FulfilmentCashflow.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/LIC.ipynb b/ifrs17-template/Report/InteractiveReports/LIC.ipynb index e7080f53..47a75c64 100644 --- a/ifrs17-template/Report/InteractiveReports/LIC.ipynb +++ b/ifrs17-template/Report/InteractiveReports/LIC.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/LRC.ipynb b/ifrs17-template/Report/InteractiveReports/LRC.ipynb index b33382f5..8af13994 100644 --- a/ifrs17-template/Report/InteractiveReports/LRC.ipynb +++ b/ifrs17-template/Report/InteractiveReports/LRC.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb b/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb index a7ceb1a8..51b14119 100644 --- a/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb +++ b/ifrs17-template/Report/InteractiveReports/LicActuarial.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/LoadData.ipynb b/ifrs17-template/Report/InteractiveReports/LoadData.ipynb index 0b97f90a..bd3666a6 100644 --- a/ifrs17-template/Report/InteractiveReports/LoadData.ipynb +++ b/ifrs17-template/Report/InteractiveReports/LoadData.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb b/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb index 760172db..c265e2d7 100644 --- a/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb +++ b/ifrs17-template/Report/InteractiveReports/LrcActuarial.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb b/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb index 8695c9e8..121c4e1b 100644 --- a/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb +++ b/ifrs17-template/Report/InteractiveReports/PresentValue.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb b/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb index c34ad162..0d434716 100644 --- a/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb +++ b/ifrs17-template/Report/InteractiveReports/RiskAdjustment.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb b/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb index 62b7e671..f6457dcf 100644 --- a/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb +++ b/ifrs17-template/Report/InteractiveReports/TechnicalMargin.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb b/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb index b03d6226..2de89a90 100644 --- a/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb +++ b/ifrs17-template/Report/InteractiveReports/WrittenActual.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb index d89cd3a0..b46257ee 100644 --- a/ifrs17-template/Report/ParameterReports.ipynb +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Report/Reports.ipynb b/ifrs17-template/Report/Reports.ipynb index b9dc29aa..1b9facff 100644 --- a/ifrs17-template/Report/Reports.ipynb +++ b/ifrs17-template/Report/Reports.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb index 7eb4f123..024579cd 100644 --- a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb +++ b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/Data/ExportReportVariables.ipynb b/ifrs17-template/Test/Data/ExportReportVariables.ipynb index 187ffd73..b02953c4 100644 --- a/ifrs17-template/Test/Data/ExportReportVariables.ipynb +++ b/ifrs17-template/Test/Data/ExportReportVariables.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 67171d72..44c43288 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb index fc9772ba..851ae200 100644 --- a/ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 60ac6284..99938caa 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb b/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb index 1dd309db..7b64a176 100644 --- a/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb +++ b/ifrs17-template/Test/PracticalCase-CSMSwitchTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb b/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb index 779c4d80..a8bd925f 100644 --- a/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb +++ b/ifrs17-template/Test/PracticalCase-CompareReinsuranceTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb index 37e4280a..a51633ec 100644 --- a/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb +++ b/ifrs17-template/Test/ReimportWithDifferentScopeTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ReportVariablesTest.ipynb b/ifrs17-template/Test/ReportVariablesTest.ipynb index 2d6351fe..be2c38f9 100644 --- a/ifrs17-template/Test/ReportVariablesTest.ipynb +++ b/ifrs17-template/Test/ReportVariablesTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ReportVariablesTestBase.ipynb b/ifrs17-template/Test/ReportVariablesTestBase.ipynb index 194adf0f..70fb899d 100644 --- a/ifrs17-template/Test/ReportVariablesTestBase.ipynb +++ b/ifrs17-template/Test/ReportVariablesTestBase.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb index b0419970..5b5e8e52 100644 --- a/ifrs17-template/Test/ScenarioDataImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb index 5dd27700..907f3f47 100644 --- a/ifrs17-template/Test/ScenarioParametersImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioParametersImportTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb index 843dbf9f..8bdbac30 100644 --- a/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb +++ b/ifrs17-template/Test/ScenarioYieldCurveImportTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index aef67b5e..97e3cb2b 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index c6c44706..6fe7644b 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 1a320c63..ab86a1a1 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index cb4b750d..26801b20 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Constants/Enums.ipynb b/ifrs17/Constants/Enums.ipynb index aa5231be..6dea86b7 100644 --- a/ifrs17/Constants/Enums.ipynb +++ b/ifrs17/Constants/Enums.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index e214b58a..633de229 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index a27687cb..40e8e34b 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index ffc11dfa..5268ec09 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index 3a357622..a49ba1dc 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 7b3bd562..febe6674 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 87a517db..eaf7f45f 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/OverviewCalculationEngine.ipynb b/ifrs17/OverviewCalculationEngine.ipynb index 2ba37ea6..df10c230 100644 --- a/ifrs17/OverviewCalculationEngine.ipynb +++ b/ifrs17/OverviewCalculationEngine.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb index 199703ff..6e2fe467 100644 --- a/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb +++ b/ifrs17/Report/ParameterReportMutableScopeInteractive.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ParameterReportsQueries.ipynb b/ifrs17/Report/ParameterReportsQueries.ipynb index 7e401112..93780429 100644 --- a/ifrs17/Report/ParameterReportsQueries.ipynb +++ b/ifrs17/Report/ParameterReportsQueries.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index 069c2f44..ef268227 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index 2689ec60..d1d92625 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ReportMutableScopesInteractive.ipynb b/ifrs17/Report/ReportMutableScopesInteractive.ipynb index 26fb0f69..d73da2e6 100644 --- a/ifrs17/Report/ReportMutableScopesInteractive.ipynb +++ b/ifrs17/Report/ReportMutableScopesInteractive.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb index fd8e37c1..2c00626a 100644 --- a/ifrs17/Report/ReportScopes.ipynb +++ b/ifrs17/Report/ReportScopes.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Report/ReportStorage.ipynb b/ifrs17/Report/ReportStorage.ipynb index 3af872a6..54514a51 100644 --- a/ifrs17/Report/ReportStorage.ipynb +++ b/ifrs17/Report/ReportStorage.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/AggregateDoubleArrayTest.ipynb b/ifrs17/Test/AggregateDoubleArrayTest.ipynb index 9d9a9b35..27cc81dc 100644 --- a/ifrs17/Test/AggregateDoubleArrayTest.ipynb +++ b/ifrs17/Test/AggregateDoubleArrayTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17/Test/AocConfigurationTest.ipynb b/ifrs17/Test/AocConfigurationTest.ipynb index 16274ad5..9f05c8a9 100644 --- a/ifrs17/Test/AocConfigurationTest.ipynb +++ b/ifrs17/Test/AocConfigurationTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/AocStructureTest.ipynb b/ifrs17/Test/AocStructureTest.ipynb index c3fbbd6b..3a5b4c45 100644 --- a/ifrs17/Test/AocStructureTest.ipynb +++ b/ifrs17/Test/AocStructureTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/EqualityComparerTest.ipynb b/ifrs17/Test/EqualityComparerTest.ipynb index 0c567485..4c97e989 100644 --- a/ifrs17/Test/EqualityComparerTest.ipynb +++ b/ifrs17/Test/EqualityComparerTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/ImportStorageTest.ipynb b/ifrs17/Test/ImportStorageTest.ipynb index b6827a63..90dfa772 100644 --- a/ifrs17/Test/ImportStorageTest.ipynb +++ b/ifrs17/Test/ImportStorageTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/QueriesScenarioDataTest.ipynb b/ifrs17/Test/QueriesScenarioDataTest.ipynb index 6caa9e49..a24898a6 100644 --- a/ifrs17/Test/QueriesScenarioDataTest.ipynb +++ b/ifrs17/Test/QueriesScenarioDataTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17/Test/QueriesTest.ipynb b/ifrs17/Test/QueriesTest.ipynb index ed804833..96b29978 100644 --- a/ifrs17/Test/QueriesTest.ipynb +++ b/ifrs17/Test/QueriesTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17/Test/ReportStorageTest.ipynb b/ifrs17/Test/ReportStorageTest.ipynb index 8d2c9414..e5d77dbe 100644 --- a/ifrs17/Test/ReportStorageTest.ipynb +++ b/ifrs17/Test/ReportStorageTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "code", diff --git a/ifrs17/Test/TechnicalMarginTest.ipynb b/ifrs17/Test/TechnicalMarginTest.ipynb index fa5138a7..a7b29d3d 100644 --- a/ifrs17/Test/TechnicalMarginTest.ipynb +++ b/ifrs17/Test/TechnicalMarginTest.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/TestData.ipynb b/ifrs17/Test/TestData.ipynb index e660e2a6..e222656a 100644 --- a/ifrs17/Test/TestData.ipynb +++ b/ifrs17/Test/TestData.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index 5a6b070d..aa5cba54 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index c522bc2d..e821c2ff 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/ApplicationMessage.ipynb b/ifrs17/Utils/ApplicationMessage.ipynb index 64c766ed..bd39c52e 100644 --- a/ifrs17/Utils/ApplicationMessage.ipynb +++ b/ifrs17/Utils/ApplicationMessage.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/EqualityComparers.ipynb b/ifrs17/Utils/EqualityComparers.ipynb index 95c8b455..2f713e97 100644 --- a/ifrs17/Utils/EqualityComparers.ipynb +++ b/ifrs17/Utils/EqualityComparers.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index c3587cec..45c921fc 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index c1c3de8a..6e96e64d 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/Queries.ipynb b/ifrs17/Utils/Queries.ipynb index 809fe695..ce59b274 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown", diff --git a/ifrs17/Utils/TestHelper.ipynb b/ifrs17/Utils/TestHelper.ipynb index 79512a83..93512a05 100644 --- a/ifrs17/Utils/TestHelper.ipynb +++ b/ifrs17/Utils/TestHelper.ipynb @@ -14,7 +14,7 @@ } }, "nbformat": 4, - "nbformat_minor": 5, + "nbformat_minor": 8, "cells": [ { "cell_type": "markdown",