Improve cast_input/apply stored. The input type for Value and Dynamic should perhaps be Unions. If we have the type dynamically we should apply constraints on it, so that i) it is a properly formed Value with Primitive or Dynamic and/or the Primitive/Dynamic is properly formed. The dynamic should be tested according to the type of the dynamic indicated. It should actually match the type, and fields should be valid.
Dynamic values are limited to Ash.Type.NewType that have storage_type: :map.
These are Ash.TypedStruct, or Ash.Type.NewType that are subtype_of keyword, tuple, map, union, struct
They shouldn't and probably can't be used for Elixir types that happen to be structs in Elixir, such as Decimal, Date, Time, DateTime, etc, these all have their own storage_type.
Improve cast_input/apply stored. The input type for Value and Dynamic should perhaps be Unions. If we have the type dynamically we should apply constraints on it, so that i) it is a properly formed Value with Primitive or Dynamic and/or the Primitive/Dynamic is properly formed. The dynamic should be tested according to the type of the dynamic indicated. It should actually match the type, and fields should be valid.
Dynamic values are limited to Ash.Type.NewType that have storage_type: :map.
These are Ash.TypedStruct, or Ash.Type.NewType that are subtype_of keyword, tuple, map, union, struct
They shouldn't and probably can't be used for Elixir types that happen to be structs in Elixir, such as Decimal, Date, Time, DateTime, etc, these all have their own storage_type.