diff --git a/PresentValueSeries/AnalysisOfChange.png b/PresentValueSeries/AnalysisOfChange.png new file mode 100644 index 00000000..75bbb916 Binary files /dev/null and b/PresentValueSeries/AnalysisOfChange.png differ diff --git a/PresentValueSeries/CF_CH_2021_12.xlsx b/PresentValueSeries/CF_CH_2021_12.xlsx index bdc502b9..a7156d0c 100644 Binary files a/PresentValueSeries/CF_CH_2021_12.xlsx and b/PresentValueSeries/CF_CH_2021_12.xlsx differ diff --git a/PresentValueSeries/CF_DE_2021_12.xlsx b/PresentValueSeries/CF_DE_2021_12.xlsx index 72fb2aff..5d1be035 100644 Binary files a/PresentValueSeries/CF_DE_2021_12.xlsx and b/PresentValueSeries/CF_DE_2021_12.xlsx differ diff --git a/PresentValueSeries/CF_DE_2022_12.xlsx b/PresentValueSeries/CF_DE_2022_12.xlsx index fe5e13b8..cbcadc97 100644 Binary files a/PresentValueSeries/CF_DE_2022_12.xlsx and b/PresentValueSeries/CF_DE_2022_12.xlsx differ diff --git a/PresentValueSeries/Cashflows.xlsx b/PresentValueSeries/Cashflows.xlsx index 1b1ffd52..acc96124 100644 Binary files a/PresentValueSeries/Cashflows.xlsx and b/PresentValueSeries/Cashflows.xlsx differ diff --git a/PresentValueSeries/Dimensions.xlsx b/PresentValueSeries/Dimensions.xlsx index 806a6c76..0fd16d7d 100644 Binary files a/PresentValueSeries/Dimensions.xlsx and b/PresentValueSeries/Dimensions.xlsx differ diff --git a/PresentValueSeries/InitializeData.ipynb b/PresentValueSeries/InitializeData.ipynb index bb01a0f9..aacb77e0 100644 --- a/PresentValueSeries/InitializeData.ipynb +++ b/PresentValueSeries/InitializeData.ipynb @@ -67,7 +67,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Dimensions.xlsx\").WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Dimensions.xlsx\")", + "\n .WithFormat(ImportFormats.AocConfiguration)", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -76,7 +79,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/PresentValueSeries/PresentValue - Episode 2.ipynb b/PresentValueSeries/PresentValue - Episode 2.ipynb index b4fd0906..9164e6e5 100644 --- a/PresentValueSeries/PresentValue - Episode 2.ipynb +++ b/PresentValueSeries/PresentValue - Episode 2.ipynb @@ -31,9 +31,33 @@ { "cell_type": "markdown", "source": [ - "> IFRS 17 is a new accounting standard for insurance contracts. It is an economic accounting approach, replacing the nominal accounting of the previous standard IFRS 4, that is, the economic value of the insurance products is considered. The focus is on the liabilities of an insurance company, namely the insurance policies. ", + "> The International Financial Reporting Standard (IFRS) 17 is the new economic accounting standard for insurance contracts. It entails that the **economic value of insurance products** is considered, ", + "\n> as opposed to the previous nominal accounting standard IFRS 4. The focus is on the liabilities of an insurance company, namely the insurance policies. ", + "\n>", + "\n> This means being able to answer to the question: ", + "\n> ", + "\n> *what is the value of an issued insurance contract today?*", "\n", - "\n

" + "\n> For this reason, IFRS 17 is based on the idea of computing the Present Value of the insurance contracts. ", + "\n> This is the money you or someone else would pay for all these insurance policies today. ", + "\n> Calculating present value, and understanding its evolution over time, is the basis for computing IFRS 17 financials. ", + "\n", + "\n

", + "\n
", + "\n", + "\nThe aim of this notebook is to illustrate the IFRS 17 *Present Value* calculation using Systemorph Cloud Technology. Present Values are the amount of money that someone would pay in the present day for the contracts of the group up to their run off. The starting point are the so called *Nominal Cash flows*, which express the amounts of cash and cash equivalents being transferred into and out of a business. Cash flow values are **discounted** according to the *Yield Curve* provided as economic input in order to take into account the corresponding Interest Accretion, and the discounted figures are **cumulated** to find the **Present Values**. ", + "\n", + "\nThe IFRS 17 standard prescribes that the accounting statements are based on the value of a group of insurance contracts at the beginning of the period (BoP), their development throughout the period, and the value at the end of the period (EoP). While the period is typically a quarter, the **Analysis of Change** (AoC) from BoP to EoP per group of contract is made considering for each step the variation of the cash flow so as to enhance the readability of the value changes. To this aim it is necessary to **evaluate the Present Value difference** (or delta) between each step, yielding the figures shown in the resulting report.", + "\n", + "\nThe company portfolio value change throughout one period is given by the following standard steps:", + "\n", + "\n1. Beginning of Period (BOP): starting value of the portfolio as of December last year (in the Year to Date view), ", + "\n2. Model Corrections (MC): change of the portfolio value based on the model change,", + "\n3. Cash Flow (CF): release of the expected cash flow for the current period", + "\n4. Interest Accretion (IA): change of the nominal cash flow due to the economic interest rate", + "\n5. Assumption Update (AU): change in (non-)financial assumptions (insurance risks, expenses, other non-economic)", + "\n6. Experience Variance (EV): value adjustments following insurance related events which took place (e.g. mortality),", + "\n7. End of Period (EOP): portfolio value at the end of the current period." ], "metadata": {}, "execution_count": 0, @@ -42,13 +66,9 @@ { "cell_type": "markdown", "source": [ - "
", + "The AoC chain for two consecutive periods looks like this", "\n", - "\nThe aim of this notebook is to illustrate the IFRS 17 *Present Value* calculation using Systemorph Cloud Technology. Present Values are the amount of money that someone would pay in the present day for the contracts of the group up to their run off. The starting point are the so called *Nominal Cash flows*, which express the amounts of cash and cash equivalents being transferred into and out of a business. Cash flow values are **discounted** according to the *Yield Curve* provided as economic input in order to take into account the corresponding Interest Accretion, and the discounted figures are **cumulated** to find the **Present Values**. ", - "\n", - "\nThe IFRS 17 standard prescribes that the accounting statements are based on the value of a group of insurance contracts at the beginning of the period (BoP), their development throughout the period, and the value at the end of the period (EoP). While the period is typically a quarter, the **Analysis of Change** (AoC) from BoP to EoP per group of contract is made considering for each step the variation of the cash flow so as to enhance the readability of the value changes. To this aim it is necessary to **evaluate the Present Value difference** (or delta) between each step, yielding the figures shown in the resulting report.", - "\n", - "\nThis process is pictorially represented in the flowchart below" + "\n
" ], "metadata": {}, "execution_count": 0, @@ -57,7 +77,9 @@ { "cell_type": "markdown", "source": [ - "
" + "This process is pictorially represented in the flowchart below", + "\n", + "\n
" ], "metadata": {}, "execution_count": 0, @@ -146,7 +168,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"YieldCurve.xlsx\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"YieldCurve.xlsx\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -155,7 +180,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Cashflows.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Cashflows.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -217,7 +245,7 @@ { "cell_type": "markdown", "source": [ - "














", + "



", "\n", "\n# View imported Data" ], diff --git a/PresentValueSeries/PresentValue - Episode 3.ipynb b/PresentValueSeries/PresentValue - Episode 3.ipynb index 114e275b..16605c69 100644 --- a/PresentValueSeries/PresentValue - Episode 3.ipynb +++ b/PresentValueSeries/PresentValue - Episode 3.ipynb @@ -31,9 +31,33 @@ { "cell_type": "markdown", "source": [ - "> IFRS 17 is a new accounting standard for insurance contracts. It is an economic accounting approach, replacing the nominal accounting of the previous standard IFRS 4, that is, the economic value of the insurance products is considered. The focus is on the liabilities of an insurance company, namely the insurance policies. ", + "> The International Financial Reporting Standard (IFRS) 17 is the new economic accounting standard for insurance contracts. It entails that the **economic value of insurance products** is considered, ", + "\n> as opposed to the previous nominal accounting standard IFRS 4. The focus is on the liabilities of an insurance company, namely the insurance policies. ", + "\n>", + "\n> This means being able to answer to the question: ", + "\n> ", + "\n> *what is the value of an issued insurance contract today?*", "\n", - "\n

" + "\n> For this reason, IFRS 17 is based on the idea of computing the Present Value of the insurance contracts. ", + "\n> This is the money you or someone else would pay for all these insurance policies today. ", + "\n> Calculating present value, and understanding its evolution over time, is the basis for computing IFRS 17 financials. ", + "\n", + "\n

", + "\n
", + "\n", + "\nThe aim of this notebook is to illustrate the IFRS 17 *Present Value* calculation using Systemorph Cloud Technology. Present Values are the amount of money that someone would pay in the present day for the contracts of the group up to their run off. The starting point are the so called *Nominal Cash flows*, which express the amounts of cash and cash equivalents being transferred into and out of a business. Cash flow values are **discounted** according to the *Yield Curve* provided as economic input in order to take into account the corresponding Interest Accretion, and the discounted figures are **cumulated** to find the **Present Values**. ", + "\n", + "\nThe IFRS 17 standard prescribes that the accounting statements are based on the value of a group of insurance contracts at the beginning of the period (BoP), their development throughout the period, and the value at the end of the period (EoP). While the period is typically a quarter, the **Analysis of Change** (AoC) from BoP to EoP per group of contract is made considering for each step the variation of the cash flow so as to enhance the readability of the value changes. To this aim it is necessary to **evaluate the Present Value difference** (or delta) between each step, yielding the figures shown in the resulting report.", + "\n", + "\nThe company portfolio value change throughout one period is given by the following standard steps:", + "\n", + "\n1. Beginning of Period (BOP): starting value of the portfolio as of December last year (in the Year to Date view), ", + "\n2. Model Corrections (MC): change of the portfolio value based on the model change,", + "\n3. Cash Flow (CF): release of the expected cash flow for the current period", + "\n4. Interest Accretion (IA): change of the nominal cash flow due to the economic interest rate", + "\n5. Assumption Update (AU): change in (non-)financial assumptions (insurance risks, expenses, other non-economic)", + "\n6. Experience Variance (EV): value adjustments following insurance related events which took place (e.g. mortality),", + "\n7. End of Period (EOP): portfolio value at the end of the current period." ], "metadata": {}, "execution_count": 0, @@ -42,13 +66,9 @@ { "cell_type": "markdown", "source": [ - "
", - "\n", - "\nThe aim of this notebook is to illustrate the IFRS 17 *Present Value* calculation using Systemorph Cloud Technology. Present Values are the amount of money that someone would pay in the present day for the contracts of the group up to their run off. The starting point are the so called *Nominal Cash flows*, which express the amounts of cash and cash equivalents being transferred into and out of a business. Cash flow values are **discounted** according to the *Yield Curve* provided as economic input in order to take into account the corresponding Interest Accretion, and the discounted figures are **cumulated** to find the **Present Values**. ", + "The AoC chain for two consecutive periods looks like this", "\n", - "\nThe IFRS 17 standard prescribes that the accounting statements are based on the value of a group of insurance contracts at the beginning of the period (BoP), their development throughout the period, and the value at the end of the period (EoP). While the period is typically a quarter, the **Analysis of Change** (AoC) from BoP to EoP per group of contract is made considering for each step the variation of the cash flow so as to enhance the readability of the value changes. To this aim it is necessary to **evaluate the Present Value difference** (or delta) between each step, yielding the figures shown in the resulting report.", - "\n", - "\nThis process is pictorially represented in the flowchart below" + "\n
" ], "metadata": {}, "execution_count": 0, @@ -57,7 +77,9 @@ { "cell_type": "markdown", "source": [ - "
" + "This process is pictorially represented in the flowchart below", + "\n", + "\n
" ], "metadata": {}, "execution_count": 0, @@ -146,7 +168,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_CH.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_CH.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -155,7 +180,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_DE.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_DE.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -164,7 +192,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"YieldCurve.xlsx\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"YieldCurve.xlsx\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -173,7 +204,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Cashflows.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Cashflows.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -182,7 +216,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_CH_2021_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_CH_2021_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -191,7 +228,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_DE_2021_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_DE_2021_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -200,7 +240,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_DE_2022_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_DE_2022_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -271,7 +314,7 @@ { "cell_type": "markdown", "source": [ - "














", + "








", "\n", "\n# View imported Data" ], @@ -345,7 +388,7 @@ { "cell_type": "code", "source": [ - "await Report.ForDataCube(nominals.ToReportType()).SliceRowsBy(\"AmountType\",\"AocType\").SliceColumnsBy(\"Index\").WithQuerySource(Workspace).ToBarChart().ExecuteAsync()" + "await Report.ForDataCube(nominals.ToReportType()).SliceRowsBy(\"AmountType\",\"AocType\").SliceColumnsBy(\"Index\").WithQuerySource(Workspace).ToBarChart().WithColorScheme(Palettes.Brewer.PuBu3).ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index 931953b7..a56e1ffe 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 .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -240,7 +240,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -326,7 +326,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Files/Dimensions.csv b/ifrs17-template/Files/Dimensions.csv index 63f91bdb..85a30f1d 100644 --- a/ifrs17-template/Files/Dimensions.csv +++ b/ifrs17-template/Files/Dimensions.csv @@ -1,9 +1,9 @@ @@AmountType,,,,,,,,,,, -SystemName,DisplayName,Parent,Order,PeriodType,ExternalId0,ExternalId1,ExternalId2,ExternalId3,,, -PR,Premiums,,10,BeginningOfPeriod,PayablePR,ReceivablePR,RiPayablePR,RiReceivablePR,,, +SystemName,DisplayName,Parent,Order,PeriodType,,,,,,, +PR,Premiums,,10,BeginningOfPeriod,,,,,,, CL,Claims,,20,EndOfPeriod,,,,,,, -NIC,Non Investment Component,CL,30,EndOfPeriod,PayableNIC,ReceivableNIC,RiPayableNIC,RiReceivableNIC,,, -ICO,Investment Component,CL,40,EndOfPeriod,PayableICO,ReceivableICO,,,,, +NIC,Non Investment Component,CL,30,EndOfPeriod,,,,,,, +ICO,Investment Component,CL,40,EndOfPeriod,,,,,,, CDR,Credit Default Risk,CL,50,EndOfPeriod,,,,,,, CE,Claim Expenses,CL,200,EndOfPeriod,,,,,,, ALE,Allocated Loss Adjustment Expenses,CE,210,EndOfPeriod,,,,,,, @@ -53,6 +53,7 @@ YCU,I,CalculatedTelescopic,4,EndOfPeriod,EndOfPeriod,BeginningOfPeriod,EndOfPeri CRU,I,CalculatedTelescopic,4,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,80,1900,1 EV,I,Optional,4,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,90,1900,1 BOP,N,Optional,4,Average,EndOfPeriod,EndOfPeriod,BeginningOfPeriod,EndOfPeriod,100,1900,1 +MC,N,Optional,4,Average,EndOfPeriod,EndOfPeriod,BeginningOfPeriod,EndOfPeriod,105,1900,1 CF,N,Calculated,4,Average,NotApplicable,EndOfPeriod,Delta,EndOfPeriod,110,1900,1 IA,N,Calculated,4,Average,EndOfPeriod,EndOfPeriod,Delta,EndOfPeriod,120,1900,1 AU,N,Optional,4,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,130,1900,1 @@ -99,8 +100,9 @@ EUR,Euro,,,,,,,,,, GBP,British Pound,,,,,,,,,, HKD,Hong Kong Dollar,,,,,,,,,, ITL,Italian Lira,,,,,,,,,, -PLN,Polish Zloty (since 01.01.95),,,,,,,,,, +PLN,Polish Zloty,,,,,,,,,, SKK,Slovakian Krona,,,,,,,,,, +XTSHY,Testing Currency (High Yields),,,,,,,,,, ,,,,,,,,,,, @@EconomicBasis,,,,,,,,,,, SystemName,DisplayName,Order,,,,,,,,, @@ -109,7 +111,7 @@ L,Locked-in,10,,,,,,,,, C,Current,20,,,,,,,,, ,,,,,,,,,,, @@EstimateType,,,,,,,,,,, -SystemName,DisplayName,Order,StructureType,InputSource,PeriodType,ExternalId0,ExternalId1,ExternalId2,ExternalId3,ExternalId4, +SystemName,DisplayName,Order,StructureType,InputSource,PeriodType,,,,,, BE,Best Estimate of Present Value,1,AoC,4,EndOfPeriod,,,,,, RA,Risk Adjustment,10,AoC,4,EndOfPeriod,,,,,, CU,CoverageUnit,15,AoC,4,EndOfPeriod,,,,,, @@ -117,9 +119,9 @@ C,Contractual Service Margin,20,AoC,7,NotApplicable,,,,,, L,Loss Component,30,AoC,7,NotApplicable,,,,,, LR,Loss Recovery Component,40,AoC,7,NotApplicable,,,,,, PL,Profit and Loss,50,None,7,NotApplicable,,,,,, -AA,Advance Actuals,60,AoC,3,NotApplicable,PayablePR,ReceivableNIC,ReceivableICO,RiReceivablePR,RiPayableNIC, -OA,Overdue Actuals,70,AoC,3,NotApplicable,ReceivablePR,PayableNIC,PayableICO,RiPayablePR,RiReceivableNIC, -DA,Deferrable Actuals,80,AoC,3,NotApplicable,,,,,, +AA,Advance Actuals,60,AoC,3,NotApplicable,,,,,, +OA,Overdue Actuals,70,AoC,3,NotApplicable,,,,,, +DA,Deferrable Actuals,80,AoC,7,NotApplicable,,,,,, A,Actuals,90,None,2,NotApplicable,,,,,, F,Factors,100,None,4,NotApplicable,,,,,, APA,Actuals,130,None,2,NotApplicable,,,,,, diff --git a/ifrs17-template/Files/Parameters/YieldCurve.csv b/ifrs17-template/Files/Parameters/YieldCurve.csv deleted file mode 100644 index 892b7ee7..00000000 --- a/ifrs17-template/Files/Parameters/YieldCurve.csv +++ /dev/null @@ -1,11 +0,0 @@ -@@YieldCurve,,,,,, -Currency,Year,Month,Values0,Values1,Values2,Values3 -EUR,2020,3,0.008685495,0.008685495,0.018498471,0.019966839 -CHF,2020,3,0.002,0.002,0.002,0.002 -CHF,2021,3,0.1,0.1,0.1,0.1 -USD,2021,3,0.005,0.005,0.005,0.005 -USD,2020,12,0.002,0.002,0.002,0.002 -USD,2020,3,0.002,0.002,0.002,0.002 -USD,2020,1,0.002,0.002,0.002,0.002 -GBP,2021,3,0.005,0.005,0.005,0.005 -GBP,2020,3,0.002,0.002,0.002,0.002 diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2019_12.csv b/ifrs17-template/Files/Parameters/YieldCurve_2019_12.csv new file mode 100644 index 00000000..657f3e7e --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2019_12.csv @@ -0,0 +1,7 @@ +@@Main +Year,Month +2019,12 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +CHF,0,0,0.015,0.02 +XTSHY,0.85,0.85,0.85,0.85 \ No newline at end of file diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2020_1.csv b/ifrs17-template/Files/Parameters/YieldCurve_2020_1.csv new file mode 100644 index 00000000..c94e347e --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2020_1.csv @@ -0,0 +1,7 @@ +@@Main +Year,Month +2020,12 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +USD,0.002,0.002,0.002,0.002 + diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2020_12.csv b/ifrs17-template/Files/Parameters/YieldCurve_2020_12.csv new file mode 100644 index 00000000..48e9669d --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2020_12.csv @@ -0,0 +1,8 @@ +@@Main +Year,Month +2020,1 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +USD,0.002,0.002,0.002,0.002 +CHF,0.01,0.02,0.025,0.025 + diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2020_3.csv b/ifrs17-template/Files/Parameters/YieldCurve_2020_3.csv new file mode 100644 index 00000000..266e8682 --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2020_3.csv @@ -0,0 +1,8 @@ +@@Main +Year,Month +2020,3 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +EUR,0.008685495,0.008685495,0.018498471,0.019966839 +USD,0.002,0.002,0.002,0.002 +GBP,0.01,0.015,0.02,0.02 diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2021_12.csv b/ifrs17-template/Files/Parameters/YieldCurve_2021_12.csv new file mode 100644 index 00000000..ef5b7414 --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2021_12.csv @@ -0,0 +1,6 @@ +@@Main +Year,Month +2021,12 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +CHF,0.025,0.025,0.035,0.035 diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2021_3.csv b/ifrs17-template/Files/Parameters/YieldCurve_2021_3.csv new file mode 100644 index 00000000..5386ae88 --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2021_3.csv @@ -0,0 +1,7 @@ +@@Main +Year,Month +2021,3 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +USD,0.005,0.005,0.005,0.005 +GBP,0.015,0.02,0.02,0.025 diff --git a/ifrs17-template/Files/Parameters/YieldCurve_2021_6.csv b/ifrs17-template/Files/Parameters/YieldCurve_2021_6.csv new file mode 100644 index 00000000..65e212d4 --- /dev/null +++ b/ifrs17-template/Files/Parameters/YieldCurve_2021_6.csv @@ -0,0 +1,6 @@ +@@Main +Year,Month +2021,6 +@@YieldCurve +Currency,Values0,Values1,Values2,Values3 +CHF,0.03,0.03,0.035,0.035 diff --git a/ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv b/ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv index ae6b2620..a7900401 100644 --- a/ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv +++ b/ifrs17-template/Files/TransactionalData/Actuals_CH_2020_12.csv @@ -1,55 +1,55 @@ -@@Main,,,, -ReportingNode,Year,Month,, -CH,2020,12,, -@@Actual,,,, -DataNode,AocType,ValueType,AccidentYear,Value -DT1.1,CF,PR,,400 -DT1.1,CF,NIC,,-280 -DT1.1,CF,ACA,,-10 -DT1.1,CF,AEA,,-5 -DT1.2,CF,NIC,2020,-280 -DT2.1,CF,PR,,400 -DT2.1,CF,NIC,,-280 -DT2.1,CF,ACA,,-10 -DT2.1,CF,AEA,,-5 -DT1.3,CF,PR,,400 -DT1.3,CF,NIC,,-280 -DT1.3,CF,ACA,,-10 -DT1.3,CF,AEA,,-5 -DT1.4,CF,PR,,400 -DT1.4,CF,NIC,,-280 -DT1.4,CF,ACA,,-10 -DT1.4,CF,AEA,,-5 -DT1.4,CF,PayablePR,,15 -DT1.4,CF,ReceivablePR,,-10 -DT1.4,CF,ReceivableNIC,,-5 -DT1.4,CF,PayableNIC,,8 -DT2.2,CF,NIC,2020,-280 -DTR1.1,CF,PR,,-200 -DTR1.1,CF,NIC,,140 -DTR1.2,CF,NIC,2020,140 -DTR2.1,CF,PR,,-200 -DTR2.1,CF,NIC,,140 -DTR2.2,CF,NIC,2020,140 -DT3.1,CF,PR,,400 -DT3.1,CF,NIC,,-280 -DT3.1,CF,ACA,,-10 -DT3.1,CF,AEA,,-5 -DT4.1,CF,PR,,400 -DT4.1,CF,NIC,,-280 -DT4.1,CF,ACA,,-10 -DT4.1,CF,AEA,,-5 -DT1.5,CF,PR,,400 -DT1.5,CF,NIC,,-280 -DT1.5,CF,ACA,,-10 -DT1.5,CF,AEA,,-5 -DT1.5,CF,ReceivablePR,,-10 -DTR1.3,CF,PR,,-200 -DTR1.3,CF,NIC,,140 -DTR1.3,CF,RiPayablePR,,7.5 -DTR1.3,CF,RiReceivablePR,,-5 -DTR1.3,CF,RiReceivableNIC,,-2.5 -DTR1.3,CF,RiPayableNIC,,4 -DTR1.4,CF,PR,,-200 -DTR1.4,CF,NIC,,140 -DTR1.4,CF,RiReceivableNIC,,-10 +@@Main,,,,, +ReportingNode,Year,Month,Scenario ,, +CH,2020,12,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +DT1.1,CF,PR,A,,400 +DT1.1,CF,NIC,A,,-280 +DT1.1,CF,ACA,A,,-10 +DT1.1,CF,AEA,A,,-5 +DT1.2,CF,NIC,A,2020,-280 +DT2.1,CF,PR,A,,400 +DT2.1,CF,NIC,A,,-280 +DT2.1,CF,ACA,A,,-10 +DT2.1,CF,AEA,A,,-5 +DT1.3,CF,PR,A,,400 +DT1.3,CF,NIC,A,,-280 +DT1.3,CF,ACA,A,,-10 +DT1.3,CF,AEA,A,,-5 +DT1.4,CF,PR,A,,400 +DT1.4,CF,NIC,A,,-280 +DT1.4,CF,ACA,A,,-10 +DT1.4,CF,AEA,A,,-5 +DT1.4,CF,PR,AA,,15 +DT1.4,CF,PR,OA,,-10 +DT1.4,CF,NIC,AA,,-5 +DT1.4,CF,NIC,OA,,8 +DT2.2,CF,NIC,A,2020,-280 +DTR1.1,CF,PR,A,,-200 +DTR1.1,CF,NIC,A,,140 +DTR1.2,CF,NIC,A,2020,140 +DTR2.1,CF,PR,A,,-200 +DTR2.1,CF,NIC,A,,140 +DTR2.2,CF,NIC,A,2020,140 +DT3.1,CF,PR,A,,400 +DT3.1,CF,NIC,A,,-280 +DT3.1,CF,ACA,A,,-10 +DT3.1,CF,AEA,A,,-5 +DT4.1,CF,PR,A,,400 +DT4.1,CF,NIC,A,,-280 +DT4.1,CF,ACA,A,,-10 +DT4.1,CF,AEA,A,,-5 +DT1.5,CF,PR,A,,400 +DT1.5,CF,NIC,A,,-280 +DT1.5,CF,ACA,A,,-10 +DT1.5,CF,AEA,A,,-5 +DT1.5,CF,PR,OA,,-10 +DTR1.3,CF,PR,A,,-200 +DTR1.3,CF,NIC,A,,140 +DTR1.3,CF,PR,OA,,7.5 +DTR1.3,CF,PR,AA,,-5 +DTR1.3,CF,NIC,OA,,-2.5 +DTR1.3,CF,NIC,AA,,4 +DTR1.4,CF,PR,A,,-200 +DTR1.4,CF,NIC,A,,140 +DTR1.4,CF,NIC,OA,,-10 diff --git a/ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv b/ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv index fb0bebcb..666a3cb8 100644 --- a/ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv +++ b/ifrs17-template/Files/TransactionalData/Actuals_CH_2021_3.csv @@ -1,64 +1,64 @@ -@@Main,,,, -ReportingNode,Year,Month,, -CH,2021,3,, -@@Actual,,,, -DataNode,AocType,ValueType,AccidentYear,Value -DT1.1,CF,PR,,90 -DT1.1,CF,ICO,,-6 -DT1.1,CF,NIC,,-70 -DT1.1,CF,ACA,,-10 -DT1.1,CF,AEA,,-5 -DT1.2,CF,NIC,2020,-76 -DT1.3,CF,PR,,90 -DT1.3,CF,ICO,,-6 -DT1.3,CF,NIC,,-70 -DT1.3,CF,ACA,,-10 -DT1.3,CF,AEA,,-5 -DT2.1,CF,PR,,90 -DT2.1,CF,ICO,,-6 -DT2.1,CF,NIC,,-70 -DT2.1,CF,ACA,,-10 -DT2.1,CF,AEA,,-5 -DT2.2,CF,NIC,2020,-76 -DTR1.1,CF,PR,,-45 -DTR1.1,CF,NIC,,35 -DTR1.2,CF,NIC,2020,35 -DTR2.1,CF,PR,,-45 -DTR2.1,CF,NIC,,35 -DTR2.2,CF,NIC,2020,35 -DT3.1,CF,PR,,90 -DT3.1,CF,ICO,,-6 -DT3.1,CF,NIC,,-70 -DT3.1,CF,ACA,,-10 -DT3.1,CF,AEA,,-5 -DT4.1,CF,PR,,90 -DT4.1,CF,ICO,,-6 -DT4.1,CF,NIC,,-70 -DT4.1,CF,ACA,,-10 -DT4.1,CF,AEA,,-5 -DT1.4,WO,ReceivablePR,,7 -DT1.4,WO,ReceivableNIC,,5 -DT1.4,CF,PayablePR,,5 -DT1.4,CF,ReceivablePR,,3 -DT1.4,CF,PayableNIC,,-8 -DT1.4,CF,PR,,90 -DT1.4,CF,ICO,,-6 -DT1.4,CF,NIC,,-70 -DT1.4,CF,ACA,,-10 -DT1.4,CF,AEA,,-5 -DT1.5,WO,ReceivablePR,,10 -DT1.5,CF,PR,,90 -DT1.5,CF,ICO,,-6 -DT1.5,CF,NIC,,-70 -DT1.5,CF,ACA,,-10 -DT1.5,CF,AEA,,-5 -DTR1.3,CF,PR,,-45 -DTR1.3,CF,NIC,,35 -DTR1.3,WO,RiReceivablePR,,3.5 -DTR1.3,WO,RiReceivableNIC,,2.5 -DTR1.3,CF,RiPayablePR,,2.5 -DTR1.3,CF,RiReceivablePR,,1.5 -DTR1.3,CF,RiPayableNIC,,-4 -DTR1.4,CF,PR,,-45 -DTR1.4,CF,NIC,,35 -DTR1.4,WO,RiReceivableNIC,,10 +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2021,3,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +DT1.1,CF,PR,A,,90 +DT1.1,CF,ICO,A,,-6 +DT1.1,CF,NIC,A,,-70 +DT1.1,CF,ACA,A,,-10 +DT1.1,CF,AEA,A,,-5 +DT1.2,CF,NIC,A,2020,-76 +DT1.3,CF,PR,A,,90 +DT1.3,CF,ICO,A,,-6 +DT1.3,CF,NIC,A,,-70 +DT1.3,CF,ACA,A,,-10 +DT1.3,CF,AEA,A,,-5 +DT2.1,CF,PR,A,,90 +DT2.1,CF,ICO,A,,-6 +DT2.1,CF,NIC,A,,-70 +DT2.1,CF,ACA,A,,-10 +DT2.1,CF,AEA,A,,-5 +DT2.2,CF,NIC,A,2020,-76 +DTR1.1,CF,PR,A,,-45 +DTR1.1,CF,NIC,A,,35 +DTR1.2,CF,NIC,A,2020,35 +DTR2.1,CF,PR,A,,-45 +DTR2.1,CF,NIC,A,,35 +DTR2.2,CF,NIC,A,2020,35 +DT3.1,CF,PR,A,,90 +DT3.1,CF,ICO,A,,-6 +DT3.1,CF,NIC,A,,-70 +DT3.1,CF,ACA,A,,-10 +DT3.1,CF,AEA,A,,-5 +DT4.1,CF,PR,A,,90 +DT4.1,CF,ICO,A,,-6 +DT4.1,CF,NIC,A,,-70 +DT4.1,CF,ACA,A,,-10 +DT4.1,CF,AEA,A,,-5 +DT1.4,WO,PR,OA,,7 +DT1.4,WO,NIC,AA,,5 +DT1.4,CF,PR,AA,,5 +DT1.4,CF,PR,OA,,3 +DT1.4,CF,NIC,OA,,-8 +DT1.4,CF,PR,A,,90 +DT1.4,CF,ICO,A,,-6 +DT1.4,CF,NIC,A,,-70 +DT1.4,CF,ACA,A,,-10 +DT1.4,CF,AEA,A,,-5 +DT1.5,WO,PR,OA,,10 +DT1.5,CF,PR,A,,90 +DT1.5,CF,ICO,A,,-6 +DT1.5,CF,NIC,A,,-70 +DT1.5,CF,ACA,A,,-10 +DT1.5,CF,AEA,A,,-5 +DTR1.3,CF,PR,A,,-45 +DTR1.3,CF,NIC,A,,35 +DTR1.3,WO,PR,AA,,3.5 +DTR1.3,WO,NIC,OA,,2.5 +DTR1.3,CF,PR,OA,,2.5 +DTR1.3,CF,PR,AA,,1.5 +DTR1.3,CF,NIC,AA,,-4 +DTR1.4,CF,PR,A,,-45 +DTR1.4,CF,NIC,A,,35 +DTR1.4,WO,NIC,OA,,10 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv index 1101d5d3..fc7e76c9 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12.csv @@ -1,117 +1,117 @@ -@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,, -ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,,,,,,,,,,,,, -CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,, -@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,, -DataNode,AmountType,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 -DT1.1,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT1.1,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.1,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.1,RA,BOP,N,,-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 -DT1.1,PR,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 -DT1.1,NIC,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 -DT1.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 -DT1.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 -DT1.2,NIC,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.2,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.2,RA,BOP,N,2020,-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 -DT1.2,NIC,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.2,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.2,RA,CL,C,2020,-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 -DT1.3,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT1.3,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.3,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.3,RA,BOP,N,,-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 -DT1.3,PR,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 -DT1.3,NIC,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 -DT1.3,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 -DT1.3,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 -DT2.1,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT2.1,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.1,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT2.1,RA,BOP,N,,-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 -DT2.1,PR,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 -DT2.1,NIC,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 -DT2.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 -DT2.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 -DT2.2,NIC,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.2,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT2.2,RA,BOP,N,2020,-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 -DT2.2,NIC,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT2.2,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT2.2,RA,CL,C,2020,-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 -DTR1.1,PR,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.1,NIC,BOP,N,,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 -DTR1.1,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.1,RA,BOP,N,,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 -DTR1.1,PR,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.1,NIC,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 -DTR1.1,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.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 -DTR1.2,NIC,BOP,N,2020,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 -DTR1.2,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.2,RA,BOP,N,2020,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 -DTR1.2,NIC,CL,C,2020,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 -DTR1.2,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.2,RA,CL,C,2020,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 -DTR2.1,PR,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR2.1,NIC,BOP,N,,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 -DTR2.1,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR2.1,RA,BOP,N,,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 -DTR2.1,PR,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR2.1,NIC,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 -DTR2.1,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR2.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 -DTR2.2,NIC,BOP,N,2020,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 -DTR2.2,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR2.2,RA,BOP,N,2020,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 -DTR2.2,NIC,CL,C,2020,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 -DTR2.2,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR2.2,RA,CL,C,2020,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 -DT3.1,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT3.1,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT3.1,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT3.1,RA,BOP,N,,-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 -DT3.1,PR,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 -DT3.1,NIC,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 -DT3.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 -DT3.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 -DT4.1,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT4.1,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT4.1,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT4.1,RA,BOP,N,,-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 -DT4.1,PR,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 -DT4.1,NIC,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 -DT4.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 -DT4.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 -DT1.4,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT1.4,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.4,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.4,RA,BOP,N,,-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 -DT1.4,PR,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 -DT1.4,NIC,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 -DT1.4,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 -DT1.4,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 -DT1.5,PR,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 -DT1.5,NIC,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 -DT1.5,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 -DT1.5,RA,BOP,N,,-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 -DT1.5,PR,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 -DT1.5,NIC,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 -DT1.5,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 -DT1.5,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 -DTR1.3,PR,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.3,NIC,BOP,N,,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 -DTR1.3,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.3,RA,BOP,N,,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 -DTR1.3,PR,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.3,NIC,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 -DTR1.3,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.3,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 -DTR1.4,PR,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.4,NIC,BOP,N,,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 -DTR1.4,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.4,RA,BOP,N,,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 -DTR1.4,PR,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 -DTR1.4,NIC,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 -DTR1.4,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 -DTR1.4,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 +@@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,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 +DT1.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.1,,RA,BOP,N,,-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 +DT1.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 +DT1.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 +DT1.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 +DT1.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 +DT1.2,NIC,BE,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.2,,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.2,,RA,BOP,N,2020,-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 +DT1.2,NIC,BE,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.2,,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.2,,RA,CL,C,2020,-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 +DT1.3,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT1.3,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.3,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.3,,RA,BOP,N,,-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 +DT1.3,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 +DT1.3,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 +DT1.3,,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 +DT1.3,,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 +DT2.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT2.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT2.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.1,,RA,BOP,N,,-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 +DT2.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 +DT2.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 +DT2.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 +DT2.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 +DT2.2,NIC,BE,BOP,N,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT2.2,,CU,BOP,N,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.2,,RA,BOP,N,2020,-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 +DT2.2,NIC,BE,CL,C,2020,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT2.2,,CU,CL,C,2020,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT2.2,,RA,CL,C,2020,-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 +DTR1.1,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.1,NIC,BE,BOP,N,,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 +DTR1.1,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.1,,RA,BOP,N,,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 +DTR1.1,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.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 +DTR1.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.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 +DTR1.2,NIC,BE,BOP,N,2020,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 +DTR1.2,,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.2,,RA,BOP,N,2020,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 +DTR1.2,NIC,BE,CL,C,2020,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 +DTR1.2,,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.2,,RA,CL,C,2020,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 +DTR2.1,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR2.1,NIC,BE,BOP,N,,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 +DTR2.1,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.1,,RA,BOP,N,,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 +DTR2.1,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR2.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 +DTR2.1,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.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 +DTR2.2,NIC,BE,BOP,N,2020,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 +DTR2.2,,CU,BOP,N,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.2,,RA,BOP,N,2020,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 +DTR2.2,NIC,BE,CL,C,2020,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 +DTR2.2,,CU,CL,C,2020,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR2.2,,RA,CL,C,2020,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 +DT3.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT3.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT3.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT3.1,,RA,BOP,N,,-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 +DT3.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 +DT3.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 +DT3.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 +DT3.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 +DT4.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT4.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT4.1,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT4.1,,RA,BOP,N,,-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 +DT4.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 +DT4.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 +DT4.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 +DT4.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 +DT1.4,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT1.4,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.4,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.4,,RA,BOP,N,,-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 +DT1.4,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 +DT1.4,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 +DT1.4,,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 +DT1.4,,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 +DT1.5,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +DT1.5,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +DT1.5,,CU,BOP,N,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3 +DT1.5,,RA,BOP,N,,-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 +DT1.5,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 +DT1.5,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 +DT1.5,,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 +DT1.5,,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 +DTR1.3,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.3,NIC,BE,BOP,N,,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 +DTR1.3,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.3,,RA,BOP,N,,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 +DTR1.3,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.3,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 +DTR1.3,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.3,,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 +DTR1.4,PR,BE,BOP,N,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.4,NIC,BE,BOP,N,,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 +DTR1.4,,CU,BOP,N,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.4,,RA,BOP,N,,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 +DTR1.4,PR,BE,CL,C,,-50,0,0,-50,0,0,-50,0,0,-50,0,0,0,-50,0,0,-50,0,0,-50,0,0,-50,0 +DTR1.4,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 +DTR1.4,,CU,CL,C,,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-1.5 +DTR1.4,,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 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv index 3e08a787..2b6c23a3 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv @@ -1,13 +1,13 @@ -@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,, -ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,,,,,,,,,,,,, -CH,2020,12,MTUP10pct,,,,,,,,,,,,,,,,,,,,,,,,, -@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,, -DataNode,AmountType,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 -DT1.1,NIC,BOP,N,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 -DT1.1,NIC,CL,C,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 -DT1.2,NIC,BOP,N,2020,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 -DT1.2,NIC,CL,C,2020,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 -DTR1.1,NIC,BOP,N,,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 -DTR1.1,NIC,CL,C,,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 -DTR1.2,NIC,BOP,N,2020,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 -DTR1.2,NIC,CL,C,2020,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 +@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,Scenario,,,,,,,,,,,,,,,,,,,,,,,,,, +CH,2020,12,MTUP10pct,,,,,,,,,,,,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataNode,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 +DT1.1,NIC,BE,BOP,N,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 +DT1.1,NIC,BE,CL,C,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 +DT1.2,NIC,BE,BOP,N,2020,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 +DT1.2,NIC,BE,CL,C,2020,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5 +DTR1.1,NIC,BE,BOP,N,,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 +DTR1.1,NIC,BE,CL,C,,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 +DTR1.2,NIC,BE,BOP,N,2020,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 +DTR1.2,NIC,BE,CL,C,2020,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75,13.75 diff --git a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv index 6a256346..b814f614 100644 --- a/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv +++ b/ifrs17-template/Files/TransactionalData/NominalCashflows_CH_2021_3.csv @@ -1,220 +1,220 @@ -@@Main,,,,,,,,,,,,,,,,,,,,,,,,, -ReportingNode,Year,Month,,,,,,,,,,,,,,,,,,,,,,, -CH,2021,3,,,,,,,,,,,,,,,,,,,,,,, -@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,, -DataNode,AmountType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20 -DT1.1,PR,MC,I,,0,110,0,0,110,0,0,110,0,0,110,0,0,0,0,0,0,0,0,0,0 -DT1.1,NIC,MC,I,,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,0,0,0,0,0,0,0,0,0 -DT1.1,CU,MC,I,,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-3,0,0,0,0,0,0,0,0,0 -DT1.1,RA,MC,I,,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,0,0,0,0,0,0,0,0,0 -DT1.1,PR,BOP,N,,0,10,0,0,10,0,0,10,0,0,10,0,0,0,0,0,0,0,0,0,0 -DT1.1,ICO,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0 -DT1.1,NIC,BOP,N,,-4,-4,-4,-4,-4,-4,-4,-4,-4,-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,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0 -DTR1.4,PR,BOP,N,,0,-5,0,0,-5,0,0,-5,0,0,-5,0,0,0,0,0,0,0,0,0,0 -DTR1.4,NIC,BOP,N,,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,0,0,0,0,0,0,0,0,0 -DTR1.4,RA,BOP,N,,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0,0,0,0,0,0,0,0,0 -DTR1.4,PR,EV,N,,0,-2.5,0,0,-2.5,0,0,-2.5,0,0,-2.5,0,0,0,0,0,0,0,0,0,0 -DTR1.4,NIC,EV,N,,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0 -DTR1.4,RA,EV,N,,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0,0,0,0,0,0,0,0,0 -DTR1.4,PR,CL,C,,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,0,0,0,0,0,0,0,0 -DTR1.4,NIC,CL,C,,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,0 -DTR1.4,CU,CL,C,,-7.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-2.5,0,0,0,0,0,0,0,0,0 -DTR1.4,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,0,0,0,0,0,0,0,0,0 +@@Main,,,,,,,,,,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,,,,,,,,,,,,,,,,,,,,,,,, +CH,2021,3,,,,,,,,,,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11,Values12,Values13,Values14,Values15,Values16,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N,,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,2.5,0,0,0,0,0,0,0,0,0 +DTR1.4,,RA,BOP,N,,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0,0,0,0,0,0,0,0,0 +DTR1.4,PR,BE,EV,N,,0,-2.5,0,0,-2.5,0,0,-2.5,0,0,-2.5,0,0,0,0,0,0,0,0,0,0 +DTR1.4,NIC,BE,EV,N,,5,5,5,5,5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0,0 +DTR1.4,,RA,EV,N,,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0,0,0,0,0,0,0,0,0 +DTR1.4,PR,BE,CL,C,,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,-57.5,0,0,0,0,0,0,0,0,0,0 +DTR1.4,NIC,BE,CL,C,,15,15,15,15,15,15,15,15,15,15,15,15,0,0,0,0,0,0,0,0,0 +DTR1.4,,CU,CL,C,,-7.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-3.5,-2.5,0,0,0,0,0,0,0,0,0 +DTR1.4,,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,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/Images/ActualFormat.png b/ifrs17-template/Images/ActualFormat.png index e055a0a7..82f45d5c 100644 Binary files a/ifrs17-template/Images/ActualFormat.png and b/ifrs17-template/Images/ActualFormat.png differ diff --git a/ifrs17-template/Images/CashflowFormat.png b/ifrs17-template/Images/CashflowFormat.png index 31288bdc..17c686e3 100644 Binary files a/ifrs17-template/Images/CashflowFormat.png and b/ifrs17-template/Images/CashflowFormat.png differ diff --git a/ifrs17-template/Images/CsmLc.png b/ifrs17-template/Images/CsmLc.png new file mode 100644 index 00000000..90eea1e7 Binary files /dev/null and b/ifrs17-template/Images/CsmLc.png differ diff --git a/ifrs17-template/Images/Switch.png b/ifrs17-template/Images/Switch.png new file mode 100644 index 00000000..83ebb2bd Binary files /dev/null and b/ifrs17-template/Images/Switch.png differ diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 1f9b84ac..aa95ca1d 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -118,7 +118,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(pathToFile)", + "\n .WithFormat(format)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -163,7 +166,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(pathToFile)", + "\n .WithFormat(format)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 92447054..84f27378 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -77,7 +77,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -86,7 +89,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -95,7 +101,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index ad4e7b83..b0fb3cba 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 .ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -127,7 +127,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Dimensions.csv\").WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Dimensions.csv\")", + "\n .WithFormat(ImportFormats.AocConfiguration)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -136,7 +139,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -154,7 +160,40 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader));", + "\nlog" ], "metadata": {}, "execution_count": 0, @@ -163,7 +202,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -172,7 +214,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -181,7 +226,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -204,15 +252,6 @@ "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/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index 65138c29..9d7288c4 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 .ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -105,7 +105,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -123,7 +126,41 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog" ], "metadata": {}, "execution_count": 0, @@ -132,7 +169,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -141,7 +181,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -150,7 +193,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -168,7 +214,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -177,7 +226,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -186,7 +238,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -204,7 +259,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Opening)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -213,7 +271,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -222,7 +283,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -231,7 +295,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -240,7 +307,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -249,7 +319,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue )", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -258,7 +331,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index f349f687..d82e0186 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -67,7 +67,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Opening)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -76,7 +79,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -85,7 +91,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -94,7 +103,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -103,7 +115,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -112,7 +127,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue )", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -121,7 +139,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/InputFormatDescription.ipynb b/ifrs17-template/InputFormatDescription.ipynb index 8071d924..42f72726 100644 --- a/ifrs17-template/InputFormatDescription.ipynb +++ b/ifrs17-template/InputFormatDescription.ipynb @@ -44,6 +44,7 @@ "\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.0.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.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- [AocType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", "\n- [Novelty](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#novelty) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims.", @@ -62,7 +63,7 @@ "\n# The Actuals File Structure ", "\n", "\n", - "\n
" + "\n
" ], "metadata": {}, "execution_count": 0, @@ -78,7 +79,8 @@ "\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.0.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.0.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", - "\n- [ValueType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : corresponds to AmountType SystemName extended with the ExternalId,", + "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "metadata": {}, @@ -107,13 +109,22 @@ "\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.0.0/DataModel/DataStructure#group-of-contracts) : lowest granularity of the Data Node, it is entered with its SystemName,", - "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- [AmountType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", + "\n- [EstimateType](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." ], "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/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb new file mode 100644 index 00000000..5db058d3 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -0,0 +1,256 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + }, + "toc-autonumbering": "True", + "toc-showcode": "False" + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Actuals Outside the Period Data Import

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This is the Data Import notebook for the Actuals Outside the Period case." + ], + "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": [ + "## Data Nodes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Transactional Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reset Workspace" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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)" + ], + "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/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb new file mode 100644 index 00000000..133580d4 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseReports.ipynb @@ -0,0 +1,1093 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + }, + "toc-autonumbering": "True", + "toc-showcode": "False" + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Actuals Outside the Period

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

Written vs Effective Cashflows (Gross business)

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Usually, actuarial cashflows for portfolio valuations are modelled on a \"due\" or \"written\" basis, meaning they are derived from the corresponding contractual obligations.", + "\nHowever, it is normal that the effective cashflows will not exactly follow the expected written ones and will therefore fall outside the reporting period.", + "\n", + "\nIn this case study we look at the effects of cashflows happening outside the expected reporting period, also referred to as Payables and Receivables in accounting language. The reconciliation between the written and effective cashflows is usually handled by the Actuals. This reconciliation must be taken into account, since the IFRS 17 Standard requires insurance liabilities to be measured according to the effective cashflows.", + "\n", + "\nWe can try to summarize the the cases for In Advance and Overdue actuals in a table. On the colums we define the due date of the payments in relation to the reporting period, and in the rows we define the effective date of the payments in relation to the reporting period. If we exclude the write off (WO) for now, we are left we the following possibilities:", + "\n", + "\n
", + "\n", + "\n| | **payment due date
before the reporting period** | **payment due date
in the reporting period** | **payment due date
after the reporting period** |", + "\n|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|", + "\n| **payment effective date
before the reporting period**     | not relevant for this reporting period
*both due and effective payment dates are in the past*      | release of balance sheet in advance position (-CF_A)
*payment due in this period already settled in previous periods*     | existing in advance balance
*remaining in advance reserve from previous periods and payment is not due yet* |", + "\n| **payment effective date
in the reporting period**      | release of balance sheet overdue position (-CF_O)
*overdue payment from previous periods settled in this period*     | neither in advance nor overdue balance
*the due and effective payment dates fall within the reporting period*      | increase of balance sheet in advance position (CF_A)
*payment settled in this period is not due yet* |", + "\n| **payment effective date
after the reporting period**      | unchanged overdue balance
*existing overdue reserve from previous periods and payment has not been settled*      | increase of balance sheet overdue position (CF_O)
*payment due in this period has not been settled*      | not relevant for this reporting period
*both due and effective payment dates are in the future* |", + "\n", + "\n
", + "\n", + "\nWrite off (WO) of the Receivables (In Advance Claims and Overdue Premimus for Gross business) would also release the balance like the corresponding entries in the table above (-CF_A and -CF_O). However, while the releases shown in the table above do not impact the Financial Performance, written off amounts will. ", + "\n", + "\nWe will now look at a few scenarios in reference to a base case. We have modelled 3 reporting periods (2020 12, 2021 6 and 2021 12, where the first number is the reporting year and the second is the reporting month) and assume we start with only New Business in the beginning of 2020 and the portfolio completely runs-off in the end of 2021. In summary:", + "\n", + "\n- **2020 12**: End of year reporting for the first year: we see New Business coming in and the corresponding model adjustments for future services. We also introduce the outstanding Payables and Receivables according to the scenarios.", + "\n- **2021  6**: Mid year reporting for the second year: we see the development of the GIC for half a year. Some New Businss stills comes in. We also see how Payables and Receivables have changed.", + "\n- **2021 12**: End of year for the second year: we see the GIC goes into run-off and all liabilities should be relseased. This also applies to the outstanding balance for Payables and Receivables, which are completely released with settlement payments or write offs. ", + "\n", + "\nWe are modelling the Gross case and have defined the following GICs (Valuation Approach is BBA):", + "\n", + "\n - **MZ 2.1 Written**: all cashflows for this GIC follow exactly the written cashflows expected in the atuarial model. It is our base case.", + "\n - **MZ 2.2 OA Premium**: in this case the **Premium is overdue** in the 1st reporting period (**Receivable Premium**). In the subsequent periods, some is received and some is written off.", + "\n - **MZ 2.3 AA Claim**: in this case the **Claim is paid in advance** in the 1st reporting period (**Receivable Claim**). In the subsequent periods, some is received and some is written off.", + "\n - **MZ 2.4 AA Premium / OA Claim**: in this case we have received **Premium in advance** (**Payable Premium**), and also have an **overdue Claim** payment (**Payable Claim**). In the subsequent periods, we have settled the actuals accordingly.", + "\n", + "\nThe only difference between all cases is the timing of the effective cashflows (paid in advance and overdue actuals), with all other inputs and parameters exctly the same. For simplicity, we only added Premium and Claims (Non Investment Component) amount types.", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We call the ActualsUseCaseDataImport notebook, where the data is imported." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"ActualsUseCaseDataImport\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Best Estimate Present Value of Cashflows", + "\n", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We start by looking at the Best Estimate Present Value of Cashflows of MZ 2.1 Written (base case) for the 3 reporting periods." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var pv = ifrs17.PresentValues;", + "\npv.ReportingNode = \"CH\";", + "\npv.ReportingPeriod = (2020, 12);", + "\npv.CurrencyType = CurrencyType.Contractual;", + "\npv.ColumnSlices = new string[]{\"GroupOfContract\", \"AmountType\"};", + "\npv.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await pv.ToReportAsync) with {Height = 720}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var pv = ifrs17.PresentValues;", + "\npv.ReportingNode = \"CH\";", + "\npv.ReportingPeriod = (2021, 6);", + "\npv.CurrencyType = CurrencyType.Contractual;", + "\npv.ColumnSlices = new string[]{\"GroupOfContract\", \"AmountType\"};", + "\npv.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await pv.ToReportAsync) with {Height = 720}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var pv = ifrs17.PresentValues;", + "\npv.ReportingNode = \"CH\";", + "\npv.ReportingPeriod = (2021, 12);", + "\npv.CurrencyType = CurrencyType.Contractual;", + "\npv.ColumnSlices = new string[]{\"GroupOfContract\", \"AmountType\"};", + "\npv.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await pv.ToReportAsync) with {Height = 720}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Risk Adjustment" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now look at the Best Estimate Risk Adjustment of MZ 2.1 Written (base case) for the 3 reporting periods." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ra = ifrs17.RiskAdjustments;", + "\nra.ReportingNode = \"CH\";", + "\nra.ReportingPeriod = (2020, 12);", + "\nra.ColumnSlices = new string[]{};", + "\nra.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await ra.ToReportAsync) with {Height = 800}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ra = ifrs17.RiskAdjustments;", + "\nra.ReportingNode = \"CH\";", + "\nra.ReportingPeriod = (2021, 6);", + "\nra.ColumnSlices = new string[]{};", + "\nra.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await ra.ToReportAsync) with {Height = 800}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var ra = ifrs17.RiskAdjustments;", + "\nra.ReportingNode = \"CH\";", + "\nra.ReportingPeriod = (2021, 12);", + "\nra.ColumnSlices = new string[]{};", + "\nra.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await ra.ToReportAsync) with {Height = 800}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Fulfilment Cash Flows" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "The corresponding Fulfilment Cash Flows of MZ 2.1 Written (base case) for the 3 reporting periods are shown below." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var fulfillmentCashflows = ifrs17.FulfillmentCashflows;", + "\nfulfillmentCashflows.ReportingNode = \"CH\";", + "\nfulfillmentCashflows.ReportingPeriod = (2020, 12);", + "\nfulfillmentCashflows.ColumnSlices = new string[]{\"EstimateType\"};", + "\nfulfillmentCashflows.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await fulfillmentCashflows.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var fulfillmentCashflows = ifrs17.FulfillmentCashflows;", + "\nfulfillmentCashflows.ReportingNode = \"CH\";", + "\nfulfillmentCashflows.ReportingPeriod = (2021, 6);", + "\nfulfillmentCashflows.ColumnSlices = new string[]{\"EstimateType\"};", + "\nfulfillmentCashflows.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await fulfillmentCashflows.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var fulfillmentCashflows = ifrs17.FulfillmentCashflows;", + "\nfulfillmentCashflows.ReportingNode = \"CH\";", + "\nfulfillmentCashflows.ReportingPeriod = (2021, 12);", + "\nfulfillmentCashflows.ColumnSlices = new string[]{\"EstimateType\"};", + "\nfulfillmentCashflows.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await fulfillmentCashflows.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Written Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now look at the Written Actuals of MZ 2.1 Written (base case) for the 3 reporting periods. These actuals are also the same for all cases, as they Written Actuals follow the contractual obligations." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var writtenActual = ifrs17.WrittenActuals;", + "\nwrittenActual.ReportingNode = \"CH\";", + "\nwrittenActual.ReportingPeriod = (2020, 12);", + "\nwrittenActual.ColumnSlices = new string[]{};", + "\nwrittenActual.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await writtenActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var writtenActual = ifrs17.WrittenActuals;", + "\nwrittenActual.ReportingNode = \"CH\";", + "\nwrittenActual.ReportingPeriod = (2021, 6);", + "\nwrittenActual.ColumnSlices = new string[]{};", + "\nwrittenActual.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await writtenActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var writtenActual = ifrs17.WrittenActuals;", + "\nwrittenActual.ReportingNode = \"CH\";", + "\nwrittenActual.ReportingPeriod = (2021, 12);", + "\nwrittenActual.ColumnSlices = new string[]{};", + "\nwrittenActual.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await writtenActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Paid in Advance and Overdue Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "As this point we start to have differences for all scenarios. We show below the effective actuals, i.e., those falling outside the reporting period, also known as Payables and Receivables.", + "\n", + "\nThe case case MZ 2.1 Written will not show any data by design, as all effective actuals and corresponding due dates occur within the reporting period." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We are introducing In Advance and Overdue reserves for the scenarios described above (CF_A and CF_O cases in the table above), and it is important to note the sign convention (Receivables bear a negative sign, while Payables a positive sign). This convention becomes relavent when determining the Liability of Remaining Coverage below, as it will bring the LRC to either to a more Asset-like character (negative) or Liability-like character (positive)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var accrualActual = ifrs17.AccrualActuals;", + "\naccrualActual.ReportingNode = \"CH\";", + "\naccrualActual.ReportingPeriod = (2020, 12);", + "\naccrualActual.ColumnSlices = new string[]{ \"GroupOfContract\", \"EstimateType\", \"AmountType\" };", + "\naccrualActual.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};", + "\n(await accrualActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now see what happens to the In Advance and Overdue reserves for each scenarios. We have introduced some write off (WO) for the Receivables, and no settlement has been made yet. We also notice a further increase of In Advance Premium Payments (CF_A), while Overdue Claims remain unchanged." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var accrualActual = ifrs17.AccrualActuals;", + "\naccrualActual.ReportingNode = \"CH\";", + "\naccrualActual.ReportingPeriod = (2021, 6);", + "\naccrualActual.ColumnSlices = new string[]{ \"GroupOfContract\", \"EstimateType\", \"AmountType\" };", + "\naccrualActual.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};", + "\n(await accrualActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Since all cases run-off in the end of the period, we must also check that all correspondings balances go to zero. We see that some Receivables have been settled (-CF_A and -CF_O), but also the write off (WO) increased, releasing the entire balance as expected. Payables have been also been fully settled (-CF_A and -CF_O) without write offs (as they are not applicable)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var accrualActual = ifrs17.AccrualActuals;", + "\naccrualActual.ReportingNode = \"CH\";", + "\naccrualActual.ReportingPeriod = (2021, 12);", + "\naccrualActual.ColumnSlices = new string[]{ \"GroupOfContract\", \"EstimateType\", \"AmountType\" };", + "\naccrualActual.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};", + "\n(await accrualActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Actuarial Experience Adjustment" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now look at the Actuarial Experience Adjustment of MZ 2.1 Written (base case) for the 3 reporting periods. Here we only look at Written Actuals and therefore the values for all scenarios is still exactly the same." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var experienceAdjustments = ifrs17.ExperienceAdjustments;", + "\nexperienceAdjustments.ReportingNode = \"CH\";", + "\nexperienceAdjustments.ReportingPeriod = (2020, 12);", + "\nexperienceAdjustments.ColumnSlices = new string[]{};", + "\nexperienceAdjustments.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await experienceAdjustments.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var experienceAdjustments = ifrs17.ExperienceAdjustments;", + "\nexperienceAdjustments.ReportingNode = \"CH\";", + "\nexperienceAdjustments.ReportingPeriod = (2021, 6);", + "\nexperienceAdjustments.ColumnSlices = new string[]{};", + "\nexperienceAdjustments.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await experienceAdjustments.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var experienceAdjustments = ifrs17.ExperienceAdjustments;", + "\nexperienceAdjustments.ReportingNode = \"CH\";", + "\nexperienceAdjustments.ReportingPeriod = (2021, 12);", + "\nexperienceAdjustments.ColumnSlices = new string[]{};", + "\nexperienceAdjustments.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await experienceAdjustments.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Contractual Service Margin / Loss Component / Loss Recovery Component" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now look at the Contractual Service Margin and Loss Component of MZ 2.1 Written (base case) for the 3 reporting periods." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allocatedTechnicalMargins = ifrs17.AllocatedTechnicalMargins;", + "\nallocatedTechnicalMargins.ReportingNode = \"CH\";", + "\nallocatedTechnicalMargins.ReportingPeriod = (2020, 12);", + "\nallocatedTechnicalMargins.ColumnSlices = new string[]{};", + "\nallocatedTechnicalMargins.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allocatedTechnicalMargins = ifrs17.AllocatedTechnicalMargins;", + "\nallocatedTechnicalMargins.ReportingNode = \"CH\";", + "\nallocatedTechnicalMargins.ReportingPeriod = (2021, 6);", + "\nallocatedTechnicalMargins.ColumnSlices = new string[]{};", + "\nallocatedTechnicalMargins.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allocatedTechnicalMargins = ifrs17.AllocatedTechnicalMargins;", + "\nallocatedTechnicalMargins.ReportingNode = \"CH\";", + "\nallocatedTechnicalMargins.ReportingPeriod = (2021, 12);", + "\nallocatedTechnicalMargins.ColumnSlices = new string[]{};", + "\nallocatedTechnicalMargins.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# LRC Actuarial" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We now look at the Actuarial Liability of Remaining Coverage of MZ 2.1 Written (base case) for the 3 reporting periods. This report does not include any effective actuals, as it show the actuarial view of the LRC. Therefore, also here the results are the same for all scenarios." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuarialLrc = ifrs17.ActuarialLrc;", + "\nactuarialLrc.ReportingNode = \"CH\";", + "\nactuarialLrc.ReportingPeriod = (2020, 12);", + "\nactuarialLrc.ColumnSlices = new string[]{};", + "\nactuarialLrc.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuarialLrc = ifrs17.ActuarialLrc;", + "\nactuarialLrc.ReportingNode = \"CH\";", + "\nactuarialLrc.ReportingPeriod = (2021, 6);", + "\nactuarialLrc.ColumnSlices = new string[]{};", + "\nactuarialLrc.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuarialLrc = ifrs17.ActuarialLrc;", + "\nactuarialLrc.ReportingNode = \"CH\";", + "\nactuarialLrc.ReportingPeriod = (2021, 12);", + "\nactuarialLrc.ColumnSlices = new string[]{};", + "\nactuarialLrc.DataFilter = new []{ (\"GroupOfContract\", \"MZ2.1\") };", + "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# LRC " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Finally we come to the effective Liability of Remaining Coverage, which includes the effect of the In Advanced and Overdue actuals. To take these into account, we must add these balances to the Actuarial LRC." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This is the first year of the GIC, meaning the opening is zero and all the balance comes from the New Business. Therefore, the changes in balance is equivalent to the closing balance (EOP).", + "\n", + "\nMZ 2.1 Written (base case) ends with a negative LRC balance, giving it a slight Asset-like character. This comes from favorable Best Estimate Present Value of Cashflows, where the Premium (cass flow in) outweighs the Claims (cash flow out).", + "\n", + "\nFor MZ 2.2 OA Premium and MZ 2.3 AA Claim, there is a future expectation of effective payments, as we have outstanding Receivables (In Advance Claims and Overdue Premium). For both cases this means a further decrease of the LRC balance (more negative).", + "\nFor MZ 2.2 OA Premium, we must decrease the actuarial cash flows to incorporate the expected recovery of the overdue Premium.", + "\nFor MZ 2.2 AA Claim, we must decrease the actuarial cash flows to incorporate the in advance payment of the Claim not due yet.", + "\n", + "\nFor MZ 2.4 AA Premium / OA Claim, the effect is exactly the opposite, as we are dealing with Payables. For this case we observe an increase of the LRC balance (becomes positive).", + "\nFor MZ 2.4 AA Premium / OA Claim, we must increase the actuarial cash flows to incorporate the in advance payment of the Premium not due yet, and the delayed payment of the overdue Claim.", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var lrc = ifrs17.Lrc;", + "\nlrc.ReportingNode = \"CH\";", + "\nlrc.ReportingPeriod = (2020, 12);", + "\nlrc.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};", + "\nlrc.DataFilter = null;", + "\n(await lrc.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Here we look at what happened half a year later.", + "\nAs mentioned above we introduce some write off for the Receivables, and some increase in balance for the In Advance Premium Payments.", + "\n", + "\nFor MZ 2.1 Written (base case), some adverse devleopment heppened and the LRC becomes positive during the period. If we look into the details, there is a deterioration of the results (Actuals) and the expectation has also been adjusted. Furthermore, the CSM turns into a Loss Component.", + "\n", + "\nFor MZ 2.2 OA Premium and MZ 2.3 AA Claim, we have recognized some write offs for part of the overdue amounts, without any further release. This affects the LRC balance, but since there is still some outstanding balance, the LRC stll moves towards a more negative value when compared to the base case.", + "\n", + "\nFor MZ 2.4 AA Premium / OA Claim, we had no movements for the Overdue Claims, but we see an further increase in the In Advance Premium. Thus, it must increase even more the liability character of the LRC.", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var lrc = ifrs17.Lrc;", + "\nlrc.ReportingNode = \"CH\";", + "\nlrc.ReportingPeriod = (2021, 6);", + "\nlrc.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};", + "\nlrc.DataFilter = null;", + "\n(await lrc.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This is the closing period of our example. All liability must be released at the end of the period. Indeed, the LRC balance goes to zero in all cases.", + "\nAs seen above, the release os the In Advance or Overdue balances happens either with settlement of payments, or write off in the case of Receivables." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var lrc = ifrs17.Lrc;", + "\nlrc.ReportingNode = \"CH\";", + "\nlrc.ReportingPeriod = (2021, 12);", + "\nlrc.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};", + "\nlrc.DataFilter = null;", + "\n(await lrc.ToReportAsync) with {Height = 300}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "The last part of the analsys refers to the Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2020 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "This is the first period, and we did not have any write off. Thus, the Financial Performance is the same for all scenarios, as In Advance and Overdue balances do not have an impact." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var financialPerformance = ifrs17.FinancialPerformance;", + "\nfinancialPerformance.ReportingNode = \"CH\";", + "\nfinancialPerformance.ReportingPeriod = (2020, 12);", + "\nfinancialPerformance.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\nfinancialPerformance.DataFilter = null;", + "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 6" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "In the subsequent period of this analsys, we introduced some write off for the Receivables. This impacts MZ 2.2 OA Premium and MZ 2.3 AA Claim, decreasing the Insurance Service Result by the ammounts written off. The remaining scenarios (MZ 2.1 Written and MZ 2.4 AA Premium / OA Claim) are still equal, as there no notion of write offs in these cases.", + "\n", + "\nFor MZ 2.2 OA Premium, the write off is recognized at the Insurance Revenue, Overdue Actuals.", + "\n", + "\nFor MZ 2.3 AA Claim, the write off is recognized at the Insurance Service Expense, Advance Actuals." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var financialPerformance = ifrs17.FinancialPerformance;", + "\nfinancialPerformance.ReportingNode = \"CH\";", + "\nfinancialPerformance.ReportingPeriod = (2021, 6);", + "\nfinancialPerformance.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\nfinancialPerformance.DataFilter = null;", + "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## 2021 12" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "In the last period, we see the final results in the Financial Performance.", + "\nAs before, MZ 2.2 OA Premium and MZ 2.3 AA Claim have a lower Insurance Service Result in comparison to MZ 2.1 Written (base case) due to the write offs.", + "\nSimilarly, MZ 2.1 Written and MZ 2.4 AA Premium / OA Claim continue to show the same results." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var financialPerformance = ifrs17.FinancialPerformance;", + "\nfinancialPerformance.ReportingNode = \"CH\";", + "\nfinancialPerformance.ReportingPeriod = (2021, 12);", + "\nfinancialPerformance.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\nfinancialPerformance.DataFilter = null;", + "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + ], + "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/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2020_12.csv new file mode 100644 index 00000000..45616c23 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2020_12.csv @@ -0,0 +1,17 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2020,12,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +MZ2.1,CF,PR,A,,413 +MZ2.1,CF,NIC,A,,-311 +MZ2.2,CF,PR,A,,413 +MZ2.2,CF,NIC,A,,-311 +MZ2.2,CF,PR,OA,,-200 +MZ2.3,CF,PR,A,,413 +MZ2.3,CF,NIC,A,,-311 +MZ2.3,CF,NIC,AA,,-150 +MZ2.4,CF,PR,A,,413 +MZ2.4,CF,NIC,A,,-311 +MZ2.4,CF,PR,AA,,200 +MZ2.4,CF,NIC,OA,,150 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_12.csv new file mode 100644 index 00000000..8f4a7ee5 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_12.csv @@ -0,0 +1,19 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2021,12,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +MZ2.1,CF,PR,A,,551 +MZ2.1,CF,NIC,A,,-455 +MZ2.2,CF,PR,A,,551 +MZ2.2,CF,NIC,A,,-455 +MZ2.2,WO,PR,OA,,150 +MZ2.2,CF,PR,OA,,50 +MZ2.3,CF,PR,A,,551 +MZ2.3,CF,NIC,A,,-455 +MZ2.3,WO,NIC,AA,,125 +MZ2.3,CF,NIC,AA,,25 +MZ2.4,CF,PR,A,,551 +MZ2.4,CF,NIC,A,,-455 +MZ2.4,CF,PR,AA,,-200 +MZ2.4,CF,NIC,OA,,-150 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_6.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_6.csv new file mode 100644 index 00000000..4e8662cd --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/Actuals_ActualsCase_CH_2021_6.csv @@ -0,0 +1,16 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2021,6,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +MZ2.1,CF,PR,A,,296 +MZ2.1,CF,NIC,A,,-221 +MZ2.2,CF,PR,A,,296 +MZ2.2,CF,NIC,A,,-221 +MZ2.2,WO,PR,OA,,100 +MZ2.3,CF,PR,A,,296 +MZ2.3,CF,NIC,A,,-221 +MZ2.3,WO,NIC,AA,,75 +MZ2.4,CF,PR,A,,296 +MZ2.4,CF,NIC,A,,-221 +MZ2.4,CF,PR,AA,,100 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeParameters_ActualsCase_CH_2020_1.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeParameters_ActualsCase_CH_2020_1.csv new file mode 100644 index 00000000..cabec2c8 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeParameters_ActualsCase_CH_2020_1.csv @@ -0,0 +1,10 @@ +@@Main,, +ReportingNode,Year,Month +CH,2020,1 +,, +@@SingleDataNodeParameter,, +DataNode,PremiumAllocation, +MZ2.1,0.5, +MZ2.2,0.5, +MZ2.3,0.5, +MZ2.4,0.5, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeStates_ActualsCase_CH_2020_1.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeStates_ActualsCase_CH_2020_1.csv new file mode 100644 index 00000000..81cd2511 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodeStates_ActualsCase_CH_2020_1.csv @@ -0,0 +1,10 @@ +@@Main,, +ReportingNode,Year,Month +CH,2020,1 +,, +@@DataNodeState,, +DataNode,State, +MZ2.1,Active, +MZ2.2,Active, +MZ2.3,Active, +MZ2.4,Active, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodes_ActualsCase_CH.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodes_ActualsCase_CH.csv new file mode 100644 index 00000000..cde31212 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/DataNodes_ActualsCase_CH.csv @@ -0,0 +1,14 @@ +@@Main,,,,, +ReportingNode,,,,, +CH,,,,, +,,,,, +@@InsurancePortfolio,,,,, +SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType +MZ2,Actuals Case,CHF,ANN,BBA,Default +,,,,, +@@GroupOfInsuranceContract,,,,, +SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability +MZ2.1,MZ 2.1 Written,MZ2,2020,LRC,P +MZ2.2,MZ 2.2 OA Premium,MZ2,2020,LRC,P +MZ2.3,MZ 2.3 AA Claim,MZ2,2020,LRC,P +MZ2.4,MZ 2.4 AA Premium / OA Claim,MZ2,2020,LRC,P diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv new file mode 100644 index 00000000..3209b86f --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2020_12.csv @@ -0,0 +1,45 @@ +@@Main,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,,,,,,,,,,,,,,,,,,,,,,,,,,, +CH,2020,12,,,,,,,,,,,,,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +DataNode,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 +MZ2.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0 +MZ2.1,NIC,BE,BOP,N,,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15 +MZ2.1,,RA,BOP,N,,-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 +MZ2.1,PR,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 +MZ2.1,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 +MZ2.1,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-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E,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 +MZ2.2,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5 +MZ2.2,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 +MZ2.3,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0,100,0,0 +MZ2.3,NIC,BE,BOP,N,,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15,-15,-15,-15,-30,-30,-45,-45,-30,-30,-15,-15,-15 +MZ2.3,,RA,BOP,N,,-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 +MZ2.3,PR,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 +MZ2.3,NIC,BE,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 +MZ2.3,,RA,EV,N,,0,0,0,0,0,0,0,0,0,0,0,0,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5,-2.5 +MZ2.3,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,105,0,0,105,0,0,105,0,0 +MZ2.3,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0,-15,-15,-15,-35,-35,-45,-45,-35,-35,-15,-15,-15 +MZ2.3,,CU,CL,C,,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-10,-5,-5,-5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diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv new file mode 100644 index 00000000..208149c0 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_12.csv @@ -0,0 +1,57 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,,,,,,,,,,,,,,, +CH,2021,12,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +MZ2.1,PR,BE,MC,I,,102,0,0,102,0,0,102,0,0,102,0,0 +MZ2.1,NIC,BE,MC,I,,-15,-15,-15,-45,-45,-40,-40,-40,-40,-15,-15,-15 +MZ2.1,,RA,MC,I,,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 +MZ2.1,PR,BE,BOP,N,,52.5,0,0,52.5,0,0,0,0,0,0,0,0 +MZ2.1,NIC,BE,BOP,N,,-3.75,-3.75,-3.75,-11.25,-11.25,-8.75,-8.75,-8.75,-8.75,-3.75,-3.75,-3.75 +MZ2.1,,RA,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ2.1,PR,BE,MC,N,,51,0,0,51,0,0,0,0,0,0,0,0 +MZ2.1,NIC,BE,MC,N,,-5,-5,-5,-20,-20,-10,-10,-10,-10,-5,-5,-5 +MZ2.1,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 +MZ2.1,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +MZ2.1,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +MZ2.1,,CU,C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25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 +MZ2.4,PR,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +MZ2.4,NIC,BE,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 +MZ2.4,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.4,,RA,CL,C,,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv new file mode 100644 index 00000000..53260d5c --- /dev/null +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/NominalCashflows_ActualsCase_CH_2021_6.csv @@ -0,0 +1,57 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,,,,,,,,,,,,,,, +CH,2021,6,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +MZ2.1,PR,BE,MC,I,,100,0,0,100,0,0,100,0,0,100,0,0 +MZ2.1,NIC,BE,MC,I,,-15,-15,-15,-40,-40,-45,-45,-40,-40,-15,-15,-15 +MZ2.1,,RA,MC,I,,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 +MZ2.1,PR,BE,BOP,N,,52.5,0,0,52.5,0,0,0,0,0,0,0,0 +MZ2.1,NIC,BE,BOP,N,,-3.75,-3.75,-3.75,-8.75,-8.75,-11.25,-11.25,-8.75,-8.75,-3.75,-3.75,-3.75 +MZ2.1,,RA,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ2.1,PR,BE,MC,N,,50,0,0,50,0,0,0,0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,BE,BOP,N,,52.5,0,0,52.5,0,0,0,0,0,0,0,0 +MZ2.4,NIC,BE,BOP,N,,-3.75,-3.75,-3.75,-8.75,-8.75,-11.25,-11.25,-8.75,-8.75,-3.75,-3.75,-3.75 +MZ2.4,,RA,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ2.4,PR,BE,MC,N,,50,0,0,50,0,0,0,0,0,0,0,0 +MZ2.4,NIC,BE,MC,N,,-5,-5,-5,-10,-10,-20,-20,-10,-10,-5,-5,-5 +MZ2.4,,RA,MC,N,,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25,-1.25 +MZ2.4,PR,BE,CL,C,,0,0,0,0,0,0,100,0,0,100,0,0 +MZ2.4,NIC,BE,CL,C,,0,0,0,0,0,0,-65,-50,-50,-20,-20,-20 +MZ2.4,,CU,CL,C,,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25,-6.25 +MZ2.4,,RA,CL,C,,0,0,0,0,0,0,-3.25,-3.25,-3.25,-3.25,-3.25,-3.25 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2020_12.csv new file mode 100644 index 00000000..46d3b413 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2020_12.csv @@ -0,0 +1,9 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2020,12,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +MZ1.1,CF,PR,A,,400 +MZ1.1,CF,NIC,A,,-280 +MZ1.1,CF,ACA,A,,-10 +MZ1.1,CF,AEA,A,,-5 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2021_3.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2021_3.csv new file mode 100644 index 00000000..bd5e138f --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/Actuals_CsmSwitch_CH_2021_3.csv @@ -0,0 +1,10 @@ +@@Main,,,,, +ReportingNode,Year,Month,,, +CH,2021,3,,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +MZ1.1,CF,PR,A,,90 +MZ1.1,CF,ICO,A,,-6 +MZ1.1,CF,NIC,A,,-70 +MZ1.1,CF,ACA,A,,-10 +MZ1.1,CF,AEA,A,,-5 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb new file mode 100644 index 00000000..a8493d9b --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -0,0 +1,246 @@ +{ + "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": [ + "

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": [ + "## Data Nodes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Transactional Data" + ], + "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(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "### importing second GIC: 2020 12 and 2021 3 as pre-calculated values" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reset Workspace" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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)" + ], + "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/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb new file mode 100644 index 00000000..2805affe --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb @@ -0,0 +1,329 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + }, + "toc-autonumbering": "True", + "toc-showcode": "False" + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Contractual Service Margin and Loss Component Switch

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

Impact of the switch logic to Financial Performance and Balance Sheet

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Theory ", + "\nA fundamental concept introduced by IFRS 17 is the Contractual Service Margin (CSM). The CSM represents the unearned profit that an entity expects to earn as it provides services. It is defined at the minimum granularity being the Group of Insurance Contract (Unit Of Account) and it is relevant for all Liability of Remaining Coverage (LRC) approaches with the exception of the Premium Allocation Approach.", + "\n", + "\nThe main principles to understand the Contractual Sevice Margin and Loss Component in IFRS 17 are: ", + "\n", + "\n**Principle 1**: When an insurer writes profitable business, it must not be allowed to recognise the expected profits immediately and instead *must spread those profits over time*.", + "\n", + "\n**Principle 2**: When an insurer writes loss-making business, it must not be allowed to spread the expected losses for that business over time and instead *must recognise those losses immediately*.", + "\n

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


", + "\n", + "\n**Principle 3**: The CSM must be adjusted for all changes (AoC Step) that relate to future service e.g. favourable mortality updates must increase the CSM; unfavourable lapse experience must decrease the CSM.", + "\n", + "\n**Principle 4**: When an insurer recognises that written business, that was previously expected to be profitable, is now expected to be loss-making, e.g. because of changes relating to future service, it must not be allowed to spread the expected losses for that business over time and instead must recognise those losses immediately. It will do so by first extinguishing the CSM and then establishing a Loss Component (LC) in respect of the remaining excess. This represents a switch of the CSM to LC. ", + "\n

", + "\n", + "\n
" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Case Study", + "\nIn this case study we look at the allocation of the Technical Margin into Contractual Service Margin or Loss Component and its impact on the Financial Performance and Balance Sheet. ", + "\n
In particular, we are going to consider two possible approaches for the **switch logic**, which determines how the Technical Margin turns from CSM to LC and vice versa throughout the Analysis of Change (AoC). ", + "\n", + "\nFor this exercise, we consider two hypothetical GICs with identical inputs: the same parameters, modelled cash flows, actuals, etc... We will then analyze the results obtained by applying two different implementations of the **switch logic** and its implications to financial figures.", + "\n", + "\nWe have defined the following GICs:", + "\n - **MZ 1.1 Multiple Switches**: in this case the allocation of the Technical Margin to either CSM or LC can happen multiple times between the Beginning of Period (BoP) and End of Period (EoP). This means whenever the cumulative Technical Margin changes its sign due to the corresponding AoC contributions, a switch from CSM to LC (and vice versa) is observed.", + "\n ", + "\n - **MZ 1.2 Single Switch**: in this case the allocation of the Technical Margin to either CSM or LC can happen only once between the Beginning of Period (BoP) and End of Period (EoP). This means only if there is an effective switch (i.e. the cumulative Technical Margin at the Beginning of Period (BoP) and at the End of Period (EoP) have different signs), a single switch is observed. Otherwise there is no switch.", + "\n", + "\nWe will look at the relevant reports for the first quarter of year 2021 (2021 3).", + "\n", + "\nIt is worth to mention that in our starndard implementation, we consider *In Force* and *New business* contributions seperately as most analysts consider the new business part of the CSM an important Key Performance Indicator (KPI)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"CsmSwitchDataImport\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var reportingYear = 2021; ", + "\nvar reportingMonth = 3;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Fulfilment Cash Flow (FCF)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "We start by looking at the Fulfilment Cash Flows (FCF). Data and results for both cases are exactly the same." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var fulfillmentCashflows = ifrs17.FulfillmentCashflows;", + "\nfulfillmentCashflows.ReportingNode = \"CH\";", + "\nfulfillmentCashflows.ReportingPeriod = (reportingYear, reportingMonth);", + "\nfulfillmentCashflows.ColumnSlices = new string[]{\"GroupOfContract\",\"EstimateType\"};", + "\nfulfillmentCashflows.DataFilter = null;", + "\n(await fulfillmentCashflows.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Written Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Aslo the Actuals for both cases are exactly the same." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var writtenActual = ifrs17.WrittenActuals;", + "\nwrittenActual.ReportingNode = \"CH\";", + "\nwrittenActual.ReportingPeriod = (reportingYear, reportingMonth);", + "\nwrittenActual.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\nwrittenActual.DataFilter = null;", + "\n(await writtenActual.ToReportAsync) with {Height = 400}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# LRC Technical Margin (TM)", + "\n", + "\nIn the Technical Margin report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", + "\n", + "\nA negative value for Technical Margin correspond to an Asset character and thus allocated to the CSM. Conversely, a positive value of the Technical Margin represents a Liability character, which is then allocated to Loss Component. ", + "\n", + "\nAn Analysis of Change (AoC) report allows one to explain how the closing value (EoP) is obtained from the opening value (BoP). Each change to the previous value (i.e. a delta) is captured in its dedicated AoC Step (Model Correction, Experience Variance, ...).", + "\nAt each AoC step, the Technical Margin is recognized as Asset-like or Liability-like according to the sign of the accumulation (aggregation) of all figures of the Technical Margin starting from the opening (BoP) to a given AoC step in the chain.", + "\n", + "\nThrough the AoC steps it is possible that such aggregation of the Technical Margin oscillates from positive to negative and vice versa several times. How the Technical Margin figures are then allocated to CSM or LC is controlled by the implementation of the **switch logic**.", + "\n", + "\nAs we can see below, at this point, the Technical Margin is still the same for both cases considered, as no allocation to either CSM or LC is performed (i.e. the switch logic).", + "\n", + "\nWe also notice that the opening balance (BoP) has the same sign as the closing balance (EoP), thus one would not expect any switch intuitively.", + "\n", + "\nHowever, in this calculation approach the Technical Margin is calculated independently for each novelty (In Force and New Business) and the expected closing balance by novelty have opposite signs. While the In Force is always negative, the New Business is always positive.", + "\n", + "\nOnce the novelties are combined, we must look at the result of all contributions together. In our example, the In Force contribution is larger in magnitude than the New Business, thus the combined effect should be negative.", + "\nSince the AoC Steps for combined novelties are still not large enough to change the sign (in this case the Experience Adjustment), the closing balance remains negative. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var technicalMargins = ifrs17.TechnicalMargins;", + "\ntechnicalMargins.ReportingNode = \"CH\";", + "\ntechnicalMargins.ReportingPeriod = (reportingYear, reportingMonth);", + "\ntechnicalMargins.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\ntechnicalMargins.DataFilter = null;", + "\n(await technicalMargins.ToReportAsync) with {Height = 600}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Contractual Service Margin / Loss Component", + "\n", + "\nHere, we show the result of two different implementations of the **switch logic** for the two GICs we are considering.", + "\n", + "\n- **MZ 1.1 Multiple Switches**: it is calculated with our standard methodology (**multiple switches**) which allows to switch at every AoC Step with no limitation of amount of switches. ", + "\n- **MZ 1.2 Single Switch**: it is calculated with a switch logic (**single switch**) that shows only one switch when the number of total switches is odd (last relevant switch), none otherwise. ", + "\n", + "\nBecause only the New Business figures drive the Technical Margin to the Liability side, one can immediately realize the main difference between these two switch choices.", + "\nMZ 1.2 does not recognize any Loss Component, as in practice the Technical Margin at the Beginning of Period has the same sign as at the End of Period (both negative).", + "\n", + "\nIn this case the **single switch** (MZ 1.2) logic does not show any switch as both opening and closing figures are negative. The New Business contributions are then forced on the CSM side of this report with a negative sign to reflect the fact that they are decreasing the value. ", + "\n", + "\nContrarily, the **multiple switches** (MZ 1.1) approach allows the New Business to be recognized in the Loss Component (as mentioned above, because we consider the novelties independently). This generates a discrepancy between the In Force (Asset-like allocated to the CSM) and New Business (Liability-like allocated to the Loss Component).", + "\nThis is resolved in the Combined section of the report where both In Force and New Business figures are considered together.", + "\nThe Combined Liability AoC Step takes care of adding the two contributions, releasing the Liability-like contributions and allocating the equivalent amount to the CSM. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allocatedTechnicalMargins = ifrs17.AllocatedTechnicalMargins;", + "\nallocatedTechnicalMargins.ReportingNode = \"CH\";", + "\nallocatedTechnicalMargins.ReportingPeriod = (reportingYear, reportingMonth);", + "\nallocatedTechnicalMargins.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};", + "\nallocatedTechnicalMargins.DataFilter = null;", + "\n(await allocatedTechnicalMargins.ToReportAsync) with {Height = 700}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# LRC Actuarial", + "\nIn the LRC Balance Sheet view, the two approaches show the same Beginning of Period and End of Period (as expected) and can only be distinguished by looking at the AoC chains in detail, where indeed they behave differently.", + "\n", + "\nBy slicing in the data by EstimateType (i.e. the individual contributions to the LRC), we notice that the New Business section of the CSM of MZ 1.1 is completely missing (as it is allocated to the LC).", + "\nHowever, the Combined Liability AoC Step (effectively a balancing item) in the CSM of MZ 1.1 brings the New Business contribution back to the CSM, netting the effect and restoring the overall closing balance.", + "\n", + "\nIn MZ 1.2, since we have never allocated any LC, the New Business contributions appear as negative CSM (as seen in the corresponding report above) and should cancel the FCF for equivalent AoC Steps. Moreover, the Combined Liability AoC Step should be zero, as there is nothing to balance." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuarialLrc = ifrs17.ActuarialLrc;", + "\nactuarialLrc.ReportingNode = \"CH\";", + "\nactuarialLrc.ReportingPeriod = (reportingYear, reportingMonth);", + "\nactuarialLrc.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};", + "\nactuarialLrc.DataFilter = null;", + "\n(await actuarialLrc.ToReportAsync) with {Height = 750}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Financial Performance", + "\n", + "\nAs expected, the *Total comprehensive Income* is the same in both scenarios. ", + "\n
One observes differences in the *Insurance Sevice Result* (ISE) and *Insurance Finance income/Expense* (IFIE) sections. These differences cancel out to produce the same value for *Profit and Loss*. The *Other Comprehensive Income* section reports the same figure in both scenarios. ", + "\n", + "\nDrilling down into the data granularity one can realize the source of the above mentioned differences. ", + "\n
Let's start from the IFIE contribution (Financial contributions): ", + "\n- MZ 1.1 explicitly recognizes a contribution to Loss Component: this is the interest accretion on the Liability side of the Techinical Margin. Contrarily, MZ 1.2 does not recognizes any Loss Component. ", + "\n- MZ 1.1 reports a bigger figure for CSM than MZ 1.2: this is because in MZ 1.2 the interest on the Asset and on the Liability are both allocated to CSM and reported here as summed up (they carry opposite sign - check the CSM/LC report above).", + "\n", + "\nContinuing with the ISE contribution, one sees that both *Insurance Revenue* and *Insurance service Expense* carries a difference between the two scenarios. ", + "\n- The difference in *Insurance service Expense* is due to having explicitly allocated the New Business of the Techinical Margin to Loss Component. In this item the financial step (such as Interest Accretion (IA)) is excluded. Thus, because overall the Loss amounts to 0, the net effect of summing all the movements except IA result in $-$IA. This term cancels out the LC contribution reported in the Financial section. ", + "\n- The difference in *Insurance Revenue* is produced by the CSM contribution to the *Non Financial LRC changes*. The MZ 1.1 GIC includes here the Combined Liability AoC Step which takes into account the contribution of the IA computed on the New Business (Liability-like).", + "\n", + "\nIt is worth to mention that our choice of splitting between financial and non-financial contributions for all figures reported in the Financial Performance creates additional items (rows) that cancel out when aggregated. While for some it might be confusing and counter intuitive, for others this adds transparency. ", + "\nWe acknowledge that without this split for the Loss Component part, the Financial Performance would not report such items, producing the same final figures without explicit showing any Loss Component contribution.", + "\n", + "\nWe also point out that many KPIs can be defined based on some of these figures (CSM and/or LC), and although the Financial Performance in the end is the same, some of these KPIs might look significantly different." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var financialPerformance = ifrs17.FinancialPerformance;", + "\nfinancialPerformance.ReportingNode = \"CH\";", + "\nfinancialPerformance.ReportingPeriod = (reportingYear, reportingMonth);", + "\nfinancialPerformance.ColumnSlices = new string[]{\"GroupOfContract\"};", + "\nfinancialPerformance.DataFilter = null;", + "\n(await financialPerformance.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" + ], + "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/SingleVsMultipleCsmSwitch/DataNodeParameters_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodeParameters_CsmSwitch_CH_2020_12.csv new file mode 100644 index 00000000..50e7a14d --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodeParameters_CsmSwitch_CH_2020_12.csv @@ -0,0 +1,8 @@ +@@Main,, +ReportingNode,Year,Month +CH,2020,12 +,, +@@SingleDataNodeParameter,, +DataNode,PremiumAllocation, +MZ1.1,0.8, +MZ1.2,0.8, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodeStates_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodeStates_CsmSwitch_CH_2020_12.csv new file mode 100644 index 00000000..9e05c37b --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodeStates_CsmSwitch_CH_2020_12.csv @@ -0,0 +1,8 @@ +@@Main,, +ReportingNode,Year,Month +CH,2020,12 +,, +@@DataNodeState,, +DataNode,State, +MZ1.1,Active, +MZ1.2,Active, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodes_CsmSwitch_CH.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodes_CsmSwitch_CH.csv new file mode 100644 index 00000000..a728d0d1 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/DataNodes_CsmSwitch_CH.csv @@ -0,0 +1,12 @@ +@@Main,,,,, +ReportingNode,,,,, +CH,,,,, +,,,,, +@@InsurancePortfolio,,,,, +SystemName,DisplayName,ContractualCurrency,LineOfBusiness,ValuationApproach,OciType +MZ1,CSM/LC Switch,XTSHY,ANN,BBA,Default +,,,,, +@@GroupOfInsuranceContract,,,,, +SystemName,DisplayName,InsurancePortfolio,AnnualCohort,LiabilityType,Profitability +MZ1.1,MZ 1.1 Multiple Switches,MZ1,2020,LRC,P +MZ1.2,MZ 1.2 Single Switch,MZ1,2020,LRC,P diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv new file mode 100644 index 00000000..473ce967 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2020_12.csv @@ -0,0 +1,12 @@ +@@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,Values12,Values13,Values14,Values15,Values16,Values17,Values18,Values19,Values20,Values21,Values22,Values23 +MZ1.1,PR,BE,BOP,N,,100,0,0,100,0,0,100,0,0,100,0,0,0,100,0,0,100,0,0,100,0,0,100,0 +MZ1.1,NIC,BE,BOP,N,,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25,-25 +MZ1.1,,RA,BOP,N,,-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 +MZ1.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 +MZ1.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 +MZ1.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 +MZ1.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 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv new file mode 100644 index 00000000..f9e9d6b3 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/NominalCashflows_CsmSwitch_CH_2021_3.csv @@ -0,0 +1,21 @@ +@@Main,,,,,,,,,,,,,,,,, +ReportingNode,Year,Month,,,,,,,,,,,,,,, +CH,2021,3,,,,,,,,,,,,,,, +@@Cashflow,,,,,,,,,,,,,,,,, +DataNode,AmountType,EstimateType,AocType,Novelty,AccidentYear,Values0,Values1,Values2,Values3,Values4,Values5,Values6,Values7,Values8,Values9,Values10,Values11 +MZ1.1,PR,BE,MC,I,,0,110,0,0,110,0,0,110,0,0,110,0 +MZ1.1,NIC,BE,MC,I,,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,-20 +MZ1.1,,RA,MC,I,,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 +MZ1.1,PR,BE,BOP,N,,0,10,0,0,10,0,0,10,0,0,10,0 +MZ1.1,ICO,BE,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ1.1,NIC,BE,BOP,N,,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4 +MZ1.1,,RA,BOP,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ1.1,PR,BE,EV,N,,0,5,0,0,5,0,0,5,0,0,5,0 +MZ1.1,ICO,BE,EV,N,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ1.1,NIC,BE,EV,N,,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9 +MZ1.1,,RA,EV,N,,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5,-0.5 +MZ1.1,PR,BE,CL,C,,0,115,0,0,115,0,0,115,0,0,115,0 +MZ1.1,ICO,BE,CL,C,,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 +MZ1.1,NIC,BE,CL,C,,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29,-29 +MZ1.1,,CU,CL,C,,-15,-7,-7,-7,-7,-7,-7,-7,-7,-7,-7,-5 +MZ1.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 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2020_12.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2020_12.csv new file mode 100644 index 00000000..c2a4d4f1 --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2020_12.csv @@ -0,0 +1,44 @@ +@@Main,,,,,,, +Month,ReportingNode,Scenario,Year,,,, +12,CH,,2020,,,, +@@SimpleValue,,,,,,, +AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value +,ACA,CF,MZ1.2,,A,C,-10 +,AEA,CF,MZ1.2,,A,C,-5 +,NIC,CF,MZ1.2,,A,C,-280 +,PR,CF,MZ1.2,,A,C,400 +,PR,CF,MZ1.2,,APA,C,320 +,NIC,EOP,MZ1.2,C,BE,C,218.36476 +,NIC,BOP,MZ1.2,C,BE,N,336.39976 +,NIC,CF,MZ1.2,C,BE,N,-300 +,NIC,IA,MZ1.2,C,BE,N,181.965 +,PR,EOP,MZ1.2,C,BE,C,-306.20002 +,PR,BOP,MZ1.2,C,BE,N,-487.82037 +,PR,CF,MZ1.2,C,BE,N,400 +,PR,IA,MZ1.2,C,BE,N,-218.37965 +,NIC,EOP,MZ1.2,L,BE,C,218.36476 +,NIC,BOP,MZ1.2,L,BE,N,336.39976 +,NIC,CF,MZ1.2,L,BE,N,-300 +,NIC,IA,MZ1.2,L,BE,N,181.965 +,PR,EOP,MZ1.2,L,BE,C,-306.20002 +,PR,BOP,MZ1.2,L,BE,N,-487.82037 +,PR,CF,MZ1.2,L,BE,N,400 +,PR,IA,MZ1.2,L,BE,N,-218.37965 +,PR,CF,MZ1.2,L,BEPA,N,320 +,,AM,MZ1.2,,C,C,-95.78552 +,,EA,MZ1.2,,C,C,-15 +,,EOP,MZ1.2,,C,C,25.21326 +,,BOP,MZ1.2,,C,N,117.78063 +,,IA,MZ1.2,,C,N,18.21816 +,,AM,MZ1.2,,DA,C,11.87436 +,,CF,MZ1.2,,DA,C,-15 +,,EOP,MZ1.2,,DA,C,-3.12564 +,,AM,MZ1.2,L,F,C,0.79162 +,,EOP,MZ1.2,C,RA,C,21.83648 +,,BOP,MZ1.2,C,RA,N,33.63998 +,,CF,MZ1.2,C,RA,N,-30 +,,IA,MZ1.2,C,RA,N,18.1965 +,,EOP,MZ1.2,L,RA,C,21.83648 +,,BOP,MZ1.2,L,RA,N,33.63998 +,,CF,MZ1.2,L,RA,N,-30 +,,IA,MZ1.2,L,RA,N,18.1965 diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2021_3.csv b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2021_3.csv new file mode 100644 index 00000000..5396e3aa --- /dev/null +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/SimpleValue_CsmSwitch_CH_2021_3.csv @@ -0,0 +1,91 @@ +@@Main,,,,,,, +Month,ReportingNode,Scenario,Year,,,, +3,CH,,2021,,,, +@@SimpleValue,,,,,,, +AccidentYear,Am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 +,,EOP,MZ1.2,L,RA,C,17.56543 +,,BOP,MZ1.2,L,RA,I,21.83648 +,,CF,MZ1.2,L,RA,I,-6 +,,IA,MZ1.2,L,RA,I,2.58316 +,,MC,MZ1.2,L,RA,I,-4.3673 +,,BOP,MZ1.2,L,RA,N,8.73459 +,,CF,MZ1.2,L,RA,N,-3 +,,EV,MZ1.2,L,RA,N,-3.51309 +,,IA,MZ1.2,L,RA,N,1.29158 diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb new file mode 100644 index 00000000..2d062832 --- /dev/null +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -0,0 +1,252 @@ +{ + "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": [ + "# Data Initialization" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Workspace.InitializeFrom(DataSource);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Args" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var args = new ImportArgs(\"CH\", 2021, 3, default, default , default);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Node" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var dataNodeData = await Workspace.GetDataNodeDataReportParameters(args);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var dataNodeStates = await Workspace.GetDataNodeStateReportParameters(args);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var allYieldCurves = await Workspace.GetYieldCurveReportParameters(args);;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var singleDataNodeParameters = await Workspace.GetSingleDataNodeReportParameters(args);;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var interDataNodeParameters = await Workspace.GetInterDataNodeParameters(args);;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var partnerRatings = await Workspace.GetPartnerRatingsReportParameters(args);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var partnerDefaultRates = await Workspace.GetCreditDefaultRatesReportParameters(args);;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reports" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(dataNodeData)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.Portfolio).GroupRowsBy(x => x.DataNode)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(dataNodeStates)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()", + "\n " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(allYieldCurves)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.YieldCurveType).GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(singleDataNodeParameters)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(interDataNodeParameters)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.GroupOfContract).GroupRowsBy(x => x.LinkedDataNode)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(partnerRatings)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.Partner)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Report.ForObjects(partnerDefaultRates)", + "\n .WithQuerySource(Workspace)", + "\n .GroupRowsBy(x => x.CreditRiskRating)", + "\n .GroupColumnsBy(x => x.Period)", + "\n .ToTable()", + "\n .ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Test/Data/Actuals_CH_2020_12_MTUP10pct.csv b/ifrs17-template/Test/Data/Actuals_CH_2020_12_MTUP10pct.csv index eb8fb4c5..d898eb8a 100644 --- a/ifrs17-template/Test/Data/Actuals_CH_2020_12_MTUP10pct.csv +++ b/ifrs17-template/Test/Data/Actuals_CH_2020_12_MTUP10pct.csv @@ -1,12 +1,12 @@ -@@Main,,,, -ReportingNode,Year,Month,Scenario, -CH,2020,12,MTUP10pct, -@@Actual,,,, -DataNode,AocType,ValueType,AccidentYear,Value -DT1.1,CF,NIC,,-310 -DT1.2,CF,NIC,2020,-310 -DT2.1,CF,NIC,,-310 -DT1.3,CF,NIC,,-310 -DT2.2,CF,NIC,2020,-310 -DTR1.1,CF,NIC,,170 -DTR1.2,CF,NIC,2020,170 +@@Main,,,,, +ReportingNode,Year,Month,Scenario,, +CH,2020,12,MTUP10pct,, +@@Actual,,,,, +DataNode,AocType,AmountType,EstimateType,AccidentYear,Value +DT1.1,CF,NIC,A,,-310 +DT1.2,CF,NIC,A,2020,-310 +DT2.1,CF,NIC,A,,-310 +DT1.3,CF,NIC,A,,-310 +DT2.2,CF,NIC,A,2020,-310 +DTR1.1,CF,NIC,A,,170 +DTR1.2,CF,NIC,A,2020,170 diff --git a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb index 5e7d141f..f855a567 100644 --- a/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb +++ b/ifrs17-template/Test/Data/ExportIfrsVariable.ipynb @@ -20,7 +20,25 @@ { "cell_type": "markdown", "source": [ - "

Test Reports

" + "

Ifrs Variable Exporter

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Infrastructure and Configuration" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Initialize Workspace" ], "metadata": {}, "execution_count": 0, @@ -29,7 +47,8 @@ { "cell_type": "code", "source": [ - "#!eval-notebook \"InitSystemorphToMemoryForTesting\"" + "//#!eval-notebook \"InitSystemorphToMemoryForTesting\"", + "\n#!eval-notebook \"../../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport\"" ], "metadata": {}, "execution_count": 0, @@ -38,7 +57,7 @@ { "cell_type": "markdown", "source": [ - "# BenchMarks" + "## Configurations" ], "metadata": {}, "execution_count": 0, @@ -47,7 +66,7 @@ { "cell_type": "code", "source": [ - "var pathToBm = \"./Data/ReportBenchmarks/\";" + "//var pathToBm = \"./Data/ReportBenchmarks/\";" ], "metadata": {}, "execution_count": 0, @@ -56,19 +75,56 @@ { "cell_type": "code", "source": [ - "var argsArray = new ImportArgs[]{", - "\n new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, null, null),", - "\n new ImportArgs (\"CH\", 2021, 3, Periodicity.Quarterly, null, null)", + "int roundingDigits = - (int)Math.Log10(BenchmarkPrecision) + 1;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Defining Scope for the IfrsVariables" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Defining the Import Args" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "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 };" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Gathering Data" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "var scenario = \"MTUP10pct\";" + "var args = exportScope[0];", + "\nargs" ], "metadata": {}, "execution_count": 0, @@ -77,9 +133,30 @@ { "cell_type": "code", "source": [ - "var args = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, scenario, null);", - "\nawait DataSource.Partition.SetAsync(new {ReportingNode = args.ReportingNode, Year= args.Year, Month = args.Month, Scenario = args.Scenario});", - "\nvar computedVariables = (await DataSource.Query().ToArrayAsync()).ToDictionaryGrouped(x => x.EstimateType, x => x.ToArray());" + "await DataSource.Partition.SetAsync(new {ReportingNode = args.ReportingNode, Year = args.Year, Month = args.Month, Scenario = args.Scenario});", + "\nvar ifrsVariables = (await DataSource.Query().ToArrayAsync())", + "\n .Select(v => v with { Value = Math.Round(v.Value, roundingDigits)})", + "\n .OrderBy(v => v.DataNode).ThenBy(v => v.AccidentYear).ThenBy(v => v.EstimateType).ThenBy(v => v.EconomicBasis).ThenBy(v => v.AmountType).ThenBy(v => v.Novelty)", + "\n .ThenBy(v => v.AocType)", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Export SimpleValue" ], "metadata": {}, "execution_count": 0, @@ -88,7 +165,7 @@ { "cell_type": "code", "source": [ - "(0, computedVariables.Keys)" + "const string fileNamePrefix = \"SimpleValue\";" ], "metadata": {}, "execution_count": 0, @@ -97,8 +174,7 @@ { "cell_type": "code", "source": [ - "var estimateType = \"BEPA\";", - "\nawait Export.ToCsv(\"BM_\"+args.ReportingNode+\"_\"+args.Year.ToString()+\"_\"+args.Month.ToString()+\"_\"+scenario+\"_\"+estimateType)", + "await Export.ToCsv(fileNamePrefix + \"_\" + args.ReportingNode + \"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario)", "\n .WithTable(tableConfig => tableConfig", "\n .AtBeginning()", "\n .WithName(Main)", @@ -107,13 +183,22 @@ "\n .WithColumn(x => x.ImportFormat, x => x.Delete())", "\n )", "\n .WithTable(tableConfig => tableConfig", - "\n .WithSource(source => computedVariables[estimateType].AsQueryable())", - "\n .WithName(estimateType)", + "\n .WithSource(source => ifrsVariables.AsQueryable())", + "\n .WithName(fileNamePrefix)", "\n .WithColumn(x => x.Partition, x => x.Delete())", "\n .WithColumn(x => x.Id, x => x.Delete())", "\n )", "\n .WithSource(DataSource)", - "\n .ExecuteAsync()" + "\n .ExecuteAsync() " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Export by Estimate Type" ], "metadata": {}, "execution_count": 0, @@ -122,7 +207,40 @@ { "cell_type": "code", "source": [ - "" + "const string benchmarkFileNamePrefix = \"BM\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var estimateType = \"BE\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Export.ToCsv(benchmarkFileNamePrefix + \"_\" + args.ReportingNode +\"_\" + args.Year.ToString() + \"_\" + args.Month.ToString() + \"_\" + args.Scenario + \"_\" + estimateType)", + "\n .WithTable(tableConfig => tableConfig", + "\n .AtBeginning()", + "\n .WithName(Main)", + "\n .WithSource(source => args.RepeatOnce().AsQueryable())", + "\n .WithColumn(x => x.Periodicity, x => x.Delete())", + "\n .WithColumn(x => x.ImportFormat, x => x.Delete())", + "\n )", + "\n .WithTable(tableConfig => tableConfig", + "\n .WithSource(source => ifrsVariables.Where(x => x.EstimateType == estimateType).AsQueryable())", + "\n .WithName(estimateType)", + "\n .WithColumn(x => x.Partition, x => x.Delete())", + "\n .WithColumn(x => x.Id, x => x.Delete())", + "\n )", + "\n .WithSource(DataSource)", + "\n .ExecuteAsync() " ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/Data/ExportReportVariables.ipynb b/ifrs17-template/Test/Data/ExportReportVariables.ipynb index b7fc2793..bf06f205 100644 --- a/ifrs17-template/Test/Data/ExportReportVariables.ipynb +++ b/ifrs17-template/Test/Data/ExportReportVariables.ipynb @@ -56,7 +56,7 @@ { "cell_type": "markdown", "source": [ - "## Imports and Configurations" + "## Imports" ], "metadata": {}, "execution_count": 0, @@ -129,7 +129,7 @@ { "cell_type": "markdown", "source": [ - "### Defining the Period and Reporting Node (...) for the Reports" + "## Defining the Period and Reporting Node (...) for the Reports" ], "metadata": {}, "execution_count": 0, @@ -155,7 +155,7 @@ { "cell_type": "markdown", "source": [ - "# Export" + "# Gathering Data" ], "metadata": {}, "execution_count": 0, @@ -164,7 +164,7 @@ { "cell_type": "code", "source": [ - "var args = exportScope[6];", + "var args = exportScope[0];", "\nargs" ], "metadata": {}, @@ -174,13 +174,22 @@ { "cell_type": "code", "source": [ - "var scopesData = (await GetScopesDataAsync(args, reportStorage, Scopes)).Select(rv => rv with { Value = Math.Round(rv.Value, roundingDigits)});", + "var scopesData = (await GetScopesDataAsync(args, reportStorage, Scopes)).AggregateBy().Select(rv => rv with { Value = Math.Round(rv.Value, roundingDigits)});", "\nvar bmFileName = benchmarkFileNamePrefix + GetBenchmarkFileName(args) + \".csv\";" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Export" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ 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 6a49b39f..b950aba6 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 @@ -3,12 +3,22 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@A AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,NIC,CF,DT2.1,,A,C,-310 -2020,NIC,CF,DT1.2,,A,C,-310 ,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 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 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 new file mode 100644 index 00000000..98071041 --- /dev/null +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_APA.csv @@ -0,0 +1,8 @@ +@@Main +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 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 c57d6d4b..dcfc1f10 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,13 +3,19 @@ Month,ReportingNode,Scenario,Year 12,CH,MTUP10pct,2020 @@C AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,EA,DT2.1,,C,C,-139.99082 -,,EA,DT1.1,,C,C,-80.02327 ,,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 ,,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,-139.99082 +,,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 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 new file mode 100644 index 00000000..4ad94e50 --- /dev/null +++ b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_DA.csv @@ -0,0 +1,14 @@ +@@Main +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 diff --git a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_L.csv b/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_L.csv deleted file mode 100644 index c38e0f99..00000000 --- a/ifrs17-template/Test/Data/IfrsVariableBenchmarks/BM_CH_2020_12_MTUP10pct_L.csv +++ /dev/null @@ -1,14 +0,0 @@ -@@Main -Month,ReportingNode,Scenario,Year -12,CH,MTUP10pct,2020 -@@L -AccidentYear,AmountType,AocType,DataNode,EconomicBasis,EstimateType,Novelty,Value -,,AM,DT2.1,,L,C,-118.1274 -,,EA,DT2.1,,L,C,180.00918 -,,EA,DT1.1,,L,C,239.97673 -,,AM,DT1.1,,L,C,-157.4799 -,,EOP,DT1.1,,L,C,82.49683 -,,EOP,DT2.1,,L,C,61.88178 -,,EA,DT1.3,,L,C,260.00918 -,,AM,DT1.3,,L,C,-170.62578 -,,EOP,DT1.3,,L,C,89.38339 \ No newline at end of file diff --git a/ifrs17-template/Test/Data/ReportVariableBenchmarks/ReportVariableBenchmarks_2020_12_CH_MTUP10pct_Contractual.csv b/ifrs17-template/Test/Data/ReportVariableBenchmarks/ReportVariableBenchmarks_2020_12_CH_MTUP10pct_Contractual.csv index 6ab9b317..5c3c3747 100644 --- a/ifrs17-template/Test/Data/ReportVariableBenchmarks/ReportVariableBenchmarks_2020_12_CH_MTUP10pct_Contractual.csv +++ b/ifrs17-template/Test/Data/ReportVariableBenchmarks/ReportVariableBenchmarks_2020_12_CH_MTUP10pct_Contractual.csv @@ -157,25 +157,19 @@ AccidentYear,AmountType,AnnualCohort,ContractualCurrency,Currency,EconomicBasis, 0,PR,2020,USD,USD,L,BE,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,398.53673,IR5 0,PR,2020,USD,USD,L,BE,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-399.63393,OCI1 0,PR,2020,USD,USD,L,BEPA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,320,IR6 -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-82.02271,AM +0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-42.67021,AM 0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,80.0332,BOP -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,124.99082,CL -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-80.02327,EA -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,42.96811,EOP +0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-15,EA +0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,22.35306,EOP 0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,-0.00993,IA 0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,0.00993,IFIE1 -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,82.02271,IR3 -0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-125.00075,IR5 +0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,42.67021,IR3 +0,,2020,USD,USD,,C,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-65.0332,IR5 0,,2020,USD,USD,,DA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,9.84345,AM 0,,2020,USD,USD,,DA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-15,CF 0,,2020,USD,USD,,DA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-5.15655,EOP 0,,2020,USD,USD,,DA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,9.84345,IR4 0,,2020,USD,USD,,DA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-9.84345,ISE6 -0,,2020,USD,USD,,L,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-157.4799,AM -0,,2020,USD,USD,,L,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,239.97673,EA -0,,2020,USD,USD,,L,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,82.49683,EOP -0,,2020,USD,USD,,L,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-239.97673,ISE11 -0,,2020,USD,USD,,L,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,157.4799,ISE9 0,,2020,USD,USD,C,RA,CHF,DT1.1,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,59.87529,BOP 0,,2020,USD,USD,C,RA,CHF,DT1.1,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,-30,CF 0,,2020,USD,USD,C,RA,CHF,DT1.1,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,29.96755,EOP @@ -224,8 +218,7 @@ AccidentYear,AmountType,AnnualCohort,ContractualCurrency,Currency,EconomicBasis, 0,PR,2020,USD,USD,L,BEPA,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,400,IR6 0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-82.02271,AM 0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,139.90849,BOP -0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,124.99082,CL -0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-139.99082,EA +0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-15,EA 0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,42.96811,EOP 0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,0.08233,IA 0,,2020,USD,USD,,C,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-0.08233,IFIE1 @@ -236,11 +229,6 @@ AccidentYear,AmountType,AnnualCohort,ContractualCurrency,Currency,EconomicBasis, 0,,2020,USD,USD,,DA,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-5.15655,EOP 0,,2020,USD,USD,,DA,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,9.84345,IR4 0,,2020,USD,USD,,DA,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-9.84345,ISE6 -0,,2020,USD,USD,,L,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-170.62578,AM -0,,2020,USD,USD,,L,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,260.00918,EA -0,,2020,USD,USD,,L,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,89.38339,EOP -0,,2020,USD,USD,,L,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,-260.00918,ISE11 -0,,2020,USD,USD,,L,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,170.62578,ISE9 0,,2020,USD,USD,C,RA,CHF,DT1.3,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,59.87529,BOP 0,,2020,USD,USD,C,RA,CHF,DT1.3,P,False,LRC,ANN,N,Default,,DT1,0,CH,MTUP10pct,BBA,-30,CF 0,,2020,USD,USD,C,RA,CHF,DT1.3,P,False,LRC,ANN,C,Default,,DT1,0,CH,MTUP10pct,BBA,29.96755,EOP @@ -415,8 +403,7 @@ AccidentYear,AmountType,AnnualCohort,ContractualCurrency,Currency,EconomicBasis, 0,PR,2020,USD,USD,L,BEPA,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,320,IR6 0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-82.02271,AM 0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,N,,,DT2,0,CH,MTUP10pct,BBA,139.90849,BOP -0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,124.99082,CL -0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-139.99082,EA +0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-15,EA 0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,42.96811,EOP 0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,N,,,DT2,0,CH,MTUP10pct,BBA,0.08233,IA 0,,2020,USD,USD,,C,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-0.08233,IFIE1 @@ -427,11 +414,6 @@ AccidentYear,AmountType,AnnualCohort,ContractualCurrency,Currency,EconomicBasis, 0,,2020,USD,USD,,DA,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-5.15655,EOP 0,,2020,USD,USD,,DA,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,9.84345,IR4 0,,2020,USD,USD,,DA,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-9.84345,ISE6 -0,,2020,USD,USD,,L,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-118.1274,AM -0,,2020,USD,USD,,L,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,180.00918,EA -0,,2020,USD,USD,,L,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,61.88178,EOP -0,,2020,USD,USD,,L,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,-180.00918,ISE11 -0,,2020,USD,USD,,L,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,118.1274,ISE9 0,,2020,USD,USD,C,RA,CHF,DT2.1,P,False,LRC,ANN,N,,,DT2,0,CH,MTUP10pct,BBA,59.87529,BOP 0,,2020,USD,USD,C,RA,CHF,DT2.1,P,False,LRC,ANN,N,,,DT2,0,CH,MTUP10pct,BBA,-30,CF 0,,2020,USD,USD,C,RA,CHF,DT2.1,P,False,LRC,ANN,C,,,DT2,0,CH,MTUP10pct,BBA,29.96755,EOP diff --git a/ifrs17-template/Test/IfrsVariablesTest.ipynb b/ifrs17-template/Test/IfrsVariablesTest.ipynb index 30e66d22..860c13ee 100644 --- a/ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -94,9 +94,10 @@ "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BE.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_BEPA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_A.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", + "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_APA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", + "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_DA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_C.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_F.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", - "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_L.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n new BenchmarkMetadata(pathToBm+\"BM_CH_2020_12_MTUP10pct_RA.csv\" , \"CH\", 2020, 12, \"MTUP10pct\"),", "\n};" ], @@ -134,7 +135,7 @@ { "cell_type": "code", "source": [ - "public IfrsVariable CreateVariable (IDataRow row, Guid partition)", + "public IfrsVariable CreateVariable(IDataRow row, Guid partition)", "\n{", "\n if (!double.TryParse(row[nameof(IfrsVariable.Value)]?.ToString(), AllowedNumberStyles, CultureInfo.InvariantCulture, out var doubleValue))", "\n throw new Exception(\"Value cannot be parsed.\");", @@ -147,8 +148,7 @@ "\n AmountType = row.Field(nameof(IfrsVariable.AmountType)),", "\n AccidentYear = Int32.TryParse((row.Field(nameof(IfrsVariable.AccidentYear))), out var accidentYear) ? accidentYear : (int?)null,", "\n EconomicBasis = row.Field(nameof(IfrsVariable.EconomicBasis)),", - "\n Value = (-1.0) * doubleValue,", - "\n };", + "\n Value = (-1.0) * doubleValue };", "\n}" ], "metadata": {}, @@ -182,42 +182,24 @@ { "cell_type": "code", "source": [ - "public List CompareAgainstBm (List errors, IEnumerable expected, IEnumerable computed)", + "public List CompareAgainstBm(List errors, IEnumerable expected, IEnumerable computed)", "\n{", - "\n var expectedNotComputed = expected.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Select(x => x.ToIdentityString()).Except(computed.Select(x => x.ToIdentityString()));", - "\n var computedNotExpected = computed.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Select(x => x.ToIdentityString()).Except(expected.Select(x => x.ToIdentityString()));", + "\n var expectedNotComputed = expected.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(computed, EqualityComparer.Instance);", + "\n var computedNotExpected = computed.Where(x => Math.Abs(x.Value) > BenchmarkPrecision).Except(expected, EqualityComparer.Instance);", "\n if (expectedNotComputed.Any())", - "\n foreach (var error in expectedNotComputed)", - "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: \" + error));", + "\n foreach (var variable in expectedNotComputed)", + "\n errors.Add(new BenchmarkTestResult(\"Extra expected variable for: Partition \" + variable.Partition + \", \" + variable.ToIdentityString()));", "\n if (computedNotExpected.Any())", - "\n foreach (var error in computedNotExpected)", - "\n errors.Add(new BenchmarkTestResult(\"Extra computed variable for: \" + error));", - "\n ", - "\n var misMatchedVariables = expected.Concat(computed).AggregateOver().Where(x => Math.Abs(x.Value) > BenchmarkPrecision);", - "\n if (misMatchedVariables.Any())", - "\n {", - "\n foreach (var variable in misMatchedVariables)", - "\n {", - "\n var message = variable.ToIdentityString();", - "\n var bmValue = expected.FirstOrDefault(x => x.AocType == variable.AocType && ", - "\n x.Novelty == variable.Novelty &&", - "\n x.DataNode == variable.DataNode && ", - "\n x.EstimateType == variable.EstimateType && ", - "\n x.AmountType == variable.AmountType && ", - "\n x.EconomicBasis == variable.EconomicBasis && ", - "\n x.AccidentYear == variable.AccidentYear", - "\n )?.Value ?? 0.0d;", - "\n var computedValue = computed.FirstOrDefault(x => x.AocType == variable.AocType && ", - "\n x.Novelty == variable.Novelty &&", - "\n x.DataNode == variable.DataNode && ", - "\n x.EstimateType == variable.EstimateType && ", - "\n x.AmountType == variable.AmountType && ", - "\n x.EconomicBasis == variable.EconomicBasis && ", - "\n x.AccidentYear == variable.AccidentYear", - "\n )?.Value ?? 0.0d;", - "\n errors.Add(new BenchmarkTestResult(\"Value does not match for Variable: \" + message, -bmValue, computedValue));", - "\n }", + "\n foreach (var variable in computedNotExpected)", + "\n errors.Add(new BenchmarkTestResult(\"Extra computed variable for: Partition \" + variable.Partition + \", \" + variable.ToIdentityString()));", + "\n", + "\n var comparer = EqualityComparer.Instance; ", + "\n foreach (var benchmarkVariable in expected) {", + "\n var computedVariable = computed.FirstOrDefault(y => comparer.Equals(benchmarkVariable,y))?? null;", + "\n if(computedVariable == null || Math.Abs(benchmarkVariable.Value + computedVariable.Value) < BenchmarkPrecision) continue;", + "\n errors.Add(new BenchmarkTestResult(\"Value does not match for Variable: Partition \" + benchmarkVariable.Partition + \", \" + benchmarkVariable.ToIdentityString(), -benchmarkVariable.Value, computedVariable.Value));", "\n }", + "\n", "\n return errors;", "\n}" ], @@ -261,15 +243,12 @@ "\n var reportingNode = g.Key.ReportingNode;", "\n var year = g.Key.Year;", "\n var month = g.Key.Month;", - "\n string scenario = g.Key.Scenario;", + "\n var scenario = g.Key.Scenario;", "\n ", - "\n //Set up Args and storage", - "\n await DataSource.Partition.SetAsync(new {ReportingNode = reportingNode, ", - "\n Year = year, ", - "\n Month = month, ", - "\n Scenario = scenario});", + "\n await DataSource.Partition.SetAsync(new {ReportingNode = reportingNode, Year = year, Month = month, Scenario = scenario});", "\n var partition = (await DataSource.Query().ToArrayAsync())", - "\n .SingleOrDefault(x => x.ReportingNode == reportingNode && x.Year== year && x.Month == month && x.Scenario == scenario)?.Id ?? new Guid();", + "\n .SingleOrDefault(x => x.ReportingNode == reportingNode && x.Year== year && x.Month == month && x.Scenario == scenario)?.Id ?? ", + "\n throw new Exception(\"Partition not found.\");", "\n ", "\n var computedVariablesByEstimateType = (await DataSource.Query()", "\n .Where(v => !excludedDataNodes.Contains(v.DataNode))", @@ -313,24 +292,6 @@ "metadata": {}, "execution_count": 0, "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "errorList" - ], - "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/ImportStorageTest.ipynb b/ifrs17-template/Test/ImportStorageTest.ipynb index 19b809b5..73c83161 100644 --- a/ifrs17-template/Test/ImportStorageTest.ipynb +++ b/ifrs17-template/Test/ImportStorageTest.ipynb @@ -406,7 +406,7 @@ "//Define partition", "\nvar args = new ImportArgs(\"CH\", 2021, 3, Periodicity.Quarterly, null, ImportFormats.Cashflow);", "\n", - "\nvar reportingNodePartition = DataSource.Query().FirstOrDefault(x => x.ReportingNode == args.ReportingNode && x.Scenario == args.Scenario);", + "\nvar reportingNodePartition = DataSource.Query().FirstOrDefault(x => x.ReportingNode == args.ReportingNode);", "\nif(reportingNodePartition == null) ApplicationMessage.Log(Error.PartitionNotFound);", "\n", "\n", @@ -427,15 +427,15 @@ "cell_type": "code", "source": [ "var sampleGic = new GroupOfInsuranceContract(){Portfolio = \"P1\"};", - "\nvar inputDataGic = new GroupOfInsuranceContract[]{ sampleGic with {SystemName = \"Gross1\", LiabilityType = LiabilityTypes.LRC},", - "\n sampleGic with {SystemName = \"Gross2\", LiabilityType = LiabilityTypes.LRC},", - "\n sampleGic with {SystemName = \"Gross3\", LiabilityType = LiabilityTypes.LRC},", + "\nvar inputDataGic = new GroupOfInsuranceContract[]{ sampleGic with {SystemName = \"Gross1\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", + "\n sampleGic with {SystemName = \"Gross2\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", + "\n sampleGic with {SystemName = \"Gross3\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", "\n };", "\n", "\nvar sampleGric = new GroupOfReinsuranceContract(){Portfolio = \"ReP1\"};", - "\nvar inputDataGric = new GroupOfReinsuranceContract[]{ sampleGric with {SystemName = \"Reins1\", LiabilityType = LiabilityTypes.LRC},", - "\n sampleGric with {SystemName = \"Reins2\", LiabilityType = LiabilityTypes.LRC},", - "\n sampleGric with {SystemName = \"Reins3\", LiabilityType = LiabilityTypes.LRC},", + "\nvar inputDataGric = new GroupOfReinsuranceContract[]{ sampleGric with {SystemName = \"Reins1\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", + "\n sampleGric with {SystemName = \"Reins2\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", + "\n sampleGric with {SystemName = \"Reins3\", LiabilityType = LiabilityTypes.LRC, ContractualCurrency = \"CHF\", ValuationApproach = \"BBA\"},", "\n };", "\nvar sampleDnState = new DataNodeState {Partition = reportingNodePartition.Id, Year = args.Year, Month = args.Month, State = State.Active};", "\nvar inputDataState = new DataNodeState[]{ sampleDnState with {DataNode = \"Gross1\"} ,", diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index cd6603fd..95e7e89a 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -166,7 +166,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -184,7 +184,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -265,7 +265,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -281,7 +281,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -357,7 +357,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -372,7 +372,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/PracticalCasesTest.ipynb b/ifrs17-template/Test/PracticalCasesTest.ipynb new file mode 100644 index 00000000..52e24619 --- /dev/null +++ b/ifrs17-template/Test/PracticalCasesTest.ipynb @@ -0,0 +1,277 @@ +{ + "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": [ + "

Test Practical Cases

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Csm Switch : Single vs Multiple" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using FluentAssertions;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Fulfillment Cashflows" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var fcf = fulfillmentCashflows.GetDataCube().ToDictionaryGrouped(x => x.GroupOfContract, x => x.ToArray());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "fcf.Keys.Count.Should().Be(2);", + "\nfcf[fcf.Keys.First()].All(x => Math.Abs(fcf[fcf.Keys.Last()].Single(y => y.VariableType == x.VariableType && y.Novelty == x.Novelty && ", + "\n y.EstimateType == x.EstimateType && y.EconomicBasis == x.EconomicBasis &&", + "\n y.AmountType == x.AmountType).Value - x.Value) < 10E-4)", + "\n .Should().BeTrue();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actuals = writtenActual.GetDataCube().ToDictionaryGrouped(x => x.GroupOfContract, x => x.ToArray());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "actuals.Keys.Count.Should().Be(2);", + "\nactuals[actuals.Keys.First()].All(x => Math.Abs(actuals[actuals.Keys.Last()].Single(y => y.VariableType == x.VariableType && y.Novelty == x.Novelty && ", + "\n y.EstimateType == x.EstimateType && y.EconomicBasis == x.EconomicBasis &&", + "\n y.AmountType == x.AmountType).Value - x.Value) < 10E-4)", + "\n .Should().BeTrue();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Allocated Technical Margin" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "allocatedTechnicalMargins.GetDataCube().Select(x => x.GroupOfContract).Distinct().Count().Should().Be(2);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var eops = allocatedTechnicalMargins.GetDataCube().Where(x => x.VariableType == \"EOP\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "eops.Where(x => x.EstimateType == \"C\").Count().Should().Be(2);", + "\neops.Where(x => x.EstimateType == \"C\").All(x => Math.Abs(x.Value - 5.71) < 0.01).Should().BeTrue();", + "\neops.Single(x => x.EstimateType == \"L\").Value.Should().BeApproximately(0,Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var lc = allocatedTechnicalMargins.GetDataCube().Where(x => x.EstimateType == \"L\");", + "\nvar lcIa = lc.Single(x => x.VariableType == \"IA\").Value;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "lc.All(x => x.Novelty != \"I\" && x.GroupOfContract == \"MZ1.1\").Should().BeTrue();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var lcCombined = lc.Where(x => x.Novelty == \"C\" && x.GroupOfContract == \"MZ1.1\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "lcCombined.Count().Should().Be(2);", + "\nlcCombined.Where(x => x.VariableType == \"CL\").Count().Should().Be(1);", + "\nlcCombined.Where(x => x.VariableType == \"EOP\").Count().Should().Be(1);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Financial Performance" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var mz11 = financialPerformance.GetDataCube().Where(x => x.GroupOfContract == \"MZ1.1\");", + "\nvar mz12 = financialPerformance.GetDataCube().Where(x => x.GroupOfContract == \"MZ1.2\");" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mz11.Sum(x => x.Value).Should().BeApproximately(mz12.Sum(x => x.Value), 10E-4);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mz11.Single(x => x.VariableType == \"IR5\" && x.EstimateType ==\"C\").Value", + "\n .Should().BeApproximately(", + "\n mz12.Single(x => x.VariableType == \"IR5\" && x.EstimateType ==\"C\").Value + lcIa,", + "\n Precision", + "\n );" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mz11.Single(x => x.VariableType == \"ISE11\").Value.Should().BeApproximately(lcIa,Precision);", + "\nmz12.SingleOrDefault(x => x.VariableType == \"ISE11\")?.Value.Should().BeApproximately(0,Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mz11.Single(x => x.VariableType == \"IFIE1\" && x.EstimateType ==\"C\").Value", + "\n .Should().BeApproximately(", + "\n mz12.Single(x => x.VariableType == \"IFIE1\" && x.EstimateType ==\"C\").Value - lcIa,", + "\n Precision", + "\n );" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "mz11.Single(x => x.VariableType == \"IFIE1\" && x.EstimateType == \"L\").Value.Should().BeApproximately(-lcIa,Precision);", + "\nmz12.SingleOrDefault(x => x.VariableType == \"IFIE1\" && x.EstimateType == \"L\")?.Value.Should().BeApproximately(0,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/ReportVariablesTest.ipynb b/ifrs17-template/Test/ReportVariablesTest.ipynb index 1ed77b94..d68c8116 100644 --- a/ifrs17-template/Test/ReportVariablesTest.ipynb +++ b/ifrs17-template/Test/ReportVariablesTest.ipynb @@ -137,15 +137,16 @@ "\n scopesData = await GetScopesDataAsync(args, reportStorage, Scopes);", "\n benchmarkData = await GetBenchmarkDataAsync(args, path, Workspace, Import);", "\n", - "\n scopesData.Should().BeEquivalentTo(benchmarkData,", - "\n options => options", - "\n //.ComparingRecordsByValue()", - "\n .ComparingRecordsByMembers() ", - "\n //.ComparingByMembers()", - "\n //.ComparingByValue()", - "\n //.Excluding(o => o.Value)", - "\n .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, BenchmarkPrecision))", - "\n .WhenTypeIs() );", + "\n scopesData.AggregateBy().Should().BeEquivalentTo(", + "\n benchmarkData,", + "\n options => options", + "\n //.ComparingRecordsByValue()", + "\n .ComparingRecordsByMembers() ", + "\n //.ComparingByMembers()", + "\n //.ComparingByValue()", + "\n //.Excluding(o => o.Value)", + "\n .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, BenchmarkPrecision))", + "\n .WhenTypeIs() );", "\n return Activity.Finish();", "\n}" ], diff --git a/ifrs17-template/Test/ScenarioDataImportTest.ipynb b/ifrs17-template/Test/ScenarioDataImportTest.ipynb new file mode 100644 index 00000000..c372ff33 --- /dev/null +++ b/ifrs17-template/Test/ScenarioDataImportTest.ipynb @@ -0,0 +1,888 @@ +{ + "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": [ + "

Scenario Transactional Data 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": "code", + "source": [ + "var ws = Workspace.CreateNew();", + "\nws.InitializeFrom(DataSource);", + "\nvar argsBestEstimate = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, null, ImportFormats.Cashflow);", + "\nvar argsScenario = new ImportArgs (\"CH\", 2020, 12, Periodicity.Quarterly, \"Test\", ImportFormats.Cashflow);", + "\nvar initStorage = new ImportStorage(argsBestEstimate, DataSource, ws);", + "\nawait initStorage.InitializeAsync();", + "\nvar 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);" + ], + "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": [ + "var ivsBestEstimateInit = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Scenario Init Cash flows" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsScenario = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\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,,110,0,0,110,0,0,110,0,0,110,0,0,0,110,0,0,110,0,0,110,0,0,110,0", + "\nDT1.1,NIC,BE,CL,C,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5", + "\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,-5.5,-5.5,-5.5,-53.5,-52.5,-31.3", + "\nDT1.1,,RA,CL,C,,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowsScenario).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Scenario Init Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actualsScenario = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\n@@Actual", + "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", + "\nDT1.1,CF,NIC,A,,-308\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(actualsScenario).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Update of Deferrable Actuals with a Scenario Coverage Units Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Update CU cashflow for scenario and check that the Amortization Factor (and hence the Deferrable Actual) is updated" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsScenarioUpdateCU = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\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,,CU,CL,C,,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-6.5,-7.5,-8.5\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowsScenarioUpdateCU).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Update of Deferrable Actuals with a Scenario ACA/AEA Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actualsScenarioUpdateACAAEA = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\n@@Actual", + "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", + "\nDT1.1,CF,ACA,A,,-555", + "\nDT1.1,CF,AEA,A,,-777\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(actualsScenarioUpdateACAAEA).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Removal of Deferrable Actuals with a Actual Scenario Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Set ACA and AEA to zero and check that DA is removed" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actualsScenarioNoACAAEA = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\n@@Actual", + "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", + "\nDT1.1,CF,ACA,A,,0", + "\nDT1.1,CF,AEA,A,,0\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(actualsScenarioNoACAAEA).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenario);", + "\nvar ivsScenarioActualNoACAAEA = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsScenarioActualNoACAAEA.Except(ivsScenarioActualUpdateACAAEA, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Robustness: back to Best Estimate" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsScenarioEqualToBestEstimate = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\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\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var actualsScenarioEqualToBestEstimate = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\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\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(actualsScenarioEqualToBestEstimate).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowsScenarioEqualToBestEstimate).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenario);", + "\nvar ivsScenarioReimportEqualToBestEstimate = await DataSource.Query().ToArrayAsync(); ", + "\nvar diffs = ivsScenarioReimportEqualToBestEstimate.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance()).Where(x => Math.Abs(x.Value) > Precision);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "diffs.Count().Should().Be(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reimport of Best Estimate Cashflow: zero impact on Scenario" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Reimport of best estimate with different gross cash flow, whereas reinsurance business is the same of the initialization. This causes an update of the best estimate IFRS variables but it must have no impact on Scenario variables because gross cash flow contains only a combination of AocType, Novelty and AmoutType that have already been imported for Scenario (see above the variable cashflowsScenarioEqualToBestEstimate). " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsBestEstimateNoImpact = @\"", + "\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,,210,0,0,210,0,0,210,0,0,210,0,0,0,210,0,0,210,0,0,210,0,0,210,0", + "\nDT1.1,NIC,BE,CL,C,,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37", + "\nDT1.1,,CU,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", + "\nDT1.1,,RA,CL,C,,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42", + "\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(cashflowsBestEstimateNoImpact).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenario);", + "\nvar ivsScenarioReimportCashFlows = await DataSource.Query().ToArrayAsync();", + "\nvar diffs = ivsScenarioReimportCashFlows.Except(ivsBestEstimateInit, IfrsVariableComparer.Instance());" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reimport of Best Estimate Cashflow: impact on Scenario" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsBestEstimateImpact = @\"", + "\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,ICO,BE,CL,C,,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3,-3", + "\nDT1.1,PR,BE,CL,C,,210,0,0,210,0,0,210,0,0,210,0,0,0,210,0,0,210,0,0,210,0,0,210,0", + "\nDT1.1,NIC,BE,CL,C,,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37,-37", + "\nDT1.1,,CU,CL,C,,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-21,-17,-17,-17,-17,-17,-17,-17,-17,-17,-17,-3.3", + "\nDT1.1,,RA,CL,C,,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42,-42\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowsBestEstimateImpact).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Reimport of Best Estimate Actuals" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var newActualsBestEstimate = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,", + "\n@@Actual", + "\nDataNode,AocType,AmountType,EstimateType,AccidentYear,Value", + "\nDT1.1,CF,NIC,A,,-2000", + "\nDT1.1,CF,PR,A,,-4000\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(newActualsBestEstimate).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Update of Deferrable Actuals with a Best Estimate Coverage Units Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "Reset Coverage Units for Scenario so that they are taken from Best Estimate. Then, test that a re-import of Best Estimate Coverage Units changes the Scenario Deferrable Actuals. " + ], + "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": [ + "var cashflowsScenarioNoCU = @\"", + "\n@@Main", + "\nReportingNode,Year,Month,Scenario", + "\nCH,2020,12,Test", + "\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,,110,0,0,110,0,0,110,0,0,110,0,0,0,110,0,0,110,0,0,110,0,0,110,0", + "\nDT1.1,NIC,BE,CL,C,,-274.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5", + "\nDT1.1,,RA,CL,C,,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75\";" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var cashflowsBestEstimateUpdatedCU = @\"", + "\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,,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,,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 Import.FromString(cashflowsScenarioNoCU).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await DataSource.Partition.SetAsync(argsScenario);", + "\nvar ivsScenarioReimportCashflowNoCU = await DataSource.Query().ToArrayAsync();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "await Import.FromString(cashflowsBestEstimateUpdatedCU).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "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();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "actualVars.Length.Should().Be(0);", + "\ncashflowVars.Length.Should().NotBe(0);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17-template/Test/ScenarioTest.ipynb b/ifrs17-template/Test/ScenarioTest.ipynb deleted file mode 100644 index 8effcfa3..00000000 --- a/ifrs17-template/Test/ScenarioTest.ipynb +++ /dev/null @@ -1,264 +0,0 @@ -{ - "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": [ - "

Scenario Import Test

" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Context" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var defaultVarsBE = Workspace.Query().ToArray();" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Scenario Cash flows" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var cashflows_scenarioTest = @\"", - "\n@@Main", - "\nReportingNode,Year,Month,Scenario", - "\nCH,2020,12,Test", - "\n@@Cashflow", - "\nDataNode,AmountType,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,CL,C,,110,0,0,110,0,0,110,0,0,110,0,0,0,110,0,0,110,0,0,110,0,0,110,0", - "\nDT1.1,NIC,CL,C,,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5,-27.5", - "\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,-5.5,-5.5,-5.5,-5.5,-5.5,-3.3", - "\nDT1.1,RA,CL,C,,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75,-2.75\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var cashflows_scenarioTest_equalTo_BestEstimate = @\"", - "\n@@Main", - "\nReportingNode,Year,Month,Scenario", - "\nCH,2020,12,Test", - "\n@@Cashflow", - "\nDataNode,AmountType,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,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,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\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromString(cashflows_scenarioTest).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "await Workspace.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", - "\nawait DataSource.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", - "\nvar diffs = Workspace.Query().Except(defaultVarsBE, IfrsVariableComparer.Instance());", - "\ndiffs.Where(x => (new[]{\"A\",\"AA\",\"OA\",\"DA\"}).Contains(x.EstimateType)).ToArray().Length.Should().Be(0);", - "\ndiffs.Where(x => !(new[]{\"A\",\"AA\",\"OA\",\"DA\"}).Contains(x.EstimateType)).ToArray().Length.Should().NotBe(0);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Scenario Actuals" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var actuals_scenarioTest = @\"", - "\n@@Main", - "\nReportingNode,Year,Month,Scenario", - "\nCH,2020,12,Test", - "\n@@Actual", - "\nDataNode,AocType,ValueType,AccidentYear,Value", - "\nDT1.1,CF,NIC,,-308\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var actuals_scenarioTest_equalTo_BestEstimate = @\"", - "\n@@Main", - "\nReportingNode,Year,Month,Scenario", - "\nCH,2020,12,Test", - "\n@@Actual", - "\nDataNode,AocType,ValueType,AccidentYear,Value", - "\nDT1.1,CF,NIC,,-280\";" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromString(actuals_scenarioTest).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "await Workspace.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", - "\nawait DataSource.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", - "\nvar diffs = Workspace.Query().Except(defaultVarsBE, IfrsVariableComparer.Instance());", - "\ndiffs.Where(x => (new[]{\"A\",\"AA\",\"OA\",\"DA\"}).Contains(x.EstimateType)).ToArray().Length.Should().NotBe(0);", - "\ndiffs.Where(x => x.EstimateType == \"CU\").ToArray().Length.Should().Be(0);" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "markdown", - "source": [ - "# Robustness: back to Best Estimate" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromString(actuals_scenarioTest_equalTo_BestEstimate).WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "var log = await Import.FromString(cashflows_scenarioTest_equalTo_BestEstimate).WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync();", - "\nWorkspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", - "\nWorkspace.Initialize(x => x.FromSource(DataSource));", - "\nlog" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "Workspace.Query().Except(defaultVarsBE, IfrsVariableComparer.Instance()).ToArray().Length.Should().Be(0);" - ], - "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/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index 8a1b0187..e5014953 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -55,7 +55,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -64,7 +64,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -112,7 +112,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -121,7 +121,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/Tests.ipynb b/ifrs17-template/Test/Tests.ipynb index d7608993..c493097e 100644 --- a/ifrs17-template/Test/Tests.ipynb +++ b/ifrs17-template/Test/Tests.ipynb @@ -30,7 +30,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 9Gb RAM." + "\n
Execute this Notebook using at least 16Gb RAM." ], "metadata": {}, "execution_count": 0, @@ -93,7 +93,7 @@ { "cell_type": "code", "source": [ - "#!eval-notebook \"ScenarioTest\"" + "#!eval-notebook \"ScenarioDataImportTest\"" ], "metadata": {}, "execution_count": 0, @@ -135,6 +135,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"PracticalCasesTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 288ee9fb..49d163c6 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -22,7 +22,9 @@ "\n#!import \"Report/ReportMutableScopes\"", "\n#!import \"Import/Importers\"", "\n#!import \"Export/ExportConfiguration\"", - "\n#!import \"Utils/TestHelper\"" + "\n#!import \"Utils/TestHelper\"", + "\n#!import \"Utils/ActivityLog\"", + "\n#!import \"Report/ParameterReportsQueries\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index ceb279db..08842d5a 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -63,6 +63,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public const double YieldCurvePrecision = 1E-8;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ @@ -198,6 +207,7 @@ "\n public const string Opening = nameof(Opening); // Importer for Opening Balances (BOP Inforce of CSM/LC)", "\n public const string SimpleValue = nameof(SimpleValue); // Importer for Simple Values (pre-calculated direct import)", "\n", + "\n public const string YieldCurve = nameof(YieldCurve); // Importer for Yield Curve", "\n public const string DataNode = nameof(DataNode); // Importer for Data Node", "\n public const string DataNodeState = nameof(DataNodeState); // Importer for Data Node State", "\n public const string DataNodeParameter = nameof(DataNodeParameter); // Importer for Data Node Parameters", diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index e4db9b6c..64a58f8c 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -51,7 +51,7 @@ "source": [ "public enum Warning {", "\n // Import", - "\n ActiveDataNodeWithCashflowBOPI, VariablesAlreadyImported, VariablesAlreadyCalculated,", + "\n ActiveDataNodeWithCashflowBOPI, VariablesAlreadyImported, VariablesAlreadyCalculated, ScenarioReCalculations,", "\n // Default", "\n Generic", "\n}; " @@ -66,7 +66,7 @@ "public enum Error { ", "\n // Import", "\n NoMainTab, IncompleteMainTab, ParsingScientificNotation, ValueTypeNotFound, ValueTypeNotValid, ", - "\n ReportingNodeInMainNotFound, YearInMainNotFound, MonthInMainNotFound,", + "\n ReportingNodeInMainNotFound, YearInMainNotFound, MonthInMainNotFound, ScenarioInMainNotAvailable,", "\n AocTypeNotValid, AocTypeCompulsoryNotFound, AocTypePositionNotSupported, AocConfigurationOrderNotUnique,", "\n // Partition", "\n PartitionNotFound, ParsedPartitionNotFound, PartititionNameNotFound, PartitionTypeNotFound,", @@ -117,6 +117,7 @@ "\n (Error.ReportingNodeInMainNotFound , _) => $\"Reporting Node missing from the Main tab.\",", "\n (Error.YearInMainNotFound , _) => $\"Year missing from the Main tab.\",", "\n (Error.MonthInMainNotFound , _) => $\"Month missing from the Main tab.\",", + "\n (Error.ScenarioInMainNotAvailable , 1) => $\"Scenario {s[0]} has not been defined.\",", "\n (Error.AocTypeNotValid , 1) => $\"The parsed AoC Type {s[0]} is invalid.\",", "\n (Error.AocTypeCompulsoryNotFound , _) => $\"Not all compulsory AoC Types have been imported.\",", "\n (Error.AocTypePositionNotSupported , 1) => $\"The position of the AoC Type {s[0]} is not supported.\",", @@ -182,6 +183,7 @@ "public static string Get (Warning w, params string[] s) => (w, s.Length) switch {", "\n // Import", "\n (Warning.ActiveDataNodeWithCashflowBOPI , 1) => $\"Cash flow with AoC Type: {AocTypes.BOP} and Novelty: {Novelties.I} for Group of Contract {s[0]} is not allowed because previous period data are available.\",", + "\n (Warning.ScenarioReCalculations , 1) => $\"The import of the current file for the Best Estimate scenario makes the result of dependent Scenarios out of date. Hence, the following Scenarios are recalculated: {s[0]}.\", ", "\n // Default", "\n (Warning.Generic , _) => $\"{s[0]}\",", "\n (_ , _) => $\"Warning not found.\"", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 92cf5634..46802a93 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -52,21 +52,22 @@ { "cell_type": "code", "source": [ - "#r \"nuget:Systemorph.Activities,1.6.1\"", - "\n#r \"nuget:Systemorph.Arithmetics,1.6.1\"", - "\n#r \"nuget:Systemorph.Workspace,1.6.0\"", - "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.1\"", - "\n#r \"nuget:Systemorph.SharePoint,1.6.1\"", - "\n#r \"nuget:Systemorph.OneDrive,1.6.1\"", - "\n#r \"nuget:Systemorph.Scopes,1.6.1\"", - "\n#r \"nuget:Systemorph.Import,1.6.2\"", - "\n#r \"nuget:Systemorph.Test,1.6.1\"", - "\n#r \"nuget:Systemorph.Export,1.6.2\"", - "\n#r \"nuget:Systemorph.DataSetReader,1.6.2\"", + "#r \"nuget:Systemorph.Activities,1.6.2\"", + "\n#r \"nuget:Systemorph.Arithmetics,1.6.2\"", + "\n#r \"nuget:Systemorph.Workspace,1.6.1\"", + "\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.4\"", + "\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.DataSource,1.6.0\"", "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.0\"", - "\n#r \"nuget:Systemorph.Reporting,1.6.1\"", - "\n#r \"nuget:Systemorph.Charting,1.6.1\"" + "\n#r \"nuget:Systemorph.Reporting,1.6.2\"", + "\n#r \"nuget:Systemorph.Charting,1.6.2\"", + "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.1\"" ], "metadata": {}, "execution_count": 0, @@ -189,31 +190,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "markdown", - "source": [ - "The interface IHierarchy is used for modelling dimensions which have an hierarchical structure, such as [Amount Type](#amount-type)." - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public interface IHierarchy", - "\n{", - "\n public string Name { get; init; }", - "\n ", - "\n public string Parent { get; init; }", - "\n ", - "\n public string Child { get; init; }", - "\n}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "markdown", "source": [ @@ -1140,7 +1116,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", - "\nWhen the current Yield Curve must be 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 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." ], "metadata": {}, "execution_count": 0, @@ -1257,10 +1233,6 @@ "\n [Dimension(typeof(ReportingNode))]", "\n [IdentityProperty]", "\n public string ReportingNode { get; init; }", - "\n", - "\n [Dimension(typeof(Scenario))]", - "\n [IdentityProperty]", - "\n public string Scenario { get; init; }", "\n}" ], "metadata": {}, @@ -1305,6 +1277,11 @@ "\n [Dimension(typeof(int), nameof(Month))]", "\n [IdentityProperty]", "\n public int Month { get; init; }", + "\n ", + "\n [Display(Order = 50)]", + "\n [Dimension(typeof(Scenario))]", + "\n [IdentityProperty]", + "\n public string Scenario { get; init; }", "\n}" ], "metadata": {}, @@ -1672,6 +1649,8 @@ "\n public string LiabilityType { get; init; }", "\n public string Profitability { get; init; }", "\n public string Partner { get; init; }", + "\n public string YieldCurveName { get; init; }", + "\n ", "\n ", "\n //DataNodeState", "\n public int Year { get; init; }", @@ -1680,7 +1659,6 @@ "\n public State PreviousState { get; init; }", "\n ", "\n public bool IsReinsurance { get; init; }", - "\n public string Scenario { get; init; }", "\n public DataNodeData(){}", "\n}" ], @@ -2072,7 +2050,43 @@ { "cell_type": "code", "source": [ - "public record Args(string ReportingNode, int Year, int Month, Periodicity Periodicity, string Scenario){}" + "public record Args", + "\n{", + "\n [Required]", + "\n [IdentityProperty]", + "\n [Dimension(typeof(ReportingNode))]", + "\n public string ReportingNode { get; init; }", + "\n", + "\n [Required]", + "\n [IdentityProperty]", + "\n [NoArithmetics(ArithmeticOperation.Scale)]", + "\n [Dimension(typeof(int), nameof(Year))]", + "\n [Range(1900, 2100, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", + "\n public int Year { get; init; }", + "\n", + "\n [Required]", + "\n [IdentityProperty]", + "\n [NoArithmetics(ArithmeticOperation.Scale)]", + "\n [Dimension(typeof(int), nameof(Month))]", + "\n [Range(1, 12, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", + "\n public int Month { get; init; } ", + "\n ", + "\n [IdentityProperty]", + "\n [Dimension(typeof(Scenario))]", + "\n public string Scenario { get; init; }", + "\n", + "\n [IdentityProperty]", + "\n public Periodicity Periodicity{ get; init; }", + "\n", + "\n public Args(string reportingNode, int year, int month, Periodicity periodicity, string scenario)", + "\n {", + "\n ReportingNode = reportingNode;", + "\n Year = year;", + "\n Month = month;", + "\n Periodicity = periodicity;", + "\n Scenario = scenario;", + "\n }", + "\n}" ], "metadata": {}, "execution_count": 0, @@ -2118,6 +2132,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/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index 1190acbc..8eb90368 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -69,8 +69,7 @@ "\n => builder.WithTable( config => config .AtBeginning() ", "\n .WithName(Main) ", "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", - "\n .WithColumn(x => x.Id, x => x.Delete())", - "\n .WithColumn(x => x.Scenario, x => x.Delete()));" + "\n .WithColumn(x => x.Id, x => x.Delete()));" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index 3d155e93..5ea716a5 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -238,7 +238,7 @@ "\n ", "\n ", "\n IEnumerable ActualAmountTypes => GetStorage().GetIfrsVariables(Identity)", - "\n .Where(iv => GetStorage().EstimateTypesByImportFormat[ImportFormats.Actual].Contains(iv.EstimateType))", + "\n .Where(iv => GetStorage().ImportActualEstimateTypes.Contains(iv.EstimateType))", "\n .Select(x => x.AmountType)", "\n .ToHashSet();", "\n}", @@ -1192,7 +1192,7 @@ "\n builder.ForScope(s => ", "\n s.WithApplicability(x => x.GetStorage().ImportFormat != ImportFormats.Cashflow", "\n || x.GetStorage().IsSecondaryScope(x.Identity.DataNode)));", - "\n ", + "\n", "\n private int shift => GetStorage().GetShift(0);//Identity.ProjectionPeriod", "\n private int timeStep => GetStorage().GetTimeStep(0);//Identity.ProjectionPeriod", "\n private double amortizedFactor => GetScope(Identity)", @@ -1201,7 +1201,7 @@ "\n .Take(timeStep)", "\n .Aggregate(1d, (x, y) => x * y);", "\n [NotVisible] string EconomicBasis => GetContext();", - "\n ", + "\n", "\n string EstimateType => EstimateTypes.F;", "\n double Value => Math.Abs(amortizedFactor - 1d) > Precision", "\n ? 1d - amortizedFactor", @@ -2066,26 +2066,27 @@ "source": [ "public interface PvToIfrsVariable: IScope", "\n{", - "\n IEnumerable PvLocked => GetScope(Identity).PresentValues.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", - "\n EstimateType = x.Identity.EstimateType, ", - "\n DataNode = x.Identity.Id.DataNode, ", - "\n AocType = x.Identity.Id.AocType, ", - "\n Novelty = x.Identity.Id.Novelty, ", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = x.Identity.AmountType,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", - "\n IEnumerable PvCurrent => GetScope(Identity).PresentValues.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", - "\n EstimateType = x.Identity.EstimateType, ", - "\n DataNode = x.Identity.Id.DataNode, ", - "\n AocType = x.Identity.Id.AocType, ", - "\n Novelty = x.Identity.Id.Novelty, ", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = x.Identity.AmountType,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", + "\n IEnumerable PvLocked => GetScope(Identity).PresentValues.Select(x => ", + "\n new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", + "\n EstimateType = x.Identity.EstimateType, ", + "\n DataNode = x.Identity.Id.DataNode, ", + "\n AocType = x.Identity.Id.AocType, ", + "\n Novelty = x.Identity.Id.Novelty, ", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = x.Identity.AmountType,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", + "\n", + "\n IEnumerable PvCurrent => GetScope(Identity).PresentValues.Select(x => ", + "\n new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", + "\n EstimateType = x.Identity.EstimateType, ", + "\n DataNode = x.Identity.Id.DataNode, ", + "\n AocType = x.Identity.Id.AocType, ", + "\n Novelty = x.Identity.Id.Novelty, ", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = x.Identity.AmountType,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", "\n}" ], "metadata": {}, @@ -2097,26 +2098,27 @@ "source": [ "public interface RaToIfrsVariable: IScope", "\n{", - "\n IEnumerable RaCurrent => GetScope(Identity).PresentValues.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", - "\n EstimateType = x.Identity.EstimateType, ", - "\n DataNode = x.Identity.Id.DataNode, ", - "\n AocType = x.Identity.Id.AocType, ", - "\n Novelty = x.Identity.Id.Novelty, ", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = null,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", - "\n IEnumerable RaLocked => GetScope(Identity).PresentValues.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", - "\n EstimateType = x.Identity.EstimateType, ", - "\n DataNode = x.Identity.Id.DataNode, ", - "\n AocType = x.Identity.Id.AocType, ", - "\n Novelty = x.Identity.Id.Novelty, ", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = null,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", + "\n IEnumerable RaCurrent => GetScope(Identity).PresentValues.Select(x => ", + "\n new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", + "\n EstimateType = x.Identity.EstimateType, ", + "\n DataNode = x.Identity.Id.DataNode, ", + "\n AocType = x.Identity.Id.AocType, ", + "\n Novelty = x.Identity.Id.Novelty, ", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = null,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", + "\n ", + "\n IEnumerable RaLocked => GetScope(Identity).PresentValues.Select(x => ", + "\n new IfrsVariable{ EconomicBasis = x.EconomicBasis, ", + "\n EstimateType = x.Identity.EstimateType, ", + "\n DataNode = x.Identity.Id.DataNode, ", + "\n AocType = x.Identity.Id.AocType, ", + "\n Novelty = x.Identity.Id.Novelty, ", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = null,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", "\n}" ], "metadata": {}, @@ -2128,33 +2130,35 @@ "source": [ "public interface ActualToIfrsVariable: IScope", "\n{", - "\n IEnumerable Actual => GetScope(Identity).Actuals.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EstimateType = x.Identity.EstimateType,", - "\n DataNode = x.Identity.Id.DataNode,", - "\n AocType = x.Identity.Id.AocType,", - "\n Novelty = x.Identity.Id.Novelty,", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = x.Identity.AmountType,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", - "\n IEnumerable AdvanceActual => GetScope(Identity).Actuals.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EstimateType = x.Identity.EstimateType,", - "\n DataNode = x.Identity.Id.DataNode,", - "\n AocType = x.Identity.Id.AocType,", - "\n Novelty = x.Identity.Id.Novelty,", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = x.Identity.AmountType,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", - "\n IEnumerable OverdueActual => GetScope(Identity).Actuals.Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EstimateType = x.Identity.EstimateType,", - "\n DataNode = x.Identity.Id.DataNode,", - "\n AocType = x.Identity.Id.AocType,", - "\n Novelty = x.Identity.Id.Novelty,", - "\n AccidentYear = x.Identity.AccidentYear,", - "\n AmountType = x.Identity.AmountType,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", + "\n IEnumerable Actual => GetScope(Identity).Actuals.Select(x => ", + "\n new IfrsVariable{ EstimateType = x.Identity.EstimateType,", + "\n DataNode = x.Identity.Id.DataNode,", + "\n AocType = x.Identity.Id.AocType,", + "\n Novelty = x.Identity.Id.Novelty,", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = x.Identity.AmountType,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", + "\n ", + "\n IEnumerable AdvanceActual => GetScope(Identity).Actuals.Select(x => ", + "\n new IfrsVariable{ EstimateType = x.Identity.EstimateType,", + "\n DataNode = x.Identity.Id.DataNode,", + "\n AocType = x.Identity.Id.AocType,", + "\n Novelty = x.Identity.Id.Novelty,", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = x.Identity.AmountType,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", + "\n", + "\n IEnumerable OverdueActual => GetScope(Identity).Actuals.Select(x => ", + "\n new IfrsVariable{ EstimateType = x.Identity.EstimateType,", + "\n DataNode = x.Identity.Id.DataNode,", + "\n AocType = x.Identity.Id.AocType,", + "\n Novelty = x.Identity.Id.Novelty,", + "\n AccidentYear = x.Identity.AccidentYear,", + "\n AmountType = x.Identity.AmountType,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", "\n}" ], "metadata": {}, @@ -2166,14 +2170,14 @@ "source": [ "public interface DeferrableToIfrsVariable: IScope", "\n{", - "\n IEnumerable DeferrableActual => GetScope(Identity).RepeatOnce().Where(x => Math.Abs(x.Value) >= Precision).Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", - "\n DataNode = x.Identity.DataNode,", - "\n AocType = x.Identity.AocType,", - "\n Novelty = x.Identity.Novelty,", - "\n AccidentYear = null,", - "\n Value = x.Value,", - "\n Partition = GetStorage().TargetPartition", - "\n });", + "\n IEnumerable DeferrableActual => GetScope(Identity).RepeatOnce().Select(x => ", + "\n new IfrsVariable{ EstimateType = x.EstimateType,", + "\n DataNode = x.Identity.DataNode,", + "\n AocType = x.Identity.AocType,", + "\n Novelty = x.Identity.Novelty,", + "\n AccidentYear = null,", + "\n Value = x.Value,", + "\n Partition = GetStorage().TargetPartition });", "\n}" ], "metadata": {}, @@ -2190,7 +2194,6 @@ "\n ? Enumerable.Empty()", "\n : GetScope(Identity)", "\n .ByAmountType", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(sc => new IfrsVariable{ EstimateType = GetScope(Identity).EstimateType, ", "\n DataNode = sc.Identity.Id.DataNode, ", "\n AocType = sc.Identity.Id.AocType, ", @@ -2206,7 +2209,6 @@ "\n ? Enumerable.Empty()", "\n : GetScope(Identity)", "\n .ByAmountTypeAndEstimateType", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(sc => new IfrsVariable{ EstimateType = GetStorage().ExperienceAdjustEstimateTypeMapping[sc.Identity.EstimateType], ", "\n DataNode = sc.Identity.Id.DataNode, ", "\n AocType = sc.Identity.Id.AocType, ", @@ -2231,7 +2233,6 @@ "\n IEnumerable AmortizationFactor => Identity.AocType == AocTypes.AM", "\n ? GetScope(Identity, o => o.WithContext(EconomicBasis))", "\n .RepeatOnce()", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", @@ -2244,7 +2245,6 @@ "\n IEnumerable Csms => GetStorage().DataNodeDataBySystemName[Identity.DataNode].LiabilityType == LiabilityTypes.LIC", "\n ? Enumerable.Empty()", "\n : GetScope(Identity).RepeatOnce()", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", @@ -2257,7 +2257,6 @@ "\n ? Enumerable.Empty()", "\n : Identity.IsReinsurance ", "\n ? GetScope(Identity).RepeatOnce()", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", @@ -2266,7 +2265,6 @@ "\n Partition = GetStorage().TargetPartition", "\n })", "\n : GetScope(Identity).RepeatOnce()", - "\n .Where(x => Math.Abs(x.Value) >= Precision)", "\n .Select(x => new IfrsVariable{ EstimateType = x.EstimateType,", "\n DataNode = x.Identity.DataNode,", "\n AocType = x.Identity.AocType,", @@ -2325,7 +2323,23 @@ "\n .Concat(DeferrableActual)", "\n .Concat(Csms)", "\n .Concat(Loss);", - "\n} " + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public interface ComputeAllScopes: IScope", + "\n{", + "\n IEnumerable CalculatedIfrsVariables => GetStorage().ImportFormat switch {", + "\n ImportFormats.Actual => GetScope(Identity).CalculatedIfrsVariables,", + "\n ImportFormats.Cashflow => GetScope(Identity).CalculatedIfrsVariables,", + "\n ImportFormats.Opening => GetScope(Identity).CalculatedIfrsVariables,", + "\n };", + "\n}" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index c6572abc..f6fca951 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -118,7 +118,8 @@ "\n public Dictionary EstimateTypeDimension { get; private set; }", "\n public Dictionary> EstimateTypesByImportFormat { get; private set; }", "\n public Dictionary ExperienceAdjustEstimateTypeMapping { get; private set; } ", - "\n ", + "\n public HashSet ImportActualEstimateTypes => GetImportActualEstimateType();", + "\n", "\n //Constructor", "\n public ImportStorage(ImportArgs args, IDataSource querySource, IWorkspace workspace)", "\n {", @@ -174,8 +175,8 @@ "\n await workspace.Partition.SetAsync(TargetPartition);", "\n ", "\n //Get data from Workspace (result of parsing)", - "\n var parsedRawVariables = await workspace.Query().ToArrayAsync();", - "\n var parsedIfrsVariables = await workspace.Query().ToArrayAsync();", + "\n var parsedRawVariables = await workspace.QueryPartitionedDataAsync(querySource, TargetPartition, DefaultPartition, ImportFormat);", + "\n var parsedIfrsVariables = await workspace.QueryPartitionedDataAsync(querySource, TargetPartition, DefaultPartition, ImportFormat);", "\n ", "\n //DataNodes", "\n DataNodeDataBySystemName = await workspace.LoadDataNodesAsync(args);", @@ -223,7 +224,10 @@ "\n var openingRawVariables = Enumerable.Empty();", "\n var openingIfrsVariables = Enumerable.Empty();", "\n", - "\n if(allImportScopes.Select(dn => DataNodeDataBySystemName[dn]).Any(dnd => dnd.Year < args.Year)) {", + "\n var allImportScopesAtInceptionYear = allImportScopes.Select(dn => DataNodeDataBySystemName[dn]).Where(dnd => dnd.Year == args.Year).Select(x => x.DataNode).ToHashSet();", + "\n var allImportScopesNotAtInceptionYear = allImportScopes.Except(allImportScopesAtInceptionYear);", + "\n", + "\n if(allImportScopesNotAtInceptionYear.Any()) {", "\n PreviousPeriodPartition = (await querySource.Query().Where(p => p.ReportingNode == args.ReportingNode &&", "\n p.Year == PreviousReportingPeriod.Year &&", "\n p.Month == PreviousReportingPeriod.Month &&", @@ -240,7 +244,7 @@ "\n ", "\n openingIfrsVariables = (await querySource.Query()", "\n .Where(iv => iv.Partition == PreviousPeriodPartition && iv.AocType == AocTypes.EOP)", - "\n .Where(v => allImportScopes.Contains(v.DataNode))", + "\n .Where(v => allImportScopesNotAtInceptionYear.Contains(v.DataNode))", "\n .ToArrayAsync())", "\n .Select(iv => iv with {AocType = AocTypes.BOP, Novelty = Novelties.I, Partition = TargetPartition});", "\n ", @@ -250,11 +254,15 @@ "\n ", "\n //SetPartition to current Period", "\n await querySource.Partition.SetAsync(TargetPartition);", - "\n ", - "\n if(primaryScope.Select(dn => DataNodeDataBySystemName[dn]).Any(dnd => dnd.Year == args.Year) && ImportFormat != ImportFormats.Opening)", + "\n", + "\n var primaryScopeAtInceptionYear = allImportScopesAtInceptionYear.Where(dn => primaryScope.Contains(dn));", + "\n var secondaryScopeAtInceptionYear = allImportScopesAtInceptionYear.Where(dn => secondaryScope.Contains(dn)); ", + "\n if(allImportScopesAtInceptionYear.Any() && ImportFormat != ImportFormats.Opening) ", "\n openingIfrsVariables = openingIfrsVariables.Concat(await querySource.Query()", "\n .Where(iv => iv.Partition == TargetPartition && iv.AocType == AocTypes.BOP && iv.Novelty == Novelties.I)", - "\n .Where(iv => primaryScope.Contains(iv.DataNode) && EstimateTypesByImportFormat[InputSource.Opening.ToString()].Contains(iv.EstimateType) || secondaryScope.Contains(iv.DataNode))", + "\n .Where(iv => primaryScopeAtInceptionYear.Contains(iv.DataNode) ", + "\n && EstimateTypesByImportFormat[InputSource.Opening.ToString()].Contains(iv.EstimateType) ", + "\n || secondaryScopeAtInceptionYear.Contains(iv.DataNode))", "\n .ToArrayAsync());", "\n ", "\n //Variables", @@ -273,15 +281,8 @@ "\n", "\n if(DefaultPartition != TargetPartition) {", "\n await querySource.Partition.SetAsync(DefaultPartition);", - "\n var defaultRawVariables = await querySource.Query()", - "\n .Where(rv => rv.Partition == DefaultPartition)", - "\n .Where(rv => primaryScope.Contains(rv.DataNode)).ToArrayAsync();", - "\n var defaultIfrsVariables = await querySource.Query()", - "\n .Where(iv => iv.Partition == DefaultPartition)", - "\n .Where(iv => primaryScopeFromParsedVariables.Contains(iv.DataNode)", - "\n && !EstimateTypesByImportFormat[ImportFormat].Contains(iv.EstimateType) ", - "\n || primaryScopeFromLinkedReinsurance.Contains(iv.DataNode) ", - "\n || secondaryScope.Contains(iv.DataNode)).ToArrayAsync();", + "\n var defaultRawVariables = await querySource.Query().Where(rv => rv.Partition == DefaultPartition && primaryScope.Contains(rv.DataNode)).ToArrayAsync();", + "\n var defaultIfrsVariables = await querySource.Query().Where(iv => iv.Partition == DefaultPartition && allImportScopes.Contains(iv.DataNode)).ToArrayAsync(); ", "\n rawVariables = rawVariables.Union(defaultRawVariables, EqualityComparer.Instance);", "\n ifrsVariables = ifrsVariables.Union(defaultIfrsVariables, EqualityComparer.Instance);", "\n await querySource.Partition.SetAsync(TargetPartition);", @@ -300,7 +301,7 @@ "\n ", "\n public IEnumerable GetAllAocSteps(InputSource source) => aocStepByInputSource[source];", "\n public IEnumerable GetCalculatedTelescopicAocSteps() => AocConfigurationByAocStep.Where(kvp => kvp.Value.DataType == DataType.CalculatedTelescopic).Select(kvp => kvp.Key);", - "\n ", + "\n", "\n //YieldCurve", "\n public double[] GetYearlyYieldCurve(ImportIdentity id, string economicBasis) {", "\n var yc = GetYieldCurve(id, economicBasis);", @@ -308,13 +309,13 @@ "\n }", "\n ", "\n public YieldCurve GetYieldCurve(ImportIdentity id, string economicBasis) => (economicBasis, GetYieldCurvePeriod(id)) switch {", - "\n (EconomicBases.C, PeriodType.BeginningOfPeriod) => CurrentYieldCurve[DataNodeDataBySystemName[id.DataNode].ContractualCurrency][PreviousPeriod],", - "\n (EconomicBases.C, PeriodType.EndOfPeriod) => CurrentYieldCurve[DataNodeDataBySystemName[id.DataNode].ContractualCurrency][CurrentPeriod],", + "\n (EconomicBases.C, PeriodType.BeginningOfPeriod) => CurrentYieldCurve[id.DataNode][PreviousPeriod],", + "\n (EconomicBases.C, PeriodType.EndOfPeriod) => CurrentYieldCurve[id.DataNode][CurrentPeriod],", "\n (EconomicBases.L, _ ) => LockedInYieldCurve[id.DataNode],", "\n (_, PeriodType.NotApplicable) => (YieldCurve)ApplicationMessage.Log(Error.YieldCurvePeriodNotApplicable, id.AocType, id.Novelty),", "\n (_, _) => (YieldCurve)ApplicationMessage.Log(Error.EconomicBasisNotFound, id.DataNode)", "\n };", - "\n ", + "\n", "\n //int Identity.ProjectionPeriod ", "\n public int GetProjectionCount() => ProjectionConfiguration.Count();", "\n public int GetShift(int projectionPeriod) => ProjectionConfiguration[projectionPeriod].Shift;", @@ -381,7 +382,8 @@ "\n ", "\n // Other", "\n public IEnumerable GetNonAttributableAmountType() => new string[]{AmountTypes.NE};", - "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => new string[] {AmountTypes.ACA, AmountTypes.AEA}; //U+ specific", + "\n public IEnumerable GetAttributableExpenseAndCommissionAmountType() => hierarchyCache.Get(AmountTypes.ACA).Descendants(includeSelf : true).Select(x => x.SystemName)", + "\n .Concat(hierarchyCache.Get(AmountTypes.AEA).Descendants(includeSelf : true).Select(x => x.SystemName));", "\n public IEnumerable GetInvestmentClaims() => hierarchyCache.Get(AmountTypes.ICO).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetPremiums() => hierarchyCache.Get(AmountTypes.PR).Descendants(includeSelf : true).Select(x => x.SystemName);", "\n public IEnumerable GetClaims() => hierarchyCache.Get(AmountTypes.CL).Descendants().Select(x => x.SystemName);", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 3ec5a6aa..f4737847 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -239,7 +239,7 @@ { "cell_type": "markdown", "source": [ - "## Clean the Database" + "## Clean the Target QuerySource" ], "metadata": {}, "execution_count": 0, @@ -248,24 +248,41 @@ { "cell_type": "code", "source": [ - "async public Task CleanDatabaseAsync (Expression> filter = null) where T : class", + "public static async Task CleanAsync (this IDataSource dataSource, Expression> filter = null) where T : class", "\n{", - "\n var loadData = await DataSource.Query().Where(filter?? (Expression>)(x => true)).ToListAsync();", - "\n await DataSource.DeleteAsync(loadData);", + "\n var loadData = await dataSource.Query().Where(filter?? (Expression>)(x => true)).ToListAsync();", + "\n await dataSource.DeleteAsync(loadData);", "\n}" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Update the Target DataSource", + "\n", + "\nSource and target data space are of type IDataSource to allow update and commit to a Workspace or to a DataSource." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "public async Task CleanDatabaseFromPartitionAsync (Guid partitionId, Func filter = null) where T : class, IPartitioned", + "public static async Task CommitToAsync (this IDataSource source, IDataSource target, Guid partitionId = default, bool snapshot = true, Expression> filter = null) ", + "\nwhere TData : class, IPartitioned", + "\nwhere TPartition : IfrsPartition", "\n{", - "\n var loadData = (await DataSource.Query().Where(x => x.Partition == partitionId).ToArrayAsync())", - "\n .Where(filter?? (Func)(x => true)).ToList();", - "\n await DataSource.DeleteAsync(loadData);", + "\n if(partitionId != new Guid()) {", + "\n await target.Partition.SetAsync(partitionId);", + "\n await source.Partition.SetAsync(partitionId);", + "\n }", + "\n if(snapshot) await CleanAsync(target, filter);", + "\n await target.UpdateAsync( await source.Query().ToArrayAsync() );", + "\n await target.CommitAsync();", "\n}" ], "metadata": {}, @@ -275,7 +292,20 @@ { "cell_type": "markdown", "source": [ - "## Update the Database" + "# Import helpers" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Parse the Main Tab", + "\n", + "\nThe main table of our custom import formats contains the information which are required to identify the data partition depending on the ImportFormat. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods.", + "\n", + "\nGetArgsFromMain performes basic valiadations on the existance of the main tab. Then reads the reporting node, year, month, and scenario and return an ImportArgs with the results. If any of these information a default value is returned and will be validated in the following methods. " ], "metadata": {}, "execution_count": 0, @@ -284,11 +314,19 @@ { "cell_type": "code", "source": [ - "public async Task CommitToDatabase (IWorkspace workspace, Guid partitionId, bool snapshot = true, Func filter = null) where T : class, IPartitioned", - "\n{", - "\n if(snapshot) await CleanDatabaseFromPartitionAsync(partitionId, filter);", - "\n await DataSource.UpdateAsync( await workspace.Query().ToArrayAsync() );", - "\n await DataSource.CommitAsync();", + "public ImportArgs GetArgsFromMain(IDataSet dataSet) {", + "\n var mainTab = dataSet.Tables[Main];", + "\n if(mainTab == null) ApplicationMessage.Log(Error.NoMainTab);", + "\n if(!mainTab.Rows.Any()) ApplicationMessage.Log(Error.IncompleteMainTab);", + "\n if(ApplicationMessage.HasErrors()) return null;", + "\n", + "\n var main = mainTab.Rows.First();", + "\n var reportingNode = mainTab.Columns.Any(x => x.ColumnName == nameof(Args.ReportingNode)) ? (string)main[nameof(ReportingNode)] : default(string);", + "\n var scenario = mainTab.Columns.Any(x => x.ColumnName == nameof(Args.Scenario)) ? (string)main[nameof(Scenario)] : default(string);", + "\n var year = mainTab.Columns.Any(x => x.ColumnName == nameof(Args.Year)) ? (int)Convert.ChangeType(main[nameof(Args.Year)], typeof(int)) : default(int);", + "\n var month = mainTab.Columns.Any(x => x.ColumnName == nameof(Args.Month)) ? (int)Convert.ChangeType(main[nameof(Args.Month)], typeof(int)) : default(int);", + "\n", + "\n return new ImportArgs(reportingNode, year, month, default(Periodicity), scenario, default(string));", "\n}" ], "metadata": {}, @@ -298,7 +336,19 @@ { "cell_type": "markdown", "source": [ - "# Import helpers" + "A validation method which checks year and month. Log errors if any is missing. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static void ValidateArgsForPeriod(this ImportArgs args) {", + "\n if(args.Year == default(int)) ApplicationMessage.Log(Error.YearInMainNotFound);", + "\n if(args.Month == default(int)) ApplicationMessage.Log(Error.MonthInMainNotFound);", + "\n}" ], "metadata": {}, "execution_count": 0, @@ -307,9 +357,9 @@ { "cell_type": "markdown", "source": [ - "## Parse Main Tab and return Args", + "## Get Args and commit Partition", "\n", - "\nThe main table of our custom import formats contains the information which are required to identify the data partition. These information are temporarily stored in [Args](../DataModel/DataStructure#args) and used in the next methods. " + "\nThis is the main method to get Args which reference a specific data partition. All validations are triggered after parsing and if the partition is not already existing in the DataSource it is created and committed. " ], "metadata": {}, "execution_count": 0, @@ -318,49 +368,28 @@ { "cell_type": "code", "source": [ - "public async Task GetArgsFromMainAsync(IDataSet dataSet)", + "public async Task GetArgsAndCommitPartitionAsync(IDataSet dataSet)", "\n{", - "\n var mainTab = dataSet.Tables[Main];", - "\n if(mainTab == null) ApplicationMessage.Log(Error.NoMainTab);", - "\n if(mainTab.Rows.Count() == 0) ApplicationMessage.Log(Error.IncompleteMainTab);", - "\n if(mainTab.Columns.FirstOrDefault(x => x.ColumnName == nameof(ReportingNode)) == null) ApplicationMessage.Log(Error.ReportingNodeInMainNotFound);", + "\n var args = GetArgsFromMain(dataSet);", "\n if(ApplicationMessage.HasErrors()) return null;", - "\n ", - "\n var main = mainTab.Rows.First();", - "\n var reportingNode = (string)main[nameof(ReportingNode)];", - "\n var scenario = mainTab.Columns.Where(x => x.ColumnName == nameof(Scenario)).Count()>0? (string)main[nameof(Scenario)] : default(string);", + "\n if(args.ReportingNode == default(string)) { ApplicationMessage.Log(Error.ReportingNodeInMainNotFound); return null; }", "\n", - "\n ImportArgs args;", "\n switch(typeof(IPartition).Name) {", "\n case nameof(PartitionByReportingNode) : {", - "\n args = new ImportArgs( reportingNode,", - "\n default(int),", - "\n default(int),", - "\n default(Periodicity),", - "\n scenario,", - "\n default(string));", "\n await DataSource.UpdateAsync( new[] { new PartitionByReportingNode { ", "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", - "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario } } );", + "\n ReportingNode = args.ReportingNode } } );", "\n break;", "\n }", "\n case nameof(PartitionByReportingNodeAndPeriod) : {", - "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Year)).Count()!=1) ApplicationMessage.Log(Error.YearInMainNotFound);", - "\n if(mainTab.Columns.Where(x => x.ColumnName == nameof(PartitionByReportingNodeAndPeriod.Month)).Count()!=1) ApplicationMessage.Log(Error.MonthInMainNotFound);", + "\n args.ValidateArgsForPeriod();", "\n if(ApplicationMessage.HasErrors()) return null;", - "\n args = new ImportArgs( reportingNode, ", - "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Year)], typeof(int)),", - "\n (int)Convert.ChangeType(main[nameof(PartitionByReportingNodeAndPeriod.Month)], typeof(int)),", - "\n default(Periodicity),", - "\n scenario,", - "\n default(string) );", "\n await DataSource.UpdateAsync( new[]{ new PartitionByReportingNodeAndPeriod { ", "\n Id = (Guid)(await DataSource.Partition.GetKeyForInstanceAsync(args)),", "\n Year = args.Year,", "\n Month = args.Month,", - "\n ReportingNode = reportingNode, ", - "\n Scenario = scenario } } );", + "\n ReportingNode = args.ReportingNode, ", + "\n Scenario = args.Scenario } } );", "\n break;", "\n }", "\n default : {", @@ -391,27 +420,23 @@ "source": [ "public async Task DataNodeFactoryAsync(IDataSet dataSet, string tableName, ImportArgs args)", "\n{", - "\n var partition = (await DataSource.Query().Where(p => p.ReportingNode == args.ReportingNode && p.Scenario == null).ToArrayAsync()).SingleOrDefault();", + "\n var partition = (await DataSource.Query().Where(p => p.ReportingNode == args.ReportingNode).ToArrayAsync()).FirstOrDefault();", "\n if(partition == null) { ApplicationMessage.Log(Error.ParsedPartitionNotFound); return; }", - "\n", + "\n ", "\n var table = dataSet.Tables[tableName];", - "\n", + "\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", "\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", "\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", "\n await DataSource.UpdateAsync( dataNodeSingleParametersUndefined.Select(x => ", "\n new SingleDataNodeParameter {DataNode = x, Year = args.Year, Month = DefaultDataNodeActivationMonth, PremiumAllocation = DefaultPremiumExperienceAdjustmentFactor, Partition = partition.Id}).ToArray() );", - "\n", "\n await DataSource.CommitAsync();", "\n}" ], @@ -432,10 +457,85 @@ "cell_type": "code", "source": [ "public async Task ValidateForDataNodeStateActiveAsync(IWorkspace workspace, Dictionary dataNodes) where T : BaseDataRecord", - "\n{", + "\n{ ", "\n foreach(var item in (await workspace.Query().ToArrayAsync()).GroupBy(x => x.DataNode))", "\n if(!dataNodes.ContainsKey(item.First().DataNode))", "\n ApplicationMessage.Log(Error.InactiveDataNodeState, item.First().DataNode);", + "\n}", + "\n" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Calculate IFRS Variables", + "\n", + "\nThe following methods are used in the different importers to compute the [IfrsVariables](../DataModel/DataStructure#ifrs-variable).", + "\n", + "\nGetAllArgsAsync retrieves the partitions or Args that require computation. They are the union of the primary args (the one read from the main tab of the imported file) with the secondary args (senarios which depends on the best estimate data).", + "\nComputeAsync computes the IfrsVariables for a given partition (identified by its ImportArgs) and stores the results in a disposable workspace. This then serves as DataSource in the calculation of the secondary partitions (identified by the secondary args)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task GetAllArgsAsync(ImportArgs primaryArgs)", + "\n{", + "\n if (primaryArgs.Scenario != null)", + "\n return primaryArgs.RepeatOnce().ToArray();", + "\n", + "\n var secondaryArgs = await DataSource.Query() ", + "\n .Where(x => x.ReportingNode == primaryArgs.ReportingNode && x.Year == primaryArgs.Year && x.Month == primaryArgs.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())", + "\n ApplicationMessage.Log(Warning.ScenarioReCalculations, String.Join(\", \", secondaryArgs.Select(x => x.Scenario)));", + "\n ", + "\n return primaryArgs.RepeatOnce().Concat(secondaryArgs).ToArray();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public async Task ComputeAsync(ImportArgs args, IWorkspace workspace, IWorkspace workspaceToCompute, bool saveRawVariables)", + "\n{", + "\n Activity.Start();", + "\n var storage = new ImportStorage(args, workspaceToCompute, workspace);", + "\n await storage.InitializeAsync();", + "\n if(Activity.HasErrors()) return Activity.Finish();", + "\n ", + "\n var universe = Scopes.ForStorage(storage).ToScope();", + "\n var identities = universe.GetScopes(storage.DataNodesByImportScope[ImportScope.Primary]).SelectMany(s => s.Identities);", + "\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, storage.TargetPartition);", + "\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 }", + "\n", + "\n workspace.Reset(x => x.ResetType());", + "\n await workspace.UpdateAsync(ivs.Where(x => storage.DefaultPartition != storage.TargetPartition || Math.Abs(x.Value) >= Precision));", + "\n await workspace.CommitToAsync(workspaceToCompute, storage.TargetPartition, snapshot : true, ", + "\n filter : x => storage.EstimateTypesByImportFormat[args.ImportFormat].Contains(x.EstimateType) ", + "\n && storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode));", + "\n if(saveRawVariables) {", + "\n if(args.Scenario == null) await workspace.DeleteAsync(await workspace.Query().Where(rv => rv.Values.Sum(x => Math.Abs(x)) < Precision).ToArrayAsync());", + "\n await workspace.CommitToAsync(workspaceToCompute, storage.TargetPartition, snapshot : true, ", + "\n filter : x => storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode));", + "\n }", + "\n return Activity.Finish();", "\n}" ], "metadata": {}, @@ -454,7 +554,7 @@ { "cell_type": "markdown", "source": [ - "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new AoC steps. ", + "The [Analysis of Change configuration](../DataModel/DataStructure#aoc-step-configuration) is parsed from the input file and complemented with defaults to allow for an easy insertion of new AoC Steps.", "\n", "\nAfter having checked that the [AocTypes](../DataModel/DataStructure#aoc-variable-type) loaded in the target DataSource are including all the compulsory ones, default configurations are generated on the basis of the AocTypes ordering. ", "\n", @@ -558,7 +658,79 @@ { "cell_type": "markdown", "source": [ - "# Data Nodes", + "# 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", + "\nYield curves to be imported are compared against those already present in the DataSource and only the new ones are stored." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "Import.DefineFormat(ImportFormats.YieldCurve, async (options, dataSet) => {", + "\n Activity.Start();", + "\n var args = GetArgsFromMain(dataSet) with {ImportFormat = ImportFormats.YieldCurve};", + "\n args.ValidateArgsForPeriod();", + "\n if(ApplicationMessage.HasErrors()) return Activity.Finish();", + "\n", + "\n var workspace = Workspace.CreateNew();", + "\n workspace.Initialize(x => x.FromSource(DataSource).DisableInitialization().DisableInitialization());", + "\n", + "\n var committedYieldCurves = await DataSource.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 Currency = datarow.Field(nameof(YieldCurve.Currency)),", + "\n Year = args.Year,", + "\n Month = args.Month, ", + "\n Scenario = args.Scenario,", + "\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", + "\n ? datarow.Field(nameof(YieldCurve.Name))", + "\n : default(string)", + "\n };", + "\n return committedYieldCurves.Contains(yieldCurve, YieldCurveComparer.Instance())", + "\n ? null", + "\n : yieldCurve;", + "\n }", + "\n ).WithTarget(workspace).ExecuteAsync(); ", + "\n ", + "\n if(importLog.Errors.Any()) return Activity.Finish().Merge(importLog); ", + "\n ", + "\n var toCommitYieldCurves = await workspace.Query().ToArrayAsync();", + "\n if (!toCommitYieldCurves.Any()){", + "\n ApplicationMessage.Log(Warning.VariablesAlreadyImported); ", + "\n return Activity.Finish().Merge(importLog);", + "\n }", + "\n ", + "\n await DataSource.UpdateAsync(toCommitYieldCurves);", + "\n await DataSource.CommitAsync();", + "\n ", + "\n return Activity.Finish().Merge(importLog);", + "\n});" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Nodes" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "", "\n", "\n[Portfolios](../DataModel/DataStructure#portfolios) and [Group of Contracts](../DataModel/DataStructure#group-of-contracts) are imported in the same file. " ], @@ -579,95 +751,90 @@ "\n .DisableInitialization());", "\n ", "\n Activity.Start();", - "\n var args = await GetArgsFromMainAsync(dataSet);", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var storage = new ParsingStorage(args, DataSource, workspace);", "\n await storage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", - "\n var errors = new List();", "\n var importLogPortfolios = await Import.FromDataSet(dataSet)", - "\n .WithType((dataset, datarow) => new InsurancePortfolio {", - "\n SystemName = datarow.Field(nameof(DataNode.SystemName)),", - "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", - "\n Partition = storage.TargetPartitionByReportingNode.Id,", - "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", - "\n FunctionalCurrency = storage.ReportingNode.Currency,", - "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", - "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", - "\n OciType = datarow.Field(nameof(DataNode.OciType))", - "\n })", - "\n .WithType((dataset, datarow) =>new ReinsurancePortfolio {", - "\n SystemName = datarow.Field(nameof(DataNode.SystemName)),", - "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", - "\n Partition = storage.TargetPartitionByReportingNode.Id,", - "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", - "\n FunctionalCurrency = storage.ReportingNode.Currency,", - "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", - "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", - "\n OciType = datarow.Field(nameof(DataNode.OciType))", - "\n })", + "\n .WithType((dataset, datarow) => ", + "\n new InsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", + "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", + "\n Partition = storage.TargetPartitionByReportingNode.Id,", + "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", + "\n FunctionalCurrency = storage.ReportingNode.Currency,", + "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", + "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", + "\n OciType = datarow.Field(nameof(DataNode.OciType)) })", + "\n .WithType((dataset, datarow) =>", + "\n new ReinsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", + "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", + "\n Partition = storage.TargetPartitionByReportingNode.Id,", + "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", + "\n FunctionalCurrency = storage.ReportingNode.Currency,", + "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", + "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", + "\n OciType = datarow.Field(nameof(DataNode.OciType)) })", "\n .WithTarget(workspace)", "\n .ExecuteAsync();", "\n ", "\n var portfolios = await workspace.Query().ToDictionaryAsync(x => x.SystemName);", + "\n", + "\n var yieldCurveColumnGroupOfInsuranceContract = dataSet.Tables.Contains(nameof(GroupOfInsuranceContract)) && dataSet.Tables[nameof(GroupOfInsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfInsuranceContract.YieldCurveName));", + "\n var yieldCurveColumnGroupOfReinsuranceContract = dataSet.Tables.Contains(nameof(GroupOfReinsuranceContract)) && dataSet.Tables[nameof(GroupOfReinsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfReinsuranceContract.YieldCurveName));", + "\n", "\n var importLogGroupOfContracts = await Import.FromDataSet(dataSet)", "\n .WithType((dataset, datarow) => {", - "\n var gicSystemName = datarow.Field(nameof(DataNode.SystemName));", - "\n var pf = datarow.Field(nameof(InsurancePortfolio));", - "\n if(!portfolios.TryGetValue(pf, out var portfolioData))", - "\n {", - "\n ApplicationMessage.Log(Error.PortfolioGicNotFound, pf, gicSystemName);", - "\n return null;", - "\n }", - "\n var gic = new GroupOfInsuranceContract {", - "\n SystemName = gicSystemName,", - "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", - "\n Partition = storage.TargetPartitionByReportingNode.Id,", - "\n ContractualCurrency = portfolioData.ContractualCurrency,", - "\n FunctionalCurrency = portfolioData.FunctionalCurrency,", - "\n LineOfBusiness = portfolioData.LineOfBusiness,", - "\n ValuationApproach = portfolioData.ValuationApproach,", - "\n OciType = portfolioData.OciType,", - "\n AnnualCohort = Convert.ToInt32(datarow.Field(nameof(GroupOfContract.AnnualCohort))),", - "\n LiabilityType = datarow.Field(nameof(GroupOfContract.LiabilityType)),", - "\n Profitability = datarow.Field(nameof(GroupOfContract.Profitability)),", - "\n Portfolio = pf,", - "\n YieldCurveName = dataset.Tables[nameof(GroupOfInsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfContract.YieldCurveName)) ", - "\n ? datarow.Field(nameof(GroupOfContract.YieldCurveName)) ", - "\n : (string)null,", - "\n };", - "\n return ExtendGroupOfContract(gic, datarow);", - "\n })", + "\n var gicSystemName = datarow.Field(nameof(DataNode.SystemName));", + "\n var pf = datarow.Field(nameof(InsurancePortfolio));", + "\n if(!portfolios.TryGetValue(pf, out var portfolioData)) {", + "\n ApplicationMessage.Log(Error.PortfolioGicNotFound, pf, gicSystemName);", + "\n return null;", + "\n }", + "\n var gic = new GroupOfInsuranceContract { SystemName = gicSystemName,", + "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", + "\n Partition = storage.TargetPartitionByReportingNode.Id,", + "\n ContractualCurrency = portfolioData.ContractualCurrency,", + "\n FunctionalCurrency = portfolioData.FunctionalCurrency,", + "\n LineOfBusiness = portfolioData.LineOfBusiness,", + "\n ValuationApproach = portfolioData.ValuationApproach,", + "\n OciType = portfolioData.OciType,", + "\n AnnualCohort = Convert.ToInt32(datarow.Field(nameof(GroupOfContract.AnnualCohort))),", + "\n LiabilityType = datarow.Field(nameof(GroupOfContract.LiabilityType)),", + "\n Profitability = datarow.Field(nameof(GroupOfContract.Profitability)),", + "\n Portfolio = pf,", + "\n YieldCurveName = yieldCurveColumnGroupOfInsuranceContract", + "\n ? datarow.Field(nameof(GroupOfContract.YieldCurveName)) ", + "\n : (string)null };", + "\n return ExtendGroupOfContract(gic, datarow);", + "\n })", "\n .WithType((dataset, datarow) => {", - "\n var gricSystemName = datarow.Field(nameof(DataNode.SystemName));", - "\n var pf = datarow.Field(nameof(ReinsurancePortfolio));", - "\n if(!portfolios.TryGetValue(pf, out var portfolioData))", - "\n {", - "\n ApplicationMessage.Log(Error.PortfolioGicNotFound, pf, gricSystemName);", - "\n return null;", - "\n }", - "\n var gric = new GroupOfReinsuranceContract {", - "\n SystemName = gricSystemName,", - "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", - "\n Partition = storage.TargetPartitionByReportingNode.Id,", - "\n ContractualCurrency = portfolioData.ContractualCurrency,", - "\n FunctionalCurrency = portfolioData.FunctionalCurrency,", - "\n LineOfBusiness = portfolioData.LineOfBusiness,", - "\n ValuationApproach = portfolioData.ValuationApproach,", - "\n OciType = portfolioData.OciType,", - "\n AnnualCohort = Convert.ToInt32(datarow.Field(nameof(GroupOfContract.AnnualCohort))),", - "\n LiabilityType = datarow.Field(nameof(GroupOfContract.LiabilityType)),", - "\n Profitability = datarow.Field(nameof(GroupOfContract.Profitability)),", - "\n Portfolio = pf,", - "\n Partner = datarow.Field(nameof(GroupOfContract.Partner)),", - "\n YieldCurveName = dataset.Tables[nameof(GroupOfReinsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfContract.YieldCurveName)) ", - "\n ? datarow.Field(nameof(GroupOfContract.YieldCurveName)) ", - "\n : (string)null,", - "\n };", - "\n return ExtendGroupOfContract(gric, datarow);", - "\n })", + "\n var gricSystemName = datarow.Field(nameof(DataNode.SystemName));", + "\n var pf = datarow.Field(nameof(ReinsurancePortfolio));", + "\n if(!portfolios.TryGetValue(pf, out var portfolioData)) {", + "\n ApplicationMessage.Log(Error.PortfolioGicNotFound, pf, gricSystemName);", + "\n return null;", + "\n }", + "\n var gric = new GroupOfReinsuranceContract { SystemName = gricSystemName,", + "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", + "\n Partition = storage.TargetPartitionByReportingNode.Id,", + "\n ContractualCurrency = portfolioData.ContractualCurrency,", + "\n FunctionalCurrency = portfolioData.FunctionalCurrency,", + "\n LineOfBusiness = portfolioData.LineOfBusiness,", + "\n ValuationApproach = portfolioData.ValuationApproach,", + "\n OciType = portfolioData.OciType,", + "\n AnnualCohort = Convert.ToInt32(datarow.Field(nameof(GroupOfContract.AnnualCohort))),", + "\n LiabilityType = datarow.Field(nameof(GroupOfContract.LiabilityType)),", + "\n Profitability = datarow.Field(nameof(GroupOfContract.Profitability)),", + "\n Portfolio = pf,", + "\n Partner = datarow.Field(nameof(GroupOfContract.Partner)),", + "\n YieldCurveName = yieldCurveColumnGroupOfReinsuranceContract", + "\n ? datarow.Field(nameof(GroupOfContract.YieldCurveName)) ", + "\n : (string)null };", + "\n return ExtendGroupOfContract(gric, datarow);", + "\n })", "\n .WithTarget(workspace)", "\n .ExecuteAsync();", "\n ", @@ -685,10 +852,10 @@ "\n var workspace = Workspace.CreateNew();", "\n var log = await UploadDataNodesToWorkspaceAsync(dataSet, workspace);", "\n var partition = (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode));", - "\n await CommitToDatabase(workspace, partition);", - "\n await CommitToDatabase(workspace, partition);", - "\n await CommitToDatabase(workspace, partition);", - "\n await CommitToDatabase(workspace, partition);", + "\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 return log;", "\n});" ], @@ -739,9 +906,8 @@ "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", - "\n ", "\n Activity.Start();", - "\n var args = await GetArgsFromMainAsync(dataSet);", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeState};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var storage = new ParsingStorage(args, DataSource, workspace);", @@ -772,7 +938,7 @@ "Import.DefineFormat(ImportFormats.DataNodeState, async (options, dataSet) => {", "\n var workspace = Workspace.CreateNew();", "\n var log = await UploadDataNodeStateToWorkspaceAsync(dataSet, workspace);", - "\n await CommitToDatabase(workspace, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", + "\n await workspace.CommitToAsync(DataSource, (Guid)workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", "\n return log;", "\n});" ], @@ -799,9 +965,8 @@ "\n .DisableInitialization()", "\n .DisableInitialization()", "\n .DisableInitialization());", - "\n ", "\n Activity.Start();", - "\n var args = await GetArgsFromMainAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.DataNodeParameter};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", "\n var storage = new ParsingStorage(args, DataSource, workspace);", @@ -885,8 +1050,9 @@ "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", "\n var log = await UploadDataNodeParameterToWorkspaceAsync(dataSet, partitionId, workspace);", - "\n await CommitToDatabase(workspace, partitionId, snapshot: false);", - "\n await CommitToDatabase(workspace, partitionId, snapshot: false); ", + "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot: false);", + "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot: false); ", + "\n ", "\n return log;", "\n});" ], @@ -922,6 +1088,7 @@ "\n await parsingStorage.InitializeAsync();", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", + "\n var hasAccidentYearColumn = dataSet.Tables[ImportFormats.Cashflow].Columns.Any(x => x.ColumnName == nameof(RawVariable.AccidentYear));", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType ( (dataset, datarow) => {", "\n var aocType = datarow.Field(nameof(RawVariable.AocType));", @@ -944,28 +1111,29 @@ "\n ApplicationMessage.Log(Warning.ActiveDataNodeWithCashflowBOPI, dataNode);", "\n return null;", "\n }", - "\n ", - "\n var amountTypeFromFile = datarow.Field(nameof(RawVariable.AmountType));", - "\n var isEstimateType = parsingStorage.EstimateType.ContainsKey(amountTypeFromFile);", - "\n var amountType = isEstimateType ? null : amountTypeFromFile;", - "\n var estimateType = isEstimateType ? amountTypeFromFile : EstimateTypes.BE;", - "\n ", + "\n", + "\n (string AmountType, string EstimateType) valueType = datarow.ParseAmountAndEstimateType(ImportFormats.Cashflow, parsingStorage.DimensionsWithExternalId, parsingStorage.EstimateType, parsingStorage.AmountType);", "\n var values = datarow.Table.Columns.Where(c => c.ColumnName.StartsWith(nameof(RawVariable.Values))).OrderBy(c => c.ColumnName.Length).ThenBy(c => c.ColumnName)", - "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).Prune();", + "\n .Select(x => datarow.Field(x.ColumnName).CheckStringForExponentialAndConvertToDouble()).ToArray();", "\n ", "\n // Filter out empty raw variables for AocType != CL", - "\n if(values.Length == 0 && aocType != AocTypes.CL) return null; //TODO: extend this check for all mandatory step and not just for CL", + "\n //TODO: extend this check for all mandatory step and not just for CL", + "\n if(args.Scenario == null) {", + "\n values = values.Prune();", + "\n if(values.Length == 0 && aocType != AocTypes.CL) return null;", + "\n }", "\n ", "\n var item = new RawVariable {", "\n DataNode = dataNode,", "\n AocType = aocType,", "\n Novelty = novelty,", - "\n AmountType = amountType,", - "\n EstimateType = estimateType,", - "\n AccidentYear = dataset.Tables[ImportFormats.Cashflow].Columns.Where(x => x.ColumnName == nameof(RawVariable.AccidentYear)).Count()>0?", - "\n (Int32.TryParse((datarow.Field(nameof(RawVariable.AccidentYear))), out var accidentYear)? accidentYear : (int?)null) : (int?)null, ", + "\n AmountType = valueType.AmountType,", + "\n EstimateType = valueType.EstimateType,", + "\n AccidentYear = hasAccidentYearColumn && Int32.TryParse((datarow.Field(nameof(RawVariable.AccidentYear))), out var accidentYear)", + "\n ? accidentYear", + "\n : (int?)null,", "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", - "\n Values = Multiply(GetSign((aocType, amountType, estimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", + "\n Values = Multiply(GetSign((aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)", "\n };", "\n return item;", "\n }, ImportFormats.Cashflow", @@ -984,35 +1152,25 @@ "source": [ "Import.DefineFormat(ImportFormats.Cashflow, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = (await GetArgsFromMainAsync(dataSet)) with {ImportFormat = ImportFormats.Cashflow};", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Cashflow, args);", + "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Cashflow};", + "\n if(Activity.HasErrors()) return Activity.Finish();", + "\n", + "\n var allArgs = await GetAllArgsAsync(primaryArgs);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Cashflow, primaryArgs);", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var workspace = Workspace.CreateNew();", - "\n var parsingLog = await ParseCashflowsToWorkspaceAsync(dataSet, args, workspace);", - "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", - "\n ", - "\n var storage = new ImportStorage(args, DataSource, workspace);", - "\n await storage.InitializeAsync();", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", - "\n ", - "\n var universe = Scopes.ForStorage(storage).ToScope();", - "\n var identities = universe.GetScopes(storage.DataNodesByImportScope[ImportScope.Primary]).SelectMany(s => s.Identities);", - "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", - "\n ", - "\n await workspace.UpdateAsync(ivs);", - "\n await CommitToDatabase(workspace,", - "\n storage.TargetPartition, ", - "\n snapshot : true, ", - "\n filter : x => storage.EstimateTypesByImportFormat[ImportFormats.Cashflow].Contains(x.EstimateType) && ", - "\n storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode));", - "\n await CommitToDatabase(workspace, ", - "\n storage.TargetPartition, ", - "\n snapshot : true,", - "\n filter : x => storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode));", - "\n", - "\n return Activity.Finish().Merge(parsingLog); ", + "\n var log = await ParseCashflowsToWorkspaceAsync(dataSet, primaryArgs, workspace);", + "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", + "\n", + "\n var workspaceToCompute = Workspace.CreateNew();", + "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\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 return Activity.Finish().Merge(log); ", "\n});" ], "metadata": {}, @@ -1059,35 +1217,24 @@ "\n return null;", "\n }", "\n ", - "\n var valueType = datarow.Field(ValueType);", - "\n if(valueType == null) { ", - "\n ApplicationMessage.Log(Error.ValueTypeNotFound); ", - "\n return null; ", - "\n }", - "\n ", - "\n var amountType = parsingStorage.DimensionsWithExternalId[typeof(AmountType)].TryGetValue(valueType, out var at)? at : null;", - "\n var isStdActual = parsingStorage.AmountType.ContainsKey(valueType);", - "\n var estimateType = isStdActual? EstimateTypes.A : parsingStorage.DimensionsWithExternalId[typeof(EstimateType)].TryGetValue(valueType, out var et)? et : null;", - "\n if(estimateType == null || amountType == null) { ", - "\n ApplicationMessage.Log(Error.ValueTypeNotValid, valueType);", - "\n return null;", - "\n }", - "\n ", + "\n (string AmountType, string EstimateType) valueType = datarow.ParseAmountAndEstimateType(ImportFormats.Actual, parsingStorage.DimensionsWithExternalId, parsingStorage.EstimateType, parsingStorage.AmountType);", + "\n var isStdActual = valueType.EstimateType == EstimateTypes.A;", + "\n", "\n var aocType = datarow.Field(nameof(IfrsVariable.AocType));", "\n if((!isStdActual && aocType != AocTypes.CF && aocType != AocTypes.WO) || (isStdActual && aocType != AocTypes.CF) ) {", "\n ApplicationMessage.Log(Error.AocTypeNotValid, aocType);", "\n return null;", "\n }", - "\n ", + "\n", "\n var item = new IfrsVariable {", "\n DataNode = dataNode,", "\n AocType = aocType,", "\n Novelty = Novelties.C,", "\n AccidentYear = Int32.TryParse((datarow.Field(nameof(IfrsVariable.AccidentYear))), out var tempAccYear)? tempAccYear : (int?)null,", - "\n AmountType = amountType,", - "\n EstimateType = estimateType,", + "\n AmountType = valueType.AmountType,", + "\n EstimateType = valueType.EstimateType,", "\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,", - "\n Value = GetSign((aocType, amountType, estimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache) * datarow.Field(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", + "\n Value = GetSign((aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache) * datarow.Field(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", "\n };", "\n return item;", "\n }, ImportFormats.Actual", @@ -1106,31 +1253,25 @@ "source": [ "Import.DefineFormat(ImportFormats.Actual, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = (await GetArgsFromMainAsync(dataSet)) with {ImportFormat = ImportFormats.Actual};", - "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, args);", + "\n var primaryArgs = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Actual};", "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n var workspace = Workspace.CreateNew();", - "\n var parsingLog = await ParseActualsToWorkspaceAsync(dataSet, args, workspace);", - "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", - "\n", - "\n var storage = new ImportStorage(args, DataSource, workspace);", - "\n await storage.InitializeAsync();", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", - "\n", - "\n var universe = Scopes.ForStorage(storage).ToScope();", - "\n var identities = universe.GetScopes(storage.DataNodesByImportScope[ImportScope.Primary]).SelectMany(s => s.Identities);", - "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", + "\n var allArgs = await GetAllArgsAsync(primaryArgs);", + "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Actual, primaryArgs);", + "\n if(Activity.HasErrors()) return Activity.Finish();", "\n", - "\n await workspace.UpdateAsync(ivs);", - "\n await CommitToDatabase(workspace, ", - "\n storage.TargetPartition, ", - "\n snapshot : true, ", - "\n filter : x => storage.EstimateTypesByImportFormat[ImportFormats.Actual].Contains(x.EstimateType) && ", - "\n storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode));", + "\n var workspace = Workspace.CreateNew();", + "\n var log = await ParseActualsToWorkspaceAsync(dataSet, primaryArgs, workspace);", + "\n if(log.Errors.Any()) return Activity.Finish().Merge(log);", "\n", - "\n return Activity.Finish().Merge(parsingLog);", + "\n var workspaceToCompute = Workspace.CreateNew();", + "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\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 if (!log.Errors.Any()) await workspaceToCompute.CommitToTargetAsync(DataSource);", + "\n return Activity.Finish().Merge(log);", "\n});" ], "metadata": {}, @@ -1221,21 +1362,21 @@ "source": [ "Import.DefineFormat(ImportFormats.SimpleValue, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = (await GetArgsFromMainAsync(dataSet)) with {ImportFormat = ImportFormats.SimpleValue};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.SimpleValue};", + "\n if(Activity.HasErrors()) return Activity.Finish();", "\n await DataNodeFactoryAsync(dataSet, ImportFormats.SimpleValue, args);", "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n ", + "\n", "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", - "\n ", + "\n", "\n workspace.Query().Select(v => new {v.DataNode, v.AccidentYear}).Distinct();", - "\n ", - "\n await CommitToDatabase(workspace, ", - "\n partitionId, ", - "\n snapshot : true,", - "\n filter : x => workspace.Query().Select(v => v.DataNode).Distinct().Contains(x.DataNode));", + "\n", + "\n var targetDataNodes = workspace.Query().Select(v => v.DataNode).Distinct().ToArray();", + "\n await workspace.CommitToAsync(DataSource, partitionId, snapshot : true,", + "\n filter : x => targetDataNodes.Contains(x.DataNode));", "\n ", "\n return Activity.Finish().Merge(parsingLog);", "\n});" @@ -1260,32 +1401,22 @@ "source": [ "Import.DefineFormat(ImportFormats.Opening, async (options, dataSet) => {", "\n Activity.Start();", - "\n var args = (await GetArgsFromMainAsync(dataSet)) with {ImportFormat = ImportFormats.Opening};", + "\n var args = await GetArgsAndCommitPartitionAsync(dataSet) with {ImportFormat = ImportFormats.Opening};", + "\n if(Activity.HasErrors()) return Activity.Finish();", "\n await DataNodeFactoryAsync(dataSet, ImportFormats.Opening, args);", "\n if(Activity.HasErrors()) return Activity.Finish();", - "\n ", + "\n", "\n Guid partitionId = new Guid();", "\n var workspace = Workspace.CreateNew();", "\n var parsingLog = await ParseSimpleValueToWorkspaceAsync(dataSet, args, partitionId, workspace);", "\n if(parsingLog.Errors.Any()) return Activity.Finish().Merge(parsingLog);", - "\n ", - "\n var storage = new ImportStorage(args, DataSource, workspace);", - "\n await storage.InitializeAsync();", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", - "\n ", - "\n var universe = Scopes.ForStorage(storage).ToScope();", - "\n var identities = universe.GetScopes(storage.DataNodesByImportScope[ImportScope.Primary]).SelectMany(s => s.Identities);", - "\n var ivs = universe.GetScopes(identities).SelectMany(x => x.CalculatedIfrsVariables);", - "\n if(Activity.HasErrors()) return Activity.Finish().Merge(parsingLog);", - "\n", - "\n await workspace.UpdateAsync(ivs);", - "\n await CommitToDatabase(workspace, ", - "\n storage.TargetPartition, ", - "\n snapshot : true,", - "\n filter : x => storage.EstimateTypesByImportFormat[ImportFormats.Opening].Contains(x.EstimateType) && ", - "\n storage.DataNodesByImportScope[ImportScope.Primary].Contains(x.DataNode ));", "\n", - "\n return Activity.Finish().Merge(parsingLog);", + "\n var workspaceToCompute = Workspace.CreateNew();", + "\n workspaceToCompute.Initialize(x => x.FromSource(DataSource));", + "\n var calculationLog = await ComputeAsync(args, workspace, workspaceToCompute, false); ", + "\n if(calculationLog.Errors.Any()) return Activity.Finish().Merge(calculationLog);", + "\n await workspaceToCompute.CommitToAsync(DataSource, partitionId);", + "\n return Activity.Finish().Merge(parsingLog).Merge(calculationLog);", "\n});" ], "metadata": {}, diff --git a/ifrs17/Report/ParameterReportsQueries.ipynb b/ifrs17/Report/ParameterReportsQueries.ipynb new file mode 100644 index 00000000..04884352 --- /dev/null +++ b/ifrs17/Report/ParameterReportsQueries.ipynb @@ -0,0 +1,400 @@ +{ + "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": [ + "# Imports" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../Utils/Queries\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Model", + "\nThe data model is still in progress, but this version already allows for simple reports" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public enum Period { Previous = -1, Current = 0 };" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public abstract record ReportParameter {", + "\n [Display(Order = -100)]", + "\n [IdentityProperty]", + "\n [NotAggregated]", + "\n [Dimension(typeof(int), nameof(Year))]", + "\n public int Year { get; init; }", + "\n", + "\n [Display(Order = -90)]", + "\n [IdentityProperty]", + "\n [NotAggregated]", + "\n [Dimension(typeof(int), nameof(Month))]", + "\n public int Month { get; init; } ", + "\n", + "\n [Display(Order = -80)]", + "\n [IdentityProperty]", + "\n [Dimension(typeof(Scenario))]", + "\n public string Scenario { get; init; }", + "\n", + "\n [IdentityProperty]", + "\n [NotVisible]", + "\n public Period Period { get; init; }", + "\n", + "\n [IdentityProperty]", + "\n [NotVisible]", + "\n [Dimension(typeof(GroupOfContract))]", + "\n public string GroupOfContract { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record DataNodeStateReportParameter : ReportParameter {", + "\n public State State { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record YieldCurveReportParameter : ReportParameter {", + "\n [IdentityProperty]", + "\n [NotVisible]", + "\n public string YieldCurveType { get; init; }", + "\n", + "\n [Dimension(typeof(Currency))]", + "\n public string Currency { get; init; }", + "\n", + "\n public string Name { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record SingleDataNodeReportParameter : ReportParameter {", + "\n public double PremiumAllocation { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record InterDataNodeReportParameter : ReportParameter {", + "\n [Dimension(typeof(GroupOfContract), nameof(LinkedDataNode))]", + "\n public string LinkedDataNode { get; init; }", + "\n", + "\n public double ReinsuranceCoverage { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record PartnerRatingsReportParameter : ReportParameter {", + "\n [IdentityProperty]", + "\n [NotVisible]", + "\n [Dimension(typeof(Partner))]", + "\n public string Partner { get; init; }", + "\n", + "\n [Dimension(typeof(CreditRiskRating))]", + "\n public string CreditRiskRating { get; init; }", + "\n}", + "\npublic record CreditDefaultRatesReportParameter : ReportParameter {", + "\n [IdentityProperty]", + "\n [Dimension(typeof(CreditRiskRating))]", + "\n [NotVisible]", + "\n public string CreditRiskRating { get; init; }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Node" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetDataNodeDataReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "\n (await workspace.LoadDataNodesAsync(args))", + "\n .Values", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetDataNodeStateReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "\n (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.DataNode))", + "\n .Values", + "\n .SelectMany(x => x.Select(y => ", + "\n new DataNodeStateReportParameter {", + "\n GroupOfContract = y.Value.DataNode,", + "\n Period = ((Period)y.Key),", + "\n Year = y.Value.Year,", + "\n Month = y.Value.Month,", + "\n Scenario = y.Value.Scenario }", + "\n ))", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# YieldCurve" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetYieldCurveReportParameters(this IWorkspace workspace, ImportArgs args) {", + "\n var dataNodeData = await workspace.GetDataNodeDataReportParameters(args);", + "\n", + "\n var lockedYieldCurves = (await workspace.LoadLockedInYieldCurveAsync(args, dataNodeData))", + "\n .Select(x => new YieldCurveReportParameter {", + "\n GroupOfContract = x.Key,", + "\n YieldCurveType = \"Locked-In Curve\",", + "\n Year = x.Value.Year,", + "\n Month = x.Value.Month,", + "\n Scenario = x.Value.Scenario,", + "\n Currency = x.Value.Currency,", + "\n Name = x.Value.Name }", + "\n )", + "\n .ToArray();", + "\n", + "\n var currentYieldCurves = (await workspace.LoadCurrentYieldCurveAsync(args, dataNodeData))", + "\n .Values", + "\n .SelectMany(x => x.Select(y => new YieldCurveReportParameter {", + "\n Period = ((Period)y.Key),", + "\n YieldCurveType = \"Current Curve\",", + "\n Year = y.Value.Year,", + "\n Month = y.Value.Month,", + "\n Scenario = y.Value.Scenario,", + "\n Currency = y.Value.Currency,", + "\n Name = y.Value.Name}", + "\n ));", + "\n", + "\n var allYieldCurves = lockedYieldCurves.Concat(lockedYieldCurves.SelectMany(loc => currentYieldCurves.Select(cuc => new YieldCurveReportParameter {", + "\n GroupOfContract = loc.GroupOfContract,", + "\n Period = cuc.Period,", + "\n YieldCurveType = cuc.YieldCurveType,", + "\n Year = cuc.Year,", + "\n Month = cuc.Month,", + "\n Scenario = cuc.Scenario,", + "\n Currency = cuc.Currency,", + "\n Name = cuc.Name}", + "\n )))", + "\n .ToArray();", + "\n ", + "\n return allYieldCurves;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Single Data Node Parameters" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetSingleDataNodeReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "\n (await workspace.LoadSingleDataNodeParametersAsync(args))", + "\n .Values", + "\n .SelectMany(x => x.Select(y => new SingleDataNodeReportParameter {", + "\n GroupOfContract = y.Value.DataNode,", + "\n Period = ((Period)y.Key),", + "\n Year = y.Value.Year,", + "\n Month = y.Value.Month,", + "\n Scenario = y.Value.Scenario,", + "\n PremiumAllocation = y.Value.PremiumAllocation}", + "\n ))", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Inter Data Node Parameters" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetInterDataNodeParameters(this IWorkspace workspace, ImportArgs args) =>", + "\n (await workspace.LoadInterDataNodeParametersAsync(args))", + "\n .Values", + "\n .SelectMany(x => x.SelectMany(y => y.Value.Select(z => ", + "\n new InterDataNodeReportParameter {", + "\n GroupOfContract = z.DataNode,", + "\n Period = ((Period)y.Key),", + "\n Year = z.Year,", + "\n Month = z.Month,", + "\n Scenario = z.Scenario,", + "\n LinkedDataNode = z.LinkedDataNode,", + "\n ReinsuranceCoverage = z.ReinsuranceCoverage}", + "\n )))", + "\n .Distinct()// Can be removed when we get rid of the dictionary", + "\n .SelectMany(x => new[]{x, x with { GroupOfContract = x.LinkedDataNode, LinkedDataNode = x.GroupOfContract}}", + "\n )", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Partner Default Rates" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetPartnerRatingsReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "\n (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.Partner))", + "\n .Values", + "\n .SelectMany(x => x.Select(y => ", + "\n new PartnerRatingsReportParameter { ", + "\n Period = ((Period)y.Key),", + "\n Partner = y.Value.Partner,", + "\n Year = y.Value.Year,", + "\n Month = y.Value.Month,", + "\n Scenario = y.Value.Scenario,", + "\n CreditRiskRating = y.Value.CreditRiskRating", + "\n }", + "\n ))", + "\n .ToArray();" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task GetCreditDefaultRatesReportParameters(this IWorkspace workspace, ImportArgs args) {", + "\n var partnerRatings = await workspace.GetPartnerRatingsReportParameters(args);", + "\n ", + "\n var creditDefaultRates = (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.CreditRiskRating))", + "\n .Values", + "\n .SelectMany(x => x.Select(y =>", + "\n new {", + "\n Period = ((Period)y.Key),", + "\n CreditRiskRating = y.Value.CreditRiskRating,", + "\n Year = y.Value.Year,", + "\n Month = y.Value.Month,", + "\n Scenario = y.Value.Scenario}", + "\n ));", + "\n ", + "\n var partnerDefaultRates = partnerRatings.Join(", + "\n creditDefaultRates,", + "\n pr => new {pr.Period, pr.CreditRiskRating},", + "\n cdr => new {cdr.Period, cdr.CreditRiskRating},", + "\n (pr, cdr) => ", + "\n new CreditDefaultRatesReportParameter {", + "\n Period = pr.Period,", + "\n CreditRiskRating = pr.CreditRiskRating,", + "\n Year = cdr.Year,", + "\n Month = cdr.Month,", + "\n Scenario = cdr.Scenario,", + "\n }", + "\n )", + "\n .ToArray();", + "\n", + "\n return partnerDefaultRates;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file diff --git a/ifrs17/Test/EqualityComparerTest.ipynb b/ifrs17/Test/EqualityComparerTest.ipynb new file mode 100644 index 00000000..444f18b3 --- /dev/null +++ b/ifrs17/Test/EqualityComparerTest.ipynb @@ -0,0 +1,151 @@ +{ + "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": [ + "

Equality Comparers Test

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Yield Curve" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!import \"../Utils/EqualityComparers\"", + "\n#!import \"../Utils/TestHelper\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using FluentAssertions;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var comparer = YieldCurveComparer.Instance(); " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "var yc = new YieldCurve() {Currency = \"EUR\", ", + "\n Year = 2000,", + "\n Month = 1,", + "\n Name = default, ", + "\n Scenario = default, ", + "\n Values = new double[]{0.001, 0.002, 0.003, 0.004}};" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,yc).Should().BeTrue()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,null).Should().BeFalse()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,yc with { Month = 19}).Should().BeFalse()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,yc with { Year = 2001}).Should().BeFalse()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc, yc with {Year = 2001, Values = new[] { 0.002, 0.003, 0.004 } }).Should().BeTrue()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,yc with { Year = 1999}).Should().BeFalse()" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "comparer.Equals(yc,yc with { Year = 1999, Values = new[] { 0.001, 0.001, 0.002, 0.003, 0.004 } }).Should().BeTrue()" + ], + "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 0bf6dc5d..d48841bd 100644 --- a/ifrs17/Test/QueriesTest.ipynb +++ b/ifrs17/Test/QueriesTest.ipynb @@ -528,35 +528,41 @@ "cell_type": "code", "source": [ "public async Task CheckLoadYieldCurveAsync(Args args, IEnumerable testData, ", - "\n (int year , int month) dataNodeYearAndMonth, ", - "\n double expectedCurrentPreviousFirstYcValue,", - "\n double expectedCurrentFirstYcValue,", - "\n double expectedLockedFirstYcValue)", + "\n (int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData, ", + "\n double expectedCurrentPreviousFirstYcValue = default(double),", + "\n double expectedCurrentFirstYcValue = default(double),", + "\n double expectedLockedFirstYcValue = default(double))", "\n{", "\n Activity.Start();", "\n await Workspace.Partition.SetAsync(args);", "\n await Workspace.UpdateAsync(testData);", "\n await Workspace.UpdateAsync(new ReportingNode[]{new ReportingNode{Currency=\"EUR\",SystemName=\"CH\"}});", "\n ", - "\n var dataNodes = new DataNodeData[]{new DataNodeData{ValuationApproach=\"BBA\", Year = dataNodeYearAndMonth.year, Month = dataNodeYearAndMonth.month, DataNode = gic, ContractualCurrency = \"EUR\"}};", + "\n var dataNodes = new DataNodeData[]{new DataNodeData{ValuationApproach=dataNodeTestData.valuationApproach, Year = dataNodeTestData.year, Month = dataNodeTestData.month, DataNode = gic, ContractualCurrency = \"EUR\", YieldCurveName = dataNodeTestData.yieldCurveName}};", "\n var eurLockedYieldCurve = (await LoadLockedInYieldCurveAsync(Workspace, args, dataNodes));", "\n var eurCurrentYieldCurve = (await LoadCurrentYieldCurveAsync(Workspace, args, dataNodes));", "\n ", "\n Workspace.Reset(x => x.ResetCurrentPartitions());", "\n ", "\n var errors = new List();", - "\n var currentPrevPeriod = eurCurrentYieldCurve[\"EUR\"][PreviousPeriod].Values.First();", + "\n if (eurCurrentYieldCurve[gic] == null)", + "\n return Activity.Finish();", + "\n var currentPrevPeriod = eurCurrentYieldCurve[gic][PreviousPeriod].Values.First();", "\n if(Math.Abs(currentPrevPeriod - expectedCurrentPreviousFirstYcValue) > 1E-8)", "\n errors.Add( $\"Current YieldCurve for Previous Period not matching:\\n Expected {expectedCurrentPreviousFirstYcValue} \\n Computed {currentPrevPeriod}.\" );", "\n ", - "\n var currentCurrPeriod = eurCurrentYieldCurve[\"EUR\"][CurrentPeriod].Values.First();", + "\n var currentCurrPeriod = eurCurrentYieldCurve[gic][CurrentPeriod].Values.First();", "\n if(Math.Abs(currentCurrPeriod - expectedCurrentFirstYcValue) > 1E-8)", "\n errors.Add( $\"Current YieldCurve for Current Period not matching:\\n Expected {expectedCurrentFirstYcValue} \\n Computed {currentCurrPeriod}.\" );", "\n ", - "\n var lockedYc = eurLockedYieldCurve[gic].Values.First();", - "\n if(Math.Abs(lockedYc - expectedLockedFirstYcValue) > 1E-8)", - "\n errors.Add( $\"LockedIn YieldCurve not matching:\\n Expected {expectedLockedFirstYcValue} \\n Computed {lockedYc}.\" );", - "\n ", + "\n if(dataNodeTestData.valuationApproach == ValuationApproaches.BBA)", + "\n {", + "\n if (eurLockedYieldCurve[gic] == null)", + "\n return Activity.Finish();", + "\n var lockedYc = eurLockedYieldCurve[gic].Values.First();", + "\n if(Math.Abs(lockedYc - expectedLockedFirstYcValue) > 1E-8)", + "\n errors.Add( $\"LockedIn YieldCurve not matching:\\n Expected {expectedLockedFirstYcValue} \\n Computed {lockedYc}.\" );", + "\n }", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors)); ", "\n return Activity.Finish();", "\n}" @@ -570,11 +576,104 @@ "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Values = new double[]{0.1,0.2,0.3,0.4,0.5,0.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{7.1,7.2,7.3,7.4,7.5,7.6} }, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 3, Values = new double[]{2.1,2.2,2.3,2.4,2.5,2.6} }, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2021, Month = 9, Values = new double[]{4.1,4.2,4.3,4.4,4.5,4.6} },", - "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, 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[]{6.1,6.2,6.3,6.4,6.5,6.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Name = \"A\", Values = new double[]{9.1,9.2,9.3,9.4,9.5,9.6} }};", + "\n", + "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 6, null, \"BBA\");", + "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 6.1, 0.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,null);", + "\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, 6.1, 0.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,null);", + "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 12, Name = \"A\", Values = new double[]{11.1,11.2,11.3,11.4,11.5,11.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9, Name = \"A\", Values = new double[]{12.1,12.2,12.3,12.4,12.5,12.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"A\", Values = new double[]{13.1,13.2,13.3,13.4,13.5,13.6} },", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 3, Name = \"A\", Values = new double[]{1.1,1.2,1.3,1.4,1.5,1.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Name = \"A\", Values = new double[]{9.1,9.2,9.3,9.4,9.5,9.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 9, Name = \"A\", Values = new double[]{10.1,10.2,10.3,10.4,10.5,10.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 6, Name = \"A\", Values = new double[]{2.1,2.2,2.3,2.4,2.5,2.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 3, Name = \"A\", Values = new double[]{7.1,7.2,7.3,7.4,7.5,7.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2018, 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 = 2017, Month = 6, Name = \"A\", Values = new double[]{4.1,4.2,4.3,4.4,4.5,4.6} }, ", + "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 12, 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 = \"A\", Values = new double[]{6.1,6.2,6.3,6.4,6.5,6.6} }};", "\n", - "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, (2016, 6), 6.1, 0.1, 6.1);", + "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 6, \"A\", \"BBA\");", + "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 9.1, 12.1, 8.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,null);", + "\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, 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, Name = \"B\", Values = new double[]{4.1,4.2,4.3,4.4,4.5,4.6} }};", + "\n ", + "\n(int year , int month, string yieldCurveName, string valuationApproach) dataNodeTestData = (2016, 6, \"A\", \"VFA\");", + "\nvar activity = await CheckLoadYieldCurveAsync(args, testData, dataNodeTestData, 6.1, 0.1);", "\nactivity" ], "metadata": {}, @@ -590,6 +689,33 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", + "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Name = \"B\", Values = new double[]{0.1,0.2,0.3,0.4,0.5,0.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 = \"C\", Values = new double[]{4.1,4.2,4.3,4.4,4.5,4.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);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "activity.Status.Should().Be(ActivityLogStatus.Failed);", + "\nactivity.Errors.Select(x => x.ToString().Contains(Get(Error.YieldCurveNotFound)).Should().Be(true));" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index ef37f404..7a5e9882 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -50,6 +50,15 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"EqualityComparerTest\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb new file mode 100644 index 00000000..2ce8b659 --- /dev/null +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -0,0 +1,472 @@ +{ + "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": "code", + "source": [ + "#!import \"../DataModel/DataStructure\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using System.IO;", + "\nusing System.Text;", + "\nusing Systemorph.Vertex.DataSetReader.Csv;", + "\nusing Systemorph.Vertex.Session;", + "\nusing Systemorph.Vertex.Import.Builders;", + "\nusing Systemorph.Vertex.Import.Mappings;", + "\nusing Systemorph.Vertex.DataSetReader;", + "\nusing Systemorph.Vertex.Export.Excel.Builders;", + "\nusing Systemorph.Vertex.Export;", + "\nusing Systemorph.Vertex.Export.Builders;", + "\nusing Systemorph.Vertex.FileStorage;", + "\nusing Systemorph.Vertex.Export.Builders.Interfaces;", + "\n", + "\npublic record StreamWrapper(Stream Stream, bool WillBeReused);", + "\n", + "\npublic static string ProcessNotification(this object obj) => obj is ActivityMessageNotification amn ? amn.Message : \"\"; " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportExportActivity : KeyedRecord", + "\n{", + "\n public string Username {get; init;}", + "\n", + "\n public DateTime StartDateTime {get; init;}", + "\n", + "\n public DateTime EndDateTime {get; init;}", + "\n", + "\n public ActivityLogStatus Status {get; init;}", + "\n", + "\n public string Category {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] ErrorMessages {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] WarningMessages {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] InfoMessages {get; init;}", + "\n", + "\n public Guid SourceId {get; init;} ", + "\n ", + "\n public ImportExportActivity(ActivityLog log, ISessionVariable session)", + "\n {", + "\n Id = Guid.NewGuid();", + "\n Username = session.User.Name;", + "\n StartDateTime = log.StartDateTime;", + "\n EndDateTime = log.FinishDateTime;", + "\n Status = log.Status;", + "\n ErrorMessages = log.Errors.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n WarningMessages = log.Warnings.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n InfoMessages = log.Infos.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n }", + "\n", + "\n public ImportExportActivity(Guid id)", + "\n {", + "\n Id = id;", + "\n }", + "\n", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public abstract record KeyedImportExport : KeyedRecord", + "\n{", + "\n public DateTime CreationTime {get; init;}", + "\n public byte[] SerializedContent {get; init;}", + "\n public uint? Length {get; init;}", + "\n public string Format {get; init;}", + "\n protected IDataSetImportVariable DataSetReader {get; set;}", + "\n protected ISessionVariable Session {get; set;}", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ExportFile : KeyedImportExport", + "\n{", + "\n protected DocumentBuilder Builder {get; set;}", + "\n", + "\n public string Name {get; init;}", + "\n", + "\n public string ContentType {get; init;}", + "\n", + "\n public ExportFile(DocumentBuilder builder, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Builder = builder;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n Id = Guid.NewGuid();", + "\n CreationTime = DateTime.UtcNow;", + "\n }", + "\n", + "\n public ExportFile(Guid id)", + "\n {", + "\n Id = id;", + "\n }", + "\n", + "\n public async Task InitializeExportDataAsync()", + "\n {", + "\n byte[] content;", + "\n var mapping = await Builder.GetMappingAsync();", + "\n var storage = mapping.Storage as IFileReadStorage;", + "\n var stream = await storage.ReadAsync(mapping.FileName, Session.CancellationToken);", + "\n using(MemoryStream ms = new MemoryStream())", + "\n {", + "\n await stream.CopyToAsync(ms);", + "\n content = ms.ToArray();", + "\n stream.Close();", + "\n await stream.DisposeAsync();", + "\n }", + "\n return this with {Name = Path.GetFileName(mapping.FileName), ", + "\n ContentType = Path.GetExtension(mapping.FileName),", + "\n SerializedContent = content, ", + "\n Length = content == null ? null : (uint)content.Length,", + "\n Format = mapping.Format};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public abstract record KeyedImport : KeyedImportExport", + "\n{", + "\n protected ImportOptions Options {get; set;}", + "\n", + "\n public async Task InitializeImportDataAsync()", + "\n {", + "\n var stream = await GenerateStreamWrapperAsync();", + "\n var formatAndContent = await GetInformationFromStreamAsync(stream);", + "\n return this with{CreationTime = DateTime.UtcNow, ", + "\n Format = formatAndContent.Format ?? Options.Format,", + "\n SerializedContent = formatAndContent.Content,", + "\n Length = formatAndContent.Content != null ? (uint)formatAndContent.Content.Length : null,", + "\n };", + "\n }", + "\n", + "\n private async Task GenerateStreamWrapperAsync()", + "\n {", + "\n StreamWrapper stream = Options switch", + "\n {", + "\n FileImportOptions fio => new StreamWrapper(await fio.Storage.ReadAsync(fio.FileName, Session.CancellationToken), true),", + "\n StreamImportOptions streamImportOptions => new StreamWrapper(streamImportOptions.Stream, false),", + "\n StringImportOptions stringImportOptions => new StreamWrapper(new MemoryStream(Encoding.ASCII.GetBytes(stringImportOptions.Content)), true),", + "\n DataSetImportOptions dataSetImportOptions => new StreamWrapper(new MemoryStream(Encoding.ASCII.GetBytes(DataSetCsvSerializer.Serialize(dataSetImportOptions.DataSet))), true),", + "\n _ => null", + "\n };", + "\n return stream;", + "\n }", + "\n", + "\n private async Task<(string Format, byte[] Content)> GetInformationFromStreamAsync(StreamWrapper stream)", + "\n {", + "\n byte[] content;", + "\n string format;", + "\n using (MemoryStream ms = new MemoryStream())", + "\n {", + "\n await stream.Stream.CopyToAsync(ms);", + "\n content = ms.ToArray();", + "\n ms.Position = 0;", + "\n var dsRes = await DataSetReader.ReadFromStream(ms).ExecuteAsync();", + "\n format = dsRes.Format;", + "\n if (stream.WillBeReused)", + "\n stream.Stream.Position = 0;", + "\n else", + "\n {", + "\n stream.Stream.Close();", + "\n await stream.Stream.DisposeAsync();", + "\n }", + "\n }", + "\n return (format, content);", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportFile : KeyedImport", + "\n{", + "\n public string Name {get; init;}", + "\n", + "\n public string Directory {get; init;}", + "\n ", + "\n public string ContentType {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] Partition {get; init;}", + "\n", + "\n public string Source {get; init;}", + "\n", + "\n public ImportFile(FileImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Options = options;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n string fileName = options.FileName; ", + "\n Id = Guid.NewGuid();", + "\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 // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n }", + "\n", + "\n public ImportFile(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n", + "\n private string[] GetInvolvedPartitions(ImportOptions options)", + "\n {", + "\n // TODO", + "\n //Andrey Katz: Get all the relevant partitions here ", + "\n return null;", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportString : KeyedImport", + "\n{", + "\n public string Content {get; init;}", + "\n", + "\n public ImportString(StringImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Options = options;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n Id = Guid.NewGuid();", + "\n Content = options.Content;", + "\n }", + "\n", + "\n public ImportString(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportDataSet : KeyedImport", + "\n{", + "\n public ImportDataSet(DataSetImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Session = session;", + "\n DataSetReader = importVariable;", + "\n Options = options;", + "\n Id = Guid.NewGuid();", + "\n }", + "\n", + "\n public ImportDataSet(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportStream : KeyedImport", + "\n{", + "\n public ImportStream(StreamImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Session = session;", + "\n DataSetReader = importVariable;", + "\n Options = options;", + "\n Id = Guid.NewGuid();", + "\n }", + "\n", + "\n public ImportStream(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task ExecuteWithStoreActivityAsync(this ImportOptionsBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable)", + "\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 {", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importFile.Id, ", + "\n Category = \"Import from File\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importFile.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importString.Id, ", + "\n Category = \"Import from String\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importString.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importStream.Id, ", + "\n Category = \"Import from Stream\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importStream.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch(Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importDataSet.Id, ", + "\n Category = \"Import from Data Set\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importDataSet.RepeatOnce());", + "\n break;", + "\n default:", + "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", + "\n break;", + "\n } ", + "\n await dataSource.UpdateAsync(activity.RepeatOnce());", + "\n await dataSource.CommitAsync(); ", + "\n return log;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task ExecuteWithStoreActivityAsync(this IDocumentBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable)", + "\n{", + "\n var exportResult = await builder.ExecuteAsync();", + "\n var exportFile = await (new ExportFile(builder as DocumentBuilder, importVariable, session)).InitializeExportDataAsync();", + "\n var activity = new ImportExportActivity(exportResult.ActivityLog, session) with {Category = \"Export to File\", ", + "\n SourceId = exportFile.Id};", + "\n await dataSource.UpdateAsync(exportFile.RepeatOnce());", + "\n await dataSource.UpdateAsync(activity.RepeatOnce());", + "\n await dataSource.CommitAsync();", + "\n return exportResult;", + "\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/Utils/EqualityComparers.ipynb b/ifrs17/Utils/EqualityComparers.ipynb index c8cde44b..488dc6a8 100644 --- a/ifrs17/Utils/EqualityComparers.ipynb +++ b/ifrs17/Utils/EqualityComparers.ipynb @@ -27,7 +27,34 @@ { "cell_type": "code", "source": [ - "#!import \"../DataModel/DataStructure\"" + "#!import \"../DataModel/DataStructure\"", + "\nusing System;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "SequenceEqual static extension method is a utility for double arrays to enable comparison with a pre-defined precision." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static bool SequenceEqual(this double[] defaultArray, double[] testArray, double precision)", + "\n{", + "\n if ( defaultArray == null || testArray == null ) return false; ", + "\n if (defaultArray.Length != testArray.Length) return false;", + "\n for (int i = 0; i < defaultArray.Length; i++){", + "\n if(Math.Abs(defaultArray[i]-testArray[i]) >= precision) return false;", + "\n }", + "\n return true;", + "\n}" ], "metadata": {}, "execution_count": 0, @@ -46,16 +73,11 @@ "\n", "\n public bool Equals(RawVariable x, RawVariable y) =>", "\n x.AccidentYear == y.AccidentYear && x.AmountType == y.AmountType && x.DataNode == y.DataNode && x.AocType == y.AocType && ", - "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && (IgnoreValues ? true : x.Values.SequenceEqual(y.Values)); // TODO: enable Precision", + "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && (IgnoreValues ? true : x.Values.SequenceEqual(y.Values, Precision));", "\n", - "\n public int GetHashCode(RawVariable v) => IgnoreValues ", - "\n ? HashCode.Combine(v.AccidentYear, v.AmountType, v.DataNode, v.AocType, v.Novelty) ", - "\n : HashCode.Combine(v.AccidentYear, v.AmountType, v.DataNode, v.AocType, v.Novelty, v.Values);", + "\n public int GetHashCode(RawVariable v) => 0;", "\n", - "\n public static RawVariableComparer Instance(bool ignoreValues = false)", - "\n { ", - "\n return new RawVariableComparer(ignoreValues);", - "\n }", + "\n public static RawVariableComparer Instance(bool ignoreValues = false) => new RawVariableComparer(ignoreValues);", "\n}" ], "metadata": {}, @@ -75,16 +97,42 @@ "\n", "\n public bool Equals(IfrsVariable x, IfrsVariable y) =>", "\n x.AccidentYear == y.AccidentYear && x.AmountType == y.AmountType && x.DataNode == y.DataNode && x.AocType == y.AocType && ", - "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && (IgnoreValue ? true : Math.Abs(x.Value - y.Value) < Precision); ", + "\n x.Novelty == y.Novelty && x.EstimateType == y.EstimateType && x.EconomicBasis == y.EconomicBasis && (IgnoreValue ? true : Math.Abs(x.Value - y.Value) < Precision); ", "\n", - "\n public int GetHashCode(IfrsVariable v) => IgnoreValue ", - "\n ? HashCode.Combine(v.AccidentYear, v.AmountType, v.DataNode, v.AocType, v.Novelty) ", - "\n : HashCode.Combine(v.AccidentYear, v.AmountType, v.DataNode, v.AocType, v.Novelty, v.Value.ToString(\"F5\"));", + "\n public int GetHashCode(IfrsVariable v) => 0;", "\n", - "\n public static IfrsVariableComparer Instance(bool ignoreValue = false)", - "\n { ", - "\n return new IfrsVariableComparer(ignoreValue);", + "\n public static IfrsVariableComparer Instance(bool ignoreValue = false) => new IfrsVariableComparer(ignoreValue);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "class YieldCurveComparer: IEqualityComparer", + "\n{", + "\n private YieldCurveComparer(){}", + "\n", + "\n public bool Equals(YieldCurve x, YieldCurve y)", + "\n {", + "\n if (x == null && y == null)", + "\n return true; ", + "\n if (x == null || y == null)", + "\n return false; ", + "\n if (!(x.Month == y.Month && x.Scenario == y.Scenario && x.Currency == y.Currency && x.Id == y.Id && x.Name == y.Name))", + "\n return false; ", + "\n if (x.Year == y.Year)", + "\n return x.Values.SequenceEqual(y.Values, YieldCurvePrecision); ", + "\n return x.Year > y.Year", + "\n ? x.Values.SequenceEqual(y.Values.Skip(x.Year - y.Year).ToArray(), YieldCurvePrecision)", + "\n : x.Values.Skip(y.Year - x.Year).ToArray().SequenceEqual(y.Values, YieldCurvePrecision);", "\n }", + "\n\t", + "\n public int GetHashCode (YieldCurve x) => 0;", + "\n", + "\n public static YieldCurveComparer Instance() => new YieldCurveComparer();", "\n}" ], "metadata": {}, @@ -146,15 +194,6 @@ "metadata": {}, "execution_count": 0, "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index c783cc39..1c394e71 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -251,6 +251,21 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public static (string, string) ParseAmountAndEstimateType (this IDataRow datarow, string format, ", + "\n Dictionary> dimensionsWithExternalId, ", + "\n Dictionary estimateTypes, ", + "\n Dictionary amountTypes) ", + "\n{", + "\n return (datarow.Field(nameof(RawVariable.AmountType)), datarow.Field(nameof(RawVariable.EstimateType)));", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ @@ -271,6 +286,27 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Import Actuals EstimateType" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static HashSet GetImportActualEstimateType()", + "\n{", + "\n return new []{EstimateTypes.A, EstimateTypes.AA, EstimateTypes.OA}.ToHashSet();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] -} +} \ No newline at end of file diff --git a/ifrs17/Utils/Queries.ipynb b/ifrs17/Utils/Queries.ipynb index 47f4597b..2a102c0f 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -183,18 +183,18 @@ { "cell_type": "code", "source": [ - "public static async Task> LoadLockedInYieldCurveAsync(this IQuerySource querySource, Args args, ", - "\n IEnumerable dataNodes)", + "public static async Task> LoadLockedInYieldCurveAsync(this IQuerySource querySource, Args args, IEnumerable dataNodes)", + "\n", "\n{", "\n var lockedInYieldCurveByGoc = new Dictionary();", "\n foreach (var dn in dataNodes.Where(x => x.ValuationApproach == ValuationApproaches.BBA))", "\n {", - "\n var argsNew = args with {Year = dn.Year, Month = dn.Month, Scenario = dn.Scenario}; //MonthInAYear", - "\n var loadedYc = (await querySource.LoadCurrentParameterAsync(argsNew, x => x.Currency, x => x.Currency == dn.ContractualCurrency));", - "\n ", - "\n if(!loadedYc.TryGetValue(dn.ContractualCurrency, out var lockedYc))", + "\n var argsNew = args with {Year = dn.Year, Month = MonthInAYear, Scenario = args.Scenario};", + "\n var loadedYc = (await querySource.LoadCurrentParameterAsync(argsNew, x => x.Currency, x => x.Currency == dn.ContractualCurrency && x.Name == dn.YieldCurveName));", + "\n ", + "\n if (!loadedYc.TryGetValue(dn.ContractualCurrency, out var lockedYc))", "\n ApplicationMessage.Log(Error.YieldCurveNotFound, dn.ContractualCurrency, argsNew.Year.ToString(), argsNew.Month.ToString());", - "\n ", + "\n ", "\n lockedInYieldCurveByGoc[dn.DataNode] = lockedYc;", "\n }", "\n ", @@ -217,14 +217,33 @@ { "cell_type": "code", "source": [ - "public static async Task>> LoadCurrentYieldCurveAsync(this IQuerySource querySource, Args args, ", - "\n IEnumerable dataNodes)", - "\n{", - "\n var contractualCurrenciesInScope = dataNodes.Select(dn => dn.ContractualCurrency).ToHashSet();", - "\n return (await querySource.LoadCurrentAndPreviousParameterAsync(args, ", - "\n x => x.Currency,", - "\n x => contractualCurrenciesInScope.Contains(x.Currency)", - "\n ));", + "public static async Task>> LoadCurrentYieldCurveAsync(this IQuerySource querySource, Args args,", + "\n IEnumerable dataNodes)", + "\n{ ", + "\n var currentYieldCurveByGoc = new Dictionary>();", + "\n", + "\n var dnByValAppContrCurrYcName = dataNodes.ToDictionaryGrouped(x => (ValuationApproach: x.ValuationApproach, ContractualCurrency: x.ContractualCurrency, YieldCurveName: x.YieldCurveName), ", + "\n x => x.Select(y => y.DataNode).ToArray());", + "\n ", + "\n foreach (var key in dnByValAppContrCurrYcName.Keys)", + "\n {", + "\n var loadedYc = await querySource.LoadCurrentAndPreviousParameterAsync(args, ", + "\n x => x.Currency,", + "\n x => x.Currency == key.ContractualCurrency ", + "\n && (key.ValuationApproach == ValuationApproaches.VFA", + "\n ? x.Name == key.YieldCurveName", + "\n : true));", + "\n ", + "\n if (!loadedYc.TryGetValue(key.ContractualCurrency, out var currentYcDict))", + "\n ApplicationMessage.Log(Error.YieldCurveNotFound, key.ContractualCurrency, args.Year.ToString(), args.Month.ToString());", + "\n", + "\n foreach(var dn in dnByValAppContrCurrYcName[key])", + "\n {", + "\n currentYieldCurveByGoc[dn] = loadedYc[key.ContractualCurrency];", + "\n }", + "\n }", + "\n ", + "\n return currentYieldCurveByGoc;", "\n}" ], "metadata": {}, @@ -291,6 +310,7 @@ "\n Profitability = dn.Profitability,", "\n Partner = dn.Partner,", "\n IsReinsurance = dn.GetType() == typeof(GroupOfReinsuranceContract),", + "\n YieldCurveName = dn.YieldCurveName", "\n };", "\n }", "\n );", @@ -399,6 +419,69 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Data Variables" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task LoadPartitionedDataAsync(this IDataSource querySource, Guid partition, Guid? partitionBackup = null)", + "\n where T : IPartitioned", + "\n where P : IPartition", + "\n", + "\n{", + "\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 if(partitionBackup != null) await querySource.Partition.SetAsync

(partitionBackup);", + "\n return data;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task QueryPartitionedDataAsync(this IWorkspace workspace, IDataSource dataSource, Guid targetPartition, Guid defaultPartition, string format)", + "\n where T : IPartitioned", + "\n where P : IPartition", + "\n{", + "\n var isRelaxed = targetPartition != defaultPartition &&", + "\n ((format != ImportFormats.Cashflow && typeof(T).Name == nameof(IfrsVariable)) ||", + "\n (format == ImportFormats.Cashflow && typeof(T).Name == nameof(RawVariable)));", + "\n", + "\n var variablesFromWorkspace = await workspace.LoadPartitionedDataAsync(targetPartition);", + "\n if(!isRelaxed || variablesFromWorkspace.Any()) return variablesFromWorkspace;", + "\n", + "\n // For scenario re-calculation", + "\n var variablesFromDataSource = await dataSource.LoadPartitionedDataAsync(targetPartition);", + "\n if(variablesFromDataSource.Any()) return variablesFromDataSource;", + "\n", + "\n // For scenarios related to parameters solely", + "\n return await dataSource.LoadPartitionedDataAsync(defaultPartition, targetPartition);", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file