summaryrefslogtreecommitdiff
path: root/app/models/packages/event.rb
blob: f1d0af64ccd8a4c9cd7b57d363ed864585573609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

class Packages::Event < ApplicationRecord
  belongs_to :package, optional: true

  EVENT_SCOPES = ::Packages::Package.package_types.merge(container: 1000, tag: 1001).freeze

  enum event_scope: EVENT_SCOPES

  enum event_type: {
    push_package: 0,
    delete_package: 1,
    pull_package: 2,
    search_package: 3,
    list_package: 4,
    list_repositories: 5,
    delete_repository: 6,
    delete_tag: 7,
    delete_tag_bulk: 8,
    list_tags: 9,
    cli_metadata: 10
  }

  enum originator_type: { user: 0, deploy_token: 1, guest: 2 }
end