refactor: change room offset_{x,y} to just {x,y}

This commit is contained in:
2026-05-12 15:38:08 +02:00
parent 7e18fce3ac
commit 74fdd2568e
6 changed files with 21 additions and 21 deletions
+5 -5
View File
@@ -7,10 +7,10 @@ defmodule Localiser.Domain.Schema.Room do
schema "rooms" do
field :name, :string
field :width, :float
field :height, :float
field :offset_x, :float
field :offset_y, :float
field :width, :float, default: 1.0
field :height, :float, default: 1.0
field :x, :float, default: 0.0
field :y, :float, default: 0.0
belongs_to :floor, Floor
has_many :sensors, Sensor
@@ -21,7 +21,7 @@ defmodule Localiser.Domain.Schema.Room do
@doc false
def changeset(room, attrs) do
room
|> cast(attrs, [:name, :floor_id, :width, :height, :offset_x, :offset_y])
|> cast(attrs, [:name, :floor_id, :width, :height, :x, :y])
|> validate_required([:name, :floor_id])
|> assoc_constraint(:floor)
end