MishkaGervaz.Form.Transformers.MergeDefaults
(MishkaGervaz v0.0.1-alpha.3)
Copy Markdown
View Source
Fills the form DSL state with sensible defaults before downstream transformers run.
Three responsibilities, applied in order:
Domain inheritance — copy each key in
@domain_mappingsfrom the resource's domain into the resource's DSL state when the resource hasn't set it explicitly. Resource overrides win.Identity defaults — derive
identity.namefrom the resource module name (snake-cased, suffixed with_form) when not set, and deriveidentity.stream_nameas<name>_stream.Master-check fallback — when neither resource nor domain defines
master_check, persist a fallback MFA pointing toMishkaGervaz.Helpers.master_user?/1.
Pipeline
See transform/1 — every stage takes the DSL state as the first
argument so the entry point reads top-down.
See MishkaGervaz.Form.Transformers.ResolveFields and
MishkaGervaz.Form.Transformers.BuildRuntimeConfig for the
downstream transformers that consume these defaults.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.