Sha256: 674691e63013f9f5f119657365b1e857a279fd94bf4e190f73e02c33f5d18e8b

Contents?: true

Size: 503 Bytes

Versions: 2

Compression:

Stored size: 503 Bytes

Contents

module RestPack::Account::Service::Commands
  module Account
    class Create < RestPack::Service::Command
      required do
        array :accounts do
          hash do
            required do
              integer :application_id
              integer :created_by
              string :name
            end
          end
        end
      end

      def execute
        accounts = Models::Account.create!(inputs[:accounts])
        Serializers::Account.serialize(accounts)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restpack_account_service-0.0.4 lib/restpack_account_service/commands/account/create.rb
restpack_account_service-0.0.3 lib/restpack_account_service/commands/account/create.rb