AshDispatch.Calculations.SourceUrl (AshDispatch v0.5.0)
View SourceCalculates the source URL for a delivery receipt at runtime.
This calculation looks up the event module from configuration and calls
its source_url/2 callback with a reconstructed context and channel.
The URL is computed at runtime (not persisted) because it may depend on who is viewing it (admin vs user paths differ).
Requirements for source_url to work
For an event to have working source URLs on delivery receipts, the event
module must define the data_key/0 callback:
@impl true
def data_key, do: :order # or :ticket, :user, etc.The data_key tells the calculation which key to use when reconstructing the context for URL generation. Without it, source_url will return nil.
See AshDispatch.Event documentation for more details.
Summary
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.