Skip to content

Instantly share code, notes, and snippets.

@dan-palmer
Last active November 3, 2022 16:31
Show Gist options
  • Save dan-palmer/33486dfc833ac9c46e097804f9d2fe8d to your computer and use it in GitHub Desktop.
Save dan-palmer/33486dfc833ac9c46e097804f9d2fe8d to your computer and use it in GitHub Desktop.

Teller Bank Challenge

Mix.install([:req, :jason, :kino])

Your Solution

username = Kino.Input.text("Username") |> Kino.render()
password = Kino.Input.text("Password")
defmodule TellerBank do
  defmodule ChallengeResult do
    @type t :: %__MODULE__{
            account_number: String.t(),
            balance_in_cents: integer
          }
    defstruct [:account_number, :balance_in_cents]
  end

  defmodule Client do
    @type username() :: String.t()
    @type password() :: String.t()

    @spec fetch(username, password) :: ChallengeResult.t()
    def fetch(username, password) do
    end
  end
end

username = Kino.Input.read(username)
password = Kino.Input.read(password)

TellerBank.Client.fetch(username, password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment