Skip to content

Commit

Permalink
update function signature docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beard-programmer committed Oct 31, 2023
1 parent dec3457 commit ea70e02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/handle_errors/ok_error/calculate_employee_payroll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class CalculationError < StandardError; end
# that responds to #call with an argument LineItemWithPolicy
# and returns CalculatedLineItem
# @param employee_payroll [EmployeePayroll]
# @raise [CalculationError]
# @returns [CalculatedEmployeePayroll]
# @return [Array(Symbol, ServiceFunctions::HandleErrors::OkError::CalculatedEmployeePayroll)] when success,
# first element is symbol :ok
# @return [Array(Symbol, String)] when failed, first element is symbol :error an d second is error message
def call(
build_line_item_with_policy_fn, # Dependency
calculate_taxes_fn, # Dependency
Expand Down Expand Up @@ -72,7 +73,7 @@ def reduce_collection(collection, operation)

# @param employee_payroll [EmployeePayroll]
# @param line_items [Array<CalculatedLineItem>]
# @returns [CalculatedEmployeePayroll]
# @returns [ServiceFunctions::HandleErrors::OkError::CalculatedEmployeePayroll]
def build_calculated_employee_payroll(employee_payroll, line_items)
employee_id = employee_payroll.employee_id
total, taxable, exempt = line_items.reduce(
Expand Down

0 comments on commit ea70e02

Please sign in to comment.