Move AACI and coerce logic to hz_aaci.erl #17

Closed
spivee wants to merge 0 commits from hz_aaci into master
Member

Now hz_aaci:erlang_to_fate and hz_aaci:fate_to_erlang are exposed functions that projects like SFP can use.

The loops that go through lists/maps/tuples/records/variants and convert their elements back and forth, are still made in the overloaded dispatchy way, but the function that used to be called 'coerce' is now more honest about its responsibilities.

I also removed the hz:prepare_aaci function, which converts an erlangy ACI into an erlangy AACI, and exposed it as hz_aaci:prepare_aaci instead. It seems like if you are handling ACI terms yourself, you're doing non-standard low-level stuff that shouldn't pollute and confuse hz.erl

Now hz_aaci:erlang_to_fate and hz_aaci:fate_to_erlang are exposed functions that projects like SFP can use. The loops that go through lists/maps/tuples/records/variants and convert their elements back and forth, are still made in the overloaded dispatchy way, but the function that used to be called 'coerce' is now more honest about its responsibilities. I also removed the hz:prepare_aaci function, which converts an erlangy ACI into an erlangy AACI, and exposed it as hz_aaci:prepare_aaci instead. It seems like if you are handling ACI terms yourself, you're doing non-standard low-level stuff that shouldn't pollute and confuse hz.erl
spivee added 3 commits 2026-01-13 10:40:11 +09:00
So far the interface to hz.erl is mostly unchanged, apart from prepare_aaci/1

Maybe prepare_aaci should be re-exported, but using it is exactly in line with the
'inconvenient but more flexible primitives' that hz_aaci.erl is meant to represent,
so, maybe that is a fine place to have to go for it, dunno.
Also renamed coerce_bindings to erlang_args_to_fate, to match.
Just a little thing I noticed could be improved.
spivee requested review from zxq9 2026-01-13 10:40:11 +09:00
spivee added 1 commit 2026-01-15 10:49:03 +09:00
hz_aaci:aaci_get_function_signature is a bit redundant.
zxq9 closed this pull request 2026-05-10 15:27:00 +09:00

Pull request closed

Sign in to join this conversation.