diff --git a/PresentValueSeries/InitializeData.ipynb b/PresentValueSeries/InitializeData.ipynb index aacb77e0..f7baba98 100644 --- a/PresentValueSeries/InitializeData.ipynb +++ b/PresentValueSeries/InitializeData.ipynb @@ -108,4 +108,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/PresentValueSeries/PresentValue - Episode 2.ipynb b/PresentValueSeries/PresentValue - Episode 2.ipynb index 9164e6e5..37e9ce42 100644 --- a/PresentValueSeries/PresentValue - Episode 2.ipynb +++ b/PresentValueSeries/PresentValue - Episode 2.ipynb @@ -507,4 +507,4 @@ "outputs": [] } ] -} \ No newline at end of file +} diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index a56e1ffe..dc792dba 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -154,8 +154,9 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -239,8 +240,9 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -326,7 +328,8 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index aa95ca1d..fc78fc44 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -121,7 +121,8 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -169,7 +170,8 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 84f27378..412f644a 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -80,7 +80,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -92,7 +93,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -104,7 +106,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index b0fb3cba..d406a80d 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -118,7 +118,8 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -130,7 +131,8 @@ "await Import.FromFile(\"../Files/Dimensions.csv\")", "\n .WithFormat(ImportFormats.AocConfiguration)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -142,7 +144,8 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -163,36 +166,43 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader));", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync());", "\nlog" ], "metadata": {}, @@ -205,7 +215,8 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -217,7 +228,8 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -229,7 +241,8 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index 9d7288c4..ecb29f00 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -96,7 +96,8 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -108,7 +109,8 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -129,36 +131,43 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()", "\n );", "\nlog" ], @@ -172,7 +181,8 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -184,7 +194,8 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -196,7 +207,8 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -217,7 +229,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -229,7 +242,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -241,7 +255,8 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -262,7 +277,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -274,7 +290,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -286,7 +303,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -298,7 +316,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -310,7 +329,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -322,7 +342,8 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -334,7 +355,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index d82e0186..f5a7d4bc 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -70,7 +70,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -82,7 +83,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -94,7 +96,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -106,7 +109,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -118,7 +122,8 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -130,7 +135,8 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -142,7 +148,8 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index 5db058d3..f3066174 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -77,7 +77,8 @@ "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -89,7 +90,8 @@ "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -101,7 +103,8 @@ "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -131,7 +134,8 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -143,7 +147,8 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -164,7 +169,8 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -176,7 +182,8 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -197,7 +204,8 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -209,7 +217,8 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index a8493d9b..a0d0556a 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -76,7 +76,8 @@ "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -88,7 +89,8 @@ "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -100,7 +102,8 @@ "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -130,7 +133,8 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -142,7 +146,8 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -154,7 +159,8 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -166,7 +172,8 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -187,7 +194,8 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -199,7 +207,8 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Report/ParameterReports.ipynb b/ifrs17-template/Report/ParameterReports.ipynb index 2d062832..b1823e77 100644 --- a/ifrs17-template/Report/ParameterReports.ipynb +++ b/ifrs17-template/Report/ParameterReports.ipynb @@ -81,7 +81,7 @@ { "cell_type": "code", "source": [ - "var dataNodeData = await Workspace.GetDataNodeDataReportParameters(args);" + "var dataNodeData = await Workspace.GetDataNodeDataReportParametersAsync(args);" ], "metadata": {}, "execution_count": 0, @@ -90,7 +90,7 @@ { "cell_type": "code", "source": [ - "var dataNodeStates = await Workspace.GetDataNodeStateReportParameters(args);" + "var dataNodeStates = await Workspace.GetDataNodeStateReportParametersAsync(args);" ], "metadata": {}, "execution_count": 0, @@ -99,7 +99,7 @@ { "cell_type": "code", "source": [ - "var allYieldCurves = await Workspace.GetYieldCurveReportParameters(args);;" + "var allYieldCurves = await Workspace.GetYieldCurveReportParametersAsync(args);;" ], "metadata": {}, "execution_count": 0, @@ -108,7 +108,7 @@ { "cell_type": "code", "source": [ - "var singleDataNodeParameters = await Workspace.GetSingleDataNodeReportParameters(args);;" + "var singleDataNodeParameters = await Workspace.GetSingleDataNodeReportParametersAsync(args);;" ], "metadata": {}, "execution_count": 0, @@ -117,7 +117,7 @@ { "cell_type": "code", "source": [ - "var interDataNodeParameters = await Workspace.GetInterDataNodeParameters(args);;" + "var interDataNodeParameters = await Workspace.GetInterDataNodeParametersAsync(args);;" ], "metadata": {}, "execution_count": 0, @@ -126,7 +126,7 @@ { "cell_type": "code", "source": [ - "var partnerRatings = await Workspace.GetPartnerRatingsReportParameters(args);" + "var partnerRatings = await Workspace.GetPartnerRatingsReportParametersAsync(args);" ], "metadata": {}, "execution_count": 0, @@ -135,7 +135,7 @@ { "cell_type": "code", "source": [ - "var partnerDefaultRates = await Workspace.GetCreditDefaultRatesReportParameters(args);;" + "var partnerDefaultRates = await Workspace.GetCreditDefaultRatesReportParametersAsync(args);;" ], "metadata": {}, "execution_count": 0, @@ -150,6 +150,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Data node", + "\nProperties of the Group of Contracts and corresponding Portfolios are merged to provide a full description of the [Data Node](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructureDataStructure#data-node)" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -163,6 +173,17 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Data node state", + "\n", + "\nCurrent and previous period [data node state](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-state)." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -178,6 +199,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Yield curve", + "\n[Yield Curve](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#yield-curve) used for locked-in discounting and current rating discouning (curret period and previous period) are shown." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -192,6 +223,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Single data node parameter", + "\n[Single data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -206,6 +247,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Inter data node parameter", + "\n[Inter data node parameters](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#data-node-parameters) for current and previous period. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -220,6 +271,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Partner ratings", + "\n[Partner ratings](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#partner-rating) for current and previous period." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -234,6 +295,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Partner default rates", + "\n[Partner default rates](https://portal.systemorph.cloud/project/ifrs17/env/v1.0.0/DataModel/DataStructure#credit-default-rate) for current and previous period." + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 6aac2878..36b1ed2a 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -27,7 +27,11 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_CH_2020_12_MTUP10pct.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index 95e7e89a..39134932 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -165,8 +165,9 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -183,8 +184,9 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -264,8 +266,9 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -280,8 +283,9 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .MainTabConfiguration(partition)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -357,7 +361,8 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -372,7 +377,8 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index e5014953..fec21ac1 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -55,7 +55,11 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(ws1)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -64,7 +68,11 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(ws1)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -99,6 +107,15 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "#!eval-notebook \"../Initialization/InitSystemorphBaseToMemory\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -112,7 +129,11 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(ws2)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, @@ -121,7 +142,11 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(ws2)", + "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .ExecuteAsync()" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/Constants/Validations.ipynb b/ifrs17/Constants/Validations.ipynb index 64a58f8c..5f22aca2 100644 --- a/ifrs17/Constants/Validations.ipynb +++ b/ifrs17/Constants/Validations.ipynb @@ -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,", @@ -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]}.\",", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 46802a93..d8992bc6 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -54,7 +54,7 @@ "source": [ "#r \"nuget:Systemorph.Activities,1.6.2\"", "\n#r \"nuget:Systemorph.Arithmetics,1.6.2\"", - "\n#r \"nuget:Systemorph.Workspace,1.6.1\"", + "\n#r \"nuget:Systemorph.Workspace,1.6.3\"", "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.2\"", "\n#r \"nuget:Systemorph.SharePoint,1.6.2\"", "\n#r \"nuget:Systemorph.OneDrive,1.6.2\"", @@ -63,11 +63,11 @@ "\n#r \"nuget:Systemorph.Test,1.6.2\"", "\n#r \"nuget:Systemorph.Export,1.6.4\"", "\n#r \"nuget:Systemorph.DataSetReader,1.6.4\"", - "\n#r \"nuget:Systemorph.DataSource,1.6.0\"", - "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.0\"", + "\n#r \"nuget:Systemorph.DataSource,1.6.3\"", + "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.3\"", "\n#r \"nuget:Systemorph.Reporting,1.6.2\"", "\n#r \"nuget:Systemorph.Charting,1.6.2\"", - "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.1\"" + "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.3\"" ], "metadata": {}, "execution_count": 0, @@ -305,7 +305,7 @@ "", "\n# Dimensions", "\n", - "\nDimensions are data which tipically can be given a short name, here called 'System Name'. They also change slowly with time. A typical example is currencies, and examples of System Names are EUR, CHF, etc.", + "\nDimensions are data which typically can be given a short name, here called 'System Name'. They also change slowly with time. A typical example is currencies, and examples of System Names are EUR, CHF, etc.", "\n", "\nThe advantages of using Dimensions are:", "\n- The data is easier to maintain (the data is said to be 'normalized');", @@ -562,7 +562,7 @@ "", "\n## Balance Sheet Variable Type", "\n", - "\nThe BsVariableType is used to descibe the Anlysis of change of the Balance Sheet reports." + "\nThe BsVariableType is used to descibe the Analysis of change of the Balance Sheet reports." ], "metadata": {}, "execution_count": 0, @@ -1116,7 +1116,7 @@ "\n", "\nThe Yield Curve values must be entered with **yearly** granularity, i.e. every value corresponds to the rate of the whole year starting from the year entered in column Year. The last value is considered valid also for the following years (for which no value has been provided). ", "\n", - "\nDuring calculation, the Yield Curve are retrieved from the DataSource. The Yield Curve Name defined for each group-of-contracts will be used to match the Name of the Yield Curve to be considered. This occurs only for the curve that is used in the computation of the Contractual Service Margin (locked-in for BBA valuation approach, current otherwise). The calculation engine allows the update of the locked-in curve during the entire inception year of the group-of-contracts. When the locked-in Yield Curve is used, the latest Yield Curve available in the system with Year earlier or equal to the inception Year of the group-of-contracts will be used. When the current Yield Curve is used in the calculation, the latest Yield Curve available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used." + "\nDuring calculation, the Yield Curve values are retrieved from the DataSource. The Yield Curve Name defined for each group-of-contracts will be used to match the Name of the Yield Curve to be considered. This occurs only for the curve that is used in the computation of the Contractual Service Margin (locked-in for BBA valuation approach, current otherwise). The calculation engine allows the update of the locked-in curve during the entire inception year of the group-of-contracts. When the locked-in Yield Curve is used, the latest Yield Curve available in the system with Year earlier or equal to the inception Year of the group-of-contracts will be used. When the current Yield Curve is used in the calculation, the latest Yield Curve available in the system with Year and Month earlier or equal to Year and Month of the closing period will be used." ], "metadata": {}, "execution_count": 0, @@ -1151,7 +1151,6 @@ "\n public string Scenario { get; init; }", "\n", "\n [IdentityProperty]", - "\n [Display(Order = 37)]", "\n public string Name { get; init; }", "\n ", "\n [Conversion(typeof(PrimitiveArrayConverter))]", @@ -1232,6 +1231,7 @@ "\n [Required]", "\n [Dimension(typeof(ReportingNode))]", "\n [IdentityProperty]", + "\n [Display(Order = 10)]", "\n public string ReportingNode { get; init; }", "\n}" ], @@ -1272,15 +1272,17 @@ "public record PartitionByReportingNodeAndPeriod : IfrsPartition {", "\n [Dimension(typeof(int), nameof(Year))]", "\n [IdentityProperty]", + "\n [Display(Order = 20)]", "\n public int Year { get; init; }", "\n", "\n [Dimension(typeof(int), nameof(Month))]", "\n [IdentityProperty]", + "\n [Display(Order = 30)]", "\n public int Month { get; init; }", "\n ", - "\n [Display(Order = 50)]", "\n [Dimension(typeof(Scenario))]", "\n [IdentityProperty]", + "\n [Display(Order = 40)]", "\n public string Scenario { get; init; }", "\n}" ], @@ -1502,7 +1504,6 @@ "\n ", "\n [Required]", "\n [IdentityProperty]", - "\n [Display(Order = 10)]", "\n [Dimension(typeof(GroupOfContract))]", "\n public string DataNode { get; init; }", "\n ", @@ -1511,7 +1512,6 @@ "\n [NoArithmetics(ArithmeticOperation.Scale)]", "\n [Dimension(typeof(int), nameof(Year))]", "\n [Range(1900, 2100, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", - "\n [Display(Order = 20)]", "\n public int Year { get; init; }", "\n ", "\n [Required]", @@ -1519,17 +1519,14 @@ "\n [NoArithmetics(ArithmeticOperation.Scale)]", "\n [Dimension(typeof(int), nameof(Month))]", "\n [Range(1, 12, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", - "\n [Display(Order = 30)]", "\n [DefaultValue(DefaultDataNodeActivationMonth)]", "\n public int Month { get; init; } = DefaultDataNodeActivationMonth;", "\n ", "\n [Required]", - "\n [Display(Order = 40)]", "\n [DefaultValue(State.Active)]", "\n public State State { get; init; } = State.Active;", "\n", "\n [IdentityProperty]", - "\n [Display(Order = 50)]", "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" @@ -1568,7 +1565,6 @@ "\n [NoArithmetics(ArithmeticOperation.Scale)]", "\n [Dimension(typeof(int), nameof(Year))]", "\n [Range(1900, 2100, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", - "\n [Display(Order = 20)]", "\n public int Year { get; init; }", "\n ", "\n [Required]", @@ -1576,18 +1572,15 @@ "\n [NoArithmetics(ArithmeticOperation.Scale)]", "\n [Dimension(typeof(int), nameof(Month))]", "\n [Range(1, 12, ErrorMessage = \"Value for {0} must be between {1} and {2}.\")]", - "\n [Display(Order = 30)]", "\n [DefaultValue(DefaultDataNodeActivationMonth)]", "\n public int Month { get; init; } = DefaultDataNodeActivationMonth;", "\n ", "\n [Required]", "\n [IdentityProperty]", - "\n [Display(Order = 10)]", "\n [Dimension(typeof(GroupOfContract))]", "\n public string DataNode { get; init; }", "\n", "\n [IdentityProperty]", - "\n [Display(Order = 40)]", "\n [Dimension(typeof(Scenario))]", "\n public string Scenario { get; init; }", "\n}" @@ -1608,7 +1601,6 @@ "\npublic record InterDataNodeParameter : DataNodeParameter {", "\n [Required]", "\n [IdentityProperty]", - "\n [Display(Order = 10)]", "\n [Dimension(typeof(GroupOfContract))]", "\n public string LinkedDataNode { get; init; }", "\n ", @@ -2040,7 +2032,7 @@ "source": [ "# Args", "\n", - "\nArgs are used to hold data related to the partition and additional information required to performe calculation at import and report. ", + "\nArgs are used to hold data related to the partition and additional information required to perform calculation at import and report. ", "\nThey are not persisted, i.e. they are not saved on the database." ], "metadata": {}, diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index 8eb90368..1b94ed00 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -62,19 +62,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public static IDocumentBuilder MainTabConfigurationWoScenario(this IDocumentBuilder builder, T args) where T : IfrsPartition", - "\n => builder.WithTable( config => config .AtBeginning() ", - "\n .WithName(Main) ", - "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", - "\n .WithColumn(x => x.Id, x => x.Delete()));" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ @@ -197,6 +184,7 @@ "\n .WithColumn(x => x.Month, x => x.Delete())", "\n .WithColumn(x => x.Year, x => x.Delete())", "\n .WithColumn(x => x.Id, x => x.Delete())", + "\n .WithColumn(x => x.Scenario, x => x.Delete())", "\n .WithColumn(x => x.State, y => y.WithDataValidation(z => z.WithReferenceTo(t => t.State)))", "\n );" ], @@ -250,6 +238,7 @@ "\n .WithColumn(x => x.Partition, x => x.Delete())", "\n .WithColumn(x => x.Month, x => x.Delete())", "\n .WithColumn(x => x.Id, x => x.Delete())", + "\n .WithColumn(x => x.Scenario, x => x.Delete())", "\n .WithColumn(x => x.Year, x => x.Delete())", "\n )", "\n .WithTable(config => config ", @@ -261,6 +250,7 @@ "\n .WithColumn(x => x.Year, x => x.Delete())", "\n .WithColumn(x => x.Year, x => x.Delete())", "\n .WithColumn(x => x.Id, x => x.Delete())", + "\n .WithColumn(x => x.Scenario, x => x.Delete())", "\n );" ], "metadata": {}, diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index f4737847..52c5a764 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -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 ", @@ -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", @@ -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(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", + "\n Value = GetSign((ImportFormats.Actual, aocType, valueType.AmountType, valueType.EstimateType, dataNodeData.IsReinsurance), parsingStorage.HierarchyCache) * datarow.Field(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", "\n };", "\n return item;", "\n }, ImportFormats.Actual", @@ -1308,7 +1313,7 @@ "\n", "\n var importLog = await Import.FromDataSet(dataSet)", "\n .WithType ( (dataset, datarow) => {", - "\n var dataNode = parsingStorage.ValidateDataNode(datarow.Field(nameof(DataNode)));", + "\n var dataNode = parsingStorage.ValidateDataNode(datarow.Field(nameof(DataNode)),importFormat);", "\n var amountType = parsingStorage.ValidateAmountType(datarow.Field(nameof(IfrsVariable.AmountType)));", "\n var estimateType = parsingStorage.ValidateEstimateType(datarow.Field(nameof(IfrsVariable.EstimateType)), dataNode); //TODO LIC/LRC dependence", "\n var aocStep = importFormat == ImportFormats.SimpleValue ", @@ -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(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", + "\n Value = GetSign((importFormat, aocStep.AocType, amountType, estimateType, parsingStorage.IsDataNodeReinsurance(dataNode)), parsingStorage.HierarchyCache) * datarow.Field(nameof(IfrsVariable.Value)).CheckStringForExponentialAndConvertToDouble()", "\n };", "\n return iv;", "\n }, importFormat // This should indicate the table name, not the input format", diff --git a/ifrs17/Report/ParameterReportsQueries.ipynb b/ifrs17/Report/ParameterReportsQueries.ipynb index 04884352..8f0d6f4a 100644 --- a/ifrs17/Report/ParameterReportsQueries.ipynb +++ b/ifrs17/Report/ParameterReportsQueries.ipynb @@ -176,7 +176,7 @@ { "cell_type": "code", "source": [ - "public static async Task GetDataNodeDataReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "public static async Task GetDataNodeDataReportParametersAsync(this IWorkspace workspace, ImportArgs args) =>", "\n (await workspace.LoadDataNodesAsync(args))", "\n .Values", "\n .ToArray();" @@ -188,7 +188,7 @@ { "cell_type": "code", "source": [ - "public static async Task GetDataNodeStateReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "public static async Task GetDataNodeStateReportParametersAsync(this IWorkspace workspace, ImportArgs args) =>", "\n (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.DataNode))", "\n .Values", "\n .SelectMany(x => x.Select(y => ", @@ -217,8 +217,8 @@ { "cell_type": "code", "source": [ - "public static async Task GetYieldCurveReportParameters(this IWorkspace workspace, ImportArgs args) {", - "\n var dataNodeData = await workspace.GetDataNodeDataReportParameters(args);", + "public static async Task GetYieldCurveReportParametersAsync(this IWorkspace workspace, ImportArgs args) {", + "\n var dataNodeData = await workspace.GetDataNodeDataReportParametersAsync(args);", "\n", "\n var lockedYieldCurves = (await workspace.LoadLockedInYieldCurveAsync(args, dataNodeData))", "\n .Select(x => new YieldCurveReportParameter {", @@ -275,7 +275,7 @@ { "cell_type": "code", "source": [ - "public static async Task GetSingleDataNodeReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "public static async Task GetSingleDataNodeReportParametersAsync(this IWorkspace workspace, ImportArgs args) =>", "\n (await workspace.LoadSingleDataNodeParametersAsync(args))", "\n .Values", "\n .SelectMany(x => x.Select(y => new SingleDataNodeReportParameter {", @@ -304,7 +304,7 @@ { "cell_type": "code", "source": [ - "public static async Task GetInterDataNodeParameters(this IWorkspace workspace, ImportArgs args) =>", + "public static async Task GetInterDataNodeParametersAsync(this IWorkspace workspace, ImportArgs args) =>", "\n (await workspace.LoadInterDataNodeParametersAsync(args))", "\n .Values", "\n .SelectMany(x => x.SelectMany(y => y.Value.Select(z => ", @@ -338,7 +338,7 @@ { "cell_type": "code", "source": [ - "public static async Task GetPartnerRatingsReportParameters(this IWorkspace workspace, ImportArgs args) =>", + "public static async Task GetPartnerRatingsReportParametersAsync(this IWorkspace workspace, ImportArgs args) =>", "\n (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.Partner))", "\n .Values", "\n .SelectMany(x => x.Select(y => ", @@ -360,8 +360,8 @@ { "cell_type": "code", "source": [ - "public static async Task GetCreditDefaultRatesReportParameters(this IWorkspace workspace, ImportArgs args) {", - "\n var partnerRatings = await workspace.GetPartnerRatingsReportParameters(args);", + "public static async Task GetCreditDefaultRatesReportParametersAsync(this IWorkspace workspace, ImportArgs args) {", + "\n var partnerRatings = await workspace.GetPartnerRatingsReportParametersAsync(args);", "\n ", "\n var creditDefaultRates = (await workspace.LoadCurrentAndPreviousParameterAsync(args, x => x.CreditRiskRating))", "\n .Values", diff --git a/ifrs17/Report/ReportConfigurationAndUtils.ipynb b/ifrs17/Report/ReportConfigurationAndUtils.ipynb index df641ba1..aa805243 100644 --- a/ifrs17/Report/ReportConfigurationAndUtils.ipynb +++ b/ifrs17/Report/ReportConfigurationAndUtils.ipynb @@ -50,11 +50,12 @@ "\n int headerColumnWidth = 250,", "\n int groupDefaultExpanded = 2)", "\n => pivotBuilder.ToTable().WithOptions(go => go", - "\n .WithColumns(cols => cols.Modify(\"Value\",c => c.WithWidth(valueColumnWidth).WithFormat(\"new Intl.NumberFormat('en',{ minimumFractionDigits:2, maximumFractionDigits:2 }).format(value)\")))", + "\n .WithColumns(cols => cols.Modify(\"Value\",c => c.WithWidth(valueColumnWidth).WithFormat(\"typeof(value) == 'number' ? new Intl.NumberFormat('en',{ minimumFractionDigits:2, maximumFractionDigits:2 }).format(value) : value\")))", "\n .WithRows(rows => rows", "\n .Where(r => !(r.RowGroup.Coordinates.Last() == \"NullGroup\"))", "\n .Select(r => r with { RowGroup = r.RowGroup with { Coordinates = r.RowGroup.Coordinates.Where(c => c != \"NullGroup\").ToImmutableList() } })", "\n .ToArray())", + "\n .HideRowValuesForDimension(\"Novelty\")", "\n .WithAutoGroupColumn(c => c.WithWidth(headerColumnWidth) with { Pinned = \"left\" })", "\n with { Height = reportHeight, GroupDefaultExpanded = groupDefaultExpanded, OnGridReady = null } );" ], diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 2ce8b659..4bd9a413 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -15,6 +15,24 @@ "nbformat": 4, "nbformat_minor": 5, "cells": [ + { + "cell_type": "markdown", + "source": [ + "

Activity Log

" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Import" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -48,6 +66,25 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Data Model" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## Import Export Activity ", + "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -63,6 +100,8 @@ "\n", "\n public string Category {get; init;}", "\n", + "\n public string ExceptionMessage {get; init;}", + "\n", "\n [Conversion(typeof(JsonConverter))]", "\n public string[] ErrorMessages {get; init;}", "\n", @@ -72,7 +111,7 @@ "\n [Conversion(typeof(JsonConverter))]", "\n public string[] InfoMessages {get; init;}", "\n", - "\n public Guid SourceId {get; init;} ", + "\n public Guid? SourceId {get; init;} ", "\n ", "\n public ImportExportActivity(ActivityLog log, ISessionVariable session)", "\n {", @@ -97,6 +136,16 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "## Keyed Import Export", + "\nContains the information of the file that has been the object of the activity. Among other information, it contains the content of the file in a serialized format. " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ @@ -354,83 +403,103 @@ "execution_count": 0, "outputs": [] }, + { + "cell_type": "markdown", + "source": [ + "# Helper methods " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ - "public static async Task ExecuteWithStoreActivityAsync(this ImportOptionsBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable)", + "public record ImportBuilderWriter(ImportOptionsBuilder Builder, ", + "\n ISessionVariable Session, ", + "\n IDataSource DataSource, ", + "\n IDataSetImportVariable ImportVariable)", "\n{", - "\n var log = await builder.ExecuteAsync();", - "\n var options = builder.GetImportOptions();", - "\n var activity = new ImportExportActivity(log, session);", - "\n bool importSucceeded = true;", - "\n switch(options)", + "\n public async Task ExecuteAsync()", "\n {", - "\n case FileImportOptions fio:", - "\n var importFile = new ImportFile(Guid.NewGuid());", - "\n try", - "\n {", - "\n importFile = await (new ImportFile(fio, importVariable, session)).InitializeImportDataAsync() as ImportFile;", - "\n }", - "\n catch (Exception)", - "\n {", - "\n importSucceeded = false;", - "\n }", - "\n activity = activity with {SourceId = importFile.Id, ", - "\n Category = \"Import from File\"};", - "\n if (importSucceeded) await dataSource.UpdateAsync(importFile.RepeatOnce());", - "\n break;", - "\n case StringImportOptions sgio:", - "\n var importString = new ImportString(Guid.NewGuid());", - "\n try", - "\n { ", - "\n importString = await (new ImportString(sgio, importVariable, session)).InitializeImportDataAsync() as ImportString;", - "\n }", - "\n catch (Exception)", - "\n {", - "\n importSucceeded = false;", - "\n }", - "\n activity = activity with {SourceId = importString.Id, ", - "\n Category = \"Import from String\"};", - "\n if (importSucceeded) await dataSource.UpdateAsync(importString.RepeatOnce());", - "\n break;", - "\n case StreamImportOptions smio:", - "\n var importStream = new ImportStream(Guid.NewGuid());", - "\n try", - "\n {", - "\n importStream = await (new ImportStream(smio, importVariable, session)).InitializeImportDataAsync() as ImportStream;", - "\n }", - "\n catch (Exception)", - "\n {", - "\n importSucceeded = false;", - "\n }", - "\n activity = activity with {SourceId = importStream.Id, ", - "\n Category = \"Import from Stream\"};", - "\n if (importSucceeded) await dataSource.UpdateAsync(importStream.RepeatOnce());", - "\n break;", - "\n case DataSetImportOptions dsio:", - "\n var importDataSet = new ImportDataSet(Guid.NewGuid());", - "\n try", - "\n {", - "\n importDataSet = await (new ImportDataSet(dsio, importVariable, session)).InitializeImportDataAsync() as ImportDataSet;", - "\n }", - "\n catch(Exception)", - "\n {", - "\n importSucceeded = false;", - "\n }", - "\n activity = activity with {SourceId = importDataSet.Id, ", - "\n Category = \"Import from Data Set\"};", - "\n if (importSucceeded) await dataSource.UpdateAsync(importDataSet.RepeatOnce());", - "\n break;", - "\n default:", - "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", - "\n break;", - "\n } ", - "\n await dataSource.UpdateAsync(activity.RepeatOnce());", - "\n await dataSource.CommitAsync(); ", - "\n return log;", + "\n var log = await Builder.ExecuteAsync();", + "\n var options = Builder.GetImportOptions();", + "\n var activity = new ImportExportActivity(log, Session);", + "\n bool importSucceeded = true;", + "\n switch(options)", + "\n {", + "\n case FileImportOptions fio:", + "\n var importFile = new ImportFile(Guid.NewGuid());", + "\n try", + "\n {", + "\n importFile = await (new ImportFile(fio, ImportVariable, Session)).InitializeImportDataAsync() as ImportFile;", + "\n activity = activity with {SourceId = importFile.Id};", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n importSucceeded = false;", + "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", + "\n }", + "\n activity = activity with {Category = \"Import from File\"};", + "\n if (importSucceeded) await DataSource.UpdateAsync(importFile.RepeatOnce());", + "\n break;", + "\n", + "\n case StringImportOptions sgio:", + "\n var importString = new ImportString(Guid.NewGuid());", + "\n try", + "\n {", + "\n importString = await (new ImportString(sgio, ImportVariable, Session)).InitializeImportDataAsync() as ImportString;", + "\n activity = activity with {SourceId = importString.Id};", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n importSucceeded = false;", + "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", + "\n }", + "\n activity = activity with {Category = \"Import from String\"};", + "\n if (importSucceeded) await DataSource.UpdateAsync(importString.RepeatOnce());", + "\n break;", + "\n ", + "\n case StreamImportOptions smio:", + "\n var importStream = new ImportStream(Guid.NewGuid());", + "\n try", + "\n {", + "\n importStream = await (new ImportStream(smio, ImportVariable, Session)).InitializeImportDataAsync() as ImportStream;", + "\n activity = activity with {SourceId = importStream.Id};", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n importSucceeded = false;", + "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", + "\n }", + "\n activity = activity with {Category = \"Import from Stream\"};", + "\n if (importSucceeded) await DataSource.UpdateAsync(importStream.RepeatOnce());", + "\n break;", + "\n", + "\n case DataSetImportOptions dsio:", + "\n var importDataSet = new ImportDataSet(Guid.NewGuid());", + "\n try", + "\n {", + "\n importDataSet = await (new ImportDataSet(dsio, ImportVariable, Session)).InitializeImportDataAsync() as ImportDataSet;", + "\n activity = activity with {SourceId = importDataSet.Id};", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n importSucceeded = false;", + "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", + "\n }", + "\n activity = activity with {Category = \"Import from Data Set\"};", + "\n if (importSucceeded) await DataSource.UpdateAsync(importDataSet.RepeatOnce());", + "\n break;", + "\n", + "\n default:", + "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", + "\n break;", + "\n }", + "\n await DataSource.UpdateAsync(activity.RepeatOnce());", + "\n await DataSource.CommitAsync();", + "\n return log;", + "\n }", "\n}" ], "metadata": {}, @@ -440,25 +509,54 @@ { "cell_type": "code", "source": [ - "public static async Task ExecuteWithStoreActivityAsync(this IDocumentBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable)", + "public record ExportBuilderWriter(DocumentBuilder Builder, ", + "\n ISessionVariable Session, ", + "\n IDataSource DataSource, ", + "\n IDataSetImportVariable ImportVariable)", "\n{", - "\n var exportResult = await builder.ExecuteAsync();", - "\n var exportFile = await (new ExportFile(builder as DocumentBuilder, importVariable, session)).InitializeExportDataAsync();", - "\n var activity = new ImportExportActivity(exportResult.ActivityLog, session) with {Category = \"Export to File\", ", + "\n public async Task ExecuteAsync()", + "\n {", + "\n var exportResult = await Builder.ExecuteAsync();", + "\n var exportFile = await (new ExportFile(Builder, ImportVariable, Session)).InitializeExportDataAsync();", + "\n var activity = new ImportExportActivity(exportResult.ActivityLog, Session) with {Category = \"Export to File\", ", "\n SourceId = exportFile.Id};", - "\n await dataSource.UpdateAsync(exportFile.RepeatOnce());", - "\n await dataSource.UpdateAsync(activity.RepeatOnce());", - "\n await dataSource.CommitAsync();", - "\n return exportResult;", + "\n await DataSource.UpdateAsync(exportFile.RepeatOnce());", + "\n await DataSource.UpdateAsync(activity.RepeatOnce());", + "\n await DataSource.CommitAsync();", + "\n return exportResult;", + "\n }", "\n}" ], "metadata": {}, "execution_count": 0, "outputs": [] }, + { + "cell_type": "code", + "source": [ + "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable) => ", + "\n new ImportBuilderWriter(builder, session, dataSource, importVariable);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable) =>", + "\n new ExportBuilderWriter(builder as DocumentBuilder, session, dataSource, importVariable);" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, { "cell_type": "code", "source": [ diff --git a/ifrs17/Utils/ImportCalculationMethods.ipynb b/ifrs17/Utils/ImportCalculationMethods.ipynb index 1c394e71..a380baa8 100644 --- a/ifrs17/Utils/ImportCalculationMethods.ipynb +++ b/ifrs17/Utils/ImportCalculationMethods.ipynb @@ -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,