From 4083db59c98b479f87c463dd2c8b30a44e338910 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Tue, 11 Jul 2023 16:29:28 +0200 Subject: [PATCH 1/7] First proposition --- ifrs17-template/Files/Dimensions.csv | 2 ++ ifrs17/Import/Importers.ipynb | 1 + ifrs17/Utils/ImportCalculationMethods.ipynb | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/ifrs17-template/Files/Dimensions.csv b/ifrs17-template/Files/Dimensions.csv index da6e028c..0f83756d 100644 --- a/ifrs17-template/Files/Dimensions.csv +++ b/ifrs17-template/Files/Dimensions.csv @@ -17,6 +17,8 @@ AC,Attributable Commission,,120,BeginningOfPeriod,,,,,,, ACA,Aquisition,AC,130,BeginningOfPeriod,,,,,,, ACM,Maitenance,AC,140,EndOfPeriod,,,,,,, CU,Coverage Units,,150,EndOfPeriod,,,,,,, +INV,Coverage Units: investment componenet,CU,160,EndOfPeriod,,,,,,, +INS,Coverage Units: insurance component,CU,170,EndOfPeriod,,,,,,, ,,,,,,,,,,, @@DeferrableAmountType,,,,,,,,,,, SystemName,DisplayName,Parent,Order,PeriodType,,,,,,, diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 9f417140..af44da07 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1458,6 +1458,7 @@ "\n }, ImportFormats.Cashflow", "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", + "\n await workspace.CheckForCompositeCoverageUnitsAndNormalize();", "\n await workspace.ValidateForMandatoryAocSteps(dataSet, parsingStorage.MandatoryAocSteps);", "\n await workspace.ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 28a9fe07..97d735f4 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -409,6 +409,24 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Normalization of Coverage Units" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task CheckForCompositeCoverageUnitsAndNormalize (this IWorkspace workspace) {}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "markdown", "source": [ From 58dbd13fd46642f33d3dd3e25bcce985cdfd278e Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Tue, 11 Jul 2023 16:37:26 +0200 Subject: [PATCH 2/7] Reverting the change --- ifrs17-template/Files/Dimensions.csv | 2 -- 1 file changed, 2 deletions(-) diff --git a/ifrs17-template/Files/Dimensions.csv b/ifrs17-template/Files/Dimensions.csv index 0f83756d..da6e028c 100644 --- a/ifrs17-template/Files/Dimensions.csv +++ b/ifrs17-template/Files/Dimensions.csv @@ -17,8 +17,6 @@ AC,Attributable Commission,,120,BeginningOfPeriod,,,,,,, ACA,Aquisition,AC,130,BeginningOfPeriod,,,,,,, ACM,Maitenance,AC,140,EndOfPeriod,,,,,,, CU,Coverage Units,,150,EndOfPeriod,,,,,,, -INV,Coverage Units: investment componenet,CU,160,EndOfPeriod,,,,,,, -INS,Coverage Units: insurance component,CU,170,EndOfPeriod,,,,,,, ,,,,,,,,,,, @@DeferrableAmountType,,,,,,,,,,, SystemName,DisplayName,Parent,Order,PeriodType,,,,,,, From 38282137b2d96b57f2e5995d96070f1892faeb38 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 12 Jul 2023 13:38:21 +0200 Subject: [PATCH 3/7] Davides feedback --- ifrs17/Import/Importers.ipynb | 2 +- ifrs17/Utils/ImportCalculationMethods.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index af44da07..08928901 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1458,7 +1458,7 @@ "\n }, ImportFormats.Cashflow", "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", - "\n await workspace.CheckForCompositeCoverageUnitsAndNormalize();", + "\n await workspace.CheckForCompositeAmountTypeAndNormalize(AmountTypes.CU);", "\n await workspace.ValidateForMandatoryAocSteps(dataSet, parsingStorage.MandatoryAocSteps);", "\n await workspace.ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", "\n return Activity.Finish().Merge(importLog);", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 97d735f4..47970e15 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -421,7 +421,7 @@ { "cell_type": "code", "source": [ - "public static async Task CheckForCompositeCoverageUnitsAndNormalize (this IWorkspace workspace) {}" + "public static async Task CheckForCompositeAmountTypeAndNormalize (this IWorkspace workspace, string amountType) {}" ], "metadata": {}, "execution_count": 0, From 0c6d208b4b1d4b409f9845201ff6a84285c2c72e Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Thu, 13 Jul 2023 11:49:18 +0200 Subject: [PATCH 4/7] Feedback --- ifrs17/Constants/Validations.ipynb | 4 +++- ifrs17/Import/Importers.ipynb | 4 ++-- ifrs17/Utils/ImportCalculationMethods.ipynb | 17 +++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index e759d396..b454d1ca 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -66,7 +66,7 @@ "\n NoMainTab, IncompleteMainTab, ParsingInvalidOrScientificValue, ValueTypeNotFound, ValueTypeNotValid, ", "\n ReportingNodeInMainNotFound, YearInMainNotFound, MonthInMainNotFound, ScenarioInMainNotAvailable,", "\n AocTypeNotValid, AocTypeCompulsoryNotFound, AocTypePositionNotSupported, AocConfigurationOrderNotUnique,", - "\n AccidentYearTypeNotValid,", + "\n AccidentYearTypeNotValid, CoverageUnitComponentNotFound, CoverageUnitComponentIsEmpty,", "\n // Partition", "\n PartitionNotFound, ParsedPartitionNotFound, PartititionNameNotFound, PartitionTypeNotFound,", "\n // Dimensions", @@ -124,6 +124,8 @@ "\n (Error.AocTypePositionNotSupported , 1) => $\"The position of the AoC Type {s[0]} is not supported.\",", "\n (Error.AocConfigurationOrderNotUnique , _) => $\"Two or more AoC Configurations have the same Order.\",", "\n (Error.AccidentYearTypeNotValid , 1) => $\"The parsed AccidentYear {s[0]} is invalid. Expected Accident Year input of type int.\",", + "\n (Error.CoverageUnitComponentNotFound , 2) => $\"Coverage Units component {s[0]} is missing for Data Node {s[1]}.\",", + "\n (Error.CoverageUnitComponentIsEmpty , 2) => $\"Coverage Units component {s[0]} for Data Node {s[1]} should contain non-zero entries.\",", "\n // Partition", "\n (Error.PartitionNotFound , _) => $\"Partition do not found.\",", "\n (Error.ParsedPartitionNotFound , 1) => $\"Parsed partition not available: ReportingNode {s[0]}.\",", diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 08928901..8d997a3c 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1458,10 +1458,10 @@ "\n }, ImportFormats.Cashflow", "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", - "\n await workspace.CheckForCompositeAmountTypeAndNormalize(AmountTypes.CU);", + "\n var extensionLog = await workspace.ExtendParsedVariables(parsingStorage.HierarchyCache, Activity);", "\n await workspace.ValidateForMandatoryAocSteps(dataSet, parsingStorage.MandatoryAocSteps);", "\n await workspace.ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", - "\n return Activity.Finish().Merge(importLog);", + "\n return Activity.Finish().Merge(importLog).Merge(extensionLog);", "\n}" ], "metadata": {}, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 47970e15..48373b37 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -412,7 +412,7 @@ { "cell_type": "markdown", "source": [ - "## Normalization of Coverage Units" + "## Extend Parsed Variables" ], "metadata": {}, "execution_count": 0, @@ -421,7 +421,20 @@ { "cell_type": "code", "source": [ - "public static async Task CheckForCompositeAmountTypeAndNormalize (this IWorkspace workspace, string amountType) {}" + "public static async Task ExtendParsedCoverageUnits (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache, Systemorph.Vertex.Activities.ActivityVariable activity) {", + "\n activity.Start();", + "\n return activity.Finish();", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task ExtendParsedVariables (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache, Systemorph.Vertex.Activities.IActivityVariable activity) =>", + "\n await workspace.ExtendParsedCoverageUnits(hierarchyCache, activity);" ], "metadata": {}, "execution_count": 0, From 2d4c8256c6dace1f7984fb149b64c1aad4792234 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Thu, 13 Jul 2023 14:00:56 +0200 Subject: [PATCH 5/7] Refactoring activity --- ifrs17/Import/Importers.ipynb | 4 ++-- ifrs17/Utils/ImportCalculationMethods.ipynb | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 8d997a3c..aa464a34 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -1458,10 +1458,10 @@ "\n }, ImportFormats.Cashflow", "\n ).WithTarget(workspace).ExecuteAsync();", "\n ", - "\n var extensionLog = await workspace.ExtendParsedVariables(parsingStorage.HierarchyCache, Activity);", + "\n await workspace.ExtendParsedVariables(parsingStorage.HierarchyCache);", "\n await workspace.ValidateForMandatoryAocSteps(dataSet, parsingStorage.MandatoryAocSteps);", "\n await workspace.ValidateForDataNodeStateActiveAsync(parsingStorage.DataNodeDataBySystemName);", - "\n return Activity.Finish().Merge(importLog).Merge(extensionLog);", + "\n return Activity.Finish().Merge(importLog);", "\n}" ], "metadata": {}, diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 48373b37..1808f512 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -421,10 +421,7 @@ { "cell_type": "code", "source": [ - "public static async Task ExtendParsedCoverageUnits (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache, Systemorph.Vertex.Activities.ActivityVariable activity) {", - "\n activity.Start();", - "\n return activity.Finish();", - "\n}" + "public static async Task ExtendParsedCoverageUnits (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) {}" ], "metadata": {}, "execution_count": 0, @@ -433,8 +430,8 @@ { "cell_type": "code", "source": [ - "public static async Task ExtendParsedVariables (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache, Systemorph.Vertex.Activities.IActivityVariable activity) =>", - "\n await workspace.ExtendParsedCoverageUnits(hierarchyCache, activity);" + "public static async Task ExtendParsedVariables (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) =>", + "\n await workspace.ExtendParsedCoverageUnits(hierarchyCache);" ], "metadata": {}, "execution_count": 0, From c4b5524ec36c42ea63adc8366947fa7bd5fbfcd4 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Fri, 14 Jul 2023 11:03:05 +0200 Subject: [PATCH 6/7] Feedback --- ifrs17/Constants/Validations.ipynb | 4 +--- ifrs17/Utils/ImportCalculationMethods.ipynb | 12 +----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index b454d1ca..e759d396 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -66,7 +66,7 @@ "\n NoMainTab, IncompleteMainTab, ParsingInvalidOrScientificValue, ValueTypeNotFound, ValueTypeNotValid, ", "\n ReportingNodeInMainNotFound, YearInMainNotFound, MonthInMainNotFound, ScenarioInMainNotAvailable,", "\n AocTypeNotValid, AocTypeCompulsoryNotFound, AocTypePositionNotSupported, AocConfigurationOrderNotUnique,", - "\n AccidentYearTypeNotValid, CoverageUnitComponentNotFound, CoverageUnitComponentIsEmpty,", + "\n AccidentYearTypeNotValid,", "\n // Partition", "\n PartitionNotFound, ParsedPartitionNotFound, PartititionNameNotFound, PartitionTypeNotFound,", "\n // Dimensions", @@ -124,8 +124,6 @@ "\n (Error.AocTypePositionNotSupported , 1) => $\"The position of the AoC Type {s[0]} is not supported.\",", "\n (Error.AocConfigurationOrderNotUnique , _) => $\"Two or more AoC Configurations have the same Order.\",", "\n (Error.AccidentYearTypeNotValid , 1) => $\"The parsed AccidentYear {s[0]} is invalid. Expected Accident Year input of type int.\",", - "\n (Error.CoverageUnitComponentNotFound , 2) => $\"Coverage Units component {s[0]} is missing for Data Node {s[1]}.\",", - "\n (Error.CoverageUnitComponentIsEmpty , 2) => $\"Coverage Units component {s[0]} for Data Node {s[1]} should contain non-zero entries.\",", "\n // Partition", "\n (Error.PartitionNotFound , _) => $\"Partition do not found.\",", "\n (Error.ParsedPartitionNotFound , 1) => $\"Parsed partition not available: ReportingNode {s[0]}.\",", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 1808f512..fc076d28 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -421,17 +421,7 @@ { "cell_type": "code", "source": [ - "public static async Task ExtendParsedCoverageUnits (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) {}" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "public static async Task ExtendParsedVariables (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) =>", - "\n await workspace.ExtendParsedCoverageUnits(hierarchyCache);" + "public static async Task ExtendParsedVariables (this IWorkspace workspace, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) {}" ], "metadata": {}, "execution_count": 0, From 642fa26eddfb9996fc6ed4f58fa7147592c3fe13 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Mon, 17 Jul 2023 11:48:59 +0200 Subject: [PATCH 7/7] Merge details --- ifrs17/Utils/ImportCalculationMethods.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index d236a824..3407c03e 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -356,11 +356,6 @@ { "cell_type": "markdown", "source": [ - "# Helper variables used in calculation", - "\n", - "\nVariables defined here and used in the calculation:", - "\n- AocTypeWithNoPv : used in [Present Value](../Import/2ImportScope-PresentValue#present-value-1) to trigger no calculation for some AoC Type.", - "\n- ReferenceAocSteps : used in [Reference AoC Step](../Import/1ImportScope-Identities#reference-aoc-step) to over rule the standard defition of reference AoC Step. " "## Extend Parsed Variables" ], "metadata": {}, @@ -379,6 +374,11 @@ { "cell_type": "markdown", "source": [ + "# Helper variables used in calculation", + "\n", + "\nVariables defined here and used in the calculation:", + "\n- AocTypeWithNoPv : used in [Present Value](../Import/2ImportScope-PresentValue#present-value-1) to trigger no calculation for some AoC Type.", + "\n- ReferenceAocSteps : used in [Reference AoC Step](../Import/1ImportScope-Identities#reference-aoc-step) to over rule the standard defition of reference AoC Step. " ], "metadata": {}, "execution_count": 0,