mirror of
https://codeberg.org/JasterV/spazio-solazzo.git
synced 2026-04-26 18:20:03 +00:00
31 lines
734 B
Elixir
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
|