defmodule Helpdesk.Support.Ticket do
# @link https://ash-hq.org/docs/guides/ash/latest/tutorials/get-started
# This turns this module into a resource
use Ash.Resource,
data_layer: Ash.DataLayer.Ets
actions do
# Add a set of simple actions. You'll customize these later.
defaults [:create, :read, :update, :destroy]
### ommitted code..
# @link https://ash-hq.org/docs/guides/ash/latest/code-interface
code_interface do
define :open_support_ticket, args: [:subject]
define :read_support_ticket, action: :read, get_by: [:id]
define :close_support_ticket, args: []
define :destroy_support_ticket, action: :destroy
end
end
defmodule Helpdesk.Support.Ticket do
# @link https://ash-hq.org/docs/guides/ash/latest/tutorials/get-started
# This turns this module into a resource
use Ash.Resource,
data_layer: Ash.DataLayer.Ets
actions do
# Add a set of simple actions. You'll customize these later.
defaults [:create, :read, :update, :destroy]
### ommitted code..
# @link https://ash-hq.org/docs/guides/ash/latest/code-interface
code_interface do
define :open_support_ticket, args: [:subject]
define :read_support_ticket, action: :read, get_by: [:id]
define :close_support_ticket, args: []
define :destroy_support_ticket, action: :destroy
end
end