Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ifrs17/Constants/Validations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"\n // Data Note State",
"\n ChangeDataNodeState, InactiveDataNodeState,",
"\n // Parameters",
"\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, ",
"\n ReinsuranceCoverageDataNode, DuplicateInterDataNode, DuplicateSingleDataNode, InvalidDataNode, InvalidDataNodeForOpening,",
"\n // Storage",
"\n DataNodeNotFound, PartnerNotFound, RatingNotFound, CreditDefaultRateNotFound, MissingPremiumAllocation, ReinsuranceCoverage, ",
"\n YieldCurveNotFound, YieldCurvePeriodNotApplicable, EconomicBasisNotFound, AccountingVariableTypeNotFound,",
Expand Down Expand Up @@ -150,6 +150,7 @@
"\n (Error.DuplicateInterDataNode , 2) => $\"Duplicated Inter-DataNode parameter for {s[0]}-{s[1]} is found.\",",
"\n (Error.DuplicateSingleDataNode , 1) => $\"Duplicated Single-DataNode parameter for {s[0]} is found.\",",
"\n (Error.InvalidDataNode , 1) => $\"Data imported for invalid Data Node {s[0]}.\",",
"\n (Error.InvalidDataNodeForOpening , 1) => $\"Data imported for invalid Data Node or for a Data Node after its inception year {s[0]}.\",",
"\n // Storage",
"\n (Error.DataNodeNotFound , 1) => $\"DataNode {s[0]} not found.\",",
"\n (Error.PartnerNotFound , 1) => $\"Partner not found for DataNode {s[0]}.\",",
Expand Down
17 changes: 11 additions & 6 deletions ifrs17/Import/Importers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@
"\n return aoc;",
"\n }",
"\n ",
"\n public string ValidateDataNode(string goc) {",
"\n public string ValidateDataNode(string goc, string importFormat) {",
"\n if (!DataNodeDataBySystemName.ContainsKey(goc))",
"\n ApplicationMessage.Log(Error.InvalidDataNode, goc);",
"\n {",
"\n if( importFormat == ImportFormats.Opening )",
"\n ApplicationMessage.Log(Error.InvalidDataNodeForOpening, goc);",
"\n else",
"\n ApplicationMessage.Log(Error.InvalidDataNode, goc);",
"\n }",
"\n return goc;",
"\n }",
"\n ",
Expand Down Expand Up @@ -1133,7 +1138,7 @@
"\n ? accidentYear",
"\n : (int?)null,",
"\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,",
"\n Values = Multiply(GetSign((aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)",
"\n Values = Multiply(GetSign((ImportFormats.Cashflow, aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache), values)",
"\n };",
"\n return item;",
"\n }, ImportFormats.Cashflow",
Expand Down Expand Up @@ -1234,7 +1239,7 @@
"\n AmountType = valueType.AmountType,",
"\n EstimateType = valueType.EstimateType,",
"\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,",
"\n Value = GetSign((aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache) * datarow.Field<string>(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()",
"\n Value = GetSign((ImportFormats.Actual, aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache) * datarow.Field<string>(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()",
"\n };",
"\n return item;",
"\n }, ImportFormats.Actual",
Expand Down Expand Up @@ -1308,7 +1313,7 @@
"\n",
"\n var importLog = await Import.FromDataSet(dataSet)",
"\n .WithType<IfrsVariable> ( (dataset, datarow) => {",
"\n var dataNode = parsingStorage.ValidateDataNode(datarow.Field<string>(nameof(DataNode)));",
"\n var dataNode = parsingStorage.ValidateDataNode(datarow.Field<string>(nameof(DataNode)),importFormat);",
"\n var amountType = parsingStorage.ValidateAmountType(datarow.Field<string>(nameof(IfrsVariable.AmountType)));",
"\n var estimateType = parsingStorage.ValidateEstimateType(datarow.Field<string>(nameof(IfrsVariable.EstimateType)), dataNode); //TODO LIC/LRC dependence",
"\n var aocStep = importFormat == ImportFormats.SimpleValue ",
Expand All @@ -1330,7 +1335,7 @@
"\n EstimateType = estimateType,",
"\n EconomicBasis = economicBasis,",
"\n Partition = parsingStorage.TargetPartitionByReportingNodeAndPeriod.Id,",
"\n Value = GetSign((aocStep.AocType, amountType, estimateType, parsingStorage.IsDataNodeReinsurance(dataNode)), parsingStorage.HierarchyCache) * datarow.Field<string>(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()",
"\n Value = GetSign((importFormat, aocStep.AocType, amountType, estimateType, parsingStorage.IsDataNodeReinsurance(dataNode)), parsingStorage.HierarchyCache) * datarow.Field<string>(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()",
"\n };",
"\n return iv;",
"\n }, importFormat // This should indicate the table name, not the input format",
Expand Down
2 changes: 1 addition & 1 deletion ifrs17/Utils/ImportCalculationMethods.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
{
"cell_type": "code",
"source": [
"public static int GetSign((string AocType, string AmountType, string EstimateType, bool IsReinsurance) variable, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) => 1;"
"public static int GetSign((string importFormat, string AocType, string AmountType, string EstimateType, bool IsReinsurance) variable, Systemorph.Vertex.Hierarchies.IHierarchicalDimensionCache hierarchyCache) => 1;"
],
"metadata": {},
"execution_count": 0,
Expand Down