spazio-solazzo/lib/spazio_solazzo/booking_system/space.ex
2026-01-10 19:03:02 +01:00

31 lines
734 B
Elixir

defmodule SpazioSolazzo.BookingSystem.Space do
@moduledoc """
Represents a physical or virtual space that contains bookable assets.
"""
use Ash.Resource,
otp_app: :spazio_solazzo,
domain: SpazioSolazzo.BookingSystem,
data_layer: AshPostgres.DataLayer
postgres do
table "spaces"
repo SpazioSolazzo.Repo
end
actions do
defaults [:read, create: :*]
end
attributes do
uuid_primary_key :id
attribute :name, :string, allow_nil?: false, public?: true
attribute :description, :string, allow_nil?: false, public?: true
attribute :slug, :string, allow_nil?: false, public?: true
end
identities do
identity :unique_name, [:name]
identity :unique_slug, [:slug]
end
end