diff --git a/full-ifrs17-template/Constants/CalculationEngine.ipynb b/full-ifrs17-template/Constants/CalculationEngine.ipynb index cf36e68d..e30509df 100644 --- a/full-ifrs17-template/Constants/CalculationEngine.ipynb +++ b/full-ifrs17-template/Constants/CalculationEngine.ipynb @@ -16,13 +16,17 @@ "nbformat_minor": 5, "cells": [ { + "id": "0lsQIC1gDEODx-OkvAl3pQ", "cell_type": "code", "source": [ "var projectName = \"ifrs17\";", "\nvar environmentName = \"v1.0.0\";", "\nvar notebookName = \"CalculationEngine\";", "\nvar calculationEngine = $\"#!import \\\"//{projectName}/{environmentName}/{notebookName}\\\"\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Database/Configure.ipynb b/full-ifrs17-template/Database/Configure.ipynb index 44886de4..84f668d3 100644 --- a/full-ifrs17-template/Database/Configure.ipynb +++ b/full-ifrs17-template/Database/Configure.ipynb @@ -19,37 +19,58 @@ "nbformat_minor": 5, "cells": [ { + "id": "4pCtjml9b0qsW_qdBuJO6w", "cell_type": "markdown", "source": [ "

DataSource Configuration

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Vfn_7rax10adJW_1ZtDM8A", "cell_type": "code", "source": [ "#!import \"../Constants/CalculationEngine\"", "\n#!eval calculationEngine" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KhBa0fF-l0a93pgXYgVuFw", "cell_type": "code", "source": [ "#!import \"PersonalConnection\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Vh7nAxVvy0iUuSAGzjmDaw", "cell_type": "code", "source": [ "using System.Reflection;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZMZQjqRWTUGnPoJJpxkdLw", "cell_type": "markdown", "source": [ "# Database Configure" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "M452PsrooEqiMehPCaxUyQ", "cell_type": "code", "source": [ "var allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes())", @@ -57,38 +78,61 @@ "\n && !t.IsInterface", "\n && !t.IsAbstract", "\n ).ToArray();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0N7ABGO-n06LsiMOOHcdJw", "cell_type": "code", "source": [ "await DataSource.Configure().UseMsSql(opt => opt.WithConnectionString(connectionStringMsSql)", "\n .WithTypes(allTypes)) .ConnectAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RmBLxQdX_kOIeA0ktt94xQ", "cell_type": "code", "source": [ "await DataSource.CommitAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BA0VOza8rEajIHBmKBrSXA", "cell_type": "markdown", "source": [ "# Reset Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9InVK4PX5EGrE4_tARwXLw", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oYFbN_9RAU6NiE_F3qNY1A", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Database/PersonalConnectionExample.ipynb b/full-ifrs17-template/Database/PersonalConnectionExample.ipynb index 0bcdbdd5..a7877df3 100644 --- a/full-ifrs17-template/Database/PersonalConnectionExample.ipynb +++ b/full-ifrs17-template/Database/PersonalConnectionExample.ipynb @@ -16,10 +16,14 @@ "nbformat_minor": 5, "cells": [ { + "id": "PacHtppMCEiAbT28F8yC9Q", "cell_type": "code", "source": [ "var connectionStringMsSql = \"here enter your connection string\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Database/Schema Delete.ipynb b/full-ifrs17-template/Database/Schema Delete.ipynb index f1f25629..0894d1dd 100644 --- a/full-ifrs17-template/Database/Schema Delete.ipynb +++ b/full-ifrs17-template/Database/Schema Delete.ipynb @@ -17,18 +17,27 @@ "nbformat_minor": 5, "cells": [ { + "id": "kZ8F8V4tB0Wn8FeC8OhusQ", "cell_type": "code", "source": [ "#!import \"PersonalConnection\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ns9rbHPX0kSH-ZK7AejMeA", "cell_type": "code", "source": [ "#r \"nuget:SqlConnection,1.0.4\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4PUwLlVsK0uhCCfeGwRHFg", "cell_type": "code", "source": [ "string[] split = connectionStringMsSql.Split(new char[] { '=', ':', ',', ';' });", @@ -37,27 +46,42 @@ "\nstring database = split[5];", "\nstring userID = split[9];", "\nstring password = split[11];" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_tMxxfxtoU-Ji32JWMtCRw", "cell_type": "code", "source": [ "using SQLConnection;", "\nusing System;", "\nusing System.Data.SqlClient;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4vlEnuUvfkqV87nAO3Zbsg", "cell_type": "code", "source": [ "string query = \"DECLARE @sql NVARCHAR(max)='' SELECT @sql += ' Drop table ' + QUOTENAME(TABLE_SCHEMA) + '.'+ QUOTENAME(TABLE_NAME) + '; 'FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' Exec Sp_executesql @sql\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wseyK5F-cE-ZP_jy2OkS8Q", "cell_type": "code", "source": [ "int rowAffect = SqlServer.AzureSqlConnection(serverName, database, userID, password, query);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Export/MapTemplate.ipynb b/full-ifrs17-template/Export/MapTemplate.ipynb index f9062ea3..8d0c70b3 100644 --- a/full-ifrs17-template/Export/MapTemplate.ipynb +++ b/full-ifrs17-template/Export/MapTemplate.ipynb @@ -18,34 +18,51 @@ "nbformat_minor": 5, "cells": [ { + "id": "fjKBauyn0Uyuk0uljGsArg", "cell_type": "markdown", "source": [ "

Map Template

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "A4j8UHGNc0697n1iNB4Z7g", "cell_type": "markdown", "source": [ "This notebook exports the data nodes, data node states, and data node parameters belonging to a specific data partition into an excel file.", "\n
This file contains reference data used to prepopulate dropdows and validations to facilitate editing.", "\n
This can be modified and imported in the calculation engine to create and modify data." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WuQQ_5xug0mco92fji7LKw", "cell_type": "markdown", "source": [ "After setting the desired target Partition, the Data present in the workspace is ready to be exported. ", "\n", "\nThe default location of the exported files is the project file storage. A **download** link is generated and available for as long as the session is active. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "91ew-zbV-kyChbcoiWA4Pg", "cell_type": "markdown", "source": [ "# Select Initialization" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Qv_pfuGhMk6HAPOyqqo4RA", "cell_type": "markdown", "source": [ "Choose to run the Map Template either with the set of Systemorph data in memory or with the data present in the Database: ", @@ -53,60 +70,96 @@ "\n- #!eval-notebook \"../Import/CloseImportTemplate\" : uses the in-memory set up", "\n", "\nWe use here the in-memory set up." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jYRWlCvih0ih3Qb-VCnJxw", "cell_type": "code", "source": [ "#!eval-notebook \"../Import/CloseImportTemplate\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "f0i5Zqm2k0CiHXxvSxfEMw", "cell_type": "markdown", "source": [ "# Workspace Initialization " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eyUx5D6bFkeK-e_YOjcKcw", "cell_type": "markdown", "source": [ "Firstly, the Workspace is initialized with basic dimensions and with Data Nodes. For a list of the dimensions please refer to the DataModel/DataStructure notebook." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XLZRzQo0h0KkxPio3o_pQA", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yaG0mhZJ4USG66zLvyOp8A", "cell_type": "markdown", "source": [ "# Map Template: Data Node", "\n", "\n[DataNodes](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node) defines the properties of [Portfolios](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#portfolios) and [Group of Contracts](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#group-of-contracts)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZwUv99iEz0-BpQlAkBB0MQ", "cell_type": "markdown", "source": [ "## Set Partition" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KZS8p8Zgm0aL-Acn-8hUUQ", "cell_type": "code", "source": [ "static var partition = new PartitionByReportingNode() { ReportingNode = \"CH\" };", "\nawait Workspace.Partition.SetAsync( partition );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "L64PC131ukOuV4NLTc8U8g", "cell_type": "markdown", "source": [ "## Export" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "36zerkOEh0ChbLDtD5sf9Q", "cell_type": "code", "source": [ "await Export.ToExcel(\"DataNodes\")", @@ -117,42 +170,66 @@ "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LHS727tkQ06vfv6NhHl_sg", "cell_type": "markdown", "source": [ "# Map Template: Data Node State", "\n", "\n[Data Node State](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-state) defines whether the instance is active (used in import/output) or inactive (present in the DataSource but not used in input/output operations)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5jGzLrGmT0Gj9wlvkzSy9Q", "cell_type": "markdown", "source": [ "## Set Partition" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vV883PT1KUOnvMOnG7uAoA", "cell_type": "code", "source": [ "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };", "\nawait Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cGT1t9x9WkiwDWDsmfpnCw", "cell_type": "markdown", "source": [ "## Export" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3xILTNiIAk2QthF03nLqeQ", "cell_type": "markdown", "source": [ "The data is retrieved for the Workspace and prepared for export." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1WrPhQtQwkic6piAumGUmw", "cell_type": "code", "source": [ "var dataNodeStates = (await Workspace.Query()", @@ -161,15 +238,23 @@ "\n .Select(x => x.OrderByDescending(y => y.Year).ThenByDescending(y => y.Month))", "\n .Select(x => x.Last())", "\n .ToArray();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oJW1Sg5FsUyI5evdcvmJ_A", "cell_type": "markdown", "source": [ "Export is performed." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p2h3e_gKYkSWAenN52sRYQ", "cell_type": "code", "source": [ "await Export.ToExcel(\"DataNodeState\")", @@ -178,42 +263,66 @@ "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "B9bFvDffqES-eH1DaAJaEw", "cell_type": "markdown", "source": [ "# Map Template: Data Node Parameter", "\n", "\n[Data Node Parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters) are defined at the Group of Contract level and are used during the import calculation. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZvrsiiVNcU6R9eFqGvFb8A", "cell_type": "markdown", "source": [ "## Set Partition" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YFFB0fSxIEKDyRQ75hVt2g", "cell_type": "code", "source": [ "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2020, Month = 12 };", "\nawait Workspace.Partition.SetAsync( new PartitionByReportingNode() { ReportingNode = partition.ReportingNode } );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Iy02_lvUWkqaWMeXB2KfpQ", "cell_type": "markdown", "source": [ "## Export" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "l2jxOmpye0iihraZH8DCdg", "cell_type": "markdown", "source": [ "The data is retrieved for the Workspace and prepared for export." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LYzzjVLUkk-ts_ulw22Z4A", "cell_type": "code", "source": [ "var dataNodeParameters = (await Workspace.Query()", @@ -224,15 +333,23 @@ "\n .Select(y => y.OrderByDescending(z => z.Year).ThenByDescending(z => z.Month))", "\n .Select(y => y.Last())", "\n .ToArray() );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DVUmvzU18kiplnYxpVJ6Aw", "cell_type": "markdown", "source": [ "Export is performed." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CAMD-p4UT0CPgGf2pt0gDQ", "cell_type": "code", "source": [ "await Export.ToExcel(\"DataNodeParameter\")", @@ -240,13 +357,20 @@ "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TMlydk8uOUKGO2LOiMpREw", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Import/CloseImportTemplate.ipynb b/full-ifrs17-template/Import/CloseImportTemplate.ipynb index 3ba75fe8..50d70692 100644 --- a/full-ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/full-ifrs17-template/Import/CloseImportTemplate.ipynb @@ -16,18 +16,27 @@ "nbformat_minor": 5, "cells": [ { + "id": "FEKLEJqGf0Oz-qMZllkbng", "cell_type": "markdown", "source": [ "*Note: before configuring your data please refer to [Map Template](../Export/MapTemplate) Notebook.*" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hMb1v4Hbz0uLUbhvmm6Y1A", "cell_type": "markdown", "source": [ "

Close Import Template

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ArK9WxF3XUGSRdpNv0aa0A", "cell_type": "markdown", "source": [ "All imports are triggered via the Import command. Several options can be fluently appended to customize the import action:", @@ -36,17 +45,25 @@ "\n- WithFileStorage() : defined the drive from where the input files is retrieved. In this example we use the project file storage (new files have to be uploaded into the project), other options are SharePoint and OneDrive. ", "\n- WithTarget() : target drive where the results are stored. In this example we use our in-memory set up", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D5wNqWFLo0-UlPV4sPO33A", "cell_type": "markdown", "source": [ "# Set up data and configuration", "\n", "\nThe data source is initialized and the whole IFRS 17 Calculation Engine code is compiled. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c7It4DDk0UaGqiW6TZG_iA", "cell_type": "markdown", "source": [ "Choose to run the Close Import Template notebook either on top of the set of Systemorph data in memory or on top to the data present in the Database: ", @@ -54,15 +71,23 @@ "\n- #!eval-notebook \"../Initialization/InitSystemorphToMemory\" : uses the in-memory set up", "\n", "\nWe use here the in-memory set up." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "USHMPCizs0G_kBACuX-dDA", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "U3F6pMBgdUyHgBU8qjiYJQ", "cell_type": "markdown", "source": [ "# DataNode and Parameters", @@ -74,27 +99,43 @@ "\n- ImportFormats.DataNodeState : the [state of a data node](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-state) can be either active or inactive.", "\n- ImportFormats.DataNodeParameter : parameters are described [here](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters). For **Group of Insurance Contracts** a default [Premium Allocation factor](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Import/ImportScopeCalculation#experience-adjustment-on-premium) of 1 is applied if the parameter is not imported.", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AaFS-0j0sEWW5SxoRYq4Vw", "cell_type": "code", "source": [ "var pathToFile = \"../Files/DataNodes/DataNodes_CH.csv\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ubGP1EsDNUC7xBL5VK7W7Q", "cell_type": "code", "source": [ "var format = ImportFormats.DataNode;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-tgk2OJzaUWeC73huuAIAg", "cell_type": "code", "source": [ "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HHeBgnlDRkui1KTpqRPtaA", "cell_type": "markdown", "source": [ "# Transactional Data", @@ -105,39 +146,62 @@ "\n- ImportFormats.Cashflow : nominal cash flows", "\n- ImportFormats.Actual : written actuals, payable and receivables. ", "\n- ImportFormats.SimpleValue : direct import of pre-calculated Present Value and Actual values for all reports - no calculation is triggered -" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FQeU-8odV0ql_WZJ1jHEWQ", "cell_type": "code", "source": [ "var pathToFile = \"../Files/TransactionalData/Openings_CH_2020_12.csv\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "iNUyEWfT3EamYL5mRG4amg", "cell_type": "code", "source": [ "var format = ImportFormats.Opening;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "98WY7o4cn06YizVrcR94xA", "cell_type": "code", "source": [ "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "19kLJ4wFEkqfyJbhSgoIcg", "cell_type": "markdown", "source": [ "# Workspace reset" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zd61cWGdzkGJptkix9ISbA", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", "\nawait DataSource.Partition.SetAsync(null);", "\nawait DataSource.Partition.SetAsync(null);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index dfe320cb..c66f0472 100644 --- a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -18,59 +18,92 @@ "nbformat_minor": 5, "cells": [ { + "id": "Jw20XG4x1EilMCJAihQP9g", "cell_type": "markdown", "source": [ "

In Memory Initialization of unconfigured DataSource

", "\n

Reference Data and DataNode

", "\n", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CJ391fe1PkqmNCzrbe2e9A", "cell_type": "code", "source": [ "#!import \"../Constants/CalculationEngine\"", "\n#!eval calculationEngine" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6_xa9moxtkyL3ihz07u5jw", "cell_type": "markdown", "source": [ "# Set default DataSource" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bxuByZKrEEGaJlJhmI9osQ", "cell_type": "code", "source": [ "await DataSource.SetAsync();", "\nDataSource.Reset(x => x.ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "s0AlrC6liUWQOtiQVIhETw", "cell_type": "markdown", "source": [ "# Initialize Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "z4343SXng06FxPSXN2Aeow", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WL51QeoKJUmjFus2UMroPw", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2-aLOC4J4kGoki0zyUlMYA", "cell_type": "markdown", "source": [ "# Import Dimensions, Partitions" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K0kR1Ex6GUuSxR9UWW6lAw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Dimensions.csv\")", @@ -95,91 +128,150 @@ "\n .WithType()", "\n .WithTarget(DataSource)", "\n .ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gQrym4Or-UK0l0KA6Oo1Ag", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Dimensions.csv\").WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pVnKfqXxqkOFmEN6oMqzXA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CeFL2feAYEm4_iQf1FF-kw", "cell_type": "markdown", "source": [ "# Import Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jh9UF6J2W0yN7wPYYlWH3A", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-yXSxX1SlkCP7ItYBNxBzQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "g62eclyU5keZInFB-XjOuA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DBD01bxBz0ybP_0ZJWx6pQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mzOil6-bnEOxaKRmzJkALA", "cell_type": "markdown", "source": [ "# Import DataNodes and DataNodeParameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7-ashq1f2UamoHI5eVd6TQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vfjAuDCj4E6udIDEPDpi5g", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gyPlZm5h-kyEEdSBKnxjQw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "j9T1pkXp8Ui_6fUppmZStQ", "cell_type": "markdown", "source": [ "# Reset Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oIEu2CZCckC-kJlVOOIFUA", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jPzyibohbkO7BcQpOMcOfg", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index 04d2caa5..9bb486c7 100644 --- a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -18,42 +18,67 @@ "nbformat_minor": 5, "cells": [ { + "id": "dXiMOEAkhUS3szd2gfF6AA", "cell_type": "markdown", "source": [ "

Physical Database Initialization

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_W0Ol9Yp9UeBergpPJwHJQ", "cell_type": "code", "source": [ "#!import \"../Database/Configure\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "65YliV-tKkmoSPy38bJF1Q", "cell_type": "markdown", "source": [ "# Initialize Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "a-PRJMIuu0-d1Wc9Vdzexw", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MiNtGH15D0yiZ7EBxZapSw", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ly36ekMIOEmIr3ecEcrcLw", "cell_type": "markdown", "source": [ "# Import Dimensions, Partitions" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "x-MizAOJUE2I94Jd_HMpBA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Dimensions.csv\")", @@ -79,121 +104,200 @@ "\n .WithType()", "\n .WithTarget(DataSource)", "\n .ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dH5kihXlfU-Ipg3yKL6HZQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ptLGGIqwaU-rOpJwqkDPMQ", "cell_type": "markdown", "source": [ "# Import Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nyVjHWMCwkq5BzpPbVxpSg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/YieldCurve.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EnJEQa5B1kSZWSMWzVP6iQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nlxEPvEV8ke7pYuCdyx_Kw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MKh8LPhn8EWNCzMIjw0FPg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().SnapshotMode().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6Lg4ijhfp02NEI7_K7WLeg", "cell_type": "markdown", "source": [ "# Import DataNodes and DataNodeParameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wybN1I0PzE60Q8fsBQncNA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lDVi2RgwC0KBfSTM0haXLA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RZGXHFwlhUa4QElkgnabrA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZRzbVWjGt0CQWMBmcdV6xA", "cell_type": "markdown", "source": [ "# Import Cashflow and Actuals" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AQ2a6_t30kK9G1SpuPzbXA", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "czdzFh4XYE6tgQIH0X5PeQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4oyINCcm00aOGDsmy3uYCg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4QCb8Aedd0SGt_lDSgoLZg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PpdBhbl5XUOHeuneQTuqHg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cuqbrXADgESQzMGmdJNbKA", "cell_type": "markdown", "source": [ "# Reset Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yH5itqeYMkKbcSt0cjJdBw", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hQT5R1kCBUSQ-acs3AO6yg", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index 37489f3f..c3796999 100644 --- a/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/full-ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -18,102 +18,166 @@ "nbformat_minor": 5, "cells": [ { + "id": "cbbGg6wjDk-TVYeStR4qBQ", "cell_type": "markdown", "source": [ "

In Memory Initialization of unconfigured DataSource

", "\n", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IpRteNYsKEaP0_-LNWk1cw", "cell_type": "code", "source": [ "#!eval-notebook \"InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SoE3gUys8EKp3ltftwtJ6A", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "a7zceRktk0Oj53N2bl_YgQ", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "VNVvjMUDfUyw_34VpV0mKw", "cell_type": "markdown", "source": [ "# Import of Transactional Data" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fUkB1KS4Uk-UGYu3OGnZVQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4eI7O5E33kO7J2A17OzgkQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yZwiP28TokCPvTjooQvb3w", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-pwL5OY8Zk-MVsjCcc0GBw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_BBWqUgvVEGssR-nINMZzw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fZkRZKEuA0yPF2yeLMm9Nw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "n9gNpRaqN0OZp7FW0xzn8Q", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nT-Kxk8_wEmlJuFiTIyo4g", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RxVrDBGSckmToNXY8u0qNA", "cell_type": "markdown", "source": [ "# Reset Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zJuYHgo2HkKTEErlOcc0tg", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1OoKa9wkCkSVyawbxgUPJA", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/InputFormatDescription.ipynb b/full-ifrs17-template/InputFormatDescription.ipynb index 2b083f04..02a51dce 100644 --- a/full-ifrs17-template/InputFormatDescription.ipynb +++ b/full-ifrs17-template/InputFormatDescription.ipynb @@ -18,6 +18,7 @@ "nbformat_minor": 5, "cells": [ { + "id": "KxjjzFMIGE2XG47MupU_Rw", "cell_type": "markdown", "source": [ "

Structure of the Cashflows, Actuals and Openings Files

", @@ -29,9 +30,13 @@ "\n", "\n", "\n
" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "b_ujMXfzKkK739lQz4lDLA", "cell_type": "markdown", "source": [ "A cashflow file is named **NominalCashflows** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Cashflow**.", @@ -47,9 +52,13 @@ "\n", "\nAll valid combinations of AocType and Novelty can be found in [AocConfiguration](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-configuration) with DataType Optional or Mandatory.", "\n
The cash flow is entered in the columns named ValuesN where N goes from 0 to the lenght of cash flow. The Value0 corresponds to January of the Year entered in the **Main** section for every combination of AocType and Novelty. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3ZvTFE0td0OhuzUYPSQNYg", "cell_type": "markdown", "source": [ "", @@ -57,9 +66,13 @@ "\n", "\n", "\n
" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TmexPVnf9UOLk5M-rBIOFQ", "cell_type": "markdown", "source": [ "An Actuals file is named **Actuals** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Actual**.", @@ -71,9 +84,13 @@ "\n- [AocType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#aoc-type) : entered with its SystemName,", "\n- [ValueType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : corresponds to AmountType SystemName extended with the ExternalId,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8q7t_L66eUCR0RPDomX5vw", "cell_type": "markdown", "source": [ "", @@ -81,9 +98,13 @@ "\n", "\n", "\n
" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KeCG80BBU0mkKTrFyzYswg", "cell_type": "markdown", "source": [ "An Openings file is named **Openings** *\\_* *\\_* *\\_* and is composed of two sections: **Main** and **Opening**. In an AoC for one period, we only need one file with the year/month combination of the beginning of the period. Some GICs do not need any entries in Openings.", @@ -95,7 +116,10 @@ "\n- [EstimateType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#estimate-type) : entered with its SystemName,", "\n- [AmountType](https://portal.stage.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#amount-type) : entered with its SystemName,", "\n- AccidentYear : relevant for Data Node with Liability Type: Liability for Incurred Claims." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/OverviewIFRS17Template.ipynb b/full-ifrs17-template/OverviewIFRS17Template.ipynb index 2475dbde..46b1daf1 100644 --- a/full-ifrs17-template/OverviewIFRS17Template.ipynb +++ b/full-ifrs17-template/OverviewIFRS17Template.ipynb @@ -18,12 +18,17 @@ "nbformat_minor": 5, "cells": [ { + "id": "XqP6oT3oEUG8gfJACppeEA", "cell_type": "markdown", "source": [ "

IFRS17 Template - an Overview

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fLQXzK7btES7Yy94RU7hPg", "cell_type": "markdown", "source": [ "# Introduction", @@ -33,9 +38,13 @@ "\nSystemorph's Full IFRS 17 Template provides a complete example of input data and uses the Calculation Engine for the production of IFRS 17 results. Users can adapt this template to their own needs by changing the input data and calculating their own results.", "\n", "\nThis notebook provides an **overview** of Systemorph's Full IFRS 17 Template with brief introductions to all the main steps." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mgx2RMH1lU2loBaAni5g_A", "cell_type": "markdown", "source": [ "", @@ -65,17 +74,25 @@ "\n - Liability for Remaining Coverage (LRC)", "\n - Liability for Incurred Claims (LIC)", "\n - Financial Performance" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MzVwAqqUUU2txhGSipf7JQ", "cell_type": "markdown", "source": [ "# Data input", "\n", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nWSvAb7SxEKuYE10AgcJ3g", "cell_type": "markdown", "source": [ "", @@ -86,9 +103,13 @@ "\n$$", "\n$$", "\n- **Dimensions**: The many dimensions required to characterize all of the data and results, with system names and display names. This information is quite stable." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Y-wDmfD8GUCqW-pX9i8oLA", "cell_type": "markdown", "source": [ "", @@ -102,9 +123,13 @@ "\n$$", "\n$$", "\n- **DataNodeStates** *\\_* *\\_* *\\_*: Switching data nodes on and off, the normal state is (\"Active\") for all the GICs and GRICs of the reporting node/year/month combination; if needed, more such files may be added for other reporting node/year/month combinations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EeU9UVGsoEuSU1mmM-28cQ", "cell_type": "markdown", "source": [ "", @@ -121,9 +146,13 @@ "\n$$", "\n$$", "\n- **PartnerRating**: For each reinsurance partner of a relevant GRIC, the rating in S&P notation with the as-of date (year/month)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sLBXsjIWDUuSBmO6_bb3aQ", "cell_type": "markdown", "source": [ "", @@ -141,9 +170,13 @@ "\nThe structure of the [Actuals](./InputFormatDescription#actual), [Openings](./InputFormatDescription#opening) and [NominalCashflows](./InputFormatDescription#cashflow) files is explained in a special [notebook](./InputFormatDescription).", "\n", "\nThe less usual option of having discounted instead of nominal cash flows in the input is supported, but not a subject of this notebook in its current state." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EKBiTpxkLkKpIEhzVuZ-kw", "cell_type": "markdown", "source": [ "# Initialization", @@ -159,22 +192,33 @@ "\n", "\nIn the **Full IFRS 17 Template** project we always rely on the in-memory set up in order to be independet from a physical database which might not be available to every user. ", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ovtyPj3BG0OpMirbW0a-vg", "cell_type": "markdown", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "A_hBKHHrgEWrhwl60wgegQ", "cell_type": "markdown", "source": [ "", "\n# Reports", "\n", "\nAll the reports are produced by running a notebook such as **[Reports](./Report/Reports#report-production)**." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Report/Reports.ipynb b/full-ifrs17-template/Report/Reports.ipynb index b31f2e68..771699ba 100644 --- a/full-ifrs17-template/Report/Reports.ipynb +++ b/full-ifrs17-template/Report/Reports.ipynb @@ -18,13 +18,18 @@ "nbformat_minor": 5, "cells": [ { + "id": "u7uIwzix5EikOZED39lDSQ", "cell_type": "markdown", "source": [ "", "\n

Reports

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4igmSVIW0E6Kv5_vkT9DLg", "cell_type": "markdown", "source": [ "For demonstration purposes we import here data for some *Group of Insurance Contract* (GIC) and *Group of Reinsurance Contract* (GRIC) - the import is triggered in the [Set up data and configuration](#set-up-data-and-configuration).", @@ -33,9 +38,13 @@ "\n
For simplicity, we import similar transactional data for all GICs and GRICs. Each *Group of Contracts* produces different figures due to differences in parameters such as *Liability Type*, *Oci type* or *Premium allocation factor* to Contractual Service Margin.", "\n", "\nFollow the instructions below for a guided interaction with the reports." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hLLR1wkcZkyJXyEFLqPMMA", "cell_type": "markdown", "source": [ "# Set up data and configuration", @@ -45,22 +54,34 @@ "\n- #!eval-notebook \"../Import/CloseImportTemplate\" : uses the in-memory set up", "\n", "\nWe use here the in-memory set up." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eKD8BZm_xUOZQuA6m8UmTg", "cell_type": "code", "source": [ "#!eval-notebook \"../Import/CloseImportTemplate\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "U7KdEKhA_EOYfJ4pQQNz5A", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);", "\nifrs17Report.Reset(Workspace)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "poAVlQqeLkiV37sb_NpveQ", "cell_type": "markdown", "source": [ "# Best Estimate", @@ -71,9 +92,13 @@ "\nFor example one can add \"GroupOfContract\" to separate the contributions of the individual Group of Contracts.", "\n", "\nAggregated values are displayed when the data has a finer granularity than the one selected by the report slice options." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vtm0lBQIJEGfynjBvvZOrA", "cell_type": "code", "source": [ "var pvReport = ifrs17Report.PresentValues;", @@ -83,9 +108,13 @@ "\npvReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\npvReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.2\"),(\"LiabilityType\", \"LIC\") }", "\n(await pvReport.ToReportAsync) with {Height = 720}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ldw5kzK-mUSWoT7wyZhjcw", "cell_type": "markdown", "source": [ "# Risk Adjustment", @@ -93,9 +122,13 @@ "\nPresent values of the [risk adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#risk-adjustment) future cashflows are shown here.", "\n", "\nThe additional ColumnSlices are added to the view as the inner column. This can dicrease the readability of the report. For example, adding the slice by \"GroupOfContract\" leaves the lock-in and current rate contributions far apart and difficult to compare. The re-order of default slices with custom slices is achieved by esplicitly add the default slice among the custom slices. In our case, you can try entering both \"GroupOfContract\" and \"EconomicBasis\" separated by a comma in the ColumnSlices." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6qXICBD8FUOKmE7kKFNOdw", "cell_type": "code", "source": [ "var raReport = ifrs17Report.RiskAdjustments;", @@ -104,9 +137,13 @@ "\nraReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"EconomicBasis\"", "\nraReport.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.2\")};", "\n(await raReport.ToReportAsync) with {Height = 800}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "v073-6zoBUOkEN0NkPMINA", "cell_type": "markdown", "source": [ "# Written Actuals", @@ -115,9 +152,13 @@ "\n", "\nIn this case, the analysis of change view is replaced with a default slice by the **AmountTypes**. Only the amount type with non zero value are displayed. ", "\n
Filters can be applied to reports in order to isolate a sub-set of the data. They are specified by the name of the dimension to filter and the system name of the desired value. For example, to investigate the contribution of a single Group of Contract the following filter can be applied: new [] {(\"GroupOfContract\", \"DT1.1\")}." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Bqo2fJLwn02ro4jOw7UcAQ", "cell_type": "code", "source": [ "var writtenActualReport = ifrs17Report.WrittenActuals;", @@ -126,9 +167,13 @@ "\nwrittenActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nwrittenActualReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await writtenActualReport.ToReportAsync) with {Height = 400}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "h3gavlvtO0u2bh1A333Oew", "cell_type": "markdown", "source": [ "## Advance, Overdue Actuals", @@ -137,9 +182,13 @@ "\nor [Overdue](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral) are shown here together in a simplified Analysis of Change. ", "\n", "\nCombining Filters and ColumnSlices facilitate the report analysis. For example, you can select \"GroupOfContract\" as column slices with a Filter on EstimateType \"AA\" to analyse the Advance Actuals for all Group of Contract. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "g5vadolJpEykmOcUutrCRg", "cell_type": "code", "source": [ "var accrualActualReport = ifrs17Report.AccrualActuals;", @@ -148,17 +197,25 @@ "\naccrualActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\naccrualActualReport.DataFilter = null; //new [] {(\"EstimateType\", \"AA\")};", "\n(await accrualActualReport.ToReportAsync) with {Height = 400}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yxg6Q5NzBE2TOmApSlpCKw", "cell_type": "markdown", "source": [ "## Deferrable Actuals", "\n", "\n[Deferrable Actuals](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#written-accrual-deferral) are shown here. Amortization of the deferrable amount is computed using the Coverage Unit pattern. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1I7E2WC9I0SuubPYwDRh0w", "cell_type": "code", "source": [ "var deferrableActualReport = ifrs17Report.DeferralActuals;", @@ -167,9 +224,13 @@ "\ndeferrableActualReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\ndeferrableActualReport.DataFilter = null;//new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await deferrableActualReport.ToReportAsync) with {Height = 400}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "b21x1Qg4zka-PSLZ2_VVtw", "cell_type": "markdown", "source": [ "# Fulfilment Cashflow", @@ -179,9 +240,13 @@ "\n", "\nFilters can be applied to report to isolate a sub-set of the data. For example you can Filter by a specific Group of Contract using its system name using : new [] {(\"GroupOfContract\", \"DT1.1\")}.", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fQuP9scuY0GkBt5BDKH4rQ", "cell_type": "code", "source": [ "var fulfillmentCashflowsReport = ifrs17Report.FulfillmentCashflows;", @@ -190,17 +255,25 @@ "\nfulfillmentCashflowsReport.ColumnSlices = new string[]{};//\"EstimateType\"", "\nfulfillmentCashflowsReport.DataFilter = null;// new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await fulfillmentCashflowsReport.ToReportAsync) with {Height = 750}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-Klq4DH4K0qG8aZqN3oSew", "cell_type": "markdown", "source": [ "# Actuarial Experience Adjustment", "\n", "\nA comparison between [Written Actual](#written-actual) and the Releases of the [Best Estimate](#present-value) is reported in the [Actuarial Experience Adjustment](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#experience-adjustment)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ed6yzeiYa0-3UyyBO7W0Rg", "cell_type": "code", "source": [ "var experienceAdjustmentsReport = ifrs17Report.ExperienceAdjustments;", @@ -209,18 +282,26 @@ "\nexperienceAdjustmentsReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nexperienceAdjustmentsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await experienceAdjustmentsReport.ToReportAsync) with {Height = 300}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5cscmHZq0U2qZkBjPplHRA", "cell_type": "markdown", "source": [ "# LRC Technical Margin", "\n", "\nIn the [Technical Margin](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#technical-margin) report we present a unified view on the figures that are allocated to either Contractual Service Margin or to Loss Component. ", "\n
The Analysis of Change is expanded with few more steps such as **Experience Adjustment** and **Amortization**." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "a3POL_T-EUqCOxc6-th4Ew", "cell_type": "code", "source": [ "var technicalMarginsReport = ifrs17Report.TechnicalMargins;", @@ -229,9 +310,13 @@ "\ntechnicalMarginsReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\ntechnicalMarginsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await technicalMarginsReport.ToReportAsync) with {Height = 600}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gPdzoyThOU--U7xX2ECoQQ", "cell_type": "markdown", "source": [ "# Contractual Service Margin / Loss Component / Loss Recovery Component", @@ -239,9 +324,13 @@ "\nThe Contractual Service Margin (CSM) / Loss Component (LC) / Loss Recovery Component (LR) [report](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#technical-margin) are here shown side by side as the allocation to profit or loss is done at each step of the Analysis of Change. ", "\n", "\nA default slice by EstimateType - which distinguish between CSM, LC and LR contributions - is automatically enforced. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FmXWfR1g2EmvLBkN1e-E9w", "cell_type": "code", "source": [ "var allocatedTechnicalMarginsReport = ifrs17Report.AllocatedTechnicalMargins;", @@ -250,17 +339,25 @@ "\nallocatedTechnicalMarginsReport.ColumnSlices = new string[]{\"GroupOfContract\", \"EstimateType\"};//\"GroupOfContract\", \"AmountType\"", "\nallocatedTechnicalMarginsReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await allocatedTechnicalMarginsReport.ToReportAsync) with {Height = 700}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wy3GYkeG5UKsa50J8R17YQ", "cell_type": "markdown", "source": [ "# LRC Actuarial", "\n", "\nThe [Actuarial Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lrc-actuarial-actuarial-liability-for-remaining-coverage) report shows figures from Fulfilment Cashflow discounted with current yield curve, and the allocated techinical margin. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Xpp0x9HDlkihJkci0h4Fmw", "cell_type": "code", "source": [ "var actuarialLrcReport = ifrs17Report.ActuarialLrc;", @@ -269,17 +366,25 @@ "\nactuarialLrcReport.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nactuarialLrcReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await actuarialLrcReport.ToReportAsync) with {Height = 750}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k6LnLkmNYkytkmkTkJLNJg", "cell_type": "markdown", "source": [ "# LRC", "\n", "\nThe [Liability for Remaining Coverage](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lrc-liability-for-remaining-coverage) report adds to the [Actuarial Liability for Remaining Coverage](#lrc-actuarial) the contribution of and accrual actuals. A simplified Aoc Chain is used to allow comparison of the balance change between Actuals and Present Values. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pnSRXZw4G0mlrw6Balh3Eg", "cell_type": "code", "source": [ "var lrcReport = ifrs17Report.Lrc;", @@ -288,17 +393,25 @@ "\nlrcReport.ColumnSlices = new string[]{};//\"GroupOfContract\",", "\nlrcReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await lrcReport.ToReportAsync) with {Height = 250}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IEpuI6z2ZkSjC4N-wWpnXw", "cell_type": "markdown", "source": [ "# LIC Actuarial", "\n", "\nThe [Actuarial Liability of Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lic-actuarial-actuarial-liability-for-incurred-claims) report shows figures from Fulfilment Cashflow discounted with current yield curve. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yS3hZ7c9YEWHWZPTNX-rhw", "cell_type": "code", "source": [ "var actuarialLicReport = ifrs17Report.ActuarialLic;", @@ -307,17 +420,25 @@ "\nactuarialLicReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nactuarialLicReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await actuarialLicReport.ToReportAsync) with {Height = 750}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bo9xgnvtk0CRHOeS9vTULg", "cell_type": "markdown", "source": [ "# LIC", "\n", "\nThe [Liability for Incurred Claims](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#lic-liability-for-incurred-claims) adds to the [Actuarial Liability for Incurred Claims](#lic-actuarial) the contribution of and accrual actuals." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "88vqIH2CvUaR5ukjOZzJwQ", "cell_type": "code", "source": [ "var licReport = ifrs17Report.Lic;", @@ -326,9 +447,13 @@ "\nlicReport.ColumnSlices = new string[]{};//\"GroupOfContract\", \"AmountType\"", "\nlicReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await licReport.ToReportAsync) with {Height = 250}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "euXCVCpFJ0-az91gK8ZAjg", "cell_type": "markdown", "source": [ "# Financial Performance", @@ -336,9 +461,13 @@ "\nThe [Financial Performance](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/Report/ReportScopes#ifrs-17-financial-performance) report discloses the Change in Estimate of the IFRS 17 balance sheet items ([LRC](#lrc) and [LIC](#lic)) and the relevant incurred cashflows (Premiums, Claims, Expenses, etc...) for the given period.", "\n", "\nUse the expand and collapse buttons in the report rows to change the granularity of the figures displayed." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "s-A7Z24en0CV_hj-p9F5rQ", "cell_type": "code", "source": [ "var financialPerformanceReport = ifrs17Report.FinancialPerformance;", @@ -347,13 +476,20 @@ "\nfinancialPerformanceReport.ColumnSlices = new string[]{};//\"GroupOfContract\"", "\nfinancialPerformanceReport.DataFilter = null; //new [] {(\"GroupOfContract\", \"DT1.1\")};", "\n(await financialPerformanceReport.ToReportAsync) with { Height = 900, GroupDefaultExpanded = 3}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K9KFyJWxWEeHa2Pc1M54LQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/AocStructureTest.ipynb b/full-ifrs17-template/Test/AocStructureTest.ipynb index 7a350bb4..b84e90da 100644 --- a/full-ifrs17-template/Test/AocStructureTest.ipynb +++ b/full-ifrs17-template/Test/AocStructureTest.ipynb @@ -18,45 +18,70 @@ "nbformat_minor": 5, "cells": [ { + "id": "2SRO3ShzLkaZ7qWN8RvZ7Q", "cell_type": "markdown", "source": [ "

Test Aoc Management

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "M1VllEPGS0OhlSQ3uJd1eQ", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hNl7XCToMUKSzhT3hzDPeQ", "cell_type": "markdown", "source": [ "# Workspace Initialization " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bQMzNpxXeUuoDw7sLQ_FJA", "cell_type": "code", "source": [ "Workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_wLRhB1_zkK24aHF4LmP7Q", "cell_type": "markdown", "source": [ "# Test" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vNuhxD_Qo0GuHabTN1NA5g", "cell_type": "code", "source": [ "var reportingNode = \"CH\";", "\nvar scenario = (string)null;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9v46vtb-bUqHEbNG5SyPhw", "cell_type": "code", "source": [ "//Define partition", @@ -68,9 +93,13 @@ "\n Month = args.Month };", "\nawait DataSource.UpdateAsync(new[]{partition});", "\nawait DataSource.CommitAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Btn83FlNYE6_Ql5XGVzmIg", "cell_type": "code", "source": [ "public async Task CheckAocStepStructureAsync(IEnumerable inputVariables, ", @@ -213,27 +242,43 @@ "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "aFfmV7Ms80WfX9f9H0_wXQ", "cell_type": "markdown", "source": [ "# Use Cases" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mzSm3LewcEmN0pzLELyAoQ", "cell_type": "markdown", "source": [ "## Gross Cashflow: InForce, NewBusiness, and Combined" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_4kokfPYeUyHMwvE0QmYfA", "cell_type": "code", "source": [ "var groupOfContract = \"DT1.1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0e0Hl6UeEkeKZFmm1F23BA", "cell_type": "code", "source": [ "var inputRawVariables = new RawVariable[]{", @@ -243,9 +288,13 @@ "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Dz725xYrTU2lcT7unwrpWg", "cell_type": "code", "source": [ "var parentBm = new Dictionary>()", @@ -255,9 +304,13 @@ "\n {new AocStep(\"EV\",\"N\"), new AocStep[]{new AocStep(\"BOP\",\"N\")}},", "\n {new AocStep(\"CL\",\"C\"), new AocStep[]{new AocStep(\"YCU\",\"I\"), new AocStep(\"EV\",\"N\"),}},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gJi4A4oY9kSR1jm_-0Ottw", "cell_type": "code", "source": [ "var referenceBm = new Dictionary()", @@ -277,9 +330,13 @@ "\n {new AocStep(\"EOP\",\"C\"), new AocStep(\"CL\",\"C\")},", "\n {new AocStep(\"CF\",\"C\"), new AocStep(\"CF\",\"C\")},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "o71ZpBEymEioQHtRrczoDw", "cell_type": "code", "source": [ "var fullAocBm = new Dictionary>()", @@ -311,27 +368,43 @@ "\n }},", "\n //{new AocStep(\"CF\",\"C\"), Enumerable.Empty()},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c2lCvWF2M0KxFyXg23xR5Q", "cell_type": "code", "source": [ "await CheckAocStepStructureAsync(inputRawVariables, parentBm, referenceBm, fullAocBm)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fQPs1GfVgUGI3A2oi6ES_Q", "cell_type": "markdown", "source": [ "## Reinsurance Cashflow: InForce, NewBusiness, and Combined" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Y5UQw3aQ00Kwj2FwQlwFqA", "cell_type": "code", "source": [ "groupOfContract = \"DTR1.1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gmZ98jyVhE-gKbFFWdRM_A", "cell_type": "code", "source": [ "inputRawVariables = new RawVariable[]{", @@ -341,9 +414,13 @@ "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"EV\", Novelty = \"N\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CASGAQ4Tfk-r5qegnk_VTg", "cell_type": "code", "source": [ "parentBm = new Dictionary>()", @@ -354,9 +431,13 @@ "\n {new AocStep(\"EV\",\"N\"), new AocStep[]{new AocStep(\"BOP\",\"N\")}},", "\n {new AocStep(\"CL\",\"C\"), new AocStep[]{new AocStep(\"YCU\",\"I\"), new AocStep(\"EV\",\"N\"),}},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CLL4jQwmfEe6fmoqWNjZGw", "cell_type": "code", "source": [ "var parentBm_CDR = new Dictionary>()", @@ -367,9 +448,13 @@ "\n {new AocStep(\"EV\",\"N\"), new AocStep[]{new AocStep(\"BOP\",\"N\")}},", "\n {new AocStep(\"CL\",\"C\"), new AocStep[]{new AocStep(\"CRU\",\"I\"), new AocStep(\"EV\",\"N\"),}},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6WWtvNB4FUO7jnbMl-3d6Q", "cell_type": "code", "source": [ "referenceBm = new Dictionary()", @@ -391,9 +476,13 @@ "\n {new AocStep(\"EOP\",\"C\"), new AocStep(\"CL\",\"C\")},", "\n {new AocStep(\"CF\",\"C\"), new AocStep(\"CF\",\"C\")},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "I_If6UTWpUCQqU0iKSjSng", "cell_type": "code", "source": [ "fullAocBm = new Dictionary>()", @@ -428,27 +517,43 @@ "\n //{new AocStep(\"CF\",\"C\"), Enumerable.Empty()},", "\n ", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HtMAFjHCU0qgleOtt6J70A", "cell_type": "code", "source": [ "await CheckAocStepStructureAsync(inputRawVariables, parentBm, referenceBm, fullAocBm, parentBm_CDR)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "C7fWPcfSOU2tKgZUhmqOQA", "cell_type": "markdown", "source": [ "## Cashflow: InForce, and Combined" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zKke0guumkSXcJBCS71Uew", "cell_type": "code", "source": [ "var groupOfContract = \"DT1.1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_18dqpvWvUqCFX2z2M5WfA", "cell_type": "code", "source": [ "inputRawVariables = new RawVariable[]{", @@ -456,9 +561,13 @@ "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"MC\", Novelty = \"I\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n new RawVariable{Partition = partition.Id, Values = new []{1.0}, DataNode = groupOfContract, AocType = \"CL\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\"},", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9J919h-K1kqu1tAGwVWYdw", "cell_type": "code", "source": [ "parentBm = new Dictionary>()", @@ -467,9 +576,13 @@ "\n {new AocStep(\"YCU\",\"I\"), new AocStep[]{new AocStep(\"MC\",\"I\")}}, ", "\n {new AocStep(\"CL\",\"C\"), new AocStep[]{new AocStep(\"YCU\",\"I\")}},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZE7AsxQoG02Qol7pRFbtXA", "cell_type": "code", "source": [ "referenceBm = new Dictionary()", @@ -485,9 +598,13 @@ "\n {new AocStep(\"EOP\",\"C\"), new AocStep(\"CL\",\"C\")},", "\n {new AocStep(\"CF\",\"C\"), new AocStep(\"CF\",\"C\")},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ay6veykrjkKNWneUWBpL7Q", "cell_type": "code", "source": [ "fullAocBm = new Dictionary>()", @@ -509,27 +626,43 @@ "\n new AocStep(\"CL\",\"C\"), new AocStep(\"EA\",\"C\"), new AocStep(\"AM\",\"C\"),}},", "\n //{new AocStep(\"CF\",\"C\"), Enumerable.Empty()},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eHYrP4DJXUy7BsFDUCcJwg", "cell_type": "code", "source": [ "await CheckAocStepStructureAsync(inputRawVariables, parentBm, referenceBm, fullAocBm)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "m7BQFO0kqUiHx6TEe7OuIw", "cell_type": "markdown", "source": [ "## Actual" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_ic5CYtWrE24qDPr1qGI1Q", "cell_type": "code", "source": [ "var groupOfContract = \"DT1.1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uANg5ulWwkiuBtfSR0K1eg", "cell_type": "code", "source": [ "var inputIfrsVariables = new IfrsVariable[]{", @@ -538,21 +671,33 @@ "\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"CF\", Novelty = \"C\", AccidentYear = null, AmountType = \"ACA\", EstimateType = \"A\"},", "\n new IfrsVariable{Partition = partition.Id, Value = 1.0, DataNode = groupOfContract, AocType = \"WO\", Novelty = \"C\", AccidentYear = null, AmountType = \"PR\", EstimateType = \"OA\"},", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "l0y2QdR_O0mtdza797CLAw", "cell_type": "code", "source": [ "parentBm = null;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SnSLmJ6Ph0SdiyWLD5gXAg", "cell_type": "code", "source": [ "referenceBm = null;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pFoRvT0Vj0qccKEeuynz9w", "cell_type": "code", "source": [ "fullAocBm = new Dictionary>()", @@ -563,19 +708,30 @@ "\n {new AocStep(\"AM\",\"C\"), new AocStep[]{new AocStep(\"BOP\",\"I\"), new AocStep(\"CF\",\"C\"), new AocStep(\"WO\",\"C\"),}},", "\n {new AocStep(\"EOP\",\"C\"), new AocStep[]{new AocStep(\"BOP\",\"I\"), new AocStep(\"CF\",\"C\"), new AocStep(\"WO\",\"C\"), new AocStep(\"AM\",\"C\"),}},", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fCPrGixu902KzS2gDA_COA", "cell_type": "code", "source": [ "await CheckAocStepStructureAsync(inputIfrsVariables, parentBm, referenceBm, fullAocBm)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "UKC3B3KBzEu2chdA44RYWQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ExportIfrsVariable.ipynb b/full-ifrs17-template/Test/ExportIfrsVariable.ipynb index f844924b..268dbcda 100644 --- a/full-ifrs17-template/Test/ExportIfrsVariable.ipynb +++ b/full-ifrs17-template/Test/ExportIfrsVariable.ipynb @@ -18,59 +18,92 @@ "nbformat_minor": 5, "cells": [ { + "id": "gyniYqnKikqyyeZwKE3w_A", "cell_type": "markdown", "source": [ "

Test Reports

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "b-vYp0gzsEG2ZbVtT_7kZA", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AnHy7aq_1UCdpDokxEg1ug", "cell_type": "markdown", "source": [ "# BenchMarks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jYkLXYmEE0SzZNcORVzVyg", "cell_type": "code", "source": [ "var pathToBm = \"./Data/ReportBenchmarks/\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ntINVSp7zUe_bdSYQISwRQ", "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)", "\n };" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XQD2qkj4kEmun05vfKjBXg", "cell_type": "code", "source": [ "var scenario = \"MTUP10pct\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K0v3eoXQ-0GR5wQUavZZdA", "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());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RLE-nEp_AEC80dTOOpOuEw", "cell_type": "code", "source": [ "(0, computedVariables.Keys)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JLu16Jzr1E2J_BrBOUhoAQ", "cell_type": "code", "source": [ "var estimateType = \"BEPA\";", @@ -90,13 +123,20 @@ "\n )", "\n .WithSource(DataSource)", "\n .ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "VMRDuKeShkua9CR3XEa9Uw", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ExportReportVariables.ipynb b/full-ifrs17-template/Test/ExportReportVariables.ipynb index 65d0e2cb..d9e1a630 100644 --- a/full-ifrs17-template/Test/ExportReportVariables.ipynb +++ b/full-ifrs17-template/Test/ExportReportVariables.ipynb @@ -18,85 +18,138 @@ "nbformat_minor": 5, "cells": [ { + "id": "w3hTos8PYE2anJHmCX5-og", "cell_type": "markdown", "source": [ "

Report Variable Exporter

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HpEqqWuC7kuRLHoeY6YLaA", "cell_type": "markdown", "source": [ "# Infrastructure and Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3Gteb02znkyyorr1rK8qrg", "cell_type": "markdown", "source": [ "## Initialize Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CHzk0G-F6EqVRewucQ24Tw", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BYSXWDg9fkKVxwArMwDo2w", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EhBxY5wLOkSrpUozXxisOA", "cell_type": "markdown", "source": [ "## Imports and Configurations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "S02JZwmkG0epPmZbsUR7dg", "cell_type": "code", "source": [ "#!import \"ReportVariablesTestBase\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oJbkEK0FXkirjq30Wu873w", "cell_type": "markdown", "source": [ "## Storage" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "r-VrgwtMV0WNk2B4EJSZ7w", "cell_type": "code", "source": [ "var reportStorage = new ReportStorage(Workspace, Report);", "\nawait reportStorage.InitializeReportIndependentCacheAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D2-Sfwcbk0S_kDpIUPw9qw", "cell_type": "markdown", "source": [ "## Configurations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fST1ooZG606uxzvrn9n86w", "cell_type": "code", "source": [ "//var path = \"./Data/ReportVariableBenchmarks/\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YG-CpjjbQk6oQcpgxXt23w", "cell_type": "markdown", "source": [ "# Defining Scope for the Reports and Tests" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_0V0ZWihnk-d3zNj56ZvcQ", "cell_type": "markdown", "source": [ "### Defining the Period and Reporting Node (...) for the Reports" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QPJPvzqJqU20dfRXkgSKCA", "cell_type": "code", "source": [ "((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType)[] exportScope = {", @@ -108,15 +161,23 @@ "\n// ((2021, 3), \"CH\", null, CurrencyType.Functional),", "\n// ((2021, 3), \"CH\", null, CurrencyType.Group),", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "doLfGk3ZY0O0B-1OJ93Eww", "cell_type": "markdown", "source": [ "# Export" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "J-gceJlUTEWA3b-_lA8jqQ", "cell_type": "code", "source": [ "// foreach(var args in exportScope){", @@ -124,29 +185,44 @@ "\n// var bmFileName = benchmarkFileNamePrefix + GetBenchmarkFileName(args) + \".csv\";", "\n// await Export.ToCsv(path + bmFileName).WithTable(tableConfig => tableConfig.WithSource(source => scopesData.AsQueryable())).ExecuteAsync(); ", "\n// }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wimBAI-AxUamvGEoBsgvLQ", "cell_type": "code", "source": [ "var args = exportScope.First();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "g7w8cfsKC0uqqa8Hk-tvig", "cell_type": "code", "source": [ "var scopesData = await GetScopesDataAsync(args, reportStorage, Scopes);", "\nvar bmFileName = benchmarkFileNamePrefix + GetBenchmarkFileName(args) + \".csv\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qIKmkC8tI0afnRzqSzu3Bg", "cell_type": "code", "source": [ "await Export.ToCsv(bmFileName)", "\n .WithTable(tableConfig => tableConfig.WithSource(source => scopesData.AsQueryable()))", "\n .WithSource(Workspace)", "\n .ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/IfrsVariablesTest.ipynb b/full-ifrs17-template/Test/IfrsVariablesTest.ipynb index 78347e9c..95525812 100644 --- a/full-ifrs17-template/Test/IfrsVariablesTest.ipynb +++ b/full-ifrs17-template/Test/IfrsVariablesTest.ipynb @@ -18,36 +18,57 @@ "nbformat_minor": 5, "cells": [ { + "id": "6scxNAfeaEKQpsdiYwPBiQ", "cell_type": "markdown", "source": [ "

Ifrs Variable

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "M5pmNZSIl0-IBqNKyS2OJw", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eEnHiGXZuk-HmFq5k-uskQ", "cell_type": "markdown", "source": [ "# BenchMarks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c8Ih_f5ou0GfWn7tGD0NjA", "cell_type": "code", "source": [ "var pathToBm = \"./Data/IfrsVariableBenchmarks/\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ady4_q_75kOPCb0L_OoTuA", "cell_type": "code", "source": [ "public record BenchmarkMetadata(string FileName, string ReportingNode, int Year, int Month, string Scenario = null){} " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FxYB_odz5kauR7Tzov4FBA", "cell_type": "code", "source": [ "var bmFiles = new BenchmarkMetadata[]{", @@ -86,27 +107,43 @@ "\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};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Jpf73ojEzEuugf6Eb4VxLg", "cell_type": "code", "source": [ "var excludedDataNodes = new[] {\"DT5.1\"}; // DT5.1 is simple importer and tested at report variable level" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Obh-9GjSVk-Kzliv3vZWlA", "cell_type": "markdown", "source": [ "# Functions" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_CiTAc6k0UGmQqN2FL2rpQ", "cell_type": "code", "source": [ "public static NumberStyles AllowedNumberStyles = NumberStyles.Float | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign | NumberStyles.AllowDecimalPoint;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8qbu0w9W6kOkf3L8Z9xYmQ", "cell_type": "code", "source": [ "public IfrsVariable CreateVariable (IDataRow row, Guid partition)", @@ -125,9 +162,13 @@ "\n Value = (-1.0) * doubleValue,", "\n };", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZSYfIGNm802cO89G2pEZJg", "cell_type": "code", "source": [ "public class BenchmarkTestResult", @@ -146,9 +187,13 @@ "\n ComputedValue = compValue; ", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WJCUw1Sgj0CdzcF6Odsd5w", "cell_type": "code", "source": [ "public List CompareAgainstBm (List errors, IEnumerable expected, IEnumerable computed)", @@ -189,15 +234,23 @@ "\n }", "\n return errors;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DdmDeyIpBUmkeNdMAzoCzw", "cell_type": "markdown", "source": [ "# Test Runner" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Z0IH9izEb0ShMy_VUmBNnA", "cell_type": "code", "source": [ "public bool ValidateMainTab(IDataRow mainRow, string reportingNode, int year, int month)", @@ -210,9 +263,13 @@ "\n ", "\n return reportingNode == mainReportingNode && year == mainYear && month == mainMonth;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Dsc_qCZWK0K7nrTWLfr_8A", "cell_type": "code", "source": [ "var errorList = new List();", @@ -260,25 +317,40 @@ "\n errorList = errorList.Concat(CompareAgainstBm(errorList, bmVariables, computedVariables)).Distinct().ToList();", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uhA9D1gG6UC-WWEIVAGg6g", "cell_type": "code", "source": [ "errorList.Count().Should().Be(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yZXBFdNw30mnd_LjNJ-WeQ", "cell_type": "code", "source": [ "errorList" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "q7f3jcfZBUC5JR4OObHU8Q", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ImportStorageTest.ipynb b/full-ifrs17-template/Test/ImportStorageTest.ipynb index bb0d0a2e..0fa50ad3 100644 --- a/full-ifrs17-template/Test/ImportStorageTest.ipynb +++ b/full-ifrs17-template/Test/ImportStorageTest.ipynb @@ -18,47 +18,72 @@ "nbformat_minor": 5, "cells": [ { + "id": "4V1Y85K3S0mh2c_A3peNmQ", "cell_type": "markdown", "source": [ "

Import Storage Test

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PWZUG1NwMkCYuH0xNoicJQ", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oYCixA-P702eBHkRn7BP-A", "cell_type": "markdown", "source": [ "# Workspace Initialization " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "klkTq3g0X0ShwTF3rFiJug", "cell_type": "code", "source": [ "Workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5LVp8kBA5kq29eX43K0yDA", "cell_type": "markdown", "source": [ "# Test IfrsVariables Query" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Cz4yiK0cikSAdKQTs5lIiw", "cell_type": "code", "source": [ "var gic = \"DT1.1\";", "\nvar gric = \"DTR1.1\";", "\nvar reportingNode = \"CH\";", "\nvar scenario = (string)null;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ek6ue64fhU2TykP20XAnng", "cell_type": "code", "source": [ "//Define partition", @@ -76,9 +101,13 @@ "\n Month = args.Month };", "\nawait DataSource.UpdateAsync(new[]{partition, previousPeriodPartition});", "\nawait DataSource.CommitAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sbwZeNrQ8EOHB4SUYpHtSg", "cell_type": "code", "source": [ "public async Task CheckIfrsVariablesFromImportStorageAsync(string importFormat, IEnumerable inputDataSetForWorkspace, IEnumerable inputDataSetForDataSource, IEnumerable ivsBenchmark)", @@ -112,9 +141,13 @@ "\n ", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Anr6vl-t3UC5nTGfEVzRxA", "cell_type": "code", "source": [ "//There is a previous year, and it's the first time Actuals are imported for the current year", @@ -137,9 +170,13 @@ "\n };", "\n", "\nawait CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tE0Ru932CUGtOoYd5VsKgw", "cell_type": "code", "source": [ "//There is a previous year, and it's the second time Actuals are imported for the current year (reimport)", @@ -167,9 +204,13 @@ "\n };", "\n", "\nawait CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fWKZntzNbUSeFnicGWY8qg", "cell_type": "code", "source": [ "//There is a previous year, Cashflows were already imported and Actuals are imported for the first time", @@ -199,9 +240,13 @@ "\n };", "\n", "\nawait CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AVGmHZJBB0eWrY6cU1ZGHw", "cell_type": "code", "source": [ "//There is a previous year, Cashflows and Actuals were already imported and Actuals are imported again", @@ -239,9 +284,13 @@ "\n };", "\n", "\nawait CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WZ5UNLEbQEaqkkw1Eal-Sg", "cell_type": "code", "source": [ "//There is a previous year for Primary Scope (GRIC10) ", @@ -289,21 +338,33 @@ "\n };", "\n", "\nawait CheckIfrsVariablesFromImportStorageAsync(ImportFormats.Actual, inputDataSetForWorkspace, inputDataSetForDataSource, ivsBenchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "U-aIdwuQhEO1mNg6s_O8RQ", "cell_type": "markdown", "source": [ "# Data Node Parameter related logic" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CgIPciXcd0yoh5eSyjtWLQ", "cell_type": "markdown", "source": [ "## Data Preparation" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8sToc40RHEyX6mnl6-2JeQ", "cell_type": "code", "source": [ "//Define partition", @@ -321,9 +382,13 @@ "\nvar previousPeriodPartition = Workspace.Query().FirstOrDefault(x => x.ReportingNode == args.ReportingNode && x.Year == args.Year - 1 && ", "\n x.Month == MonthInAYear && x.Scenario == args.Scenario);", "\nif(previousPeriodPartition == null) ApplicationMessage.Log(Error.PartitionNotFound);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dj0d1i45IUCPGcUYSFqF1g", "cell_type": "code", "source": [ "var sampleGic = new GroupOfInsuranceContract(){Portfolio = \"P1\"};", @@ -360,9 +425,13 @@ "\n };", "\n", "\nvar sampleRawVar = new RawVariable{AmountType = AmountTypes.PR, AocType = AocTypes.CL, Novelty = Novelties.C, Partition = currentPartition.Id};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5tLIwPwQlE6Q-Mmjt5qABw", "cell_type": "code", "source": [ "public async Task PrepareWorkspaceDataNodes()", @@ -372,9 +441,13 @@ "\n await Workspace.UpdateAsync(inputDataState);", "\n await Workspace.UpdateAsync(inputDataParameter);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lvmU4I0au0KQSSOu4P0Oaw", "cell_type": "code", "source": [ "public async Task CleanWorkspaceDataNodes()", @@ -384,15 +457,23 @@ "\n await Workspace.DeleteAsync(inputDataState);", "\n await Workspace.DeleteAsync(inputDataParameter);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8RVSgsGTckq6uDozpgV2Xg", "cell_type": "markdown", "source": [ "## Get Underlying Gic" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "g7MyEgjcT0mIl4njOQldiA", "cell_type": "code", "source": [ "public async Task CheckGetUnderlyingGicsAsync(RawVariable[] inputDataVariable, Dictionary> underlyingGicBm)", @@ -417,9 +498,13 @@ "\n await CleanWorkspaceDataNodes();", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_LC1ibvA6k-LB8A_F-ZPJA", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins1\"},", @@ -431,9 +516,13 @@ "\n};", "\n", "\nawait CheckGetUnderlyingGicsAsync(inputDataVariable, underlyingGicBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wt4c0eVk5EiGCnz9mj-E6g", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins2\"},", @@ -443,15 +532,23 @@ "\n};", "\n", "\nawait CheckGetUnderlyingGicsAsync(inputDataVariable, underlyingGicBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rHRLxr4v60KlzL_XBkR4dg", "cell_type": "markdown", "source": [ "## Get Reinsurance Coverage" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "y3-b6njLFkOwrNvRICbFTw", "cell_type": "code", "source": [ "public async Task CheckGetReinsuranceCoverageAsync(RawVariable[] inputDataVariable, ", @@ -495,9 +592,13 @@ "\n await CleanWorkspaceDataNodes();", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3DoFFjphUk23ycw7uCoS-Q", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins1\"},", @@ -516,15 +617,23 @@ "\n};", "\n", "\nawait CheckGetReinsuranceCoverageAsync(inputDataVariable, reinsCovBoPBm, reinsCovEoPBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9SN-SI-1Z0yDm8u66Z2x9Q", "cell_type": "markdown", "source": [ "## Primary and Secondary Scope" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0rLWKbTR00WV1wWkicVaaQ", "cell_type": "code", "source": [ "public async Task CheckSecondaryScopeAsync(RawVariable[] inputDataVariable, string[] primaryScopeBm, string[] secondaryScopeBm)", @@ -559,9 +668,13 @@ "\n await CleanWorkspaceDataNodes();", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YdutG30Sxkit5d7-NlYKpg", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins1\"},", @@ -570,9 +683,13 @@ "\nvar primaryScopeBm = new string[]{\"Reins1\", \"Reins2\"};", "\nvar secondaryScopeBm = new string[]{\"Gross1\", \"Gross2\"};", "\nawait CheckSecondaryScopeAsync(inputDataVariable, primaryScopeBm, secondaryScopeBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ktz7zDRMKUayJsk8d4qJDg", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins1\"},", @@ -580,9 +697,13 @@ "\nvar primaryScopeBm = new string[]{\"Reins1\"};", "\nvar secondaryScopeBm = new string[]{\"Gross1\"};", "\nawait CheckSecondaryScopeAsync(inputDataVariable, primaryScopeBm, secondaryScopeBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "roTIyck4jUGmeXE_NdMzFA", "cell_type": "code", "source": [ "var inputDataVariable = new RawVariable[]{ sampleRawVar with {DataNode = \"Reins1\"},", @@ -591,13 +712,20 @@ "\nvar primaryScopeBm = new string[]{\"Reins1\",\"Gross1\",\"Reins2\"};", "\nvar secondaryScopeBm = new string[]{\"Gross2\"};", "\nawait CheckSecondaryScopeAsync(inputDataVariable, primaryScopeBm, secondaryScopeBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ia3QbwB_qE-OLOF3bFIIow", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/full-ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 92b8091b..313984c2 100644 --- a/full-ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/full-ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -18,90 +18,147 @@ "nbformat_minor": 5, "cells": [ { + "id": "5pJ9_h3JCkqu1VYGsHT6Ig", "cell_type": "markdown", "source": [ "

Test Map Template Export and Import

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wKj_RnoNyEmjYuzGN_J2ug", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "etRLzU1SR0KckKJ-yD-P8Q", "cell_type": "markdown", "source": [ "# Test Empty Database" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yKo9EdsuY0SaaQ7gp23QdQ", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "g50tzVTlvEqwzOtT6Vpj7A", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DU0jOj1B-0-pm6boDCGI4A", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4IuR29t8mkK5gCycGzQoeA", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "07qbwfjHbkywAJxFtlnxbA", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BcOSQ2sTfkC6Y1bwQUDwzw", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OzlMeIunREmpcZOAWqbnMw", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yhLainJEZU6uJlBFKAYzcg", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0OvZDdON4UGP-MhvLpIkmw", "cell_type": "code", "source": [ "(await DataSource.Query().ToArrayAsync()).Length.Should().NotBe(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p9wR_qEd2kq7Ivro5jR4MA", "cell_type": "markdown", "source": [ "# Test Map Template" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wpwTbPXYtE2ecKT7QHQp9g", "cell_type": "markdown", "source": [ "## Data Node" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wWGCIr86_0yXgnuWRYSopA", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);", @@ -127,9 +184,13 @@ "\n.ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vbfz9uVrmEC0qFFSYb2zlw", "cell_type": "code", "source": [ "await Export.ToExcel(filename)", @@ -140,9 +201,13 @@ "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5xqalt9bUEaXe1Sy6xOR6w", "cell_type": "code", "source": [ "// Run this only after having imported the file exported in the above cell.", @@ -172,21 +237,33 @@ "\nUtils.EqualityComparer(gics, Workspace.Query().ToArray());", "\nUtils.EqualityComparer(grics, Workspace.Query().ToArray());", "\n*/" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rir7jijjqk-YTZyHTWzY3A", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XnNuBPlC1kS4RpEgM99EFg", "cell_type": "markdown", "source": [ "## Data Node State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pCBweGbCdEuZJs8OgKqxFQ", "cell_type": "code", "source": [ "static var partition = new PartitionByReportingNodeAndPeriod() { ReportingNode = \"CH\", Year = 2021, Month = 3 };", @@ -211,9 +288,13 @@ "\n.ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vJAZZKAcXE6xZTu-pHEr-g", "cell_type": "code", "source": [ "await Export.ToExcel(filename)", @@ -222,9 +303,13 @@ "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "50DfYVJTrUi11ZM4hb0TrA", "cell_type": "code", "source": [ "// Run this only after having imported the file exported in the above cell.", @@ -245,21 +330,33 @@ "\n// Workspace is empty because ValidateDataNodeStatesAsync removes the entry, since this is already present in the DataSource.", "\nWorkspace.Query().ToArray().Should().BeEmpty();", "\n*/" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bJbigaiL_EaFa7Fwx7AH0Q", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pcaBVu-LgUu_4cP8fqy6Ug", "cell_type": "markdown", "source": [ "## DataNodeParameter" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "j05en4nLBkCnDSt4QqP_lw", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);", @@ -287,9 +384,13 @@ "\n.ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zs5pxexv-k-GWOtbsvg3Ug", "cell_type": "code", "source": [ "await Export.ToExcel(filename)", @@ -297,9 +398,13 @@ "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Rmq7ED57Y02ZNBD8YHmwew", "cell_type": "code", "source": [ "// Run this only after having imported the file exported in the above cell.", @@ -327,27 +432,43 @@ "\nUtils.EqualityComparer(singleDataNodeParamBm, expectedSingleDataNodeParamBm);", "\nUtils.EqualityComparer(interDataNodeParamBm, expectedInterDataNodeParamBm);", "\n*/" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "e_0TmZvO70ejGkrK4F25ng", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Z4ZTJKWu00eZLDbEZb1V6g", "cell_type": "markdown", "source": [ "# Test Import Validation" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "R-p92PVOLUmM6Yv6RxKing", "cell_type": "markdown", "source": [ "## Data Node State: entries cannot be imported which change status from Inactive to Active" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dhRD96R8vE2HU59-grSaDg", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);", @@ -373,21 +494,33 @@ "\nActivity.HasErrors().Should().Be(true);", "\nvar log = Activity.Finish().Errors.First().ToString().Substring(40);", "\n(log.Substring(0,log.Length-2) == Get(Error.ChangeDataNodeState, \"GIC1\")).Should().Be(true);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6Ax3adBDIkuMlpHuD259GA", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OysWLQGElkmApA3NQlx07g", "cell_type": "markdown", "source": [ "## Data Node State: Validation removes the entry when the DataSource already contains a previous version " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3PbyoVI5ukuBQzBU3K4AGw", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);", @@ -411,21 +544,33 @@ "\n", "\n// Check that the new redundant State is removed from the Workspace", "\nWorkspace.Query().ToArray().Should().BeEmpty();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "VWtJVxUJek2A-Zhla7XVwQ", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "A_IYqoP4xEaSzN2_Vg5Utw", "cell_type": "markdown", "source": [ "## Data Node Parameters : Validations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jnMxJBaIy0iLBPXrb0-spQ", "cell_type": "code", "source": [ "public async Task CheckErrors(string inputFileName, List errorBms)", @@ -434,9 +579,13 @@ "\n Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", "\n errorBms.Intersect(log.Errors.Select(x => x.ToString().Substring(0,x.ToString().Length-2).Substring(40)).ToArray()).Count().Should().Be(errorBms.Count());", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GFhYIK8kQU2Qo1jjODs8_w", "cell_type": "code", "source": [ "var inputFileName = \"Data/DataNodeParameter_InvalidDataNode.csv\";", @@ -444,30 +593,45 @@ "\n Get(Error.InvalidDataNode, \"DataNodeInvalid1\"),", "\n Get(Error.InvalidDataNode, \"DataNodeInvalid2\")};", "\nawait CheckErrors(inputFileName, errorsBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uY5fv5iAuUuPnKjSik1_qQ", "cell_type": "code", "source": [ "var inputFileName = \"Data/DataNodeParameter_Duplicate.csv\";", "\nvar errorsBm = new List(){Get(Error.DuplicateSingleDataNode, \"DT1.1\"),", "\n Get(Error.DuplicateInterDataNode, \"DT1.1\",\"DTR1.1\"),};", "\nawait CheckErrors(inputFileName, errorsBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "S_PoUgCd3kWhDZ0K3Dp5ng", "cell_type": "code", "source": [ "var inputFileName = \"Data/DataNodeParameter_InvalidReinsCov.csv\";", "\nvar errorsBm = new List(){Get(Error.ReinsuranceCoverageDataNode, \"DT1.1\",\"DT1.1\")};", "\nawait CheckErrors(inputFileName, errorsBm);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CPwWIPYorkGHUKRtmHIkdw", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ReportStorageTest.ipynb b/full-ifrs17-template/Test/ReportStorageTest.ipynb index 5fc57968..45305ec0 100644 --- a/full-ifrs17-template/Test/ReportStorageTest.ipynb +++ b/full-ifrs17-template/Test/ReportStorageTest.ipynb @@ -18,25 +18,38 @@ "nbformat_minor": 5, "cells": [ { + "id": "D-7JQE_SnUOihXCor_sygQ", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rSHUxHrWf0eGpJlmtEieVw", "cell_type": "markdown", "source": [ "# Test Exchange Rate Query" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bfJP3e-LP0uEsVPX1d-owg", "cell_type": "code", "source": [ "Workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "O-C-vhVxNkupDBDl38H7hw", "cell_type": "code", "source": [ "public async Task CheckGetFx(string currentCurrency, string targetCurrency, int year, int month, IEnumerable testData, double fxBOPBenchmark, double fxAVGBenchmark, double fxEOPBenchmark)", @@ -60,9 +73,13 @@ "\n ", "\n await Workspace.DeleteAsync(Workspace.Query().ToArray());", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mbralKJV4Uu31Rk1uV7qzA", "cell_type": "code", "source": [ "var testData = new ExchangeRate[] {new ExchangeRate{ Currency = \"EUR\", Year = 2020, Month = 12, FxType = FxType.Spot, FxToGroupCurrency = 10 }, ", @@ -73,19 +90,30 @@ "\n new ExchangeRate{ Currency = \"USD\", Year = 2021, Month = 6, FxType = FxType.Average, FxToGroupCurrency = 2 },", "\n new ExchangeRate{ Currency = \"USD\", Year = 2021, Month = 6, FxType = FxType.Spot, FxToGroupCurrency = 0.5 }};", "\nawait CheckGetFx(\"EUR\", \"USD\", 2021, 6, testData, 2, 10, 60);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3unkYVADQEGtn7_7XVHPEg", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rQ4xwp8ggUKcrL-V3XIOcA", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ReportVariablesTest.ipynb b/full-ifrs17-template/Test/ReportVariablesTest.ipynb index cbaca38e..4e8088c9 100644 --- a/full-ifrs17-template/Test/ReportVariablesTest.ipynb +++ b/full-ifrs17-template/Test/ReportVariablesTest.ipynb @@ -18,94 +18,151 @@ "nbformat_minor": 5, "cells": [ { + "id": "n3ED-3EkxkuED3NiSerohA", "cell_type": "markdown", "source": [ "

Test Reports

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jEW2JcFV1UqH9OxxrCWEEg", "cell_type": "markdown", "source": [ "# Infrastructure and Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jrvWTVmt0U2tdCG7sYizeg", "cell_type": "markdown", "source": [ "## Imports and Configurations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2HW97YdZKUOnq-DRyvt3Uw", "cell_type": "code", "source": [ "#r \"nuget:FluentAssertions\" " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "w7sYIzs9ykulzszdiIyXGg", "cell_type": "code", "source": [ "#!import \"ReportVariablesTestBase\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jk5ZRZUAoUCXUNcy1_1eXA", "cell_type": "markdown", "source": [ "## Storage" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "C7GJzm1J-EuPR9aGuWZwQg", "cell_type": "code", "source": [ "var reportStorage = new ReportStorage(Workspace, Report);", "\nawait reportStorage.InitializeReportIndependentCacheAsync();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LzDL_aRFO0etCQGzAUu0vg", "cell_type": "markdown", "source": [ "## Configurations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Y42oT-3UIU-VktHZCgIgMA", "cell_type": "code", "source": [ "var path = \"./Data/ReportVariableBenchmarks/\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "a8qO17ZhGk2lD513BUl1kg", "cell_type": "code", "source": [ "((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) args;", "\nICollection scopesData;", "\nICollection benchmarkData;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yNI1-7C-DkCwPylFdztLLg", "cell_type": "markdown", "source": [ "# Test Cases" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DG6J_osu7EG_geAlI15nDQ", "cell_type": "markdown", "source": [ "## ((2020, 12), \"CH\", null, CurrencyType.Contractual)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_9qOvBWy9kWXqjvg2Ojx-Q", "cell_type": "code", "source": [ "args = ((2020, 12), \"CH\", null, CurrencyType.Contractual);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oZphaPxRS0Cr60WeHFtueA", "cell_type": "code", "source": [ "scopesData = await GetScopesDataAsync(args, reportStorage, Scopes);", "\nbenchmarkData = await GetBenchmarkDataAsync(args, path, Workspace, Import);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ezagEsinVkq0-jfyCtYp9A", "cell_type": "code", "source": [ "scopesData.Should().BeEquivalentTo(benchmarkData,", @@ -118,28 +175,44 @@ "\n .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, BenchmarkPrecision))", "\n .WhenTypeIs()", "\n );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Rll-mqrAM0-4SIC9DLFDwA", "cell_type": "markdown", "source": [ "## ((2021, 3), \"CH\", null, CurrencyType.Contractual)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "O9tsdJU1VUWk5_AsCG7iQA", "cell_type": "code", "source": [ "args = ((2021, 3), \"CH\", null, CurrencyType.Contractual);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NrAH0jftEkKUA-mvSJBY8w", "cell_type": "code", "source": [ "scopesData = await GetScopesDataAsync(args, reportStorage, Scopes);", "\nbenchmarkData = await GetBenchmarkDataAsync(args, path, Workspace, Import);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vBqjLjwokUKpiME0hFnzxQ", "cell_type": "code", "source": [ "scopesData.Should().BeEquivalentTo(benchmarkData,", @@ -152,13 +225,20 @@ "\n .Using(ctx => ctx.Subject.Should().BeApproximately(ctx.Expectation, Precision))", "\n .WhenTypeIs()", "\n );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Q2klv4_48EmNfNAi7QNdZQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ReportVariablesTestBase.ipynb b/full-ifrs17-template/Test/ReportVariablesTestBase.ipynb index 99e9ac16..5593b6f7 100644 --- a/full-ifrs17-template/Test/ReportVariablesTestBase.ipynb +++ b/full-ifrs17-template/Test/ReportVariablesTestBase.ipynb @@ -18,48 +18,77 @@ "nbformat_minor": 5, "cells": [ { + "id": "OfXdxxCELEGQtjyg7Em6yQ", "cell_type": "markdown", "source": [ "

Report Variable Test Base

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MXuHvMBcyU6DSwnzBvDrOw", "cell_type": "code", "source": [ "#!import \"../Initialization/InitSystemorphToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "r3DErbUXa0GbhAkpyzPxCw", "cell_type": "code", "source": [ "Workspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KK8NJ8Kn1kqC5rY_2kCkRg", "cell_type": "markdown", "source": [ "# Helpers" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_jzXNzU3P02T6qxgFz5DGg", "cell_type": "code", "source": [ "const string benchmarkFileNamePrefix = \"ReportVariableBenchmarks_\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CH-fLI1W7kqtm9mGUtCEfw", "cell_type": "code", "source": [ "static string GetBenchmarkFileName(((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) args) => args.ToString().Replace(\"(\", \"\").Replace(\")\", \"\").Replace(\" \", \"\").Replace(\",\", \"_\");" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sW00wUjChEa73rX2vWQAoA", "cell_type": "markdown", "source": [ "# Calculated" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oV0C7FIcU0e_8DCrad0TkA", "cell_type": "code", "source": [ "static ICollection GetScopesData(Systemorph.Vertex.Scopes.IScopeWithStorage universe, ICollection<(ReportIdentity, CurrencyType)> identities) {", @@ -98,9 +127,13 @@ "\n .OrderBy(v => v.GroupOfContract).ThenBy(v => v.Scenario).ThenBy(v => v.Projection).ThenBy(v => v.AccidentYear).ThenBy(v => v.EstimateType).ThenBy(v => (v.VariableType, v.Novelty))", "\n .ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8lMXT1ZNw0KM3pDqhdlmsQ", "cell_type": "code", "source": [ "static async Task> GetScopesDataAsync(((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) args, ReportStorage reportStorage, Systemorph.Vertex.Scopes.Proxy.IScopeFactory scopes ) {", @@ -109,15 +142,23 @@ "\n var universe = scopes.ForSingleton().WithStorage(reportStorage).ToScope();", "\n return GetScopesData(universe, identities);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8vcku7aLC0WSTTyYO5gapQ", "cell_type": "markdown", "source": [ "# Benchmarks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eUmau60eO0CVOS0nctUgDQ", "cell_type": "code", "source": [ "static async Task> GetBenchmarkDataAsync(((int Year, int Month) Period, string ReportingNode, string Scenario, CurrencyType CurrencyType) args, string path, IWorkspace workspace, IImportVariable importVariable) {", @@ -129,7 +170,10 @@ "\n workspace.Reset(x => x.ResetCurrentPartitions().ResetType());", "\n return ret;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/ScenarioTest.ipynb b/full-ifrs17-template/Test/ScenarioTest.ipynb index c86a432b..88646c21 100644 --- a/full-ifrs17-template/Test/ScenarioTest.ipynb +++ b/full-ifrs17-template/Test/ScenarioTest.ipynb @@ -16,48 +16,73 @@ "nbformat_minor": 5, "cells": [ { + "id": "AxJoK7p0ZEikTWZszSK7UQ", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bgViMPoQM02MCvRfuRHl7w", "cell_type": "markdown", "source": [ "# Context" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7Xfmz9pFvE6I6S2B4NHMGw", "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": [] }, { + "id": "0VAf4yddEUOUDuScbDjM_w", "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": [] }, { + "id": "M9d9pYiEbk6gAY96p8hI2A", "cell_type": "code", "source": [ "var defaultVarsBE = Workspace.Query().ToArray();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_-nNIt_H2k2zv5Ibul0djQ", "cell_type": "markdown", "source": [ "# Scenario Cashflows" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3eInMKlI1kmMxVzPEbL7fw", "cell_type": "code", "source": [ "var cashflows_scenarioTest = @\"", @@ -70,9 +95,13 @@ "\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": [] }, { + "id": "S9PeLiV2B0SNvYbYxid_xA", "cell_type": "code", "source": [ "var cashflows_scenarioTest_equalTo_BestEstimate = @\"", @@ -85,18 +114,26 @@ "\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": [] }, { + "id": "D62FZxiYFEunrBSsfdn96A", "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": [] }, { + "id": "TZowMnri7EaX3jCDg7pEmw", "cell_type": "code", "source": [ "await Workspace.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", @@ -104,15 +141,23 @@ "\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": [] }, { + "id": "PMUFzN4SSUCmJ1DPrFqlpQ", "cell_type": "markdown", "source": [ "# Scenario Actuals" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wcUzBjX4rkmEmLoUol7Weg", "cell_type": "code", "source": [ "var actuals_scenarioTest = @\"", @@ -122,9 +167,13 @@ "\n@@Actual", "\nDataNode,AocType,ValueType,AccidentYear,Value", "\nDT1.1,CF,NIC,,-308\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "layYHEbmVky9lqX_ZWDryg", "cell_type": "code", "source": [ "var actuals_scenarioTest_equalTo_BestEstimate = @\"", @@ -134,18 +183,26 @@ "\n@@Actual", "\nDataNode,AocType,ValueType,AccidentYear,Value", "\nDT1.1,CF,NIC,,-280\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "j-dxFUVPfEaRhZpGuDPd8g", "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": [] }, { + "id": "ZJQHdd7UWUWU5kC0i4eisw", "cell_type": "code", "source": [ "await Workspace.Partition.SetAsync(new{ReportingNode = \"CH\", Scenario = \"Test\", Year = 2020, Month = 12});", @@ -153,43 +210,66 @@ "\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": [] }, { + "id": "csPTUe173UWekIIcmPUCuw", "cell_type": "markdown", "source": [ "# Robustness: back to Best Estimate" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "crKKS7_XGk6NeuFAgakr0g", "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": [] }, { + "id": "P-sUQjsyOUSNfI7RLgEJMQ", "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": [] }, { + "id": "Q2FeKDKw7kedk-qOC3uK4A", "cell_type": "code", "source": [ "Workspace.Query().Except(defaultVarsBE, IfrsVariableComparer.Instance()).ToArray().Length.Should().Be(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sC_GMD2sbECP6PN620THIg", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/SequenceImportTest.ipynb b/full-ifrs17-template/Test/SequenceImportTest.ipynb index cfbc24c3..927dacc9 100644 --- a/full-ifrs17-template/Test/SequenceImportTest.ipynb +++ b/full-ifrs17-template/Test/SequenceImportTest.ipynb @@ -16,106 +16,170 @@ "nbformat_minor": 5, "cells": [ { + "id": "lT6-ULeaLkCjHnJPRMVzZw", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "r8NoIEbwSUOe4IGLlZFmKw", "cell_type": "markdown", "source": [ "# Cashflow -> Actuals" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0gDULLGzvEW8v5jg0vRrjQ", "cell_type": "code", "source": [ "var ws1 = Workspace.CreateNew();", "\nws1.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Pz3H5OYg0E26NZvdiCWCeg", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0kv-mqLlQkquKj4WurtKzQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2UA1ZnfH3UipDQ1TnW8J9A", "cell_type": "code", "source": [ "ws1.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", "\nws1.Initialize(x => x.FromSource(DataSource));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6Zv5wDEHp0ejngPzm70Uug", "cell_type": "code", "source": [ "var ifrsVars1 = await ws1.Query().ToArrayAsync();", "\nifrsVars1.Count()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6Ptjc2FbG0-LBe6nw1BIdA", "cell_type": "markdown", "source": [ "# Actuals -> Cashflow" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "82iAzppfNkqb5SpUKsi8pA", "cell_type": "code", "source": [ "var ws2 = Workspace.CreateNew();", "\nws2.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "UgadDCbuM0qHwMnrQkN-TQ", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4S9H9rEKb0yCeAF4IyKWMw", "cell_type": "code", "source": [ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JqkyqzHW9Eazf8YuELjfOg", "cell_type": "code", "source": [ "ws2.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());", "\nws2.Initialize(x => x.FromSource(DataSource));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EpWHnU8f10qpBtUfsHT6MA", "cell_type": "code", "source": [ "var ifrsVars2 = await ws2.Query().ToArrayAsync();", "\nifrsVars2.Count()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HNS3Oub88kqttNJZXJ3xjw", "cell_type": "markdown", "source": [ "# Test" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XHa4H0YDOEuNvjfy0CL-8A", "cell_type": "code", "source": [ "ifrsVars1.Except(ifrsVars2, IfrsVariableComparer.Instance()).Count().Should().Be(0);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "q7E4H2BDAke4TLC0oSQtuA", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/TechnicalMarginTest.ipynb b/full-ifrs17-template/Test/TechnicalMarginTest.ipynb index 827833ed..8256ed07 100644 --- a/full-ifrs17-template/Test/TechnicalMarginTest.ipynb +++ b/full-ifrs17-template/Test/TechnicalMarginTest.ipynb @@ -18,45 +18,70 @@ "nbformat_minor": 5, "cells": [ { + "id": "i-PJ_EbKKUuy-mN1LlBMNQ", "cell_type": "markdown", "source": [ "

Technical Margin Allocation

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0nWYqIzjFEiBzB7hPQOrWw", "cell_type": "code", "source": [ "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6Wpl9e-2Ike62_H1mswKBQ", "cell_type": "markdown", "source": [ "# Workspace Initialization " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hXJrXlCyBUWqzF9TYY4pQg", "cell_type": "code", "source": [ "Workspace.Initialize(x => x.FromSource(DataSource)", "\n .DisableInitialization()", "\n .DisableInitialization());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dsGn5owwTkSqoOzILS2fuA", "cell_type": "markdown", "source": [ "# Test switch logic" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FAJtV21jM0SnurHMD958jw", "cell_type": "code", "source": [ "//define group of contract", "\nvar groupOfContract = \"DT1.1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_r9tBgRmo0yWpWOrVOogww", "cell_type": "code", "source": [ "//Define partition", @@ -64,9 +89,13 @@ "\n var partition = Workspace.Query().FirstOrDefault(x => x.ReportingNode == args.ReportingNode && x.Year == args.Year && ", "\n x.Month == args.Month && x.Scenario == args.Scenario);", "\n if(partition == null) ApplicationMessage.Log(Error.PartitionNotFound);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jT2AUILrHUyhaSmU-w039g", "cell_type": "code", "source": [ "public async Task CheckSwitchLogicAsync(IEnumerable inputDataSet, Dictionary csmLcSwitchBenchmark)", @@ -134,9 +163,13 @@ "\n ", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "f5gdp2GlKUehTXeQ_SvCIw", "cell_type": "code", "source": [ "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfContract, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", @@ -161,9 +194,13 @@ "\n };", "\n", "\nawait CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WPvTHMwp5EqJmWNsjt81fA", "cell_type": "code", "source": [ "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfContract, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", @@ -188,9 +225,13 @@ "\n };", "\n", "\nawait CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fRgoEiIujky1sZ9hnyj78A", "cell_type": "code", "source": [ "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfContract, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", @@ -211,9 +252,13 @@ "\n };", "\n", "\nawait CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xdTbysPGFkeRLHr0sUBUlA", "cell_type": "code", "source": [ "var basicIfrsVariable = new IfrsVariable{Partition = partition.Id, DataNode = groupOfContract, AccidentYear = null, AmountType = \"PR\", EstimateType = \"BE\", EconomicBasis = \"L\"};", @@ -247,13 +292,20 @@ "\n };", "\n", "\nawait CheckSwitchLogicAsync(inputDataSet, csmLcSwitch_benchmark);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dTZEjO9WM0uCJgoboB4qhw", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/full-ifrs17-template/Test/Tests.ipynb b/full-ifrs17-template/Test/Tests.ipynb index 2b7fefcb..1c330cb5 100644 --- a/full-ifrs17-template/Test/Tests.ipynb +++ b/full-ifrs17-template/Test/Tests.ipynb @@ -18,82 +18,134 @@ "nbformat_minor": 5, "cells": [ { + "id": "MQ7XPYnTFEOMHrtoB3Oerg", "cell_type": "markdown", "source": [ "

Tests

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8IHp-7c15Uq0vxaFsrXmzQ", "cell_type": "code", "source": [ "#!eval-notebook \"IfrsVariablesTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-uvPzzVPT0-Y54bxFtKl0g", "cell_type": "code", "source": [ "#!eval-notebook \"ImportStorageTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HvLhnrHPakG-RHLDv1YlTw", "cell_type": "code", "source": [ "#!eval-notebook \"ReportStorageTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GHLqatm6zEix6r7rBO-VVg", "cell_type": "code", "source": [ "#!eval-notebook \"AocStructureTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "H39eZoIm9Uu2XuyAa0Sg_Q", "cell_type": "code", "source": [ "#!eval-notebook \"TechnicalMarginTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sLb7AsZlOUyGeRzwfKoM-Q", "cell_type": "code", "source": [ "#!eval-notebook \"SequenceImportTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "B_dzy6sUvUKc2e3m81pOJg", "cell_type": "code", "source": [ "#!eval-notebook \"ScenarioTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hWVGU3WYHkycqipZOO1fFw", "cell_type": "markdown", "source": [ "---" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dZoX6ICHOkGWZZzUHjZ9DQ", "cell_type": "code", "source": [ "#!eval-notebook \"MapTemplateAndImportTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1YHxPQejxkGzdzCOLao7HQ", "cell_type": "markdown", "source": [ "---" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kXdtF5erPkm1bfIJoQ7S6g", "cell_type": "code", "source": [ "#!eval-notebook \"ReportVariablesTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "W9Bknri1XkC2erPpRjyrjQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 13b87df7..a130e870 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -16,6 +16,7 @@ "nbformat_minor": 5, "cells": [ { + "id": "lx6moIFczkyb5a8hEBu_6Q", "cell_type": "code", "source": [ "#!import \"DataModel/DataStructure\"", @@ -23,13 +24,20 @@ "\n#!import \"Import/Importers\"", "\n#!import \"Export/ExportConfiguration\"", "\n#!import \"Utils/TestHelper\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Tc-fiN15c0q-DNnqPEEVQg", "cell_type": "code", "source": [ "var ifrs17Report = new Ifrs17Reports(Workspace, Scopes, Report);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Constants/Consts.ipynb b/ifrs17/Constants/Consts.ipynb index 9d54b276..0e0a411d 100644 --- a/ifrs17/Constants/Consts.ipynb +++ b/ifrs17/Constants/Consts.ipynb @@ -19,120 +19,197 @@ "nbformat_minor": 5, "cells": [ { + "id": "tozdHqMbAkO8Ttd_Z-FPQw", "cell_type": "markdown", "source": [ "

Consts

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lqga2fWJikO2K6CkYd0uNQ", "cell_type": "markdown", "source": [ "# Numerical Precision" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "92t7bfloDk-X5dbxj8-BzA", "cell_type": "code", "source": [ "public const double Precision = 1E-5;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tU4Y0UN8FkWG4j6fdhnEdg", "cell_type": "code", "source": [ "public const double ProjectionPrecision = 1E-3;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AQz0euBRNkyhgAPTzk8kJA", "cell_type": "code", "source": [ "public const double BenchmarkPrecision = 1E-4;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZEsXT31ETE--9F4_5F7OoQ", "cell_type": "markdown", "source": [ "# Time Period" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-PEstjbAfE2GTGXiNFlkzA", "cell_type": "code", "source": [ "public const int CurrentPeriod = 0; " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Lt52PYx8LUSbxE-o4dGlUQ", "cell_type": "code", "source": [ "public const int PreviousPeriod = -1; " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KBZJtyq_206bd_HK1F6yNw", "cell_type": "code", "source": [ "public const int MonthInAYear = 12;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7o1TktT0akubYO5_0tMJ5w", "cell_type": "markdown", "source": [ "# Defaults" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Tibnci4N-0-dkhVAS2c69g", "cell_type": "code", "source": [ "public const int DefaultDataNodeActivationMonth = 1;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nMozFF7qoUKtssTOwgYi2A", "cell_type": "code", "source": [ "public const double DefaultPremiumExperienceAdjustmentFactor = 1.0;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CzLFY5d-nEmoKLUyhvG9aA", "cell_type": "markdown", "source": [ "# Names" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9nQYRJNFO0OR5QKOtr40ZQ", "cell_type": "code", "source": [ "public const string Main = nameof(Main);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4vArq04Dc0SUQ1B8pnTYIg", "cell_type": "code", "source": [ "public const string Default = nameof(Default);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bTl8GyvuRkGBooAK9zlXLg", "cell_type": "code", "source": [ "public const string ValueType = nameof(ValueType);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ziRQ7cjXbESP3l2CdNBYGQ", "cell_type": "markdown", "source": [ "GroupCurrency defines the SystemName (from Currency Dimension) to be used as the Group Currency." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "A9ITNucOV02h-mBUmn3lsQ", "cell_type": "code", "source": [ "public const string GroupCurrency = \"CHF\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QlC_r7WQ7kOmdj8kKb5aNw", "cell_type": "markdown", "source": [ "# Import Formats" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "C8v98kZ_aEWi1JyDSiGkzA", "cell_type": "code", "source": [ "public static class ImportFormats{", @@ -147,15 +224,23 @@ "\n", "\n public const string AocConfiguration = nameof(AocConfiguration); // Importer for Analysis of Change Configuration settings", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XWnM8TzYv0ytgc74W9RuiA", "cell_type": "markdown", "source": [ "# IFRS specific" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "phrHTtbxI0OYX3MaAVo2Tg", "cell_type": "code", "source": [ "public static class ValuationApproaches{", @@ -163,18 +248,26 @@ "\n public const string VFA = nameof(VFA); //Variable Fee Approach", "\n public const string PAA = nameof(PAA); //Premium Allocation Approach", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Db-Dvk_gpU2pI_BFacjbCg", "cell_type": "code", "source": [ "public static class LiabilityTypes{", "\n public const string LRC = nameof(LRC); //Liability for Remaining Coverage", "\n public const string LIC = nameof(LIC); //Liability Incurred Claims", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fQo3LSnzhUGkWwVbf21L1A", "cell_type": "code", "source": [ "public static class EstimateTypes{", @@ -195,9 +288,13 @@ "\n public const string AAPA = nameof(AAPA); //Experience Adjusted Advance Actual Premium to Csm", "\n public const string OAPA = nameof(OAPA); //Experience Adjusted Overdue Actual Premium to Csm", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "B7toQMiP_0qZXm43pyxShw", "cell_type": "code", "source": [ "public static class AocTypes{", @@ -219,9 +316,13 @@ "\n public const string FX = nameof(FX); // Foreing Exchange", "\n public const string EOP = nameof(EOP); // End of Period (closing value of an AOC chain)", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HulL6n-6IkWevFLCSC9hDQ", "cell_type": "code", "source": [ "public static class Novelties{", @@ -229,9 +330,13 @@ "\n public const string N = nameof(N); //New Business", "\n public const string C = nameof(C); //All Novelties Combined", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yejc0ve4BEe-oAi5YgJJDw", "cell_type": "code", "source": [ "public static class EconomicBases{", @@ -239,9 +344,13 @@ "\n public const string C = nameof(C); //Current Interest Rates", "\n public const string N = nameof(N); //Nominal Interest Rates", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qeXt2V5wQ0S2TiixZhHlHg", "cell_type": "code", "source": [ "public static class AmountTypes{", @@ -258,9 +367,13 @@ "\n public const string AC = nameof(AC); // Attributable Commissions", "\n public const string AE = nameof(AE); // Attributable Expenses", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nuYnoG2NB0WPGTggymtcLg", "cell_type": "code", "source": [ "public static class Scenarios{", @@ -281,22 +394,33 @@ "\n public const string LICUP10pct = nameof(LICUP10pct); // Lic Up 10pct", "\n public const string LICDW10pct = nameof(LICDW10pct); // Lic Down 10pct", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "aX8Ixs4Q3EOw3EmvsvyFng", "cell_type": "markdown", "source": [ "# Insurance specific" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xO1Ga-uPsES_cjwlbNf1yw", "cell_type": "code", "source": [ "public static class LineOfBusinesses{", "\n public const string LI = nameof(LI); //Life", "\n public const string NL = nameof(NL); //Non-Life", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Constants/Enums.ipynb b/ifrs17/Constants/Enums.ipynb index 04c87848..5b4ccc1a 100644 --- a/ifrs17/Constants/Enums.ipynb +++ b/ifrs17/Constants/Enums.ipynb @@ -19,40 +19,61 @@ "nbformat_minor": 5, "cells": [ { + "id": "xWFL-UDyVkKeoXQRsDI7YQ", "cell_type": "markdown", "source": [ "# Enumerables", "\n", "\nIn the case of data which is not expected to change over time, it is convenient to introduce such data as variables of type \"enumerable\"." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lYFecRN4gkuJ-bMXNO9DnQ", "cell_type": "markdown", "source": [ "## Exchange Rates", "\n", "\nFor exchange rates, we set the type for which the rates apply:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "h_kYaWMEjkGKhJBHv5ZTOA", "cell_type": "code", "source": [ "public enum FxType { Spot, Average }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "79eI1G0CiE2WMkFq2s3ung", "cell_type": "code", "source": [ "public enum FxPeriod { NotApplicable, BeginningOfPeriod, Average, EndOfPeriod }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bMmXBU5L1EiXVURfzYrfhg", "cell_type": "markdown", "source": [ "## Currency Types" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ThheUoz160CrIXKT0-N2NQ", "cell_type": "markdown", "source": [ "Currency Types define which currency is used as standard at different aggregation levels (in the Data Level hierarchy).", @@ -60,101 +81,165 @@ "\n- Group: this is the standard Currency Type at Group level", "\n- Contractual: this is the standard Currency Type at Data Node level", "\n- Transactional: this is the standard Currency Type at Transactional level (used typically for Actuals)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jFSshWJs3km8UAmJUvoUWA", "cell_type": "code", "source": [ "public enum CurrencyType { Functional, Group, Contractual, Transactional }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HcVv9bIVN0CTv_BR3h38KA", "cell_type": "markdown", "source": [ "## Period Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QQ_1DwAHIUWlTKSktjtX5w", "cell_type": "code", "source": [ "public enum PeriodType { NotApplicable, BeginningOfPeriod, EndOfPeriod }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IWLntYaWLUCby854KcCzPQ", "cell_type": "markdown", "source": [ "## Valuation Period" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fxCUAx87AEKTJXenM6OrSw", "cell_type": "code", "source": [ "public enum ValuationPeriod { NotApplicable, BeginningOfPeriod, MidOfPeriod, Delta, EndOfPeriod }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Iua4aiPYeUSkSdOZBIHwNQ", "cell_type": "markdown", "source": [ "## Portfolio View" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "N7qSoOiDaEG0mbO_prv_9w", "cell_type": "code", "source": [ "[Flags] public enum PortfolioView { Gross = 1, Reinsurance = 2, Net = Gross | Reinsurance }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ofzaBHXeLUGsPwp53tWk4A", "cell_type": "markdown", "source": [ "## Structure Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NJmE1eEV_Uuey166OH3U_g", "cell_type": "code", "source": [ "public enum StructureType { None, AoC }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "t6CUcWp67ESaBdUmxsyJ8A", "cell_type": "markdown", "source": [ "## State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YSkBfw3IHEuyoW2lvsOC7g", "cell_type": "markdown", "source": [ "State describes the state in which a Data Node can be - There are two types of states:", "\n- Active: visible in reports and queries", "\n- Inactive: not visible in reports and queries" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sqXQ1mcVxEit4CgNnQPAXA", "cell_type": "code", "source": [ "public enum State { Active, Inactive }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oThs73B7kkyDAHtyVfg5QA", "cell_type": "markdown", "source": [ "## Periodicity" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TAHQhWhLr0mR59KmOekVrQ", "cell_type": "code", "source": [ "public enum Periodicity { Monthly, Quarterly, Yearly }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kBck_5hoX0yAEEWJHOKRsg", "cell_type": "markdown", "source": [ "## Input Source" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rfBIAwenWUa1zipcMY1qnQ", "cell_type": "code", "source": [ "[Flags]", @@ -163,31 +248,50 @@ "\n//Opening + Cashflow = 5", "\n//Actual + Cashflow = 6", "\n//Opening + Actual + Cashflow = 7" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7dL-4X1fUEiQSzYaooPprg", "cell_type": "markdown", "source": [ "## Data Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WPim6MSI-UWnSqnOfEbFxw", "cell_type": "code", "source": [ "public enum DataType { Optional, Mandatory, Calculated, CalculatedTelescopic }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nPBJqeOjdEibtyin5hzeUQ", "cell_type": "markdown", "source": [ "## Import Scope" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pU2UM-nbJ0-aG0rhi86JLw", "cell_type": "code", "source": [ "public enum ImportScope { Primary, Secondary }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 61e79c34..9c7fc17c 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -19,25 +19,38 @@ "nbformat_minor": 5, "cells": [ { + "id": "XVEH7X-d10OpDfN_HGsgWw", "cell_type": "markdown", "source": [ "

Errors and Warnings

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "X6KZCCXZXUiL9T5SxOhs6Q", "cell_type": "code", "source": [ "#!import \"Enums\"", "\n#!import \"Consts\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XeX545EVhUujhEkMkdUSbQ", "cell_type": "markdown", "source": [ "# Codes" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BPYWZkdC6UaNstT83ZmPqQ", "cell_type": "code", "source": [ "public enum Warning {", @@ -46,9 +59,13 @@ "\n // Default", "\n Generic", "\n}; " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-g7L46bNBUi0ZX88o37kBw", "cell_type": "code", "source": [ "public enum Error { ", @@ -77,15 +94,23 @@ "\n // Default", "\n Generic", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NLh7KHTP4ESl-nGxh_T64Q", "cell_type": "markdown", "source": [ "# Messages" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "N0nqsxkmUka6GK5XzE71xg", "cell_type": "code", "source": [ "public static string Get (Error e, params string[] s) => (e, s.Length) switch ", @@ -153,9 +178,13 @@ "\n (Error.Generic , _) => $\"{s[0]}\",", "\n (_ , _) => $\"Error not found.\"", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qxv841q1gkOJt-zqkEwcZQ", "cell_type": "code", "source": [ "public static string Get (Warning w, params string[] s) => (w, s.Length) switch {", @@ -165,13 +194,20 @@ "\n (Warning.Generic , _) => $\"{s[0]}\",", "\n (_ , _) => $\"Warning not found.\"", "\n};" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DobUDUwhxUWanDJDmzxJ8Q", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] -} +} \ No newline at end of file diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 2f63475c..dc35c01d 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -19,28 +19,41 @@ "nbformat_minor": 5, "cells": [ { + "id": "vvMYbQ5-bEKq_A2vJ_DmRA", "cell_type": "markdown", "source": [ "", "\n

Data Model

", "\n", "\nThis notebook has the main structures used to hold data - This is usually called the **data model**." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6fcBzsfTH0e5CiWZtlKLtw", "cell_type": "markdown", "source": [ "# References", "\nThis section initializes libraries and code from other notebooks, which will be used here, as well as information needed for querying data from the database." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "n4jj6X3ycEap0QydisZJvw", "cell_type": "markdown", "source": [ "## Libraries" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zUmmhub5NES3DO-kz0dAnQ", "cell_type": "code", "source": [ "#r \"nuget:Systemorph.Activities,1.5.7\"", @@ -57,15 +70,23 @@ "\n#r \"nuget:Systemorph.DataSource,1.5.4\"", "\n#r \"nuget:Systemorph.DataSource.Conversions,1.5.4\"", "\n#r \"nuget:Systemorph.Reporting,1.5.7\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D9W0OLZ5G0qyvEYQxfSLew", "cell_type": "markdown", "source": [ "## Usings" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nlOhRlJHvk-F0uDp6VMMlw", "cell_type": "code", "source": [ "using System.ComponentModel.DataAnnotations;", @@ -75,29 +96,45 @@ "\nusing Systemorph.Vertex.Activities;", "\nusing Systemorph.Vertex.Import;", "\nusing static Systemorph.Vertex.Arithmetics.ArithmeticOperations;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "50Tr9UVLkE-2gM0G6oVEnQ", "cell_type": "markdown", "source": [ "## Notebooks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NKLM1yXTtU2Ti8W3ihDigw", "cell_type": "code", "source": [ "#!import \"../Constants/Enums\"", "\n#!import \"../Constants/Consts\"", "\n#!import \"../Constants/Validations\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WrFH5QlWuk2M_JmM06sq8A", "cell_type": "markdown", "source": [ "# Data Infrastructure" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ohM1Biwwe0eZ1b-HaHop9Q", "cell_type": "markdown", "source": [ "", @@ -105,51 +142,79 @@ "\nThe following interfaces are used to define the granularity at which data is stored.", "\n", "\nFor instance, the IKeyed interface corresponds to the lowest granularity which is simply a unique identifier for a certain generic piece of data:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-MQGfu51EkyCmQryoyg9mg", "cell_type": "code", "source": [ "public interface IKeyed", "\n{ ", "\n public Guid Id { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "12_68uyAs0GIWjs7tV5EQA", "cell_type": "markdown", "source": [ "The interface IPartition identifies the partitions in the system." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AlL0TcQlpkq8jqpV2BKhkw", "cell_type": "code", "source": [ "public interface IPartition : IKeyed {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0YssLND4Ake3pVnlzyDWDw", "cell_type": "markdown", "source": [ "The interface IPartitioned simply assigns a unique identifier for elements of a data partition - The exact definition of such elements can be found in the [partition](#partition) section below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "C_K3oA4OAU-LQiaHkTW4Tw", "cell_type": "code", "source": [ "public interface IPartitioned", "\n{", "\n public Guid Partition { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "z-6_NJX8rEeP2QxJvJ1iOw", "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": [] }, { + "id": "kl63jpe0oE6L_8z668bdPQ", "cell_type": "code", "source": [ "public interface IHierarchy", @@ -160,15 +225,23 @@ "\n ", "\n public string Child { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0Ute_DjaYE2kd2UHUcFnDA", "cell_type": "markdown", "source": [ "The interface IWithYearAndMonth allows to speficy to which year and month a certain piece of data applies to:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WsvB3-kq7UGjOBaBu7IJ-Q", "cell_type": "code", "source": [ "public interface IWithYearAndMonth", @@ -177,33 +250,49 @@ "\n ", "\n public int Month { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LC_mdbBTsUGl9YAFXVcTpg", "cell_type": "markdown", "source": [ "The interface IWithYearMonthAndScenario allows to identify the year, month and scenario associated to the data:", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Iq8rP4E8k0eGgF2BjhQZGg", "cell_type": "code", "source": [ "public interface IWithYearMonthAndScenario : IWithYearAndMonth", "\n{", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HtTP2eQc90eX8Ldk4oC4bw", "cell_type": "markdown", "source": [ "", "\n## Abstract Classes", "\nThese classes are not reflected in the database, i.e. are not persisted." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hev6GlsneUqQtJultvGUFQ", "cell_type": "code", "source": [ "public abstract record KeyedRecord : IKeyed {", @@ -211,9 +300,13 @@ "\n [NotVisible] ", "\n public Guid Id { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "01cW7mL7aU6ojJyBRYnoRw", "cell_type": "code", "source": [ "public abstract record KeyedDimension : INamed {", @@ -227,18 +320,26 @@ "\n [NotVisible]", "\n public string DisplayName { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "G4Du5Lq4ekyLtRBqqmY8KQ", "cell_type": "code", "source": [ "public abstract record KeyedOrderedDimension : KeyedDimension, IOrdered {", "\n [NotVisible]", "\n public int Order { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "apV-0FaPCUC53iF8dtg4bA", "cell_type": "code", "source": [ "public abstract record KeyedOrderedDimensionWithExternalId : KeyedOrderedDimension {", @@ -246,9 +347,13 @@ "\n [Conversion(typeof(JsonConverter))]", "\n public string[] ExternalId { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c99r-95hxEGNlSWFap4psw", "cell_type": "markdown", "source": [ "", @@ -260,9 +365,13 @@ "\n- The data is easier to maintain (the data is said to be 'normalized');", "\n- The business logic is easier to read;", "\n- Easier scructuring of the data, e.g. in a data-cube." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OLKX7adzcEiBfX4ViPGUAw", "cell_type": "markdown", "source": [ "", @@ -270,23 +379,35 @@ "\nHierarchical dimensions are useful to define for example the legal structure of a company (reporting nodes and their parents).", "\n", "\nBelow we introduce the concept of a hierarchical dimension with level, which is a simple way to keep track of the \"level\" in a hierarchical dimension." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kosUH41ZvEy3T-sTMgijyg", "cell_type": "code", "source": [ "//TODO: Should this be abstract or have a reference to the type?", "\npublic record HierarchicalDimensionWithLevel(string SystemName, string DisplayName, string Parent, int Level) : IHierarchicalDimension;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Tp-41ZIa1kub9oJSD5ibqQ", "cell_type": "markdown", "source": [ "", "\n## Amount Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8eBHNXGQzEyLbfkkhfefWQ", "cell_type": "markdown", "source": [ "Amount Type is a dimension used to describe the nature of numbers. For example: Numbers associated to the payment of premiums have Amount Type 'Premiums'; Numbers associated to the payment of claims have Amount Type 'Claims'; Numbers associated to expenses have Amount Type 'Expenses'. ", @@ -294,9 +415,13 @@ "\nIt is defined as a hierarchical dimension so that higher-granularity types can be introduced. For example: 'Claim Expenses' have parent 'Claims'.", "\n", "\nAmount Types are a central piece in the IFRS 17 application and are used for instance to name the different types of cashflows. For example: There might be cashflows for 'Premiums'; Cashflows for 'Claims', etc. In case the mapping between cash flow and amount type is non-trivial, then specific mappings are introduced through the use of ExternalId." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QJYJ1Q90-UavXxYFeCGs-A", "cell_type": "code", "source": [ "public record AmountType : KeyedOrderedDimensionWithExternalId, IHierarchicalDimension", @@ -309,23 +434,35 @@ "\n [Dimension(typeof(PeriodType))]", "\n public PeriodType PeriodType { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zwL1mP_fyEaPJIo7MRDj0g", "cell_type": "markdown", "source": [ "We distinguish between amount types used for cashflows and actuals (**Present Value Amount Types**), and amount types used for deferrable values (**Deferrable Amount Types**). In particular, deferrable amount types are for costs and expenses that can be deferred to the future. These amounts are treated separately from the Present Value Amount Types because they are not considered for the calculation of Contractual Service Margin and Loss Component." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xXvF54kBF0C6mNNLJGYH9Q", "cell_type": "code", "source": [ "public record PvAmountType : AmountType {} //TODO Rename ", "\n", "\npublic record DeferrableAmountType : AmountType {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "40iqJ-O9qEGg2OiuWQvabA", "cell_type": "markdown", "source": [ "", @@ -334,9 +471,13 @@ "\nRisk drivers are used to distinguish between the different Risk Adjustment numbers. For instance: Mortality, Disability, Longevity, etc.", "\n", "\nWhen only total risk adjustment values are used, then there is no need to use risk drivers." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SORci-jtcEW5a8OFmDj2Fg", "cell_type": "code", "source": [ "public record RiskDriver : KeyedOrderedDimension, IHierarchicalDimension", @@ -345,18 +486,26 @@ "\n [Dimension(typeof(RiskDriver))]", "\n public string Parent { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nYMm-mQrj0KEBCHoXoH5hQ", "cell_type": "markdown", "source": [ "", "\n## Estimate Type", "\n", "\nEstimate Type is a dimension used to distinguish the context to which numbers belong to. For instance: Numbers for present values have Estimate Type 'Present Value'; Numbers for Risk Adjustments have Estimate Type 'Risk Adjustment'." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "m8jX-ECAtECu0gFbBS1s7g", "cell_type": "code", "source": [ "public record EstimateType : KeyedOrderedDimensionWithExternalId", @@ -370,31 +519,47 @@ "\n [Dimension(typeof(PeriodType))]", "\n public PeriodType PeriodType { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kPTZ7_RnoUqohThIWWYy0A", "cell_type": "markdown", "source": [ "", "\n## Novelty", "\n", "\nNovelty is a [dimension](#dimensions) used to identity the novelty of the business. Typical examples of Novelty are New Busines, In-Force, and Combined." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K0d74Xw5i0iPT4baRGhcPw", "cell_type": "code", "source": [ "public record Novelty : KeyedOrderedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7EP52ewzjk293OCh5CO0iA", "cell_type": "markdown", "source": [ "", "\n## Variable Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "b5paXRuxKUus4Bm6tLyi9w", "cell_type": "code", "source": [ "public record VariableType : KeyedOrderedDimension, IHierarchicalDimension", @@ -402,9 +567,13 @@ "\n [Display(Order = 10)]", "\n public string Parent { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wFBlWBk4c0in2LsXyLqbBA", "cell_type": "markdown", "source": [ "", @@ -418,9 +587,13 @@ "\n- It is the first AocType for the Combined Novelty and therefore it carries the contribution of combining In force and New business.", "\n- Its present value is computed as telescoping difference with the last AoC Step for the In-Force novelty and the New Business novelty.", "\n- In the technical margin calculation it is used to merge the profitability of the In-Force and New business components, which may result in a forced switch." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kDoD4QjYMUGAzXwEvCwf-A", "cell_type": "code", "source": [ "public record AocType : VariableType", @@ -429,92 +602,144 @@ "\n [Dimension(typeof(AocType))]", "\n public string Parent { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nDI4hKR530udvpIoO6ixsQ", "cell_type": "code", "source": [ "public record AocStep(string AocType, string Novelty){}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "U4FRFJw6u0eSeSy4yO1pWg", "cell_type": "markdown", "source": [ "", "\n### PnL Variable Type", "\n", "\nThe PnlVariableType is used to describe the various profit and loss sections and the corresponding hierarchy." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LMKMAXnc3EqZp672ZjbR-g", "cell_type": "code", "source": [ "public record PnlVariableType : VariableType {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bVzzi7gJVUOAENq25I1JUQ", "cell_type": "markdown", "source": [ "", "\n## Balance Sheet Variable Type", "\n", "\nThe BsVariableType is used to descibe the Anlysis of change of the Balance Sheet reports." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Azjq6-w3xU6XO28qySfeEQ", "cell_type": "code", "source": [ "public record BsVariableType : VariableType {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tnri9RIpOEO8xYbVkcSDaw", "cell_type": "markdown", "source": [ "## Accounting Variable Type", "\nThe AccountingVariableType is used to describe the accounting events that are posted in the accounting output file." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_ITqpse1tkOzZIOiGx5RCg", "cell_type": "code", "source": [ "public record AccountingVariableType : VariableType {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4-lSJ9zaOUeDX79K04UlPQ", "cell_type": "markdown", "source": [ "", "\n## Scenario", "\nThe Scenario record holds the various scenarios for which calculations should also be performed." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_LV67wZghEKrJhiuaRhbmQ", "cell_type": "code", "source": [ "public record Scenario : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7b7N1_AF0UehwCPAqas-Mw", "cell_type": "markdown", "source": [ " The 'neutral' Scenario (i.e. the default one, with no-stress situations applied) is designated as 'Best Estimate'." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ta7e8UWrjUO1NU-lBUgTeA", "cell_type": "markdown", "source": [ "", "\n## Line Of Business" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "o0OA9JhZYU2nHM2f_Udg9A", "cell_type": "markdown", "source": [ "Line Of Business is a dimension used to identity insurance business according to usual business classifications (usually a market or company-specific business classification representing a convolution of risk covered, 1st party / 3rd party cover type, product type, etc...)", "\nTypical examples of Line of Business are Motor, Property, Endowment, etc... This is a hierarchical dimension." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QGo_JuZyVkuYVndoizxDOw", "cell_type": "code", "source": [ "public record LineOfBusiness : KeyedOrderedDimension, IHierarchicalDimension", @@ -523,66 +748,102 @@ "\n [Dimension(typeof(LineOfBusiness))]", "\n public string Parent { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dbbd2ggxGE6mHjqrwgHL1g", "cell_type": "markdown", "source": [ "", "\n## Currency" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nqDwmu8MDEO3jL-H-woh2Q", "cell_type": "markdown", "source": [ "Currency is a dimension used to identity the currency.", "\nTypical examples of Currency are EUR, CHF, USD, etc..." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XA10ILHLkUWbpQzJBAkXZQ", "cell_type": "code", "source": [ "public record Currency : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wsLO89dcuE27G1nHtDuN0Q", "cell_type": "markdown", "source": [ "", "\n## Economic Basis", "\n", "\nThe Economic Basis defines the discount type which is used in calculations. Examples are: Nominal, Current and Locked." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_YZihbxs1kq82s_4uJ50rw", "cell_type": "code", "source": [ "public record EconomicBasis : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1rEXbs0tE0ixs2PKxuzijw", "cell_type": "markdown", "source": [ "", "\n## Valuation Approach", "\nThis dimension holds the various methodologies used in the calculations: BBA, VFA and PAA." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8xWDJeD0HUSL7cCWWfxB2A", "cell_type": "code", "source": [ "public record ValuationApproach : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-VuXuyWx-UeVrmyIH4tynw", "cell_type": "markdown", "source": [ "", "\n## Liability Type", "\nThe Liability Type distinguishes betweeen e.g. liabilities for incurred claims and liabilities for remaining coverage." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pBn2RHZYH0mvlWDyMqWAYQ", "cell_type": "code", "source": [ "public record LiabilityType : KeyedDimension, IHierarchicalDimension", @@ -591,79 +852,123 @@ "\n [Dimension(typeof(LiabilityType))]", "\n public string Parent { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JqUkEBkxEUyu9LWoQ9edog", "cell_type": "markdown", "source": [ "", "\n## OCI Type", "\nOther Comprehensive Income (OCI) Type describes how the financial contributions to the IFRS17 Financial Performance is apportioned between the P&L and the OCI sections." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-pft1geAOkqbKgubPnY0PA", "cell_type": "code", "source": [ "public record OciType : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "S5jtO-BT_EWHwNwFWnSteQ", "cell_type": "markdown", "source": [ "", "\n## Profitability" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "agAepHAWC0aM8vwzMiATxA", "cell_type": "markdown", "source": [ "Profitability is a dimension used in IFRS 17 to describe the profitability of a Group of Contracts (GIC/GRIC).", "\nTypical examples of Profitability are Profitable, Non-Profitable, etc.." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4s8YBnMHfEy5nNG3RvtvQg", "cell_type": "code", "source": [ "public record Profitability : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sG9C9SlT80Sa9yKzTmomHg", "cell_type": "markdown", "source": [ "", "\n## Partner", "\nPartner is the counterparty of a reinsurance contract." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2PWRjN6ClE2h1_mjVLnjVA", "cell_type": "code", "source": [ "public record Partner : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xFvb4itG9kGr-znXcMtZmg", "cell_type": "markdown", "source": [ "", "\n## Credit Risk Rating", "\nThis holds the credit risk rating of each Partner." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "aBpP5Oc4Eke83JkSwrVEyA", "cell_type": "code", "source": [ "public record CreditRiskRating : KeyedDimension {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JYBlHEuf2EeBJK2agw9PTg", "cell_type": "markdown", "source": [ "", "\n## Reporting Node", "\nA Reporting Node is an element in the reporting structure of the company. It has a hierarchical structure and the end nodes is the level at which data is imported." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sdTROCNthU-SbN8qtndCug", "cell_type": "code", "source": [ "public record ReportingNode : KeyedDimension, IHierarchicalDimension ", @@ -677,16 +982,24 @@ "\n [Dimension(typeof(Currency))]", "\n public virtual string Currency { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "f3cgPrGYWEuewvULtOePgw", "cell_type": "markdown", "source": [ "", "\n## Projection Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OscX2jPkaUKAsAMmlWbnLA", "cell_type": "markdown", "source": [ "Projections are configured by defining the following 2 parameters:", @@ -696,9 +1009,13 @@ "\n", "\nBoth Shift and TimeStep are measured in terms of number of months.", "\nFor instance, for the current year and year-to-date view we have $\\rm{Shift}=0$ and $TimeStep=3$ for the first quarter, $TimeStep=6$ for the 2nd quarter and so on." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Y6oQoI4XX0CwFsNhatS-RQ", "cell_type": "code", "source": [ "public record ProjectionConfiguration : KeyedDimension", @@ -708,23 +1025,35 @@ "\n [IdentityProperty]", "\n public int TimeStep { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WYjnvQgpH06wl1eIrT8woA", "cell_type": "markdown", "source": [ "", "\n# Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "E5oOYjdJEUCETU2i9e-Qug", "cell_type": "markdown", "source": [ "", "\n## Aoc Step Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6GbflKhoxUiG2pAgS_I-0A", "cell_type": "markdown", "source": [ "The record below holds parameters over time for each combination of AocType and Novelty. In particular:", @@ -737,9 +1066,13 @@ "\n- RcPeriod identifies which Reinsurance Coverage should be used (from current or previous period).", "\n", "\n
The values for each parameter can be found in [Enums Notebook](./Constants/Enums)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "x8qrzUb0PEOCGxJSra4XXg", "cell_type": "code", "source": [ "public record AocConfiguration : KeyedRecord, IWithYearAndMonth, IOrdered", @@ -801,9 +1134,13 @@ "\n [NotVisible]", "\n public int Order { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QVPcX4AOT0uI2pyntN7nxw", "cell_type": "markdown", "source": [ "", @@ -811,9 +1148,13 @@ "\nThe record below holds the Exchange Rates over time and for each exchange type ([FxType](./Constants/Enums)). Exchange Rate must be updated every reporting period as part of the close preparation. In general, the last month of the reporting period should be use to import the new data for the period. ", "\n", "\nIn case the Exchange Rate for the current period is missing, an error is returned. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fjWZFfSVXUuuznBgoCdv3g", "cell_type": "code", "source": [ "public record ExchangeRate : KeyedRecord, IWithYearMonthAndScenario", @@ -853,9 +1194,13 @@ "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZKgLspAsdEC-hOZtcXzNPg", "cell_type": "markdown", "source": [ "", @@ -865,9 +1210,13 @@ "\nThe Credit Default Rate values must be entered with monthly granularity, i.e. every value corresponds to the default rate for a certain month. The first month entered in column Values0 always corresponds to January of the year entered in column Year. The last value is considered valid also for the following years (for which no value has been provided). ", "\n", "\nThe latest Credit Default Rate available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tMR0fSlBv0Krf5Y3YbA8SA", "cell_type": "code", "source": [ "public record CreditDefaultRate : KeyedRecord, IWithYearMonthAndScenario", @@ -903,9 +1252,13 @@ "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7dQwcrF4RUaBa9E-lwlRJg", "cell_type": "markdown", "source": [ "", @@ -916,9 +1269,13 @@ "\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." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5_Tdu0mOuUKPDS1__w7oKw", "cell_type": "code", "source": [ "public record YieldCurve : KeyedRecord, IWithYearMonthAndScenario", @@ -954,17 +1311,25 @@ "\n [Display(Order = 40)]", "\n public double[] Values { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nOgE_q28hEOm1sKGlkVYFQ", "cell_type": "markdown", "source": [ "", "\n## Partner Rating", "\nThe record below holds the [Credit Risk Rating](#credit-risk-partner) for each [Partner](#partner) across time. Partner Rating can be updated every month as part of the close preparation. In general, the last month of the reporting period should be use to import the new data for the period. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NsO44SR5NEmuCID96R3hkg", "cell_type": "code", "source": [ "public record PartnerRating : KeyedRecord, IWithYearMonthAndScenario", @@ -1001,17 +1366,25 @@ "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BEbzTJO6dE2xO4j5NLPSOg", "cell_type": "markdown", "source": [ "", "\n# Partitions", "\nThe notion of Partition is used to define small but meaningful sets of data, called partitions. Partitions are then used to optimize the extraction of data from the database, i.e. only the data for a certain partition is retrieved." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QkFB_IgHtkGLWDYc5tCu2g", "cell_type": "code", "source": [ "public abstract record IfrsPartition : IPartition {", @@ -1030,27 +1403,43 @@ "\n [IdentityProperty]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "VHEBFc1800ql7zqmcDgZSA", "cell_type": "markdown", "source": [ "For instance, the data pertaining to a certain [Reporting Node](#reporting-node) for a certain [Scenario](#scenario) is called an IfrsPartition and assigned a unique identifier:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bfSp5T3pV0KWnxNftKMGeQ", "cell_type": "code", "source": [ "public record PartitionByReportingNode : IfrsPartition {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "s-Z9GAJm7kSMmpdCbP93bA", "cell_type": "markdown", "source": [ "The partition PartitionByReportingNodeAndPeriod is a further partition of the IfrsPartition sets - In particular, it defines sets for the data pertaining to a certain [Reporting Node](#reporting-node), [Scenario](#scenario), year and month. The value of the Month is the last month of the reporting period to which the data belongs to. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zISZyAdnkEyzTE1zpuwyyg", "cell_type": "code", "source": [ "public record PartitionByReportingNodeAndPeriod : IfrsPartition {", @@ -1064,18 +1453,26 @@ "\n [IdentityProperty]", "\n public int Month { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SqNVh5wtfUezX47Ykwro3g", "cell_type": "markdown", "source": [ "", "\n# Policy-related Data Structures", "\n", "\nThe data structures below are the pieces of the data model where policy-related data is held." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kQT5JYjIskOeFjgMZ1w69g", "cell_type": "markdown", "source": [ "", @@ -1089,9 +1486,13 @@ "\n- LineOfBusiness", "\n- ValuationApproach", "\n- OCI Type" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sDuxslDif0Sc7ayoPFDBvw", "cell_type": "code", "source": [ "public record DataNode : KeyedDimension, IPartitioned {", @@ -1125,9 +1526,13 @@ "\n //[Immutable]", "\n public string OciType { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FSa402W3TkiFSw4IlrT0JQ", "cell_type": "markdown", "source": [ "", @@ -1136,18 +1541,26 @@ "\nA Portfolio is a set of Group of Contracts. The relationship is set on the Group of Contracts (see below).", "\n", "\nPortfolios are of type DataNode and there are two types: Insurance Portfolio and Reinsurance Portfolios." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FyJPLygckkiVEUELn08X3A", "cell_type": "code", "source": [ "public record Portfolio : DataNode {}", "\n", "\npublic record InsurancePortfolio : Portfolio {}", "\npublic record ReinsurancePortfolio : Portfolio {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-hbDX86jWke27T_Qi4yjUQ", "cell_type": "markdown", "source": [ "", @@ -1156,9 +1569,13 @@ "\nA Group of Contract is a set of contracts with the same Annual Cohort, Liability Type, Profitability and Partner (in case the contracts are done with a re-insurer).", "\n", "\nVarious Group of Contracts are put together into portfolios." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rElVpacAmUegdwqcG3mmGw", "cell_type": "code", "source": [ "public record GroupOfContract : DataNode {", @@ -1185,18 +1602,26 @@ "\n ", "\n public virtual string Partner { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "UoH8t8Gr3EeGXaXp2w6Vyg", "cell_type": "markdown", "source": [ "A group of insurance contracts is called a **GIC** and has no information on Partner.", "\n", "\nOnly Groups of Reinsurance Contracts, defined below and usually called **GRIC**s, have Partner information.", "\nAgain, there are Insurance GRICs and Reinsurance GRICs:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fxV6ONW9S02XR3zAH5RGdw", "cell_type": "code", "source": [ "public record GroupOfInsuranceContract : GroupOfContract {", @@ -1224,9 +1649,13 @@ "\n //[Immutable]", "\n public string Portfolio { get => base.Portfolio; init => base.Portfolio = value; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2RcBhR-gLEi1fyPfMVmLuA", "cell_type": "markdown", "source": [ "", @@ -1234,9 +1663,13 @@ "\n", "\nThe Data State is used to track whether a GOC is Active or Inactive across time (year and month). ", "\nIt is only possible to update the state of a Group of Contract from Active to Inactive." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Aaigxy_oXE6AunRElFSYAw", "cell_type": "code", "source": [ "public record DataNodeState : KeyedRecord, IPartitioned, IWithYearMonthAndScenario", @@ -1278,9 +1711,13 @@ "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "iDKOuanhL0i6psYc1KBeHw", "cell_type": "markdown", "source": [ "", @@ -1291,9 +1728,13 @@ "\n
ReinsuranceCoverage : defines the weight of the underlying gross business to be considered in the computation of the allocation of the Technical Margin in a Reinsurance case.", "\n", "\nThe latest Data Node Parameters available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used as the current value during calculation." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-lkGCfDzo0SbSF7dZDXIUQ", "cell_type": "code", "source": [ "public record DataNodeParameter : KeyedRecord, IPartitioned, IWithYearMonthAndScenario", @@ -1330,9 +1771,13 @@ "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zpfXY4qd10-jnedhyiVr-Q", "cell_type": "code", "source": [ "public record SingleDataNodeParameter : DataNodeParameter {", @@ -1351,16 +1796,24 @@ "\n [Range(0, 1, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", "\n public double ReinsuranceCoverage { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kxGsVzfJE0y6EdlnIRcskg", "cell_type": "markdown", "source": [ "## DataNodeData PocoType", "\nThe DataNodeData type is not persisted (i.e. not stored in the database) and is used in order to hold Data Node data during data manipulations." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vIbSqkxEAEimfOTb5df1lw", "cell_type": "code", "source": [ "public record DataNodeData {", @@ -1390,9 +1843,13 @@ "\n public string Scenario { get; init; }", "\n public DataNodeData(){}", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GoHhGqOtG0-OVZzbd26MIQ", "cell_type": "markdown", "source": [ "", @@ -1401,9 +1858,13 @@ "\nRaw Variables are used to store **cashflows** on the database during import, i.e. *after* mappings are applied and *before* calculations are applied.", "\n", "\nThey are stored on the database for both audit and re-calculation purposes." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1uBvKkke9E-jE50KJE63Kg", "cell_type": "code", "source": [ "public abstract record BaseVariableIdentity {", @@ -1422,9 +1883,13 @@ "\n [IdentityProperty]", "\n public string Novelty { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "09RqJAd98k-0yKxsVJoj7A", "cell_type": "code", "source": [ "public abstract record BaseDataRecord : BaseVariableIdentity, IKeyed, IPartitioned {", @@ -1446,15 +1911,23 @@ "\n [IdentityProperty]", "\n public int? AccidentYear { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MNQBq-sMm0qE88pJs4TI0w", "cell_type": "markdown", "source": [ "Basically, RawVariable is defined for a certain Reporting Node, Scenario, Year, Month, Amount Type and Calculation Type:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KWxQ2RGp3U-5Si5Yn8_TxQ", "cell_type": "code", "source": [ "public record RawVariable : BaseDataRecord", @@ -1467,9 +1940,13 @@ "\n [IdentityProperty]", "\n public string EstimateType { get; init; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "32EH_CRHdkaqykLzNiRMlA", "cell_type": "markdown", "source": [ "", @@ -1483,9 +1960,13 @@ "\nPresent Values are calculated from the [raw variables](#raw-variables) during the import of cashflows.", "\n", "\nIfrs Variables are stored on the database, i.e. they are 'persisted', for performance purposes." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ATEjwkbM7EmskgkBl5iDXA", "cell_type": "code", "source": [ "public record IfrsVariable : BaseDataRecord", @@ -1504,17 +1985,25 @@ "\n ", "\n public IfrsVariable (){}", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IEgWB97Takeh-qD2nT3RMA", "cell_type": "markdown", "source": [ "", "\n## Import Identity", "\nThe Import Identity contains the data elements used to determine the data sets which are used when performing data manipulations, e.g. during a [data import](./Import/ImportScopeCalculation) - In particular, an Import Identity is defined by: DataNode, AocType, Novelty, and whether it's reinsurance data or not:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QzLZ4ykjzUmtv-rANE7xIw", "cell_type": "code", "source": [ "public record ImportIdentity : BaseVariableIdentity {", @@ -1546,18 +2035,26 @@ "\n", "\n public ImportIdentity(){}", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "o5bDYrCFbEq9Q86kAQ8M2A", "cell_type": "markdown", "source": [ "", "\n# Report Variable", "\n", "\nReport Variables are used to hold data after data manipulations and before being outputed in the form of a report. They are not persisted, i.e. they are not saved on the database." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uJSztRmWuUqUk4sLXE3pqQ", "cell_type": "code", "source": [ "public record ReportVariable {", @@ -1726,21 +2223,33 @@ "\n Value = iv.Value;", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5KnkxM7jkkq7I_q6uVn55w", "cell_type": "markdown", "source": [ "# Args" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3Q9oP3-cLUqSGJRmFqlnTA", "cell_type": "code", "source": [ "public record Args(string ReportingNode, int Year, int Month, Periodicity Periodicity, string Scenario){}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cR_ZU4RxdECNosEby4pYNQ", "cell_type": "code", "source": [ "public record ImportArgs : Args", @@ -1753,9 +2262,13 @@ "\n ImportFormat = importFormat;", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GioFDTgmvEmQbwUEAS8ywA", "cell_type": "code", "source": [ "public record ReportArgs : Args", @@ -1773,7 +2286,10 @@ "\n HierarchyName = hierarchyName;", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index 622371c3..81651f36 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -18,31 +18,48 @@ "nbformat_minor": 5, "cells": [ { + "id": "P-g7GArHA0aKcY2PxC5q8Q", "cell_type": "markdown", "source": [ "

Export Configuration

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rsDJFZee4EKdQ35EUXjOKA", "cell_type": "code", "source": [ "#!import \"../DataModel/DataStructure\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Xz94Khhs1kmnH1IVWMSmaw", "cell_type": "code", "source": [ "using Systemorph.Vertex.Export.Builders.Interfaces;", "\nusing Systemorph.Vertex.Export.Excel.Builders.Interfaces;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ou65UNaKpEyCJRGlrLysBQ", "cell_type": "markdown", "source": [ "# Main Tab" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BWX9kQ_c00uLzpJKNyOhew", "cell_type": "code", "source": [ "public static IDocumentBuilder MainTabConfigurationWoScenario(this IDocumentBuilder builder, T args) where T : IfrsPartition", @@ -51,9 +68,13 @@ "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", "\n .WithColumn(x => x.Id, x => x.Delete())", "\n .WithColumn(x => x.Scenario, x => x.Delete()));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uvnoDsE4oUSt0PB0WNhadA", "cell_type": "code", "source": [ "public static IDocumentBuilder MainTabConfiguration(this IDocumentBuilder builder, T args) where T : IfrsPartition", @@ -61,15 +82,23 @@ "\n .WithName(Main) ", "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", "\n .WithColumn(x => x.Id, x => x.Delete()));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hQK8WsGMl0mDnOVj_sjG-A", "cell_type": "markdown", "source": [ "# Porfolio" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ozokghlNa0ODKC1mTz08zw", "cell_type": "code", "source": [ "public static IDocumentBuilder PortfolioConfiguration(this IDocumentBuilder builder, Type DependsOnType = default) where T : Portfolio", @@ -82,15 +111,23 @@ "\n .WithColumn(x => x.Partition, x => x.Delete())", "\n .WithColumn(x => x.FunctionalCurrency, x => x.Delete());", "\n });" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KWuLpwNT0Ui1wDosD3-3UA", "cell_type": "markdown", "source": [ "# Group of Contract" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0uiDgQgJTkO85SFnjbGm0w", "cell_type": "code", "source": [ "public static IDocumentBuilder GroupofContractConfiguration(this IDocumentBuilder builder, Type DependsOnType = default) where T : GroupOfContract", @@ -109,27 +146,43 @@ "\n .WithColumn(x => x.OciType, x => x.Delete())", "\n .WithColumn(x => x.ValuationApproach, x => x.Delete());", "\n });" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yHfYqYJoYEOI-zwzcrmiTA", "cell_type": "markdown", "source": [ "# Data Node State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dPWh1L5KDkOezW6JgfkpVA", "cell_type": "code", "source": [ "using DocumentFormat.OpenXml.Spreadsheet;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9wuPH7XlmUmQii3J5fpAXQ", "cell_type": "code", "source": [ "public record HelperState { public string State {get; init;} }" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "07W-etuVhUCGCNpWWgHgXQ", "cell_type": "code", "source": [ "public static IExcelDocumentBuilder DataNodeStateConfiguration (this IExcelDocumentBuilder builder, DataNodeState[] data)", @@ -153,9 +206,13 @@ "\n .WithColumn(x => x.Id, x => x.Delete())", "\n .WithColumn(x => x.State, y => y.WithDataValidation(z => z.WithReferenceTo(t => t.State)))", "\n );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HU5u0yMp_U68TZhQJQ7Pug", "cell_type": "code", "source": [ "public static IExcelDocumentBuilder StateEnumConfiguration (this IExcelDocumentBuilder builder)", @@ -166,15 +223,23 @@ "\n .WithColumn(x => x.State, z => z.WithDefaultNamedRange())", "\n .WithSource(source => helperState.AsQueryable()) );", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "aVQIFdhD-kCArwh73N3GYA", "cell_type": "markdown", "source": [ "# Data Node Parameter" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rnyY1JSYWkaeU1B5vAG6Ng", "cell_type": "code", "source": [ "public static IExcelDocumentBuilder DataNodeParameterConfiguration (this IExcelDocumentBuilder builder, Dictionary data)", @@ -207,13 +272,20 @@ "\n .WithColumn(x => x.Year, x => x.Delete())", "\n .WithColumn(x => x.Id, x => x.Delete())", "\n );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fAsIOPFhGUO054zF6vyX0A", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Import/ImportScopeCalculation.ipynb b/ifrs17/Import/ImportScopeCalculation.ipynb index f930054f..92be02bf 100644 --- a/ifrs17/Import/ImportScopeCalculation.ipynb +++ b/ifrs17/Import/ImportScopeCalculation.ipynb @@ -18,38 +18,59 @@ "nbformat_minor": 5, "cells": [ { + "id": "IZg63U-r4Uq_ro4hRUgeRw", "cell_type": "markdown", "source": [ "", "\n

Import Scopes (IFRS17 Methodology Business Logic)

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HGJXnMwy4kWKjzkHkvX8iw", "cell_type": "markdown", "source": [ "This notebook contains the logic used to perform calculations upon import of data (actuals and cashflows). This is also called 'Data Loading' and the concept of Scope is used here to define the logic and provide the means of executing the logic." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "e-Y5r2I4OUCIlOVCJaGGgg", "cell_type": "markdown", "source": [ "# References", "\nLibraries and other notebooks which are needed for this notebook are imported below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D25xwuzaa0Ok5fW4jO2zzg", "cell_type": "markdown", "source": [ "## Notebooks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-meq1BlgnEO_9Qi9rN8PKQ", "cell_type": "code", "source": [ "#!import \"ImportStorage\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "q7mCfe8spkiYyz0WXIYsng", "cell_type": "markdown", "source": [ "", @@ -57,15 +78,23 @@ "\nScopes are used to define and perform data handling in a structured and easy-to-read-through fashion.", "\n", "\nThe IModel interface below will be used to execute calculations (i.e. evaluate the scopes) based on imported data." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K3W7iT04JUmcnpM2pQHY5A", "cell_type": "code", "source": [ "public interface IModel : IMutableScopeWithStorage{}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JrH9-tdBRkum_Pb0wxjsvw", "cell_type": "markdown", "source": [ "## Getting Existing Identities", @@ -73,9 +102,13 @@ "\nAn [Identity](../DataModel/DataStructure#import-identity) is a set of identifiers for a certain set of data. In particular, an identity consists of a certain [AoC Type](../DataModel/DataStructure#aoc-type), [Novelty](../DataModel/DataStructure#novelty), [Data Node](../DataModel/DataStructure#data-node), Accident Year, and information on whether the data is for reinsurance or not. ", "\n", "\nGiven a certain Data Node and Accident Year, the interface GetIdentities returns all the existing identities (e.g. for Actuals and Cashflows) which have that Data Node and Accident Year." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Dr6JlCAOa0qTLmEK7mkBRQ", "cell_type": "code", "source": [ "public interface AllCfIdentities : IScope // string represents a DataNode", @@ -87,9 +120,13 @@ "\n DataNode = Identity", "\n });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AoUS_cRh0U-AkCOrRjqHQA", "cell_type": "code", "source": [ "public interface GetIdentities : IScope", @@ -178,17 +215,25 @@ "\n DataNode = Identity,", "\n }));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jE0aaaKrhka02hbasl8sXw", "cell_type": "markdown", "source": [ "## Getting Amount Types", "\n", "\nSimilarly, given a certain Data Node and Accident Year, the interface ValidAmountType returns all the amount types which are used in imported data with that Data Node and Accident Year." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3ZoSi02F8UqASGhq1HtvUw", "cell_type": "code", "source": [ "public interface ValidAmountType : IScope", @@ -216,18 +261,26 @@ "\n .Select(x => x.AmountType)", "\n .ToHashSet();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "O-LqZH86kkyVyuFwRmE5Ng", "cell_type": "markdown", "source": [ "", "\n## AoC Step Structure", "\n", "\nThe Aoc step structure is constructed from the data which is delivered as input. It is assumed that it depends only on the Group of Contrat (i.e. it is invariant across Amount types or Accident Year). " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cAjg0RqZuU6dxyD4BHjSaw", "cell_type": "markdown", "source": [ "### ParentAocStep ", @@ -248,9 +301,13 @@ "\n\\right.", "\n$$", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sGX4WCgwCEWf2CpcEzCASQ", "cell_type": "code", "source": [ "public interface ParentAocStep : IScope<(ImportIdentity Id, string AmountType), ImportStorage>", @@ -279,9 +336,13 @@ "\n IEnumerable ParentAocStep.CalculatedTelescopicAocStep => ", "\n GetStorage().GetCalculatedTelescopicAocSteps().Where(aoc => aoc.AocType != AocTypes.CRU);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZQKnYOpT6EKVKhyDAHuKHw", "cell_type": "markdown", "source": [ "### ReferenceAocStep", @@ -304,9 +365,13 @@ "\n$$", "\n", "\nwhere the last AocStep is obtained by ordering the AocSteps according to their order (as defined by its AocType) and taking the last one." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "52TfWUCcQUyc39rYcKe5KA", "cell_type": "code", "source": [ "public interface ReferenceAocStep : IScope ", @@ -332,9 +397,13 @@ "\n ? GetReferenceAocStep(Identity.AocType)", "\n : identityAocStep;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XSykc2IcnUu5GLwIp9a5xQ", "cell_type": "markdown", "source": [ "### PreviousAocSteps", @@ -357,9 +426,13 @@ "\n$$", "\n", "\nThis scope depends on the InputSource (Actual or Cashflow) for which the PreviousSteps are requested due to the AocChain differences between Actual reports and the rest." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LFMQRLnGDUeBO3zmMY_IgA", "cell_type": "code", "source": [ "public interface PreviousAocSteps : IScope<(ImportIdentity Id, InputSource ScopeInputSource), ImportStorage> ", @@ -377,24 +450,36 @@ "\n .OrderBy(aoc => GetStorage().AocConfigurationByAocStep[aoc].Order)", "\n : Enumerable.Empty();", "\n} " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ki7yLCpDS0Wgdmiahnjg7g", "cell_type": "markdown", "source": [ "The exact structure being return depends on the **order** of the AoC Steps (which is set by the [AoC Type](../DataModel/DataStructure#aoc-type)), and on which AoC steps exist." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EHEOFcljGkOYAoWWvUEJjQ", "cell_type": "markdown", "source": [ "", "\n## Discounting", "\n", "\nThe calculation of IFRS17 figures is based on cumulated discounted cashflows." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "o-nF81nHo0O2pGOpaMZPOA", "cell_type": "markdown", "source": [ "", @@ -407,9 +492,13 @@ "\n- Whereas for the **Current** economic base, the yield curve used is the latest available as per the current period.", "\n", "\nThe algorithm which retrieves the latest available yield curve is [here](../Utils/Queries#yield-curve)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "y-3vJArEak2Gxm9Aya6jOA", "cell_type": "markdown", "source": [ "", @@ -426,9 +515,13 @@ "\n$$", "\n", "\nwhere the index $i$ denotes years." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5Vjdb4UUeUWnuDe1HDkF2Q", "cell_type": "code", "source": [ "public interface MonthlyRate : IScope", @@ -443,9 +536,13 @@ "\n ", "\n double[] Discount => Interest.Select(x => Math.Pow(x, -1)).ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gD7ZdyMyvkmzaiszXR_dqw", "cell_type": "markdown", "source": [ "", @@ -455,9 +552,13 @@ "\n
These values are stored in the database as [RawVariable](../DataModel/DataStructure#raw-variables).", "\n
Refer to the ReferenceAocStep of the AocStructure calculation to identify the correct AocType and Novelty to retrieve.", "\n
Due to the Credit Default Risk of a reinsurance partner, the logic to compute the Nominal Cashflows for this Amount Type must be defined separately. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZmO1j4uGlkGdbfvcSEXJQg", "cell_type": "code", "source": [ "public interface NominalCashflow : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? AccidentYear), ImportStorage>", @@ -493,15 +594,23 @@ "\n .Select(claim => GetStorage().GetValues(Identity.Id with {AocType = referenceAocStep.AocType, Novelty = referenceAocStep.Novelty}, claim, Identity.EstimateType, Identity.AccidentYear))", "\n .Aggregate();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IIkemYfM30ytcItha5eYDw", "cell_type": "markdown", "source": [ "For a given month $i$ they are denoted as $\\rm{Nominal}_i$." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_PYIAO14FkCWaGjw_h3sjg", "cell_type": "markdown", "source": [ "", @@ -510,9 +619,13 @@ "\nPresent Values are calculated during the import of the cashflows and stored on the database. They are computed for the relevant Economic Basis, depending on the Valuation Basis.", "\n", "\nTheir calculation is described in the following sections and is summarized in the $\\rm{PV}$ formula [below](#present-value)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PaIuIxDLMUymcYHNicfmFw", "cell_type": "markdown", "source": [ "", @@ -532,9 +645,13 @@ "\nwhere Transaction Period depends on which Best Estimate value is being computed, in particular on what its [Amount Type](../DataModel/DataStructure#amount-type) is (each Amount Type has its own [Period Type](../Constants/Enums)); and $\\text{Valid Discount}$ stands for the fact that in case the Discount Curves are shorter than the required index, then their last element is returned. We also need to flip the sign of the discounted and cumulated values, to create a reserve view and be consistent with the usual [Cashflow Sign Convention](https://en.wikipedia.org/wiki/Cash_flow_sign_convention). ", "\n", "\n
Also here, the Credit Default Risk contribution is calculated separately. Since it is based on Claims, the Period Type is implicitly defined." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "85QfNxNpt06PAgYiZIqTLg", "cell_type": "code", "source": [ "public interface DiscountedCashflow : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? Accidentyear), ImportStorage>", @@ -562,9 +679,13 @@ "\n ", "\n double[] DiscountedCashflow.Values => Multiply(-1d, NominalValues.ComputeDiscountAndCumulateWithCreditDefaultRisk(MonthlyDiscounting, nonPerformanceRiskRate)); // we need to flip the sign to create a reserve view", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Yyg3nKDMaUegdQgSZmJfhg", "cell_type": "markdown", "source": [ "", @@ -583,9 +704,13 @@ "\n$$", "\n", "\nwhere AocType is the AoC Type of the AoC Step for which the calculations are being performed." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c6EYdq9zZ0uT4yfFAynddw", "cell_type": "code", "source": [ "public interface TelescopicDifference : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? Accidentyear), ImportStorage>", @@ -602,9 +727,13 @@ "\n ", "\n double[] Values => Subtract(CurrentValues, PreviousValues);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DKL8osruCU-DbEb-tO_8wA", "cell_type": "markdown", "source": [ "", @@ -627,9 +756,13 @@ "\n", "\nFor instance, for the current year and year-to-date view we have $S=0$ and $TS=3$ for the first quarter, $TS=6$ for the 2nd quarter and so on.", "\nFor the projection values of next year first quarter we would have $S=12$ and $TS=3$, etc." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wmAA753Li0Osew0Rx9zS6A", "cell_type": "code", "source": [ "public interface IWithGetValueFromValues : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? AccidentYear), ImportStorage>", @@ -648,9 +781,13 @@ "\n };", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XDKoRCKk-ESOsrY7vOJ-Ew", "cell_type": "markdown", "source": [ "", @@ -668,9 +805,13 @@ "\n$$", "\n", "\n
Due to the Credit Default Risk of a reinsurance partner, the logic to compute the Interest Accretion for this Amount Type must be defined separately. Since it is based on Claims, the Period Type is implicitly defined." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k8NFcJLF20-kg-ZccJEv5A", "cell_type": "code", "source": [ "public interface IWithInterestAccretion : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? AccidentYear), ImportStorage>", @@ -720,9 +861,13 @@ "\n return Subtract(nominalValuesCreditRisk, effectCreditRisk);", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dM2KZ1PPx0u8-5bNcF2Ccg", "cell_type": "markdown", "source": [ "", @@ -744,9 +889,13 @@ "\n$$", "\n", "\nwhere $i$ denotes the months, and the [$\\rm{TelescopingDifference}_i$](#telescopic-difference) and the [$\\rm{InterestAccretion}_i$](#interest-accretion) quantities are defined above." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8GRVgEhgUECARHHffZ47qg", "cell_type": "code", "source": [ "public interface PresentValue : IWithGetValueFromValues", @@ -805,9 +954,13 @@ "\n [NotVisible]", "\n double[] PresentValue.Values => Enumerable.Empty().ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0kSvVBqlrkKl9AsILO34Rw", "cell_type": "markdown", "source": [ "", @@ -837,9 +990,13 @@ "\n$$", "\n", "\nThese are used in the BBA methodology, whereby in the CSM calculations only PV Locked is used, and both of them are stored in the database under the [IfrsVariable](../DataModel/DataStructure#ifrs-variable) data structure." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rwsQvKBwpEKmspbkigTlhA", "cell_type": "code", "source": [ "public interface PvLocked : IScope", @@ -878,9 +1035,13 @@ "\n ", "\n double Value => PresentValues.Aggregate().Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p2piX2ZdiUu8ZvUw9tRc7g", "cell_type": "markdown", "source": [ "", @@ -897,9 +1058,13 @@ "\n$$", "\n", "\nwhere PV is defined [above](#present-value) and uses the input cashflows with Calculation Type = RA." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IxvlLZjNpkeg3-puzDYTog", "cell_type": "code", "source": [ "public interface RaLocked : IScope", @@ -930,18 +1095,26 @@ "\n ", "\n double Value => PresentValues.Aggregate().Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "d4HlvRMhakijU2gChsTaBg", "cell_type": "markdown", "source": [ "", "\n## Amortization", "\n", "\nFor the Amortization AoC Step (AoC Type **AM**), the amortization factors to be used are defined below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DeqWNbrHikiG4bMQfqXG2w", "cell_type": "markdown", "source": [ "", @@ -951,9 +1124,13 @@ "\nmeasured by considering the quantity of benefits provided as well as the expected coverage period of the GIC.", "\n", "\nThe cashflows of coverage units are retrieved from the discounted cashflows with [EstimateType](../DataModel/DataStructure#estimate-type) CU." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_ELmzzZJN0uiiI1FeT0svQ", "cell_type": "code", "source": [ "public interface CoverageUnitCashflow : IScope", @@ -965,16 +1142,24 @@ "\n ", "\n double[] Values => GetScope((Identity, (string)null, EstimateType, (int?)null)).Values;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "T8Y3hoFpOUuOHW_Ykmzvmw", "cell_type": "markdown", "source": [ "", "\n### Amortization Factor" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HeJtygvtGk6eh7_xoPz94w", "cell_type": "markdown", "source": [ "For a certain GIC, the monthly Amortization Factors $\\text{Monthly }AF_i$ are computed from the cashflows of the underlying coverage unit for that GIC:", @@ -987,9 +1172,13 @@ "\n- $i$ denotes a monthly period;", "\n- the nominal cash flows $\\text{Nominal}_i(CL)$ are the nominal cashflows of the coverage unit for the AoC Step **Combined Liability** (CL) (input data);", "\n- and the corresponding cumulated discounted cashflows $\\text{CDC}_i$ are defined [above](#cumulated-discounted-cashflows)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6LTCrGSIBUC8NNCHa7XoSw", "cell_type": "code", "source": [ "public interface MonthlyAmortizationFactorCashflow : IScope", @@ -1007,9 +1196,13 @@ "\n _ => Enumerable.Empty().ToArray(),", "\n };", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "T-KevHUzMU6jtx0febbk3Q", "cell_type": "markdown", "source": [ "For a certain projection period - defined by the Shift, $S$, and the Time-Step, $TS$, parameters - the Amortization Factor is then given by the product of the corresponding monthly amortization factors:", @@ -1021,9 +1214,13 @@ "\nEach GIC will have his own AF.", "\n", "\nIn order to run off the business of a given Group of Contract one should provide a cashflow of 0s for the AocStep with AocType CL and Novelty C. When computing the AF this results in the product of the monthly amortization factors of the period to be 1. In this case, the computed AF does not follow the formula above but is 1 allowing for the full release of the Technical Margin in the AM AocStep." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XMjWT533GUeMzhXBqcbNQQ", "cell_type": "code", "source": [ "public interface CurrentPeriodAmortizationFactor : IScope", @@ -1052,9 +1249,13 @@ "\n{", "\n double CurrentPeriodAmortizationFactor.Value => GetStorage().GetValue(Identity, (string)null, EstimateType, EconomicBasis, (int?)null);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4Fjpb-dp4kKfTVXN_ZcKZQ", "cell_type": "markdown", "source": [ "", @@ -1073,9 +1274,13 @@ "\n
 Release", "\n
 Write-off", "\n
 EOP" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cEHGz5WS5E-Ii9iLJJsfQw", "cell_type": "markdown", "source": [ "", @@ -1094,9 +1299,13 @@ "\n$$", "\n", "\nwhere the value is also function of the [Estimate Type](../DataModel/DataStructure#EstimateType) and [Amount Type](../DataModel/DataStructure#AmountType), and the $\\text{Imported Actual}$ value is described [here]()." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xxzl252E4UqfccTJZC6Yxw", "cell_type": "code", "source": [ "public interface ActualBase : IScope<(ImportIdentity Id, string AmountType, string EstimateType, int? AccidentYear), ImportStorage>", @@ -1123,9 +1332,13 @@ "\n{", "\n double ActualBase.Value => 0;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "f5KR23M1rku81r40flA3WQ", "cell_type": "markdown", "source": [ "", @@ -1136,9 +1349,13 @@ "\n$$", "\n\\text{Actual} (\\text{Release}) = \\text{Actual Base} (\\text{Release})|_{\\text{Estimate Type} = A}", "\n$$" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qn7r5BBOzEOndYaSAj9Xdg", "cell_type": "code", "source": [ "public interface Actual : IScope", @@ -1153,9 +1370,13 @@ "\n .SelectMany(at => accidentYears", "\n .Select(ay => GetScope((Identity, at, EstimateType, ay)))).ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k7EQao6-V0KRhEJwrzUb9Q", "cell_type": "markdown", "source": [ "", @@ -1171,9 +1392,13 @@ "\n$$", "\n\\text{Advance Actual} (\\text{AoC step}) = \\text{Actual Base} (\\text{AoC step})|_{\\text{Estimate Type} = AA}", "\n$$" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "S0pnzxS5wEW8KgMHCvHTBA", "cell_type": "code", "source": [ "public interface AdvanceActual : IScope", @@ -1188,9 +1413,13 @@ "\n .SelectMany(at => accidentYears", "\n .Select(ay => GetScope((Identity, at, EstimateType, ay)))).ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k8Nl310aM06j_MP1MVjzvw", "cell_type": "markdown", "source": [ "", @@ -1208,9 +1437,13 @@ "\n$$", "\n\\text{Overdue Actual} (\\text{AoC step}) = \\text{Actual Base} (\\text{AoC step})|_{\\text{Estimate Type} = OA}", "\n$$" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "f7C3NzK97EiGVPP6pEN7BA", "cell_type": "code", "source": [ "public interface OverdueActual : IScope", @@ -1225,9 +1458,13 @@ "\n .SelectMany(at => accidentYears", "\n .Select(ay => GetScope((Identity, at, EstimateType, ay)))).ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "As4FInLuokOmKXArqSH_pg", "cell_type": "markdown", "source": [ "", @@ -1247,9 +1484,13 @@ "\n$$", "\n", "\nwhere $ACA$ and $AEA$ are *Aquisition* Amount Types from **Attributable Commission** and **Attributable Expenses**, respectively." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ca6TvbsWNUqcgsiEXoNsxg", "cell_type": "code", "source": [ "public interface DeferrableActual : IScope", @@ -1293,24 +1534,36 @@ "\n double DeferrableActual.Value => GetScope((Identity, InputSource.Actual)).Values", "\n .Sum(aocStep => GetScope(Identity with {AocType = aocStep.AocType, Novelty = aocStep.Novelty}).Value);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "h9P0A4w8mkuZ-TOMU_ONEw", "cell_type": "markdown", "source": [ "", "\n## Contractual Service Margin, Loss Component and Loss Recovery Component", "\n", "\nThe Contractual Service Margin ($CSM$) denotes the unearned profit from an insurance contract or group of insurance contracts and plays a critical role in the calculation of profit & loss values. Similarly, the unearned loss is denoted by Loss Component ($LC$), Loss Recovery Component in the case of reinsurance contracts." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Jk5HEkRb2EOEir320okRBg", "cell_type": "markdown", "source": [ "## Experience Adjustment on Premium" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oJfwg9hckEmVYLOQDafYxQ", "cell_type": "markdown", "source": [ "The Experience Adjustment (EA) on Premiums weights the cash-flow (CF aocSteps) for premium amount types by the PremiumAllocationFactor input for each group of insurance contract. ", @@ -1323,9 +1576,13 @@ "\nEA (\\text{Actual}) = \\text{Premium Allocation Factor} \\cdot \\big( \\text{Actual}(\\text{AocType = CF}) + \\text{Advance Actual}(\\text{AocType = CF})+ \\text{Overdue Actual}(\\text{AocType = CF}) \\big) ~,", "\n$$", "\nwhere amount type premium and its children are considered, novelties in-force and new business are considered for $PV$ whereas novelty combined is considered for Actual. The allocation is always done in the finest granularity (novelty, line of business, ..) possible." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gR_oBLnGjkCdbSR1Xv36KQ", "cell_type": "code", "source": [ "public interface BeExperienceAdjustmentForPremium : IScope", @@ -1346,9 +1603,13 @@ "\n{", "\n PresentValue[] BeExperienceAdjustmentForPremium.ByAmountType => Enumerable.Empty().ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k0CqaQ-_ok2vg6GE1FC75A", "cell_type": "code", "source": [ "public interface ActualExperienceAdjustmentForPremium : IScope", @@ -1366,9 +1627,13 @@ "\n{", "\n ActualBase[] ActualExperienceAdjustmentForPremium.ByAmountTypeAndEstimateType => Enumerable.Empty().ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zPtJDlQU6k-Z5r6O60RZaw", "cell_type": "markdown", "source": [ "", @@ -1430,9 +1695,13 @@ "\n$$", "\n", "\nwhere the AoC Step **CF** is implicit for all formulas, $PV$ is the [present value](#present-value) with Estimate Type **BE**, and Actuals have Estimate Types **A**, **AA**, and **OA** (see details [here](#actual-values))." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "19jPup_Bx0GSC7YLpp-7aA", "cell_type": "code", "source": [ "public interface TechnicalMargin : IScope", @@ -1520,9 +1789,13 @@ "\n{", "\n double TechnicalMargin.Value => -1d * AggregatedValue * GetScope(Identity, o => o.WithContext(EconomicBasis)).Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EL8bVpKgg0mqV06dSFrnyg", "cell_type": "markdown", "source": [ "", @@ -1641,9 +1914,13 @@ "\n### Reinsurance case", "\n", "\nFor the reinsurance case, the switch logic is identical to the one described above, except that it uses the gross Technical Margins multiplied by the weights coming from the Reinsurance Coverage Parameter (see [Data Node Parameters](../DataModel/DataStructure#data-node-parameters)). In case a GRIC has multiple GICs, then these weighted $TM$s are aggregated." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wNL0WqL5DEWHPLdAu6D-Qg", "cell_type": "code", "source": [ "public interface AllocateTechnicalMargin: IScope", @@ -1767,21 +2044,33 @@ "\n .Sum(aoc => GetScope(Identity with {AocType = aoc.AocType, Novelty = aoc.Novelty}).Value);", "\n [NotVisible] string AllocateTechnicalMargin.ComputedEstimateType => ComputeEstimateType(AggregatedTechnicalMargin);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "q9wQO79KLE6XecsW71bHug", "cell_type": "markdown", "source": [ "For the **Group of Reinsurance Contracts** (GRICs), the switch is computed within the underlying GIC context and $CSM$ and $LR$ are then computed in the same manner as for the underlying GICs CSM and LC." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wtSp81Pr5k2osiHdsbp9IQ", "cell_type": "markdown", "source": [ "The scopes below are simply used to set the appropriate Estimate Type (C for $CSM$, L for $LC$ and LR for $LoReCo$), as well as to set $CSM$ values to be positive:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YikKMJsnVkabj5NdPZgtRA", "cell_type": "code", "source": [ "public interface ContractualServiceMargin : IScope", @@ -1790,9 +2079,13 @@ "\n ", "\n double Value => -1d * GetScope(Identity, o => o.WithContext(EstimateType)).Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Z7iybzoX0kOwNsxQO5PGHg", "cell_type": "code", "source": [ "public interface LossComponent : IScope", @@ -1801,9 +2094,13 @@ "\n ", "\n double Value => GetScope(Identity, o => o.WithContext(EstimateType)).Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WDtHHWXvdUmzUQSyWWjScQ", "cell_type": "code", "source": [ "public interface LossRecoveryComponent : IScope", @@ -1812,17 +2109,25 @@ "\n ", "\n double Value => GetScope(Identity, o => o.WithContext(EstimateType)).Value;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZktIv7ZYt0qmFTGek6WDHA", "cell_type": "markdown", "source": [ "## Computing All Scopes", "\n", "\nSince all the calculations defined in the various scopes are to be performed together, it is useful to introduce the scope ComputeAllScopes below, which given a certain Import Identity and Import Storage, performs all the calculations (defined above) based on the corresponding data:" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "senAlJILrECJzpbfr5ar4A", "cell_type": "code", "source": [ "public interface ComputeAllScopes: IScope //ComputeIfrsVariable", @@ -1993,13 +2298,20 @@ "\n .Concat(Csms).Concat(Loss),", "\n };", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p-LnlEZSK0W1q5f2SrxZMQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Import/ImportStorage.ipynb b/ifrs17/Import/ImportStorage.ipynb index 41731861..db6aebee 100644 --- a/ifrs17/Import/ImportStorage.ipynb +++ b/ifrs17/Import/ImportStorage.ipynb @@ -18,6 +18,7 @@ "nbformat_minor": 5, "cells": [ { + "id": "b-AJSwH1T0q6LGMLygwVYQ", "cell_type": "markdown", "source": [ "", @@ -39,23 +40,35 @@ "\n- [DataNodes](../DataModel/DataStructure)", "\n", "\nSuch storage is then passed to calculations defined in the corresponding [Import Scopes](./ImportScopeCalculation)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tB8k622IxkexI_F9H3qDew", "cell_type": "code", "source": [ "#!import \"../Utils/EqualityComparers\"", "\n#!import \"../Utils/ImportCalculationMethods\"", "\n#!import \"../Utils/Queries\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "F3zQ1GvRyUyHAKF0DboHiw", "cell_type": "markdown", "source": [ "# Import Storage" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5OFxFeAcmES2tfGQNvWgHw", "cell_type": "code", "source": [ "public class ImportStorage", @@ -377,13 +390,20 @@ "\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);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jVpRLSU0bk6kufLUDDNU3Q", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index d3f3eacf..53fd5640 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -19,29 +19,42 @@ "nbformat_minor": 5, "cells": [ { + "id": "GEBNBjd7AESlxlt81wmoXQ", "cell_type": "markdown", "source": [ "", "\n

Importer Methods

", "\n" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6aPxAWjoMEGEYwn_2mU05g", "cell_type": "code", "source": [ "#!import \"ImportScopeCalculation\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "x_-nRNU4fU6Dnxx46JV05A", "cell_type": "markdown", "source": [ "# Parsing Storage", "\n", "\nThe Parsing storage collects data required for the import of a file. ", "\nSuch storage is then passed to parsing format definitions to map the content of the file into variables." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "97QSbHoWKEGb8n7ygLi1dg", "cell_type": "code", "source": [ "public class ParsingStorage", @@ -208,23 +221,35 @@ "\n ApplicationMessage.Log(Error.InvalidAmountTypeEstimateType, estimateType, amountType);", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nEV2GklBnUqC8JIi92ETNw", "cell_type": "markdown", "source": [ "# Basics", "\n", "\nBasic methods to delete variable and update variables to the data source are defined." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pFCSFdMzVkehiGs_gLbbUg", "cell_type": "markdown", "source": [ "## Clean the Database" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WbGNfikYmUOK7NYwj-HfkQ", "cell_type": "code", "source": [ "async public Task CleanDatabaseAsync (Expression> filter = null) where T : class", @@ -232,9 +257,13 @@ "\n var loadData = await DataSource.Query().Where(filter?? (Expression>)(x => true)).ToListAsync();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "B09ETZusIUyL99bgkGPjRA", "cell_type": "code", "source": [ "async public Task CleanDatabaseFromPartitionAsync (Guid partitionId, Func filter = null) where T : class, IPartitioned", @@ -243,15 +272,23 @@ "\n .Where(filter?? (Func)(x => true)).ToList();", "\n await DataSource.DeleteAsync(loadData);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PMbRolQ05UuKOPa9451dEg", "cell_type": "markdown", "source": [ "## Update the Database" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "EjST6sz8JEurnRLnwPYl1Q", "cell_type": "code", "source": [ "async public Task CommitToDatabase (Guid partitionId, bool snapshot = true, Func filter = null) where T : class, IPartitioned", @@ -260,15 +297,23 @@ "\n await DataSource.UpdateAsync( await Workspace.Query().ToArrayAsync() );", "\n await DataSource.CommitAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pQiCmfx0i0qTKU8MrX7n5w", "cell_type": "markdown", "source": [ "## Data Node Factory" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "iefdpcJCZE2JSkpcLQ_yAA", "cell_type": "code", "source": [ "public async Task DataNodeFactoryAsync(IDataSet dataSet, string tableName, ImportArgs args)", @@ -296,21 +341,33 @@ "\n", "\n await DataSource.CommitAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5zZRjIRbVk6RvrXn7GTtHA", "cell_type": "markdown", "source": [ "# Importers" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8psLQ8lKpU-50HR8Z9fFeg", "cell_type": "markdown", "source": [ "## Analysis of Change Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ptM1upQYJUSJ3HgrC0UyOQ", "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. ", @@ -329,9 +386,13 @@ "\n| WO < Order < CL | WO with Novelty C (only for Import Source = Actual) |", "\n", "\nThe new Aoc Configurations are created with the same order of the Aoc Types. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PXcWmb1qTkKlCSVOjJDHxw", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.AocConfiguration, async (options, dataSet) => {", @@ -406,17 +467,25 @@ "\n await workspace.CommitToTargetAsync(options.TargetDataSource);", "\n return Activity.Finish().Merge(logConfig); ", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0sc5KOQvKEicxmEkg9I2Nw", "cell_type": "markdown", "source": [ "## Parse Main Tab and return Args", "\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. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YiFEJAxq8Eeo4f1pOhrslA", "cell_type": "code", "source": [ "public async Task GetArgsFromMainAsync(IDataSet dataSet)", @@ -473,23 +542,35 @@ "\n await DataSource.CommitAsync();", "\n return args;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D_Yg7U6xL0iEu2J5dYGGQQ", "cell_type": "markdown", "source": [ "## Parse and Upload: Data Nodes", "\n", "\n[Portfolios](../DataModel/DataStructure#portfolios) and [Group of Contracts](../DataModel/DataStructure#group-of-contracts) are imported in the same file. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_YEY_T29PEuM6hOitLi_yA", "cell_type": "markdown", "source": [ "### Portfolio and Group of contract" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "iPkLnvWBw0K_vugEhM6eEA", "cell_type": "code", "source": [ "public async Task UploadDataNodesToWorkspaceAsync(IDataSet dataSet)", @@ -590,9 +671,13 @@ "\n ", "\n return Activity.Finish().Merge(importLogPortfolios).Merge(importLogGroupOfContracts);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dZee9zb4hU-600lxQvKKfA", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNode, async (options, dataSet) => {", @@ -604,15 +689,23 @@ "\n await CommitToDatabase(partition);", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OvJQpOepfUKs9HO05RZt3g", "cell_type": "markdown", "source": [ "### Data Node State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "twd-9JphDkKWlYMzzMHRZg", "cell_type": "code", "source": [ "public async Task ValidateDataNodeStatesAsync(Dictionary persistentDataNodeByDataNode)", @@ -631,9 +724,13 @@ "\n }", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "11oMaqji9ESPXtnfGdol1A", "cell_type": "code", "source": [ "public async Task UploadDataNodeStateToWorkspaceAsync(IDataSet dataSet)", @@ -667,9 +764,13 @@ "\n await ValidateDataNodeStatesAsync(storage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bLmthg_F0UmHmuC_hebLZg", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNodeState, async (options, dataSet) => {", @@ -677,15 +778,23 @@ "\n await CommitToDatabase((Guid)Workspace.Partition.GetCurrent(nameof(PartitionByReportingNode)), snapshot: false); ", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rveYUL5bPUC82CbWaGi4lQ", "cell_type": "markdown", "source": [ "### DataNode Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8BBfuwsh-kKG9CE8LIqlIg", "cell_type": "code", "source": [ "public async Task UploadDataNodeParameterToWorkspaceAsync(IDataSet dataSet, Guid targetPartitionByReportingNodeId)", @@ -771,9 +880,13 @@ "\n targetPartitionByReportingNodeId = storage.TargetPartitionByReportingNode.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qresbZmRKUGDdhb2Qg2bYQ", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.DataNodeParameter, async (options, dataSet) => {", @@ -785,9 +898,13 @@ "\n ", "\n return log;", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pbi5WLybL0WeWvmp48L8dA", "cell_type": "markdown", "source": [ "## Parse and Upload: Variables", @@ -798,15 +915,23 @@ "\n", "\nSome computed variables depend on both cash flow and actual input, requiring recalculation at each new import. ", "\n
In order to improve performance and maximize computational efficiency, we only (re)compute the set of variables that are expected to change given the underlying business logic. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0qtpigTMXUeFOJBGAhD64A", "cell_type": "markdown", "source": [ "### Validation for Active Data Node States" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "df6Q6O4n8UGZ6QMEHXWp7Q", "cell_type": "code", "source": [ "public async Task ValidateForDataNodeStateActiveAsync(Dictionary dataNodes) where T : BaseDataRecord", @@ -815,15 +940,23 @@ "\n if(!dataNodes.ContainsKey(item.First().DataNode))", "\n ApplicationMessage.Log(Error.InactiveDataNodeState, item.First().DataNode);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zer3DehdW0OXTbIW-BE5wQ", "cell_type": "markdown", "source": [ "### Cashflow as Raw Variable and Ifrs Variable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "qxiTr4OQU02FSTwnCLjAqg", "cell_type": "code", "source": [ "public async Task ParseCashflowsToWorkspaceAsync(IDataSet dataSet, ImportArgs args)", @@ -889,9 +1022,13 @@ "\n await ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "d2PR6nE090qnEhAx26W4Fw", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.Cashflow, async (options, dataSet) => {", @@ -923,15 +1060,23 @@ "\n", "\n return Activity.Finish().Merge(parsingLog); ", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "F_ov9xx25ECCgKn8LjsZgw", "cell_type": "markdown", "source": [ "### Actuals as Ifrs Variable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kEyrQCxqEkmoUupmjE-B8Q", "cell_type": "code", "source": [ "public async Task ParseActualsToWorkspaceAsync(IDataSet dataSet, ImportArgs args)", @@ -991,9 +1136,13 @@ "\n await ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HqDpHFbZNkynz3nM9TSiDA", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.Actual, async (options, dataSet) => {", @@ -1022,9 +1171,13 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cl1ZHPkmTk66Nh-WZoQ0Ag", "cell_type": "markdown", "source": [ "# Simple Value Import", @@ -1033,15 +1186,23 @@ "\n
It can be used in two very different scenarios: ", "\n- Simple Value : to import final figures as computed by an independent tool. In this case our IFRS 17 calculation is not applied and variable are stored in the Database for being consumed in reports with our powerful reporting tooling. ", "\n- Opening value : in the **fair value approach** this importer allows the import of in force opening values (Aoc step BOP and novelty I) for EstimateTypes C, L, LR, AA, OA, DA." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jjIv6ndV_EeSuPrStrKGNQ", "cell_type": "markdown", "source": [ "## Simple Value to Workspace" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k8vc0EGeGk2hVkNAYZzgig", "cell_type": "code", "source": [ "public async Task ParseSimpleValueToWorkspaceAsync(IDataSet dataSet, ImportArgs args, Guid targetPartitionByReportingNodeAndPeriodId)", @@ -1103,15 +1264,23 @@ "\n targetPartitionByReportingNodeAndPeriodId = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id;", "\n return Activity.Finish().Merge(importLog);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RQi9nkdXQEmaeLBlImg__A", "cell_type": "markdown", "source": [ "## Simple Value as IfrsVariable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DJPGRNmcW0u6oJJTFjNFLg", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.SimpleValue, async (options, dataSet) => {", @@ -1132,15 +1301,23 @@ "\n ", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uAVHYz0MD0SFk1IMsDUcIw", "cell_type": "markdown", "source": [ "## Openings as IfrsVariable" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oyD6qvynF0Or3udnGnPqoQ", "cell_type": "code", "source": [ "Import.DefineFormat(ImportFormats.Opening, async (options, dataSet) => {", @@ -1170,13 +1347,20 @@ "\n", "\n return Activity.Finish().Merge(parsingLog);", "\n});" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "PijxDGahGkKV1GD0j9HrCg", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/OverviewCalculationEngine.ipynb b/ifrs17/OverviewCalculationEngine.ipynb index 651ab74b..62ff16a0 100644 --- a/ifrs17/OverviewCalculationEngine.ipynb +++ b/ifrs17/OverviewCalculationEngine.ipynb @@ -18,12 +18,17 @@ "nbformat_minor": 5, "cells": [ { + "id": "3f2xh5L6m0OJIHBDr3UlXg", "cell_type": "markdown", "source": [ "

IFRS 17 Calculation Engine - an Overview

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CUdOibiJDEewI_wagM7MpA", "cell_type": "markdown", "source": [ "# Introduction", @@ -33,9 +38,13 @@ "\nThis notebook provides an **overview** of Systemorph's IFRS 17 Calculation Engine with brief introductions to all the main steps.", "\n", "\nThere are numerous **links** to several notebooks of the Calculation Engine. These notebooks contain specifications, code and also some detailed explanations with formulas in markdown blocks. The most important ones in this respect are [DataStructure](./DataModel/DataStructure#data-structure), [ImportScopes](./Import/ImportScopeCalculation#import-scope-calculation) and [ReportScopes](./Report/ReportScopes#report-scopes)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3IgPzAqQsEa9vnFOg7U30g", "cell_type": "markdown", "source": [ "", @@ -66,9 +75,13 @@ "\n - Liability for Incurred Claims (LIC)", "\n - Financial Performance", "\n - Accounting Events" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p2eQ-g5oYUKG2H4ZlhOBWw", "cell_type": "markdown", "source": [ "", @@ -77,9 +90,13 @@ "\nThe IFRS 17 calculations are based on a well-defined [DataModel](./DataModel/DataStructure#data-structure). The data input files are set up according to the data model, and the data import and all the ensuing calculations up to the final report generation respect the data model.", "\n", "\nThe IFRS 17 calculations start by importing data input files, and the more complex IFRS 17 Business Logic is defined in the [ImportScopes](./Import/ImportScopeCalculation#import-scope-calculation) notebook. This basis will later be used to calculate and generate different reports." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CvHU8yPgcku6OEvcmEIpSQ", "cell_type": "markdown", "source": [ "", @@ -92,9 +109,13 @@ "\nThe [input files](#data-input-dim-nodes) for ReportingNodes and especially Dimensions provide an overview of data structures actually used. Some dimensions are hierarchical, so some entries have parent entries.", "\n", "\nMany abbreviations and acronyms used later in the documentation and the code are the **system names**, where the corresponding display names can be found in the corresponding input files together with the attributes." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jOqvoH1Bl0ewf9in5N9NIQ", "cell_type": "markdown", "source": [ "", @@ -107,9 +128,13 @@ "\nImportStorage --> ImportScopeCalculation --> Importers", "\n", "\nThe calculations of ImportScopeCalculation cover a large part of the IFRS 17 methodology and are explained in the section below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k_CuwJdj_UOGz6TPZHdngQ", "cell_type": "markdown", "source": [ "", @@ -150,9 +175,13 @@ "\n - [Fulfillment Cashflow (FCF)](./Import/ImportScopeCalculation#fulfillment-cashflow), same as the aforementioned cumulated discounted cashflow, now adding the risk adjustment component as a basis for CSM and LC calculations", "\n - [Technical Margin](./Import/ImportScopeCalculation#technical-margin), which is the FCF with special rules for different AoC steps including the Amortization step, also using and calculating the Interest Accretion Factor, Premiums, Deferrals and Investment Claims", "\n - [Switch Logic for CSM and LC](./Import/ImportScopeCalculation#technical-margin), switching between CSM and LC for a given AoC step in the AoC period; one of the two is always zero depending on the sign of the Technical Margin; distinguishing the [gross case](./Import/ImportScopeCalculation#gross-case) (no reinsurance) from the [reinsurance case](./Import/ImportScopeCalculation#reinsurance-case) which applies reinsurance coverage weights" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RzhAC13vCE6swA2hTa2Sqw", "cell_type": "markdown", "source": [ "", @@ -165,7 +194,10 @@ "\nSome reports of ReportScopes just present existing data from the database, namely the imported data and the results already calculated using the methods of [ImportScopes](#model-calc).", "\n", "\nSome other reports related to **[Financial Performance](./Report/ReportScopes#ifrs-17-financial-performance)** (profit & loss) require further calculations provided by ReportScopes. An IFRS 17 financial performance report has at least four sections: Insurance Revenue, Insurance Service Expense, Insurance Finance Income/Expense and Other Comprehensive Income. Formulas are provided [here](./Report/ReportScopes#ifrs-17-financial-performance)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index 43ecc78c..e6c85b7d 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -18,19 +18,28 @@ "nbformat_minor": 5, "cells": [ { + "id": "G81HH-rybkeg0vlY1DNDgA", "cell_type": "markdown", "source": [ "

Report Configuration And Utils

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8YLIovEcLkm_r75W6SD-tQ", "cell_type": "code", "source": [ "#!import \"../Utils/EqualityComparers\"", "\n#!import \"../Utils/Queries\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YDShzSvSMEydbrp8JkeGsQ", "cell_type": "code", "source": [ "using Systemorph.Vertex.Pivot.Builder;", @@ -51,15 +60,23 @@ "\n .ToArray())", "\n .WithAutoGroupColumn(c => c.WithWidth(headerColumnWidth) with { Pinned = \"left\" })", "\n with { Height = reportHeight, GroupDefaultExpanded = groupDefaultExpanded, OnGridReady = null } );" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "n6rie8G-ykemdglb-7PEvw", "cell_type": "markdown", "source": [ "# Currency methods" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "puLk5ud_Ck6vPZU4g9XFFQ", "cell_type": "code", "source": [ "public static double GetCurrencyToGroupFx(Dictionary> exchangeRates, string currency, FxPeriod fxPeriod, string groupCurrency)", @@ -75,21 +92,33 @@ "\n", "\n return currencyToGroupFx;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nqjo4v0cw0-uU5WuJwKR6g", "cell_type": "markdown", "source": [ "# Queries" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JH81cH0s3k-O6MdnNoeqVA", "cell_type": "markdown", "source": [ "## Query Report Variables" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "uRooxq8TMEqondN6Rh6pAw", "cell_type": "code", "source": [ "public static async Task QueryReportVariablesSingleScenarioAsync(this IWorkspace workspace, (int Year, int Month, string ReportingNode, string Scenario) args ) {", @@ -141,9 +170,13 @@ "\n await workspace.Partition.SetAsync(null);", "\n return reportVariables;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mSy1fCO1M0ONNi3ki_Pmxw", "cell_type": "code", "source": [ "public static async Task> QueryReportVariablesAsync(this IWorkspace workspace, (int Year, int Month, string ReportingNode, string Scenario) args ) {", @@ -153,13 +186,20 @@ "\n return (await workspace.QueryReportVariablesSingleScenarioAsync((args.Year, args.Month, args.ReportingNode, args.Scenario)))", "\n .Union(reportVariables.Select(x => x with {Scenario = args.Scenario}), EqualityComparer.Instance).ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Sv4LupuFhkaAnNNufoj3ag", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Report/ReportMutableScopes.ipynb b/ifrs17/Report/ReportMutableScopes.ipynb index ffc3f5df..f76e992e 100644 --- a/ifrs17/Report/ReportMutableScopes.ipynb +++ b/ifrs17/Report/ReportMutableScopes.ipynb @@ -16,50 +16,79 @@ "nbformat_minor": 5, "cells": [ { + "id": "4-B50jXklE2YDIuIe3HA2w", "cell_type": "markdown", "source": [ "", "\n

Report Mutable Scopes

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FYMR6GSWdUyCG1R-fIE1Vw", "cell_type": "markdown", "source": [ "This notebook contains the set up of mutable scopes used to achieve high interactivity with reports." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "0JhA_sNpO0izpVqyzUX_Eg", "cell_type": "markdown", "source": [ "# References", "\nLibraries and other notebooks which are needed for this notebook are imported below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "UvJZERnCKUCBkDX8E0AU4g", "cell_type": "code", "source": [ "#!import \"ReportScopes\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LtTQpqceO0G0az5CE1YolA", "cell_type": "markdown", "source": [ "# Mutable Scope" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rwM6oqgcL0STU-YscKiCQQ", "cell_type": "markdown", "source": [ "The IIfrs17Report mutable scope is created with applicabilities to control how the data for each individual report is retrieved from the [report scopes](./ReportScopes)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XNQ232XQiUOqTdvMRJCv1w", "cell_type": "code", "source": [ "public interface ReportUniverse : IMutableScopeWithStorage{}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eBl7wxcU4EaUPLogx9wtYg", "cell_type": "code", "source": [ "[InitializeScope(nameof(InitAsync))]", @@ -259,21 +288,33 @@ "\n ? GetScopes(GetIdentities()).Aggregate().FinancialPerformance", "\n : GetScopes(GetIdentities()).Aggregate().FinancialPerformance.Filter(dataFilter);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gU99z__YGU2k9S64YWfNoQ", "cell_type": "markdown", "source": [ "# IFRS 17 Reports" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bxYmQqMxw0atpKUxyO_Vsg", "cell_type": "markdown", "source": [ "This class is used to trigger the calculation of the reports and it is exposed to the end-user in the reports." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6GqpaLYsskm-MRqPqzLMvg", "cell_type": "code", "source": [ "public class Ifrs17Reports ", @@ -310,13 +351,20 @@ "\n public IIfrs17Report Lic => reportUniverse.GetScope(nameof(LicReport));", "\n public IIfrs17Report FinancialPerformance => reportUniverse.GetScope(nameof(FpReport));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "osiVbq3V10aq7PZzUsHrdA", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Report/ReportScopes.ipynb b/ifrs17/Report/ReportScopes.ipynb index b8a73b15..fe17e3d7 100644 --- a/ifrs17/Report/ReportScopes.ipynb +++ b/ifrs17/Report/ReportScopes.ipynb @@ -18,74 +18,119 @@ "nbformat_minor": 5, "cells": [ { + "id": "_jUdggiDrUyBhzYT-zsKlg", "cell_type": "markdown", "source": [ "", "\n

Report Scopes (IFRS17 Methodology Business Logic)

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FCENXAo530GTEsahnzh3Zg", "cell_type": "markdown", "source": [ "This notebook contains the logic used to perform calculations upon reporting of data." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "k-67Zop3rk6rPomMgZXjpg", "cell_type": "markdown", "source": [ "# References", "\nLibraries and other notebooks which are needed for this notebook are imported below." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kmL7X4N-cEiLhdpkQ-IxCQ", "cell_type": "markdown", "source": [ "## Notebooks" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "F2Ak5SkrkkKRPq9k2iDyvw", "cell_type": "code", "source": [ "#!import \"ReportStorage\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rtjV1Wjggk-Q5YLDgDjl4A", "cell_type": "markdown", "source": [ "# Scopes" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jI7xd2iiDk6piQEpKjxoEQ", "cell_type": "markdown", "source": [ "## Helper Scopes" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4yXIuwsJmUuwuLKrj4iWWQ", "cell_type": "markdown", "source": [ "### Universe" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "r6QP8peSmkyuJm6uEbonxw", "cell_type": "code", "source": [ "public interface IUniverse: IScopeWithStorage {}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zFL_sMbgU0CN5e4NZ813YA", "cell_type": "markdown", "source": [ "## Data Transformation" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nQVTU_-Eg0yRndbemAgtXA", "cell_type": "markdown", "source": [ "### Retrieve Raw Data" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ymr0ZlbYG0um2uqiz3v6UA", "cell_type": "code", "source": [ "public interface Data: IScope<(ReportIdentity ReportIdentity, string EstimateType), ReportStorage>, IDataCube {", @@ -110,15 +155,23 @@ "\npublic interface DataWrittenActual: Data {", "\n IDataCube Data.Data => RawData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2vgu3Y_ASU29KA6DDK4lpQ", "cell_type": "markdown", "source": [ "### Foreign Exchange (FX) Rates" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rbuEOG3Gq0O68H41e9mDaA", "cell_type": "code", "source": [ "public interface Fx: IScope<(string ContractualCurrency, string FunctionalCurrency, FxPeriod FxPeriod, (int, int) Period, CurrencyType CurrencyType), ReportStorage> { ", @@ -134,9 +187,13 @@ "\n ", "\n double Fx => GetFunctionalFxRate(Identity.FxPeriod) * groupFxRate;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OL1a5GVDXUePbsqWJV1SFA", "cell_type": "code", "source": [ "public interface FxData: IScope<(ReportIdentity ReportIdentity, CurrencyType CurrencyType, string EstimateType), ReportStorage>, IDataCube {", @@ -166,24 +223,36 @@ "\npublic interface FxDataWrittenActual: FxData {", "\n IDataCube FxData.FxData => Data;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "NIBuXEsJL06BDspV6kTFjA", "cell_type": "markdown", "source": [ "## Present Value" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tfD7_v70RkiwMtqIi9PUGg", "cell_type": "markdown", "source": [ "", "\n### Best Estimate", "\n", "\nBest Estimate of Present Value (PV) report includes contributions from the [Present Value](../Import/ImportScopeCalculation#present-values) calculation. The result of the Locked-in calculation is used when the Valuation Approach is BBA and the flag for Oci is active." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "E63asVZNJkm2FlOPo5UiaQ", "cell_type": "code", "source": [ "public interface BestEstimate: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -201,18 +270,26 @@ "\n IDataCube CurrentBestEstimate => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.BE)).FxData", "\n .Filter((\"LiabilityType\", Identity.Id.LiabilityType), (\"EconomicBasis\", EconomicBases.C));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "OSD06OKuX024WjdhfeUpKg", "cell_type": "markdown", "source": [ "", "\n### Risk Adjustment", "\n", "\nRisk Adjustment (RA) report includes contributions from the [Risk Adjustment](../Import/ImportScopeCalculation#risk-adjustment) calculation. The result of the Locked-in calculation is used when the Valuation Approach is BBA and the flag for Oci is active." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "s6YtyFfYD0-IBvSoruABxQ", "cell_type": "code", "source": [ "public interface RiskAdjustment: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -230,17 +307,25 @@ "\n IDataCube CurrentRiskAdjustment => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.RA)).FxData", "\n .Filter((\"LiabilityType\", Identity.Id.LiabilityType), (\"EconomicBasis\", EconomicBases.C));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2lAiiNzYE024n3K2gWD5TA", "cell_type": "markdown", "source": [ "", "\n## Fulfillment Cashflows", "\nFulfillment Cashflows (FCF) report includes contributions from the [Best Estimate](#best-estimate) of Present Value and [Risk Adjustment](#risk-adjustment) Present Value." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "32lphidM90CypfxohxRmPA", "cell_type": "code", "source": [ "public interface Fcf: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -263,42 +348,62 @@ "\n ", "\n IDataCube LockedFcf => BestEstimate + RiskAdjustment;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "c_u6A_a9WU2mKDRqKmdzFQ", "cell_type": "markdown", "source": [ "", "\n## LRC Technical Margin: CSM, LC, LoReCo", "\n", "\nContractual Service Margin (CSM), Loss Component (LC), Loss Recovery Component (LoReCo) reports of the Liability for Remaining Coverage (LRC) include contributions from the calculation of [CSM](../Import/ImportScopeCalculation#csm), [LC](../Import/ImportScopeCalculation#csm), and [LoReCo](../Import/ImportScopeCalculation#csm), respectively." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TUE27vAmQkWg0ezEqXWxRQ", "cell_type": "code", "source": [ "public interface Csm: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", "\n IDataCube Csm => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.C)).FxData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-SGsILz87kComI2ryE1PPw", "cell_type": "code", "source": [ "public interface Lc: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", "\n IDataCube Lc => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.L)).FxData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7Lzjmyf7fkSxbTm5DqqS9Q", "cell_type": "code", "source": [ "public interface Loreco: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", "\n IDataCube Loreco => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.LR)).FxData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YEqw7EtuUEqkhmOGvwd-Xg", "cell_type": "code", "source": [ "public interface LrcTechnicalMargin: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -308,9 +413,13 @@ "\n ", "\n IDataCube LrcTechnicalMargin => Lc + Loreco - 1 * Csm;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lM0v7sd3zUmm29lWswyOgg", "cell_type": "markdown", "source": [ "", @@ -319,9 +428,13 @@ "\nWritten Actual (Actual) report includes contributions from the [Actual](../Import/ImportScopeCalculation#actuals) import. ", "\n
Accrual Actuals (Advance, Overdue Actual) report includes contributions from the [Advance](../Import/ImportScopeCalculation#advance-actuals) and [Overdue](../Import/ImportScopeCalculation#overdue-actuals) Actual calculation.", "\n
Deferral (Deferral Actual) report includes contributions from the calculation of [Deferral](../Import/ImportScopeCalculation#deferrable-actuals) Actual." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6XEGR7p1mUCG81V7tcooHA", "cell_type": "code", "source": [ "public interface WrittenAndAccruals: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -329,25 +442,37 @@ "\n IDataCube Advance => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.AA)).FxData;", "\n IDataCube Overdue => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.OA)).FxData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GmCd7oNDAE2xXgDVnfPpQg", "cell_type": "code", "source": [ "public interface Deferrals: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", "\n IDataCube Deferrals => GetScope((Identity.Id, Identity.CurrencyType, EstimateTypes.DA)).FxData;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "QbqNuXbyKEyPhcyRLIMeTw", "cell_type": "markdown", "source": [ "## Experience Adjustment", "\n", "\nExperience Adjustment (EA) report includes contributions from the [Written](#written-accrual-deferral) Actual report and the [Best Estimate](#best-estimate) of Present Value report (only the *Cash flow* AocStep). " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "daTkuCMpPE6-KM2VA5EiVA", "cell_type": "code", "source": [ "public interface ExperienceAdjustment: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -360,35 +485,51 @@ "\n", "\n IDataCube ActuarialExperienceAdjustment => WrittenCashflow - BestEstimateCashflow;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7BLBDJJG60imA4l4SJTO8g", "cell_type": "markdown", "source": [ "", "\n## LIC Actuarial (Actuarial Liability for Incurred Claims)", "\n", "\nActuarial Liability of Incurred Claims (LIC Actuarial) report includes the contributions from [Fulfillment cashflow](#fulfillment-cashflows)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_AULGacqNUum95KZX-PBMg", "cell_type": "code", "source": [ "public interface LicActuarial: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", "\n IDataCube LicActuarial => GetScope(Identity).CurrentFcf.Filter((\"LiabilityType\", LiabilityTypes.LIC));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_uefLxRQg0mTthc9-Nq4IA", "cell_type": "markdown", "source": [ "", "\n## LIC (Liability for Incurred Claims)", "\n", "\nLiability of Incurred Claims (LIC) report includes the contributions from [LIC Actuarial](#lic-actuarial) (Fullfilment Cashflow), [Advance](#written-accrual-deferral) Actual, and [Overdue](#written-accrual-deferral) Actual." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "zpDmC1m_QkioS6c5DCwG1g", "cell_type": "code", "source": [ "public interface Lic: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -405,18 +546,26 @@ "\n ", "\n IDataCube Lic => bop + delta + eop;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5QxEG_hUsk2V1Qr7j222CA", "cell_type": "markdown", "source": [ "", "\n## LRC Actuarial (Actuarial Liability for Remaining Coverage)", "\n", "\nActuarial Liability for Remaining Coverage (LRC) report includes all the contributions from [Fulfillment cashflow](#fulfillment-cashflows), [Contructual Sevice Margin](#technical-margin), [Loss Component](#technical-margin), and [Loss Recovery Component](#technical-margin)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "a9T_pIpBd0yGYTlAWfXkpw", "cell_type": "code", "source": [ "public interface LrcActuarial: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -426,18 +575,26 @@ "\n ", "\n IDataCube LrcActuarial => Fcf + Csm + Loreco;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pRaL_4nHG02rEuyl_ad4CA", "cell_type": "markdown", "source": [ "", "\n## LRC (Liability for Remaining Coverage)", "\n", "\nLiability for Remaining Coverage (LRC) report includes all the contributions from [LRC Actuarial](#lrc-actuarial) (Fulfillment Cashflow, Contructual Sevice Margin, Loss Component, Loss Recovery Component) and, [Advance](#written-accrual-deferral) Actual, and [Overdue](#written-accrual-deferral) Actual." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WO319mP3Y0i-8FXf9phGoQ", "cell_type": "code", "source": [ "public interface Lrc: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -454,16 +611,24 @@ "\n ", "\n IDataCube Lrc => bop + delta + eop;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "olUh-gLctUKqNfn8A1FU4g", "cell_type": "markdown", "source": [ "", "\n# IFRS 17 Financial Performance" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-pWSLHQ6BEiVRhO7lJSW0w", "cell_type": "markdown", "source": [ "The IFRS 17 Financial Performance aims at disclosing the deltas (i.e. difference between EoP and BoP, or the Change in Estimate) of the IFRS 17 Balance Sheet items (LRC, LIC) and the relevant incurred cashflows (Premiums, Claims, Expenses, etc...) for the given period.", @@ -505,15 +670,23 @@ "\n$$", "\n", "\nUsually, some more details on the items above are desired (e.g. separating the LRC into its components FCF, RA, CSM/LC or explicitly showing the CSM Amortization vs. other financial/non-financial adjustments to the CSM estimation). These are specific to each implementation and depend on the data granularity (e.g. how the Amount Types, AoC steps are detailed and structured). This level of detail is omitted from the generic documentation presented here, but are implicit to the way each item above is calculated. Nevertheless, this extra granularity is available when the reports are generated and sliced by the corresponding dimensions. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "87HgSSgPc0esWEFkSSQbYg", "cell_type": "markdown", "source": [ "## Fulfillment Cashflows (excluding the Loss Component)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "iRZKr4GKJUypzzUVaj_FaA", "cell_type": "markdown", "source": [ "Let us first describe the Balance Sheet items, where we need to disclose the Changes in Estimate in the Financial Performance.", @@ -534,9 +707,13 @@ "\nThe Financial contributions are reported in 'Financial LIC Changes' for a Group of Contract with Liability Type LIC and to 'Financial LRC Changes' for a Group of Contract with Liability Type LRC.", "\n
The Non Financial contributions are reported in 'Non Financial LIC Changes' for a Group of Contract with Liability Type LIC. For a Group of Contract with Liability Type LRC, they are reported in 'Non-Financial LRC Changes (Exc. CSM Amortization)' for a Group of Insurance Contract and in 'Non-Financial Reinsurance LRC Changes (Exc. LC/LoReCo)' for a Group of Reinsurance Contract.", "\n
The Oci contributions are reported in the 'Other Comprehensive Income' section under 'Financial LIC Changes' or a Group of Contract with Liability Type LIC and to 'Financial LRC Changes' for a Group of Contract with Liability Type LRC." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yGaOPpu5p0G1MQls1BXj7g", "cell_type": "code", "source": [ "public interface FcfChangeInEstimate: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -594,15 +771,23 @@ "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(rv => rv with { Novelty = Novelties.C, VariableType = variableTypeOciFinancial});", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "6yzD7vGt10uiK-1r4mR6PQ", "cell_type": "markdown", "source": [ "Subsequently, the Contractual Service Margin (CSM), Loss Component (LC) and Loss Recovery Component (LoReCo) are also divided into non-financial and financial components. In addition the corresponding amortization/releases (CSM Amortization, LC Release and LoReCo Release) are also explicitly shown." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "2JE11m-Dn0qxXR5pl8cLEw", "cell_type": "markdown", "source": [ "## Contractual Service Margin (CSM)", @@ -616,9 +801,13 @@ "\n
The Amortization contribution is reported in 'Insurance Revenue' under 'CSM Amortization' or in 'Insurance Service Expense' under 'Reinsurance CSM Amortization' for a Group of Insurance Contract and a Group of Reinsurance Contract, respectively. ", "\n
The Financial contributions are reported in 'Financial LRC Changes'.", "\n
The Non Financial contributions are reported in 'Non-Financial LRC Changes (Exc. CSM Amortization)' and 'Non-Financial Reinsurance LRC Changes (Exc. LC/LoReCo)' for a Group of Insurance Contract and a Group of Reinsurance Contract, respectively. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "wBzBXtv0WU-4jYPn9U-wjQ", "cell_type": "code", "source": [ "public interface CsmChangeInEstimate: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -648,9 +837,13 @@ "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IFIE1\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7We5gUppukC5PIKD6AvRtQ", "cell_type": "markdown", "source": [ "## Loss Component (LC)", @@ -664,9 +857,13 @@ "\n
The Amortization contribution is reported in 'Loss Component Release'.", "\n
The Financial contributions are reported in 'Financial LRC Changes'.", "\n
The Non Financial contributions are reported in 'Loss Component / LoReCo Changes (Exc. Releases)'." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1OX7jmo1u0qucu_hK3fc2Q", "cell_type": "code", "source": [ "public interface LcChangeInEstimate: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -691,9 +888,13 @@ "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IFIE1\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1U-L40Fnh02n4EVojEwt_g", "cell_type": "markdown", "source": [ "## Loss Recovery Component (LoReCo)", @@ -707,9 +908,13 @@ "\n
The Amortization contribution is reported in 'LoReCo Release'.", "\n
The Financial contributions are reported in 'Financial LRC Changes'.", "\n
The Non Financial contributions are reported in 'Loss Component / LoReCo Changes (Exc. Releases)'." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mff2Ff27G0mYqJQPfGD8AA", "cell_type": "code", "source": [ "public interface LorecoChangeInEstimate: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -734,15 +939,23 @@ "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IFIE1\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "nXJNTJrviEOmKUkfCkhiiw", "cell_type": "markdown", "source": [ "## Incurred Actuals" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cnTgM4V6M067D6fex6xYiw", "cell_type": "markdown", "source": [ "After the main Balance Sheet items, we need to disclose the Incurred Cashflows (i.e. Actuals) for the period in the Financial Performance (which includes the effect of Advance and Overdue Accruals, but Write-Off amounts are not taken into account).", @@ -754,9 +967,13 @@ "\n- Claims Investment Component contributions are reported under 'Insurance Service Expense' in 'Acquisition Expenses' section and under 'Insurance Revenue' in 'Exc. Investment Components' section with a sign change,", "\n- Expenses contributions are reported under 'Insurance Service Expense' in 'Expenses' section,", "\n- Commissions contributions are reported under 'Insurance Service Expense' in 'Commissions' section." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GcIzXWU8AUq2EvF-1feb_g", "cell_type": "code", "source": [ "public interface IncurredActuals: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -789,21 +1006,33 @@ "\n .Where(x => GetStorage().GetHierarchy().Ancestors(x.AmountType, includeSelf: true).Any(x => x.SystemName == AmountTypes.AC))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"ISE4\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XJJJPF92_E-e0GD3rJSWQQ", "cell_type": "markdown", "source": [ "## Incurred Deferrals and Acquisition Expenses" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XSS55G_c7UiKAwnsGXRUPg", "cell_type": "markdown", "source": [ "The next item are the Deferrals, where the Amortization is the only contribution explicitly shown, but these do not have any direct impact on the Financial Performance under the current methodology assumptions. The Amortization contribution is here considered with its sign changed. This contribution is allocated under 'Insurance Service Expense' in 'Acquisition Expenses' section and under 'Insurance Revenue' in 'Acquistion Expenses Amortization' section with a sign change. " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "yvtBdx8DfkC1Ovp_U8RSgw", "cell_type": "code", "source": [ "public interface IncurredDeferrals: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -815,22 +1044,34 @@ "\n IDataCube AmortizationToIr => (-1 * Amortization).SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IR4\" });", "\n IDataCube AmortizationToIse => Amortization.SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"ISE6\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "hDUy7NYvt0yV69m-BBvghQ", "cell_type": "markdown", "source": [ "## Experience Adjustment on Premium (allocation to CSM vs P&L recognition)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ryvagAUg8U6YShWSSB9glg", "cell_type": "markdown", "source": [ "The figures disclosed in the Financial Performance as described above consider full Premiums for past, current and future services (for Best Estimate and Actuals).", "\nHowever, we applied the Premium Allocation factor in the CSM computations to adjust for the experience. To correct this, we need to exclude the Experience Adjustment on Premium part in the Financial Performance to avoid double counting and it is allocated under 'Insurance Revenue' in the 'Exc. Experience Adjustment on Premiums' section." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sU1M91XJ0UK6I31YdF86mg", "cell_type": "code", "source": [ "public interface ExperienceAdjustmentOnPremium: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -843,21 +1084,33 @@ "\n .AggregateOver(nameof(Novelty), nameof(VariableType))", "\n .SelectToDataCube(v => v with { Novelty = Novelties.C, VariableType = \"IR6\" });", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "AEQ0pDhL5UKqmPJVbk-5dQ", "cell_type": "markdown", "source": [ "## Financial Performance" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DptCmibiyESCNqXKLfX2dg", "cell_type": "markdown", "source": [ "As the last step, all the contributions above are calculated and combined into the Financial Performance, which will be used to generate the final report." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ii5nhJOlykOUsHamB2X5pQ", "cell_type": "code", "source": [ "public interface FinancialPerformance: IScope<(ReportIdentity Id, CurrencyType CurrencyType), ReportStorage>, IDataCube {", @@ -872,13 +1125,20 @@ "\n ", "\n IDataCube FinancialPerformance => FcfChangeInEstimate + CsmChangeInEstimate + LcChangeInEstimate + LorecoChangeInEstimate + IncurredActuals + IncurredDeferrals + ExperienceAdjustmentOnPremium;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YlhbqrDEhEqxO83nS1Jqkg", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Report/ReportStorage.ipynb b/ifrs17/Report/ReportStorage.ipynb index f71ce9e8..fb5fff54 100644 --- a/ifrs17/Report/ReportStorage.ipynb +++ b/ifrs17/Report/ReportStorage.ipynb @@ -18,6 +18,7 @@ "nbformat_minor": 5, "cells": [ { + "id": "1PJN6PAzZkuiz9CSQFSHuQ", "cell_type": "markdown", "source": [ "", @@ -28,21 +29,33 @@ "\nThe Report Storage collects the required data and parameters used in the calculations.", "\n", "\nBoth Storage and Identity are defined to support the calculations defined in the corresponding [Report Scopes](./ReportScopes)." - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fiz_NudplEqKgTW2opTLTQ", "cell_type": "code", "source": [ "#!import \"ReportConfigurationAndUtils\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Y_VqzYOdekWZUm6JV8ylqw", "cell_type": "markdown", "source": [ "# Report Identity" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "XDkSxyikzECrdEnqADyjJQ", "cell_type": "code", "source": [ "[IdentityAggregationBehaviour(IdentityAggregationBehaviour.Aggregate)]", @@ -80,15 +93,23 @@ "\n ", "\n public bool IsOci { get; init; } ", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZDfc2OninkSDvaY7EQF9Rg", "cell_type": "markdown", "source": [ "# Report Storage" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TD8VjJUqrUW3Hya0qH8Lkg", "cell_type": "code", "source": [ "public class ReportStorage {", @@ -207,13 +228,20 @@ "\n return descendants.Where(x => !descendants.Select(y => y.Parent).Contains(x.SystemName)).Select(x => x.SystemName).ToHashSet();", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "X8pPD9yFS0euioBXF3GJyA", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Test/AocConfigurationTest.ipynb b/ifrs17/Test/AocConfigurationTest.ipynb index 501b0574..a19ffac1 100644 --- a/ifrs17/Test/AocConfigurationTest.ipynb +++ b/ifrs17/Test/AocConfigurationTest.ipynb @@ -16,24 +16,37 @@ "nbformat_minor": 5, "cells": [ { + "id": "RvStBkOdQ0qCjIE9nw6vXg", "cell_type": "markdown", "source": [ "

Test Aoc Configuration

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Q6WMnHkb20q4NHKjIkv7PQ", "cell_type": "code", "source": [ "#!import \"../CalculationEngine\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oErV2qfnK0Oj3-gnLxBzQw", "cell_type": "markdown", "source": [ "# Workspace Initialization " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "53B8s-spOkmfP6SngEWjAA", "cell_type": "code", "source": [ "string novelties = ", @@ -42,28 +55,44 @@ "\nI,In Force,,1", "\nN,New Business,,10", "\nC,Combined,,20\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ENCsBW3eVEycGgR5HwvThA", "cell_type": "code", "source": [ "await Import.FromString(novelties).WithType().WithTarget(DataSource).ExecuteAsync()" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YBmxdsvzoEGKiEaf5FOOAg", "cell_type": "code", "source": [ "var workspace = Workspace.CreateNew();", "\nworkspace.InitializeFrom(DataSource);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "BkjPwerC0E2S87WaUdeOfg", "cell_type": "markdown", "source": [ "# Canonical Aoc Types and Configurations" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5CJAH8_bR0aj6rOjfxeSiw", "cell_type": "code", "source": [ "string canonicalAocTypes = ", @@ -86,9 +115,13 @@ "\nAM,Amortization,,150,,,,,,,,", "\nFX,FX Impact,,160,,,,,,,,", "\nEOP,Closing Balance,,170,,,,,,,,\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "O2-y9gewBEK4CDCWSPoTcg", "cell_type": "code", "source": [ "string canonicalAocConfig = ", @@ -115,15 +148,23 @@ "\nAM,C,Calculated,6,EndOfPeriod,NotApplicable,NotApplicable,NotApplicable,EndOfPeriod,200,1900,1", "\nFX,C,Calculated,0,NotApplicable,NotApplicable,NotApplicable,NotApplicable,NotApplicable,210,1900,1", "\nEOP,C,Calculated,6,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,EndOfPeriod,220,1900,1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "fXmeKnWrMkipdOdvmDEdYg", "cell_type": "markdown", "source": [ "# Test" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1dYHTh43rUip61jayTv9VQ", "cell_type": "code", "source": [ "public async Task CheckAocConfigurationDefault(AocType[] newAocTypes)", @@ -140,174 +181,266 @@ "\n", "\n return await Import.FromString(canonicalAocConfig).WithFormat(\"AocConfiguration\").WithTarget(workspace).ExecuteAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SIYcSk5kNUms-ILsc7Fc9g", "cell_type": "markdown", "source": [ "## NewAoc < RCU" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "gCHBZZiJZkKsAgsn81BU8Q", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 25} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Pj5C8V1V4kOJGNPAPZNP7Q", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.MC && x.Novelty == Novelties.I) with {AocType = \"A1\", Order = 21, DataType = DataType.Optional};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "RaeGfGDv20OR0lBo7tL98Q", "cell_type": "markdown", "source": [ "## RCU < NewAoc < CF" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9hBKJlQyeEO9TpeNwxhCqA", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 45} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "vSrtK8_4k0uMWWB9xWF-wg", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.RCU && x.Novelty == Novelties.I) with {AocType = \"A1\", Order = 31, DataType = DataType.Optional};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1ipfwQM1NkaeqopEOOGQMQ", "cell_type": "markdown", "source": [ "## IA < NewAoc < YCU" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oCF44mYnYkiJ3b4OyniJDg", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 82} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sEfq7iYvaEmysMRMzhJJRg", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.AU && x.Novelty == Novelties.I) with {AocType = \"A1\", Order = 61, DataType = DataType.Optional};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Am5-CmdiEUuOaphZ2xGo0g", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.AU && x.Novelty == Novelties.N) with {AocType = \"A1\", Order = 131, DataType = DataType.Optional};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "h9RDWoiWoEmTB_a1jHk7Ag", "cell_type": "markdown", "source": [ "## CRU < NewAoc < EV" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "11o-ltR8wk650EqHmKcVlA", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 106} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "mW4K3Q9IZUa3eWjVQVy_Bw", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.EV && x.Novelty == Novelties.I) with {AocType = \"A1\", Order = 81};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Kg_NacjnKEa2gIH1OeS76A", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.EV && x.Novelty == Novelties.N) with {AocType = \"A1\", Order = 131};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "b7L0eUNUmk-CIXbI4j1tOA", "cell_type": "markdown", "source": [ "## EV < NewAoc < WO" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "xxKajX96jkyljqCugz69EA", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 116} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LOnPRjuIoEyyt9aiNWiXYA", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.EV && x.Novelty == Novelties.I) with {AocType = \"A1\", Order = 91};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "00jPx2RmPkS5eNv7uftM2A", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.EV && x.Novelty == Novelties.N) with {AocType = \"A1\", Order = 141};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "LcyGd3hXF0uWCX5LKfozug", "cell_type": "markdown", "source": [ "## WO < NewAoc < CL" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KwwQI25owUCfnoQgEbAA6g", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 125} } );", "\naocConfigLog.Errors.Any().Should().Be(false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Kfjgb1gbwkq8DAteZPY4jQ", "cell_type": "code", "source": [ "var newConfigExpected = (await workspace.Query().ToArrayAsync()).First(x => ", "\n x.AocType == AocTypes.WO && x.Novelty == Novelties.C) with {AocType = \"A1\", Order = 171};", "\nvar newConfigCalculated = await workspace.Query().Where(x => x == newConfigExpected).ToArrayAsync();", "\nnewConfigCalculated.Count().Should().Be(1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8gHymelTSUy7cigprRzYjA", "cell_type": "markdown", "source": [ "## Two or more Aoc Config with same Order" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WHY91p0GgEi9BppkYtLjew", "cell_type": "code", "source": [ "var aocConfigLog = await CheckAocConfigurationDefault( new[]{ new AocType{SystemName = \"A1\", DisplayName = \"a1\", Order = 111},", @@ -316,13 +449,20 @@ "\n new AocType{SystemName = \"A4\", DisplayName = \"a1\", Order = 114},", "\n new AocType{SystemName = \"A5\", DisplayName = \"a1\", Order = 115} } );", "\n(aocConfigLog.Errors.First().ToString() == \"ActivityMessageNotification { Message = Two or more Aoc Configurations have the same Order. }\").Should().Be(true);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kLp5Mr2wmEGr-avkMByaDg", "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 6b91461e..4b7b2bdc 100644 --- a/ifrs17/Test/QueriesTest.ipynb +++ b/ifrs17/Test/QueriesTest.ipynb @@ -18,31 +18,48 @@ "nbformat_minor": 5, "cells": [ { + "id": "NTIr8pfNRUG9v1rz8xmpmw", "cell_type": "code", "source": [ "#!import \"../CalculationEngine\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "plOzpIasQkGNAf30KoXM0w", "cell_type": "code", "source": [ "var gic = \"DT1.1\";", "\nvar scenario = \"MTUP\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5tdLFj2NXEGuOW74rTYVpQ", "cell_type": "markdown", "source": [ "# Test Load Current and Previous Parameter for Yield Curve" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DWSAoP5ltkaMOSp03MyfIA", "cell_type": "code", "source": [ "Workspace.Reset(x => x.ResetInitializationRules().ResetCurrentPartitions());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KFB4S_jzpku_e4E1QCF6Cw", "cell_type": "code", "source": [ "public async Task CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(Args args, IEnumerable testData, ", @@ -64,88 +81,128 @@ "\n ", "\n await Workspace.DeleteAsync(Workspace.Query().ToArray());", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YR7Ds1eSw0eeuBWg6pC_tQ", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData.RepeatOnce(), (2020, 9, null),(2020, 9, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bGwUfhJAL0WVLcJwx-g1Zg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,scenario);", "\nvar testData = new[] { new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9, Scenario = scenario }, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9 } };", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 9, scenario),(2020, 9, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pHPnD9INVECBXJCkAZQECg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = null};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData.RepeatOnce(), (2019, 12, null), (2019, 12, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "KGJ2HY_UdEuIxuNWoAdNAw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,scenario);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9, Scenario = scenario},", "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 9, scenario), (2019, 12, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "jpLrgab2eEWK83fcpK6ukA", "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, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 3, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 6, null), (2020, 6, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "679b2tiitkmmP1P-PKnNYQ", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,scenario);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 3, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 6, null), (2020, 6, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "axsxcDx2K0aO6jgzo7jliw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,scenario);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 3, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 6, null), (2019, 3, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ycXFIXbC_0aw9Kv0vxBhwA", "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 = 9, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 6, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 9, null), (2020, 9, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ek8T4yoF8kibcfRRiC9LGw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 9, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2020, Month = 9, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 9, null), (2019, 9, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "19ioyaUzHkqelLWINjrBJQ", "cell_type": "code", "source": [ "var args = new Args(\"EUR\",2020,9,Periodicity.Monthly,scenario);", @@ -153,27 +210,39 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = scenario},", "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 9, scenario), (2019, 12, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "U1iy3VALHESu8R42kYbXpg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 9, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2019, 12, null), (2019, 12, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "8LEJFkLz7UObFQjBwvOxjg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", "\nvar testData = new YieldCurve[] {new YieldCurve{ Currency = \"EUR\", Year = 2019, Month = 12, Scenario = null}, ", "\n new YieldCurve{ Currency = \"EUR\", Year = 2018, Month = 9, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2019, 12, null), (2019, 12, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "X6DmfAY4XkewNDJ2FNoMSw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -181,9 +250,13 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 9, Scenario = null},", "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 6, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2019, 6, null), (2019, 6, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ofyBo-TEyESmYRURsUqWsg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly, scenario);", @@ -192,9 +265,13 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 9, Scenario = null},", "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 6, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2019, 6, null), (2019, 6, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9rf-JkSGr0uNL5SeX9Klgg", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -203,9 +280,13 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2015, Month = 9, Scenario = null},", "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Scenario = null}};", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 6, null), (2016, 3, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "rj4pcMyboE-oEhMl3Rs5-w", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -215,15 +296,23 @@ "\n new YieldCurve{ Currency = \"EUR\", Year = 2016, Month = 3, Scenario = null}};", "\n", "\nawait CheckLoadCurrentAndPreviousParameterForYieldCurveAsync(args, testData, (2020, 6, null), (2016, 3, null));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "TSlFdPDzxk6CAkX57WjS_A", "cell_type": "markdown", "source": [ "# Test Data Node State Query" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7UZrdvTKHUqRUDxSqwFsXQ", "cell_type": "code", "source": [ "public async Task CheckLoadDataNodeStateAsync(Args args, IEnumerable testData, bool isExpectedToBeActive)", @@ -236,33 +325,49 @@ "\n ", "\n Workspace.Reset(x => x.ResetCurrentPartitions());", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3frqAxWAb0-iRoIjC0x0bA", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,12,Periodicity.Monthly,null);", "\nvar testData = new DataNodeState[] {new DataNodeState{ DataNode = gic, Year = 2019, Month = 12, State = State.Active },", "\n new DataNodeState{ DataNode = gic, Year = 2020, Month = 6, State = State.Inactive }};", "\nawait CheckLoadDataNodeStateAsync(args, testData, false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "x5o02N_2yEqNFaUnCf27LA", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,12,Periodicity.Monthly,null);", "\nvar testData = new DataNodeState[] {new DataNodeState{ DataNode = gic, Year = 2020, Month = 3, State = State.Active },", "\n new DataNodeState{ DataNode = gic, Year = 2020, Month = 9, State = State.Inactive }};", "\nawait CheckLoadDataNodeStateAsync(args, testData, false);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tEke28UUmk63X5X3t8-NZQ", "cell_type": "markdown", "source": [ "# Test Load Yield Curve" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Yg49scOm9kC3fsYCLvns2Q", "cell_type": "code", "source": [ "public async Task CheckLoadYieldCurveAsync(Args args, IEnumerable testData, ", @@ -296,9 +401,13 @@ "\n ", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors)); ", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "m3_gugcNbk-GBVbWxV57Gw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -308,23 +417,35 @@ "\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", "\nawait CheckLoadYieldCurveAsync(args, testData, (2016, 6), 6.1, 0.1, 6.1);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oqe6zXHpG0GJbLONZfGj3w", "cell_type": "markdown", "source": [ "# Test Load Data Node Parameter" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "5MJtyunB80GSP-alkKjOwA", "cell_type": "code", "source": [ "var gic2 = \"gic2\";", "\nvar xgic = \"xgic\";", "\nvar gric1 = \"gric1\";" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "lUU-biiLX0ibSzMuSzMh5A", "cell_type": "code", "source": [ "public async Task CheckLoadInterDataNodeParameterAsync(Args args, IEnumerable testData, ", @@ -411,9 +532,13 @@ "\n ", "\n if(errors.Any()) ApplicationMessage.Log(Error.Generic, string.Join(\"\\n\", errors));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4RaLKB7k-UajGf1Y1Zu6fQ", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -425,9 +550,13 @@ "\n };", "\n", "\nawait CheckLoadInterDataNodeParameterAsync(args, testData, previousYear);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "GeSYU4-OaUO9yOc8NBoZCw", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -443,9 +572,13 @@ "\n };", "\n", "\nawait CheckLoadInterDataNodeParameterAsync(args, testData, previousYear, currentYear);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZQ0UWivBMkaecxy1ZES6TQ", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -458,9 +591,13 @@ "\n };", "\n", "\nawait CheckLoadInterDataNodeParameterAsync(args, testData, previousYear, currentYear);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "t4W8kuYz4EWT7eheyHepVA", "cell_type": "code", "source": [ "var args = new Args(\"CH\",2020,9,Periodicity.Monthly,null);", @@ -473,13 +610,20 @@ "\n };", "\n", "\nawait CheckLoadInterDataNodeParameterAsync(args, testData, previousYear, currentYear);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kkwtnEW9N0WyXdhPCi9tIQ", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Test/Tests.ipynb b/ifrs17/Test/Tests.ipynb index e49d0f33..94626ecf 100644 --- a/ifrs17/Test/Tests.ipynb +++ b/ifrs17/Test/Tests.ipynb @@ -16,22 +16,34 @@ "nbformat_minor": 5, "cells": [ { + "id": "tIV7Q4vx8UeFi8kmrwPcEg", "cell_type": "markdown", "source": [ "

Tests

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "afu9qRQM0EK0X8DYxEDABQ", "cell_type": "code", "source": [ "#!eval-notebook \"AocConfigurationTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "eiuXjlas1kCmW7Fty4gKoQ", "cell_type": "code", "source": [ "#!eval-notebook \"QueriesTest\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/ApplicationMessage.ipynb b/ifrs17/Utils/ApplicationMessage.ipynb index b826668d..fe7025d8 100644 --- a/ifrs17/Utils/ApplicationMessage.ipynb +++ b/ifrs17/Utils/ApplicationMessage.ipynb @@ -19,19 +19,28 @@ "nbformat_minor": 5, "cells": [ { + "id": "wLzDwTbQ9Uaiyx6Djl_hGQ", "cell_type": "markdown", "source": [ "

Application Message

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "de93et2JM0KcfJdU0ydEuw", "cell_type": "code", "source": [ "#!import \"../Constants/Validations\"", "\n#!import \"../DataModel/DataStructure\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CZ5guP7mh0mpnrz00G3S0g", "cell_type": "code", "source": [ "using Microsoft.Extensions.Logging;", @@ -53,21 +62,33 @@ "\n public static bool HasErrors () => activity.HasErrors();", "\n public static bool HasWarnings () => activity.HasWarnings();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "VQkVErt-S0290QjxpeU_pg", "cell_type": "code", "source": [ "ApplicationMessage.Configure(Log, Activity)" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "drAxOrfkYUW3-64_fh5Ddw", "cell_type": "markdown", "source": [ "# Utils" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "JhD11IJpqEe5iKVccpEdOg", "cell_type": "code", "source": [ "public static bool HasErrors (this ActivityLog[] logs) {", @@ -76,9 +97,13 @@ "\n return true;", "\n return false;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-nHLgnv6CkGmjrCtmn-FfQ", "cell_type": "code", "source": [ "public static ActivityLog Merge (this ActivityLog a, ActivityLog b) {", @@ -101,13 +126,20 @@ "\n", "\npublic static ActivityLog Merge (this ActivityLog[] logs, ActivityLog log) => logs.Merge().Merge(log);", "\npublic static ActivityLog Merge (this ActivityLog log, ActivityLog[] logs) => log.Merge(logs.Merge());" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sYT7OFkE8Eu3GY-TUwLWdQ", "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 bd3021eb..39d798e8 100644 --- a/ifrs17/Utils/EqualityComparers.ipynb +++ b/ifrs17/Utils/EqualityComparers.ipynb @@ -16,18 +16,27 @@ "nbformat_minor": 5, "cells": [ { + "id": "ogmxH-FTpEGc4-ymE-mFYg", "cell_type": "markdown", "source": [ "

Equality Comparers

" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "-Y69asl-c0OSbbvFliOOCg", "cell_type": "code", "source": [ "#!import \"../DataModel/DataStructure\"" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "cewEsMJ9cUyBQhfByCbaAg", "cell_type": "code", "source": [ "class RawVariableComparer: IEqualityComparer", @@ -51,9 +60,13 @@ "\n return new RawVariableComparer(ignoreValues);", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "sWecJZ9b5UWdmf2iaZSduA", "cell_type": "code", "source": [ "class IfrsVariableComparer: IEqualityComparer", @@ -77,9 +90,13 @@ "\n return new IfrsVariableComparer(ignoreValue);", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dxFBW3aXtEeO1ZVIRlC_XA", "cell_type": "code", "source": [ "using System;", @@ -92,9 +109,13 @@ "\n//using Systemorph.Domain;", "\n//using Systemorph.Utils.Reflection;", "\nusing static Systemorph.Vertex.Equality.IdentityPropertyExtensions;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ejquQGmoSEK5L6HGwXrM9A", "cell_type": "code", "source": [ "class EqualityComparer : IEqualityComparer", @@ -127,13 +148,20 @@ "\n return Expression.Lambda>(equalityExpr, prm1, prm2).Compile();", "\n }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "dQkdrzS8s0i1J4MQfOER6w", "cell_type": "code", "source": [ "" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/Extensions.ipynb b/ifrs17/Utils/Extensions.ipynb index e006c87e..898a83a4 100644 --- a/ifrs17/Utils/Extensions.ipynb +++ b/ifrs17/Utils/Extensions.ipynb @@ -18,25 +18,38 @@ "nbformat_minor": 5, "cells": [ { + "id": "37QLGftFt0GR52lqdw-HNQ", "cell_type": "markdown", "source": [ "

Extention Methods (this IList array, int index)\"? ", @@ -52,45 +65,73 @@ "\n ? array.ElementAt(index)", "\n : array.ElementAt(count -1);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "A-JqTxL5pE21nMgEZ1JTAg", "cell_type": "code", "source": [ "public static Dictionary ToDictionaryGrouped(this IEnumerable source, Func keySelector, Func, TResult> elementSelector) => source.GroupBy(keySelector).ToDictionary(g => g.Key, elementSelector);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "MAeKIQ5QvECLkH8cmeI75w", "cell_type": "code", "source": [ "public static IDataCube SelectToDataCube(this IEnumerable source, Func whereClause, Func selector) => source.Where(whereClause).Select(selector).ToDataCube();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "izvvatd1rE21dda6NHFZPg", "cell_type": "code", "source": [ "public static IDataCube SelectToDataCube(this IEnumerable source, Func selector) => source.SelectToDataCube(x => true, selector);" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "bNj5qyvo3kue3cwR_5Azsw", "cell_type": "code", "source": [ "public static double[] Prune (this IEnumerable source, double precision = Precision) => source.Reverse().SkipWhile(x => Math.Abs(x) < precision).Reverse().ToArray();" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "DrWpMND_l0mojje8dHygRA", "cell_type": "markdown", "source": [ "# String Extensions" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "s2mmvm2-A02lMpUVEQb-4A", "cell_type": "code", "source": [ "using System.Globalization;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Bnfm2rWKHEme4-DjALszfQ", "cell_type": "code", "source": [ "public static double CheckStringForExponentialAndConvertToDouble (this string s)", @@ -99,15 +140,23 @@ "\n if (double.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out var doubleValue)) return doubleValue;", "\n else { ApplicationMessage.Log(Error.ParsingScientificNotation, s); return 1; }", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "CMA8w5ro8UGCKdLzCLQZjg", "cell_type": "markdown", "source": [ "# Enum Extentions" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7PBYRiDYtUCiAzeiZoNS3Q", "cell_type": "code", "source": [ "public static bool Contains(this T value, T lookingForFlag) ", @@ -117,15 +166,23 @@ "\n int intLookingForFlag = (int) (object) lookingForFlag;", "\n return ((intValue & intLookingForFlag) == intLookingForFlag);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "kJ91UizKf0eoJht6A0xCgw", "cell_type": "markdown", "source": [ "# ToIdentityString" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "v_U3DILjyUqmOf__msiQCw", "cell_type": "code", "source": [ "using System.Text;", @@ -139,13 +196,20 @@ "\n .Select(x => sb.Append(x.Name).Append(\":\").Append(v.GetType().GetProperty(x.Name)?.GetValue(v, null)).Append(\", \")).ToArray();", "\n return propertyInfos.Count() == 0? v.ToString() : propertyInfos.Select(p => p.ToString()).ToArray().Last();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "72YmbK18UEC9lOicYn7zRQ", "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 0ae789e3..81b9d57d 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -18,24 +18,37 @@ "nbformat_minor": 5, "cells": [ { + "id": "dm2BpbZSZ0y3Rm2xKWMh0A", "cell_type": "markdown", "source": [ "

Import Calculation Methods > GetPreviousIdentities(IEnumerable identities)", @@ -49,15 +62,23 @@ "\n previousStep[x.Novelty] = new AocStep(x.AocType, x.Novelty);", "\n return ret;});", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Q-zkjr-DsUye5AKQihTa6w", "cell_type": "markdown", "source": [ "# Get Reference AocStep for calculated steps" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "oMMELTAwO02FIHDVa5WP8w", "cell_type": "code", "source": [ "public static AocStep GetReferenceAocStepForCalculated(this IEnumerable identities, Dictionary aocConfigurationByAocStep, AocStep identityAocStep)", @@ -68,15 +89,23 @@ "\n && aocStep.Novelty == identityAocStep.Novelty) ", "\n ?? new AocStep(default, default);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IyQ1h7IPzUqnUGBTT9vlWA", "cell_type": "markdown", "source": [ "# Discount and Cumulate" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "COS5E2hpRka2paEchEV85A", "cell_type": "code", "source": [ "public static double[] ComputeDiscountAndCumulate(this double[] nominalValues, double[] monthlyDiscounting, PeriodType periodType) ", @@ -97,9 +126,13 @@ "\n ", "\n return ret;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "1jcSQCWC-UOP2rpI3vcXhw", "cell_type": "code", "source": [ "public static double[] ComputeDiscountAndCumulateWithCreditDefaultRisk(this double[] nominalValues, double[] monthlyDiscounting, double nonPerformanceRiskRate) //Is it correct that NonPerformanceRiskRate is a double? Should it be an array that takes as input tau/t?", @@ -110,51 +143,83 @@ "\n .Sum() )", "\n .ToArray();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "peOs8OplG0Km9WLVYerNLg", "cell_type": "markdown", "source": [ "# Import Configuration " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "C-ywsGdsCUqqw4-y32DtDA", "cell_type": "markdown", "source": [ "## Data Nodes" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "FaimY7RfJU28U8LOflKePQ", "cell_type": "code", "source": [ "public GroupOfInsuranceContract ExtendGroupOfContract(GroupOfInsuranceContract gic, IDataRow datarow) => gic;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "D0amuqeOkkmg6Bgrns581A", "cell_type": "code", "source": [ "public GroupOfReinsuranceContract ExtendGroupOfContract(GroupOfReinsuranceContract gric, IDataRow datarow) => gric;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "w1toWOQWFEy8EQVu7pTCng", "cell_type": "markdown", "source": [ "## Change Sign Rules" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "et9tX4p4UkuwJsMFOuKnHw", "cell_type": "code", "source": [ "public static int GetSign((string AocType, string AmountType, string EstimateType, bool IsReinsurance) variable, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) => 1;" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "_FOFZ-JqNEC7R6nwFYMFUg", "cell_type": "markdown", "source": [ "## EstimateType And AmountType" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3DI_KVkmz0KSb_7hr6gpSQ", "cell_type": "code", "source": [ "public static Dictionary> GetAmountTypesByEstimateType(Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache)", @@ -166,22 +231,33 @@ "\n {EstimateTypes.LR, new string[]{}.ToHashSet()},", "\n };", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "K8et8EQkfk-iSDvi3aF6sw", "cell_type": "markdown", "source": [ "## Technical Margin EstimateType" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "tqX2rC2hv0q0W8nRW9Ug0g", "cell_type": "code", "source": [ "public static HashSet GetTechnicalMarginEstimateType()", "\n{", "\n return new []{EstimateTypes.C, EstimateTypes.L, EstimateTypes.LR, }.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 83b6c1ef..9f3dfef8 100644 --- a/ifrs17/Utils/Queries.ipynb +++ b/ifrs17/Utils/Queries.ipynb @@ -18,30 +18,47 @@ "nbformat_minor": 5, "cells": [ { + "id": "fbab8KjyQkyLiXKGJyfa2A", "cell_type": "markdown", "source": [ "

Queries >> GetExchangeRatesDictionaryAsync(this IQuerySource querySource, int year, int month)", @@ -57,15 +74,23 @@ "\n (_, _, _) when y.Year == year && y.Month == month && y.FxType == FxType.Spot => FxPeriod.EndOfPeriod", "\n },", "\n y => y.FxToGroupCurrency));" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9oo-zuul8EKzrnCJFAzqQQ", "cell_type": "markdown", "source": [ "# Current and Previous Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "HuKjnIgTUEaGC4yIEllZdg", "cell_type": "code", "source": [ "public static async Task LoadParameterAsync(", @@ -80,9 +105,13 @@ "\n .Where(filterExpression?? (Expression>)(x => true))", "\n .ToArrayAsync();", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "em1hxyD6qEqWWc6s02QdKA", "cell_type": "code", "source": [ "public static async Task> LoadCurrentParameterAsync (", @@ -101,9 +130,13 @@ "\n .FirstOrDefault())", "\n .ToDictionary(identityExpression);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "7CWHPi_ERU-LT0Hkk1MSGQ", "cell_type": "code", "source": [ "public static async Task>> LoadCurrentAndPreviousParameterAsync (", @@ -132,22 +165,34 @@ "\n }", "\n return ret;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Ot_9jtjxvk6ShPq6_QndnA", "cell_type": "markdown", "source": [ "", "\n# Yield Curve" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "H6u21U5weU65vzmg7twmhw", "cell_type": "markdown", "source": [ "## Locked-in" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "3u_OXnhOjkKNpNivnkOuYQ", "cell_type": "code", "source": [ "public static async Task> LoadLockedInYieldCurveAsync(this IQuerySource querySource, Args args, ", @@ -167,15 +212,23 @@ "\n ", "\n return lockedInYieldCurveByGoc;", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "ZQl3LDNHKUCgaIvyB6G62w", "cell_type": "markdown", "source": [ "## Current" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "4uLD-gkkTU2DzKqGAi4WKg", "cell_type": "code", "source": [ "public static async Task>> LoadCurrentYieldCurveAsync(this IQuerySource querySource, Args args, ", @@ -187,15 +240,23 @@ "\n x => contractualCurrenciesInScope.Contains(x.Currency)", "\n ));", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "WVEn8m01vUW4RRliQ5T0-g", "cell_type": "markdown", "source": [ "# Data Node State" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "9VQcw0Oh20G7E1m1XrBZcw", "cell_type": "code", "source": [ "public static async Task> LoadDataNodeStateAsync(this IQuerySource querySource, Args args)", @@ -204,15 +265,23 @@ "\n .Where(x => x.Value[CurrentPeriod].State != State.Inactive)", "\n .ToDictionary(x => x.Key, x => x.Value[CurrentPeriod]);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "SxQLPtHgQ0ep3YzMpxVbUg", "cell_type": "markdown", "source": [ "# Data Nodes" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pfrZAbrPnUqrtPaJDeIUyg", "cell_type": "code", "source": [ "public static async Task> LoadDataNodesAsync(this IQuerySource querySource, Args args)", @@ -244,36 +313,56 @@ "\n }", "\n );", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Oew7zanlnUKPlmBc2trXBQ", "cell_type": "markdown", "source": [ "# Data Node Parameters" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "Mj2iGP3LDkKeLA7Cd8W7BA", "cell_type": "markdown", "source": [ "## Single data Node" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "YRhKcQ4Mzk2fcTyvycCDAw", "cell_type": "code", "source": [ "public static async Task>> LoadSingleDataNodeParametersAsync(this IQuerySource querySource, Args args)", "\n{", "\n return await querySource.LoadCurrentAndPreviousParameterAsync(args, x => x.DataNode);", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "W-tpkmQTjkeAKd9P26BEKA", "cell_type": "markdown", "source": [ "## Inter data Node" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "563xeprOJU2gJV_TNxa4GA", "cell_type": "code", "source": [ "public static async Task>>> LoadInterDataNodeParametersAsync(this IQuerySource querySource, Args args)", @@ -297,30 +386,45 @@ "\n x => new Dictionary>{ {CurrentPeriod, x.Select(y => y.currentPeriod).ToHashSet()},", "\n {PreviousPeriod, x.Select(y => y.previousPeriod).ToHashSet()}});", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "pWmi0o2H60SDDht7Au0x-g", "cell_type": "markdown", "source": [ "# Aoc Step Configuration" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "IbK-mlyTFEeWmk4cJZQNqw", "cell_type": "code", "source": [ "public static async Task> LoadAocStepConfigurationAsync(this IQuerySource querySource, int year, int month)", "\n => (await querySource.LoadParameterAsync(year, month))", "\n .GroupBy(x => (x.AocType, x.Novelty), ", "\n (k, v) => v.OrderByDescending(x => x.Year).ThenByDescending(x => x.Month).First()); " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] }, { + "id": "p4-Lxx_SzkWaUMWcuregEQ", "cell_type": "code", "source": [ "public static async Task> LoadAocStepConfigurationAsDictionaryAsync(this IQuerySource querySource, int year, int month) ", "\n => (await querySource.LoadAocStepConfigurationAsync(year, month))", "\n .ToDictionary(x => new AocStep(x.AocType, x.Novelty)); " - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/TestHelper.ipynb b/ifrs17/Utils/TestHelper.ipynb index 741b3e11..756fe07e 100644 --- a/ifrs17/Utils/TestHelper.ipynb +++ b/ifrs17/Utils/TestHelper.ipynb @@ -18,18 +18,27 @@ "nbformat_minor": 5, "cells": [ { + "id": "qY8DKa9dQUWTSl9qUoJHmA", "cell_type": "markdown", "source": [ "

Test Helper Methods WithGridOptionsForIfrsVariable", @@ -114,7 +139,10 @@ "\n .WithAutoGroupColumn(c => c.WithWidth(250) with { Pinned = \"left\" }) with { Height = reportHeight, GroupDefaultExpanded = 2, OnGridReady = null }", "\n );", "\n}" - ] + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file