The basic problem here is that you’re defining details to be of type :assoc but :assoc is not a type, unless you defined it somewhere else. Ecto is telling you that it was trying to cast details but it could not find any method called cast in the assoc module. Here’s the list of Ecto types available by default.
If :details is an arbitrary map, then you should use type :map for it. If it has to follow a predefined structure, then I would define a schema for it and turn it into an association. In general, if you’re dealing with complex or nested data structures, it’s easier to work with schemas rather than using inline {data, types} tuples.






















