Move AACI and coerce logic to hz_aaci.erl #17

Open
spivee wants to merge 3 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin hz_aaci:hz_aaci
git checkout hz_aaci
Sign in to join this conversation.
No Reviewers
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/hakuzaru#17
No description provided.