Files
openfoodnetwork/app/models/webhook_endpoint.rb
Gaetan Craig-Riou 059e36318e Add type to WebhookEnpoints
Add migration to update existing endpoint to "order_cycle_opened" type
2025-12-10 10:28:08 +11:00

10 lines
307 B
Ruby

# frozen_string_literal: true
# Records a webhook url to send notifications to
class WebhookEndpoint < ApplicationRecord
WEBHOOK_TYPES = %w(order_cycle_opened payment_status_changed).freeze
validates :url, presence: true
validates :webhook_type, presence: true, inclusion: { in: WEBHOOK_TYPES }
end