This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03701ea
commit 3f728dc
Showing
3 changed files
with
134 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 24, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"Dict{String, Any} with 8 entries:\n", | ||
" \"tsdb_validfrom\" => \"2022-09-26T11:30:44.483+00:00\"\n", | ||
" \"ref_history\" => Dict{String, Any}(\"value\"=>9)\n", | ||
" \"revision\" => Dict{String, Any}(\"ref_validfrom\"=>Dict{String, Any}(\"val…\n", | ||
" \"partner_refs\" => Any[Dict{String, Any}(\"rev\"=>Dict{String, Any}(\"ref_valid…\n", | ||
" \"ref_entities\" => Dict{String, Any}()\n", | ||
" \"ref_version\" => Dict{String, Any}(\"value\"=>12)\n", | ||
" \"tsw_validfrom\" => \"2022-09-26T11:30:44.483+00:00\"\n", | ||
" \"product_items\" => Any[Dict{String, Any}(\"tariff_items\"=>Any[Dict{String, An…" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"push!(LOAD_PATH, \"src\")\n", | ||
"using JSON, LifeInsuranceDataModel, SearchLight, TimeZones, ToStruct\n", | ||
"ENV[\"SEARCHLIGHT_USERNAME\"] = \"bitemporalpostgres\"\n", | ||
"ENV[\"SEARCHLIGHT_PASSWORD\"] = \"jw8s0F49KL\"\n", | ||
"\n", | ||
"model0 = JSON.parse(JSON.json(csection(1, now(tz\"UTC\"), now(tz\"UTC\"))))\n", | ||
"model1 = JSON.parse(JSON.json(csection(1, now(tz\"UTC\"), now(tz\"UTC\"))))\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 33, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"KeySet for a Dict{String, Any} with 5 entries. Keys:\n", | ||
" \"ref_validfrom\"\n", | ||
" \"ref_invalidfrom\"\n", | ||
" \"ref_component\"\n", | ||
" \"id\"\n", | ||
" \"description\"" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"model0[\"revision\"]\n", | ||
"keys(model0[\"revision\"])\n", | ||
"\n", | ||
"model1[\"revision\"][\"id\"][\"value\"] = nothing\n", | ||
"model1[\"revision\"][\"description\"]= \"first mutation by GUI model\"\n", | ||
"\n", | ||
"model1[\"revision\"]\n", | ||
"ToStruct.tostruct(ContractRevision, model1[\"revision\"])\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 47, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"\" diff for ref_component eq for id eq for description\"" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"function compareModelState(previous::Dict{String,Any}, current::Dict{String,Any})\n", | ||
" println(\"huhu\")\n", | ||
"end\n", | ||
"\n", | ||
"function compareRevisions(previous::Dict{String,Any}, current::Dict{String,Any})\n", | ||
" diff = \"\"\n", | ||
" for (key, previous_value) in previous\n", | ||
" if !(key in (\"ref_validfrom\", \"ref_invalidfrom\"))\n", | ||
" let current_value = current[key]\n", | ||
" if previous_value != current_value\n", | ||
" diff = diff * \" diff for \" * key\n", | ||
" else\n", | ||
" diff = diff * \" eq for \" * key\n", | ||
" end\n", | ||
" end\n", | ||
" end\n", | ||
" end\n", | ||
" diff\n", | ||
"end\n", | ||
"compareRevisions(model0[\"revision\"], model1[\"revision\"])" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Julia 1.8.0", | ||
"language": "julia", | ||
"name": "julia-1.8" | ||
}, | ||
"language_info": { | ||
"file_extension": ".jl", | ||
"mimetype": "application/julia", | ||
"name": "julia", | ||
"version": "1.8.0" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
3f728dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release Notes:
dep BitemporalPostgres 1.4.1
3f728dc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/68989
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: