Class: MOCO::InternalHourlyRate
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::InternalHourlyRate
- Defined in:
- lib/moco/entities/internal_hourly_rate.rb
Overview
Represents MOCO internal hourly rates (Interne Stundensätze) Internal cost rates per user for profitability calculations
Read-only structure (per user):
id, full_name, rates (Array by year)
Rate format:
{ year: 2024, rate: 120.0 }
Filtering:
moco.internal_hourly_rates.where(years: "2024") moco.internal_hourly_rates.where(years: "2023,2024") moco.internal_hourly_rates.where(unit_id: 123) moco.internal_hourly_rates.where(include_archived: true)
Updating rates:
Use PATCH with year and rates array: { year: 2024, rates: [{ user_id: 123, rate: 140.0 }] }
Instance Attribute Summary
Attributes inherited from BaseEntity
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Class Method Details
.entity_path ⇒ Object
24 25 26 |
# File 'lib/moco/entities/internal_hourly_rate.rb', line 24 def self.entity_path "account/internal_hourly_rates" end |
Instance Method Details
#to_s ⇒ Object
28 29 30 |
# File 'lib/moco/entities/internal_hourly_rate.rb', line 28 def to_s "#{name} - #{rate}" end |