Class: PartnerService::Bills::CalculateService
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- PartnerService::Bills::CalculateService
- Defined in:
- app/services/partner_service/bills/calculate_service.rb
Instance Attribute Summary
Attributes inherited from ApplicationService
Instance Method Summary collapse
- #calculate ⇒ Object
-
#initialize(reservations, date) ⇒ CalculateService
constructor
A new instance of CalculateService.
Methods inherited from ApplicationService
Constructor Details
#initialize(reservations, date) ⇒ CalculateService
Returns a new instance of CalculateService.
7 8 9 10 11 |
# File 'app/services/partner_service/bills/calculate_service.rb', line 7 def initialize(reservations, date) @start_date = date.beginning_of_month @end_date = date.end_of_month @reservations = reservations.where(date: @start_date..@end_date) end |
Instance Method Details
#calculate ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/services/partner_service/bills/calculate_service.rb', line 13 def calculate { total_price: total_price, total_due_amount: total_due_amount, package: package, total_prepayment_and_codes: total_prepayment_and_codes, } end |