Class: CommandTower::Messaging::Endpoints::VerificationTransition

Inherits:
Object
  • Object
show all
Defined in:
app/services/command_tower/messaging/endpoints/verification_transition.rb

Class Method Summary collapse

Class Method Details

.call(owner_user_id:, endpoint_id:, to:) ⇒ Object

Raises:



7
8
9
10
11
12
13
14
15
16
# File 'app/services/command_tower/messaging/endpoints/verification_transition.rb', line 7

def self.call(owner_user_id:, endpoint_id:, to:)
  record = Endpoint.for_owner(owner_user_id).lock.find_by(id: endpoint_id)
  raise NotFoundError, "endpoint not found" if record.nil?

  ChannelGate.assert_record_supported!(record)

  Verification.apply!(record, to:)
  record.save!
  SafeView.from_record(record)
end