Sha256: ec6ee39c4a26b1302942aff9f2abf280137c5ffbfdbf5baa3090bbd351634955

Contents?: true

Size: 882 Bytes

Versions: 6

Compression:

Stored size: 882 Bytes

Contents

require 'sequel'
require 'pact_broker/repositories/helpers'

module PactBroker
  module Webhooks
    class WebhookEvent < Sequel::Model

      CONTRACT_CONTENT_CHANGED = 'contract_content_changed'
      VERIFICATION_PUBLISHED = 'provider_verification_published'
      DEFAULT_EVENT_NAME = CONTRACT_CONTENT_CHANGED
      #CONTRACT_VERIFIABLE_CONTENT_CHANGED = 'contract_verifiable_content_changed'
      #VERIFICATION_STATUS_CHANGED = 'verification_status_changed'

      EVENT_NAMES = [CONTRACT_CONTENT_CHANGED, VERIFICATION_PUBLISHED]

      dataset_module do
        include PactBroker::Repositories::Helpers
      end

      def contract_content_changed?
        name == CONTRACT_CONTENT_CHANGED
      end

      def provider_verification_published?
        name == VERIFICATION_PUBLISHED
      end

    end

    WebhookEvent.plugin :timestamps, update_on_create: true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pact_broker-2.24.0 lib/pact_broker/webhooks/webhook_event.rb
pact_broker-2.23.4 lib/pact_broker/webhooks/webhook_event.rb
pact_broker-2.23.3 lib/pact_broker/webhooks/webhook_event.rb
pact_broker-2.23.2 lib/pact_broker/webhooks/webhook_event.rb
pact_broker-2.23.1 lib/pact_broker/webhooks/webhook_event.rb
pact_broker-2.23.0 lib/pact_broker/webhooks/webhook_event.rb