DiffoExample.Access.Calculations.ShelfTotalPorts (DiffoExample v0.4.0)

Copy Markdown View Source

Sums the :ports pool capacity across every card a shelf has assigned a slot to.

For each outgoing slot-assignment (cards consumer-alias their upstream Shelf relationship as :shelf), looks up the assigned card's AssignableCharacteristic for the :ports pool and sums (last - first + 1) across all of them.

Local-to-this-repo for now. Could in time become a more general diffo-side primitive (SumPoolCapacityOfAssignees or similar) once the pattern repeats; the cleanest path may also be an ash_neo4j aggregate primitive that walks assignment edges natively. Worth its own yarn.

Summary

Functions

describe(opts)

Callback implementation for Ash.Resource.Calculation.describe/1.

has_calculate?()

has_expression?()

Callback implementation for Ash.Resource.Calculation.has_expression?/0.

init(opts)

Callback implementation for Ash.Resource.Calculation.init/1.

strict_loads?()

Callback implementation for Ash.Resource.Calculation.strict_loads?/0.