Class: EmployeePayrollTransactions::CreateService
- Inherits:
-
Object
- Object
- EmployeePayrollTransactions::CreateService
- Defined in:
- app/services/employee_payroll_transactions/create_service.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#current_company ⇒ Object
readonly
Returns the value of attribute current_company.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#employee_id ⇒ Object
readonly
Returns the value of attribute employee_id.
-
#gross_amount ⇒ Object
readonly
Returns the value of attribute gross_amount.
-
#payroll_period_id ⇒ Object
readonly
Returns the value of attribute payroll_period_id.
-
#tag_sequence ⇒ Object
readonly
Returns the value of attribute tag_sequence.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(current_company:, employee_id:, payroll_period_id:, gross_amount:, amount:, tag_sequence:, current_user:) ⇒ CreateService
constructor
A new instance of CreateService.
Constructor Details
#initialize(current_company:, employee_id:, payroll_period_id:, gross_amount:, amount:, tag_sequence:, current_user:) ⇒ CreateService
Returns a new instance of CreateService.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 11 def initialize( current_company:, employee_id:, payroll_period_id:, gross_amount:, amount:, tag_sequence:, current_user: ) @current_company = current_company @employee_id = employee_id @payroll_period_id = payroll_period_id @gross_amount = gross_amount @amount = amount @tag_sequence = tag_sequence @current_user = current_user end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def amount @amount end |
#current_company ⇒ Object (readonly)
Returns the value of attribute current_company.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def current_company @current_company end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def current_user @current_user end |
#employee_id ⇒ Object (readonly)
Returns the value of attribute employee_id.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def employee_id @employee_id end |
#gross_amount ⇒ Object (readonly)
Returns the value of attribute gross_amount.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def gross_amount @gross_amount end |
#payroll_period_id ⇒ Object (readonly)
Returns the value of attribute payroll_period_id.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def payroll_period_id @payroll_period_id end |
#tag_sequence ⇒ Object (readonly)
Returns the value of attribute tag_sequence.
3 4 5 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 3 def tag_sequence @tag_sequence end |
Instance Method Details
#call ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'app/services/employee_payroll_transactions/create_service.rb', line 29 def call ActiveRecord::Base.transaction do create_or_find_payroll_transaction_header create_or_find_payroll_transaction_detail create_employee_payroll_transaction validate_after_creation @employee_payroll_transaction end end |