Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Contract Term #342

Merged
merged 3 commits into from
Jul 7, 2023
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
23 changes: 16 additions & 7 deletions ifrs17/DataModel/DataStructure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1412,8 +1412,6 @@
"\n",
"\nA Group of Contract is a set of contracts with the same Annual Cohort, Liability Type, Profitability and Partner (in case the contracts are done with a re-insurer).",
"\n",
"\nContractTerm : defines the term that the given Contract is valid for in whole number of months. It can be used to compute the deferrable or amortized positions in the Balance Sheet. It is not a mandatory input, even if column header 'ContractTerm' is present. The default value is 0.",
"\n",
"\nVarious Group of Contracts are put together into portfolios."
],
"metadata": {},
Expand Down Expand Up @@ -1450,10 +1448,6 @@
"\n public string YieldCurveName { get; init; }",
"\n ",
"\n public virtual string Partner { get; init; }",
"\n ",
"\n [NotVisible]",
"\n [Dimension(typeof(int), nameof(ContractTerm))]",
"\n public int ContractTerm { get; init; }",
"\n}"
],
"metadata": {},
Expand Down Expand Up @@ -1706,10 +1700,25 @@
"\n public State PreviousState { get; init; }",
"\n ",
"\n public bool IsReinsurance { get; init; }",
"\n public int ContractTerm { get; init; }",
"\n",
"\n public DataNodeData(){}",
"\n",
"\n public DataNodeData(GroupOfContract dn)",
"\n {",
"\n DataNode = dn.SystemName;",
"\n ContractualCurrency = dn.ContractualCurrency;",
"\n FunctionalCurrency = dn.FunctionalCurrency;",
"\n LineOfBusiness = dn.LineOfBusiness;",
"\n ValuationApproach = dn.ValuationApproach;",
"\n OciType = dn.OciType;",
"\n Portfolio = dn.Portfolio;",
"\n AnnualCohort = dn.AnnualCohort;",
"\n LiabilityType = dn.LiabilityType;",
"\n Profitability = dn.Profitability;",
"\n Partner = dn.Partner;",
"\n IsReinsurance = dn.GetType().Name == nameof(GroupOfReinsuranceContract);",
"\n YieldCurveName = dn.YieldCurveName;",
"\n }",
"\n}"
],
"metadata": {},
Expand Down
12 changes: 2 additions & 10 deletions ifrs17/Import/Importers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,6 @@
"\n",
"\n var yieldCurveColumnGroupOfInsuranceContract = dataSet.Tables.Contains(nameof(GroupOfInsuranceContract)) && dataSet.Tables[nameof(GroupOfInsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfInsuranceContract.YieldCurveName));",
"\n var yieldCurveColumnGroupOfReinsuranceContract = dataSet.Tables.Contains(nameof(GroupOfReinsuranceContract)) && dataSet.Tables[nameof(GroupOfReinsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfReinsuranceContract.YieldCurveName));",
"\n var contractTermColumnGroupOfInsuranceContract = dataSet.Tables.Contains(nameof(GroupOfInsuranceContract)) && dataSet.Tables[nameof(GroupOfInsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfInsuranceContract.ContractTerm));",
"\n var contractTermColumnGroupOfReinsuranceContract = dataSet.Tables.Contains(nameof(GroupOfReinsuranceContract)) && dataSet.Tables[nameof(GroupOfReinsuranceContract)].Columns.Any(x => x.ColumnName == nameof(GroupOfReinsuranceContract.ContractTerm));",
"\n",
"\n var importLogGroupOfContracts = await Import.FromDataSet(dataSet)",
"\n .WithType<GroupOfInsuranceContract>((dataset, datarow) => {",
Expand All @@ -1042,10 +1040,7 @@
"\n Portfolio = pf,",
"\n YieldCurveName = yieldCurveColumnGroupOfInsuranceContract",
"\n ? datarow.Field<string>(nameof(GroupOfContract.YieldCurveName)) ",
"\n : (string)null,",
"\n ContractTerm = contractTermColumnGroupOfInsuranceContract",
"\n ? Convert.ToInt32(datarow.Field<string>(nameof(GroupOfContract.ContractTerm))) ",
"\n : default };",
"\n : (string)null };",
"\n return ExtendGroupOfContract(gic, datarow);",
"\n })",
"\n .WithType<GroupOfReinsuranceContract>((dataset, datarow) => {",
Expand All @@ -1070,10 +1065,7 @@
"\n Partner = datarow.Field<string>(nameof(GroupOfContract.Partner)),",
"\n YieldCurveName = yieldCurveColumnGroupOfReinsuranceContract",
"\n ? datarow.Field<string>(nameof(GroupOfContract.YieldCurveName)) ",
"\n : (string)null,",
"\n ContractTerm = contractTermColumnGroupOfReinsuranceContract",
"\n ? Convert.ToInt32(datarow.Field<string>(nameof(GroupOfContract.ContractTerm))) ",
"\n : default };",
"\n : (string)null };",
"\n return ExtendGroupOfContract(gric, datarow);",
"\n })",
"\n .WithTarget(workspace)",
Expand Down
18 changes: 2 additions & 16 deletions ifrs17/Utils/Queries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -302,24 +302,10 @@
"\n .ToDictionary(dn => dn.SystemName, dn => {",
"\n var dnCurrentState = dataNodeStates[dn.SystemName][CurrentPeriod];",
"\n var dnPreviousState = dataNodeStates[dn.SystemName][PreviousPeriod];",
"\n return new DataNodeData(){Year = dnPreviousState.Year, ",
"\n return new DataNodeData(dn){Year = dnPreviousState.Year, ",
"\n Month = dnPreviousState.Month,",
"\n State = dnCurrentState.State,",
"\n PreviousState = dnPreviousState.State,",
"\n DataNode = dn.SystemName,",
"\n ContractualCurrency = dn.ContractualCurrency,",
"\n FunctionalCurrency = dn.FunctionalCurrency,",
"\n LineOfBusiness = dn.LineOfBusiness,",
"\n ValuationApproach = dn.ValuationApproach,",
"\n OciType = dn.OciType,",
"\n Portfolio = dn.Portfolio,",
"\n AnnualCohort = dn.AnnualCohort,",
"\n LiabilityType = dn.LiabilityType,",
"\n Profitability = dn.Profitability,",
"\n Partner = dn.Partner,",
"\n IsReinsurance = dn.GetType() == typeof(GroupOfReinsuranceContract),",
"\n YieldCurveName = dn.YieldCurveName,",
"\n ContractTerm = dn.ContractTerm",
"\n PreviousState = dnPreviousState.State",
"\n };",
"\n }",
"\n );",
Expand Down