Skip to content

Commit

Permalink
Fix typo in operation enum
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-sidorov committed Jan 3, 2025
1 parent 162f43d commit 8e079f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/budget_tracker/operations/operation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule BudgetTracker.Operations.Operation do
@moduledoc """
Model of operation with money.
Income is an operation with type :increase
Payment is an operation with type :descrease
Payment is an operation with type :decrease
Transfer from one debit account to another is a transaction of two: income + payment.
"""
use Ecto.Schema
Expand All @@ -19,7 +19,7 @@ defmodule BudgetTracker.Operations.Operation do
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "operations" do
field :type, Ecto.Enum, values: [:increase, :descrease]
field :type, Ecto.Enum, values: [:increase, :decrease]
field :amount, :float
belongs_to :user, User
belongs_to :debit_account, DebitAccount
Expand Down
2 changes: 1 addition & 1 deletion priv/repo/migrations/20241128220109_create_operations.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule BudgetTracker.Repo.Migrations.CreateOperations do
import EctoEnumMigration

def change do
create_type(:operation_type, [:increase, :descrease])
create_type(:operation_type, [:increase, :decrease])

create table(:operations, primary_key: false) do
add :id, :binary_id, primary_key: true
Expand Down

0 comments on commit 8e079f2

Please sign in to comment.