<commit_before>defmodule Leather.Plaid.Item do
  @moduledoc "The Plaid.Item model for Leather. https://plaid.com/docs/api/#retrieve-item"

  alias Leather.Plaid.Item

  import Ecto.Changeset
  import Ecto.Query

  use Ecto.Schema

  schema "plaid_items" do
    field(:institution_name, :string)
    field(:plaid_access_token, :string)
    field(:plaid_item_id, :string)
    timestamps()
    belongs_to(:user, Leather.User)
    has_many(:plaid_accounts, Leather.Plaid.Account)
  end

  @doc false
  def changeset(%Item{} = plaid_item, attrs \\ :invalid) do
    plaid_item<commit_msg>Use custom fkey for plaid item -> plaid account.<commit_after>defmodule Leather.Plaid.Item do
  @moduledoc "The Plaid.Item model for Leather. https://plaid.com/docs/api/#retrieve-item"

  alias Leather.Plaid.Item

  import Ecto.Changeset

  use Ecto.Schema

  schema "plaid_items" do
    field(:institution_name, :string)
    field(:plaid_access_token, :string)
    field(:plaid_item_id, :string)
    timestamps()
    belongs_to(:user, Leather.User)
    has_many(:plaid_accounts, Leather.Plaid.Account, foreign_key: :plaid_item_id)
  end

  @doc false
  def changeset(%Item{} = plaid_item, attrs \\ :invalid) do
    plaid_item
{'fraction_non_alphanumeric': 0.11175496688741722, 'fraction_numerical': 0.0, 'mean_word_length': 4.079831932773109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7231861', 'n_tokens_mistral': 452, 'n_tokens_neox': 437, 'n_words': 90}