Skip to content

Add support for value of money to cast when field type is Money.Ecto.Map.Type  #205

@uzairaslam196

Description

@uzairaslam196

I am currently working on an Elixir project with multiple currencies; I need currency code with the amount from form input to cast directly using changeset. However, I discovered that form sends money in a string format similar to this "$99", which cannot be cast by the Money.Ecto.Map.Type type as it expects map. So, I believe it should send the value as a map, similar to this %{"amount" => 99, "currency" => "USD"} so that it can be easily cast by changeset when the type is Money.Ecto.Map.Type.

Same issue happens when we use Money.Ecto.Map.Type

Currently, I have to update form input values explicitly into map to cast them in changeset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions