From 9a6790be928cae278b095cd64120da1fd81e63fb Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 11 Jan 2023 14:32:59 +0100 Subject: [PATCH 1/6] Removing scenario column, where needed. --- ifrs17-template/Export/MapTemplate.ipynb | 4 ++-- ifrs17/Export/ExportConfiguration.ipynb | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index 931953b7..510bc807 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -154,7 +154,7 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" ], "metadata": {}, @@ -239,7 +239,7 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index 8eb90368..dc5d0095 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -65,11 +65,12 @@ { "cell_type": "code", "source": [ - "public static IDocumentBuilder MainTabConfigurationWoScenario(this IDocumentBuilder builder, T args) where T : IfrsPartition", + "public static IDocumentBuilder MainTabConfigurationWoScenario(this IDocumentBuilder builder, T args) where T : PartitionByReportingNodeAndPeriod", "\n => builder.WithTable( config => config .AtBeginning() ", "\n .WithName(Main) ", "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", - "\n .WithColumn(x => x.Id, x => x.Delete()));" + "\n .WithColumn(x => x.Id, x => x.Delete())", + "\n .WithColumn(x => x.Scenario, x => x.Delete()));" ], "metadata": {}, "execution_count": 0, @@ -197,6 +198,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 +252,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 +264,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": {}, From 01fb7dfd6db594a30f1adb8e71a9a82d7c7beffe Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 11 Jan 2023 16:32:36 +0100 Subject: [PATCH 2/6] Changes in the Test --- ifrs17-template/Test/MapTemplateAndImportTest.ipynb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index cd6603fd..fc728746 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -165,7 +165,7 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" @@ -183,7 +183,7 @@ "\n .PortfolioConfiguration()", "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" ], "metadata": {}, @@ -264,7 +264,7 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync();", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" @@ -280,7 +280,7 @@ "\n .WithSource(Workspace)", "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", - "\n .MainTabConfigurationWoScenario(partition)", + "\n .MainTabConfiguration(partition)", "\n.ExecuteAsync()" ], "metadata": {}, @@ -404,7 +404,7 @@ "\nvar expectedSingleDataNodeParamBm = Workspace.Query().Where(x => x.Year == partition.Year && x.Month == partition.Month).ToArray();", "\nvar expectedInterDataNodeParamBm = Workspace.Query().ToArray();", "\nUtils.EqualityComparer(singleDataNodeParamBm, expectedSingleDataNodeParamBm);", - "\nUtils.EqualityComparer(interDataNodeParamBm, expectedInterDataNodeParamBm);", + "\nUtils.EqualityComparer(interDataNodeParamBm, expectedInterDataNodeParamBm)", "\n*/" ], "metadata": {}, From a9e95de684a6ac04e6842027367233514e8c4fb7 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Wed, 11 Jan 2023 16:34:10 +0100 Subject: [PATCH 3/6] diff ; --- ifrs17-template/Test/MapTemplateAndImportTest.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index fc728746..b972e36e 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -404,7 +404,7 @@ "\nvar expectedSingleDataNodeParamBm = Workspace.Query().Where(x => x.Year == partition.Year && x.Month == partition.Month).ToArray();", "\nvar expectedInterDataNodeParamBm = Workspace.Query().ToArray();", "\nUtils.EqualityComparer(singleDataNodeParamBm, expectedSingleDataNodeParamBm);", - "\nUtils.EqualityComparer(interDataNodeParamBm, expectedInterDataNodeParamBm)", + "\nUtils.EqualityComparer(interDataNodeParamBm, expectedInterDataNodeParamBm);", "\n*/" ], "metadata": {}, From 44c2d8ef8f154b5d07fd8a8e28a221e2bd76be2a Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Thu, 19 Jan 2023 10:42:05 +0100 Subject: [PATCH 4/6] Removing the unused method. --- ifrs17/Export/ExportConfiguration.ipynb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ifrs17/Export/ExportConfiguration.ipynb b/ifrs17/Export/ExportConfiguration.ipynb index dc5d0095..1b94ed00 100644 --- a/ifrs17/Export/ExportConfiguration.ipynb +++ b/ifrs17/Export/ExportConfiguration.ipynb @@ -62,20 +62,6 @@ "execution_count": 0, "outputs": [] }, - { - "cell_type": "code", - "source": [ - "public static IDocumentBuilder MainTabConfigurationWoScenario(this IDocumentBuilder builder, T args) where T : PartitionByReportingNodeAndPeriod", - "\n => builder.WithTable( config => config .AtBeginning() ", - "\n .WithName(Main) ", - "\n .WithSource(source => args.RepeatOnce().AsQueryable()) ", - "\n .WithColumn(x => x.Id, x => x.Delete())", - "\n .WithColumn(x => x.Scenario, x => x.Delete()));" - ], - "metadata": {}, - "execution_count": 0, - "outputs": [] - }, { "cell_type": "code", "source": [ From 6997a6f3ecd3c54a7861435b11ebfec6e4eb3ec0 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Thu, 19 Jan 2023 11:14:59 +0100 Subject: [PATCH 5/6] Taking care of the order of the columns --- ifrs17/DataModel/DataStructure.ipynb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 46802a93..48a62c3b 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -1232,6 +1232,7 @@ "\n [Required]", "\n [Dimension(typeof(ReportingNode))]", "\n [IdentityProperty]", + "\n [Display(Order = 10)]", "\n public string ReportingNode { get; init; }", "\n}" ], @@ -1272,15 +1273,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}" ], From 6f830a2472b4e67cd2bca6adffffe6aeb13106d8 Mon Sep 17 00:00:00 2001 From: Teo Kukuljan Date: Thu, 19 Jan 2023 12:15:57 +0100 Subject: [PATCH 6/6] Removing the display orders where the default ordering does the wanted. --- ifrs17/DataModel/DataStructure.ipynb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 48a62c3b..d3e0e1e0 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -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))]", @@ -1505,7 +1504,6 @@ "\n ", "\n [Required]", "\n [IdentityProperty]", - "\n [Display(Order = 10)]", "\n [Dimension(typeof(GroupOfContract))]", "\n public string DataNode { get; init; }", "\n ", @@ -1514,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]", @@ -1522,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}" @@ -1571,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]", @@ -1579,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}" @@ -1611,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 ",