Hello, is there a way to transform this structure:
{:name "Interest",
:id "Interest",
:db/ident "Interest",
:type "Label",
:has-element+
[{:name "Credit Interest Parameters",
:id "Credit Interest Parameters",
:db/ident "Credit Interest Parameters",
:type "Label",
:has-element+
[{:dataType "LOV",
:name "Balance Base",
:allowedValues ["Daily Balance" "Average Daily Balance"],
:id "f73cbbbf-8220-46b5-b88c-31d244468a76",
:db/ident "f73cbbbf-8220-46b5-b88c-31d244468a76"]}
Into a list like so:
[
[:id "Interest" :has-element+ {:id "Credit Interest Parameters & rest-of-map-except-has-element+}]
[:id "Credit Interest Parameters" :has-element+ {:id "f73..." & rest-of-map-except-has-element+}]
[....]
....
]
I'm trying to use m/rewrite like so to keep accumulating every 2 levels but clearly I don't have a good grasp over the operators
(m/rewrite input
{:db/ident !t :has-element+ [(m/cata !t) ...] & ?rest-map}
[!t :has-element+ !t])