From a177f60fbce401c38d99e59f7095cb3e8bcf62f9 Mon Sep 17 00:00:00 2001 From: nnikolopoulos Date: Fri, 11 Nov 2022 09:56:52 +0100 Subject: [PATCH 1/2] Use AmountType instead of PvAmountType --- full-ifrs17-template/Files/Dimensions.csv | 2 +- .../Initialization/InitSystemorphBaseToMemory.ipynb | 2 +- .../Initialization/InitSystemorphToDatabase.ipynb | 2 +- ifrs17/DataModel/DataStructure.ipynb | 4 +--- ifrs17/Import/Importers.ipynb | 10 +++++----- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/full-ifrs17-template/Files/Dimensions.csv b/full-ifrs17-template/Files/Dimensions.csv index d0a29c98..6f61a39c 100644 --- a/full-ifrs17-template/Files/Dimensions.csv +++ b/full-ifrs17-template/Files/Dimensions.csv @@ -1,4 +1,4 @@ -@@PvAmountType,,,,,,,,,,, +@@AmountType,,,,,,,,,,, SystemName,DisplayName,Parent,Order,PeriodType,ExternalId0,ExternalId1,,,,, PR,Premiums,,10,BeginningOfPeriod,PayablePR,ReceivablePR,,,,, CL,Claims,,20,EndOfPeriod,,,,,,, diff --git a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index dfe320cb..93399d0f 100644 --- a/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/full-ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -78,7 +78,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithType()", - "\n .WithType()", + "\n .WithType()", "\n .WithType()", "\n .WithType()", "\n .WithType()", diff --git a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index 04d2caa5..c3f89cff 100644 --- a/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/full-ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -62,7 +62,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithType()", - "\n .WithType()", + "\n .WithType()", "\n .WithType()", "\n .WithType()", "\n .WithType()", diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index ecd6fbe3..d5e0eb51 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -317,9 +317,7 @@ { "cell_type": "code", "source": [ - "public record PvAmountType : AmountType {} //TODO Rename ", - "\n", - "\npublic record DeferrableAmountType : AmountType {}" + "public record DeferrableAmountType : AmountType {}" ] }, { diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index d115059d..964b2dfa 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -59,7 +59,7 @@ "\n ", "\n // Dimensions", "\n public Dictionary EstimateType;", - "\n public Dictionary PvAmountType; ", + "\n public Dictionary AmountType; ", "\n public HashSet AocTypeMap;", "\n private HashSet estimateTypes;", "\n private HashSet amountTypes;", @@ -132,7 +132,7 @@ "\n : await LoadDataNodesAsync(dataSource, args);", "\n // Dimensions", "\n EstimateType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", - "\n PvAmountType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", + "\n AmountType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", "\n amountTypes = (await dataSource.Query().ToArrayAsync()).Select(at => at.SystemName).ToHashSet();", "\n estimateTypes = args.ImportFormat switch {", "\n ImportFormats.SimpleValue => (await dataSource.Query().ToArrayAsync()).Select(et => et.SystemName).ToHashSet(),", @@ -146,7 +146,7 @@ "\n // DimensionsWithExternalId", "\n DimensionsWithExternalId = new Dictionary>()", "\n {", - "\n { typeof(PvAmountType), await GetDimensionWithExternalIdDictionaryAsync() },", + "\n { typeof(AmountType), await GetDimensionWithExternalIdDictionaryAsync() },", "\n { typeof(EstimateType), await GetDimensionWithExternalIdDictionaryAsync() }", "\n };", "\n ", @@ -960,8 +960,8 @@ "\n return null; ", "\n }", "\n ", - "\n var amountType = parsingStorage.DimensionsWithExternalId[typeof(PvAmountType)].TryGetValue(valueType, out var at)? at : null;", - "\n var isStdActual = parsingStorage.PvAmountType.ContainsKey(valueType);", + "\n var amountType = parsingStorage.DimensionsWithExternalId[typeof(AmountType)].TryGetValue(valueType, out var at)? at : null;", + "\n var isStdActual = parsingStorage.AmountType.ContainsKey(valueType);", "\n var estimateType = isStdActual? EstimateTypes.A : parsingStorage.DimensionsWithExternalId[typeof(EstimateType)].TryGetValue(valueType, out var et)? et : null;", "\n if(estimateType == null || amountType == null) { ", "\n ApplicationMessage.Log(Error.ValueTypeNotValid, valueType);", From f7ec6fe416bdb75ee02be382101861ab33fd0fc4 Mon Sep 17 00:00:00 2001 From: nnikolopoulos Date: Tue, 15 Nov 2022 15:17:26 +0100 Subject: [PATCH 2/2] Filter out DeferrableAmountType --- ifrs17/Import/Importers.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifrs17/Import/Importers.ipynb b/ifrs17/Import/Importers.ipynb index 77130190..af7d117c 100644 --- a/ifrs17/Import/Importers.ipynb +++ b/ifrs17/Import/Importers.ipynb @@ -145,7 +145,7 @@ "\n : await LoadDataNodesAsync(dataSource, args);", "\n // Dimensions", "\n EstimateType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", - "\n AmountType = (await dataSource.Query().ToArrayAsync()).ToDictionary(x => x.SystemName);", + "\n AmountType = (await dataSource.Query().Where(x =>!(x is DeferrableAmountType)).ToArrayAsync()).ToDictionary(x => x.SystemName);", "\n amountTypes = (await dataSource.Query().ToArrayAsync()).Select(at => at.SystemName).ToHashSet();", "\n estimateTypes = args.ImportFormat switch {", "\n ImportFormats.SimpleValue => (await dataSource.Query().ToArrayAsync()).Select(et => et.SystemName).ToHashSet(),",