Nested aggregates
In my Product Data Management webapp I'm trying to build with Ash, I have the following resources with attributes and relatioships in
*
*
*
The idea is that an
This means that
I have tried the following in a cascade,
In
In
In
...hoping that
Instead:
What is the Ash-idiomatic way of achieving the goal of being able to access
App.Api that, combined, construct/define an Item.*
Category: has a :code attribute*
Family: belongs_to a Category (and also has a :name, etc.)*
Variant: belongs_to a Variant, has a :code attributeThe idea is that an
Item belongs_to a Category and a Variant, and has a calculated attribute (also called :code) resulting from concatenating the Category :code and the Variant :code.This means that
Item's :code calculation must "pull" Category's :code through the Variant it belongs to, which belongs to a Family, which belongs to a Category.Item's calculated :code uniquely identifies a record.I have tried the following in a cascade,
In
lib/app/resources/item.ex:In
lib/app/resources/variant.ex:In
lib/app/resources/family.ex:...hoping that
App.Api.Item |> App.Api.read! would return records on which I can App.Api.load!(:code).Instead:
What is the Ash-idiomatic way of achieving the goal of being able to access
Item's :code?