Save and restore an IFRS 17 group
ifrs17_to_json.Rdifrs17_to_json() writes a group's state as the versioned JSON Python's
to_json() writes (risk_rs.ifrs17_group, risk_rs.ifrs17_paa_group
or risk_rs.ifrs17_reinsurance_held, format 1), and
ifrs17_from_json() reads one back, choosing the class from its format,
so a group rolled forward this quarter rolls forward next quarter to the
same numbers, from R or Python.
Examples
g <- ifrs17_group(list(premiums = c(900, 0), claims = rep(400, 2)), 30,
discount_curve(1, 0))
copy <- ifrs17_from_json(ifrs17_to_json(g))
identical(copy@balances, g@balances)
#> [1] TRUE