From 292dc013b747943c68b8be3259087f476f32ec8c Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Fri, 22 Sep 2023 08:59:03 +0200 Subject: [PATCH] Preparing the holders for extra logic when importing portfolios. --- ifrs17/Import/Importers.ipynb | 16 ++++++++++------ ifrs17/Utils/ImportCalculationMethods.ipynb | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index d15c14ae..d5bf77fd 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -994,24 +994,28 @@ "\n if(Activity.HasErrors()) return Activity.Finish();", "\n ", "\n var importLogPortfolios = await Import.FromDataSet(dataSet)", - "\n .WithType((dataset, datarow) => ", - "\n new InsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", + "\n .WithType((dataset, datarow) => {", + "\n var pf = new InsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", "\n Partition = storage.TargetPartitionByReportingNode.Id,", "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", "\n FunctionalCurrency = storage.ReportingNode.Currency,", "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", - "\n OciType = datarow.Field(nameof(DataNode.OciType)) })", - "\n .WithType((dataset, datarow) =>", - "\n new ReinsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", + "\n OciType = datarow.Field(nameof(DataNode.OciType)) };", + "\n return ExtendPortfolio(pf, datarow);", + "\n })", + "\n .WithType((dataset, datarow) => {", + "\n var pf = new ReinsurancePortfolio { SystemName = datarow.Field(nameof(DataNode.SystemName)),", "\n DisplayName = datarow.Field(nameof(DataNode.DisplayName)),", "\n Partition = storage.TargetPartitionByReportingNode.Id,", "\n ContractualCurrency = datarow.Field(nameof(DataNode.ContractualCurrency)),", "\n FunctionalCurrency = storage.ReportingNode.Currency,", "\n LineOfBusiness = datarow.Field(nameof(DataNode.LineOfBusiness)),", "\n ValuationApproach = datarow.Field(nameof(DataNode.ValuationApproach)),", - "\n OciType = datarow.Field(nameof(DataNode.OciType)) })", + "\n OciType = datarow.Field(nameof(DataNode.OciType)) };", + "\n return ExtendPortfolio(pf, datarow);", + "\n })", "\n .WithTarget(workspace)", "\n .ExecuteAsync();", "\n ", diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index aa3d48a0..627ba797 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -138,6 +138,24 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public InsurancePortfolio ExtendPortfolio(InsurancePortfolio pf, IDataRow datarow) => pf;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public ReinsurancePortfolio ExtendPortfolio(ReinsurancePortfolio pf, IDataRow datarow) => pf;" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [