Skip to content

Commit

Permalink
Host deregistration events (#1245)
Browse files Browse the repository at this point in the history
* Host deregistration commands

* Host deregistration events

* Fixing module attributes in host deregistration commands
  • Loading branch information
CDimonaco committed Apr 17, 2023
1 parent d1d0e85 commit 9c41d24
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/trento/domain/host/commands/deregister_host.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule Trento.Domain.Host.Commands.DeregisterHost do
@moduledoc """
Deregister a host
"""
@required_fields :all

use Trento.Command

defcommand do
field :host_id, Ecto.UUID
end
end
12 changes: 12 additions & 0 deletions lib/trento/domain/host/commands/request_host_deregistration.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule Trento.Domain.Host.Commands.RequestHostDeregistration do
@moduledoc """
Request a deregistration of a host
"""
@required_fields :all

use Trento.Command

defcommand do
field :host_id, Ecto.UUID
end
end
12 changes: 12 additions & 0 deletions lib/trento/domain/host/events/host_deregistered.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule Trento.Domain.Host.Events.HostDeregistered do
@moduledoc """
This event is emitted when a deregistration (decomission) of a host is completed.
"""

use Trento.Event

defevent do
field :host_id, Ecto.UUID
field :deregistered_at, :utc_datetime_usec
end
end
11 changes: 11 additions & 0 deletions lib/trento/domain/host/events/host_deregistration_requested.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defmodule Trento.Domain.Host.Events.HostDeregistrationRequested do
@moduledoc """
This event is emitted when a deregistration (decomission) of a host is requested.
"""

use Trento.Event

defevent do
field :host_id, Ecto.UUID
end
end

0 comments on commit 9c41d24

Please sign in to comment.