debian-mirror-gitlab/app/events/packages/package_created_event.rb
2023-06-20 00:43:36 +05:30

23 lines
635 B
Ruby

# frozen_string_literal: true
module Packages
class PackageCreatedEvent < ::Gitlab::EventStore::Event
def schema
{
'type' => 'object',
'properties' => {
'project_id' => { 'type' => 'integer' },
'name' => { 'type' => 'string' },
'version' => { 'type' => %w[string null] },
'package_type' => { 'type' => 'string', 'enum' => ::Packages::Package.package_types.keys },
'id' => { 'type' => 'integer' }
},
'required' => %w[project_id id name package_type]
}
end
def generic?
data[:package_type] == 'generic'
end
end
end