Class: Report::SalesCommissions::SalesCommissionsCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
app/services/report/sales_commissions/sales_commissions_command.rb

Overview

Service object: sales commissions command.

Instance Method Summary collapse

Instance Method Details

#executeObject

Run the report with the given filters and store the result.

Returns:

  • (Object)


10
11
12
13
14
# File 'app/services/report/sales_commissions/sales_commissions_command.rb', line 10

def execute
  return unless valid?

  @result = Report::SalesCommissions::SalesCommissions.results(attributes)
end

#success?Boolean

Whether the command validated and ran successfully.

Returns:

  • (Boolean)


18
19
20
# File 'app/services/report/sales_commissions/sales_commissions_command.rb', line 18

def success?
  valid? && @result.success?
end