diff options
Diffstat (limited to 'app/services/packages/create_temporary_package_service.rb')
-rw-r--r-- | app/services/packages/create_temporary_package_service.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/services/packages/create_temporary_package_service.rb b/app/services/packages/create_temporary_package_service.rb new file mode 100644 index 00000000000..ee609fd787d --- /dev/null +++ b/app/services/packages/create_temporary_package_service.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Packages + class CreateTemporaryPackageService < ::Packages::CreatePackageService + PACKAGE_VERSION = '0.0.0' + + def execute(package_type, name: 'Temporary.Package') + create_package!(package_type, + name: name, + version: "#{PACKAGE_VERSION}-#{uuid}", + status: 'processing' + ) + end + + private + + def uuid + SecureRandom.uuid + end + end +end |