Sha256: 2837f0e67e203432667d27cbfe24939f99e1085bd7ba20aa9693c26d12c53f02

Contents?: true

Size: 778 Bytes

Versions: 9

Compression:

Stored size: 778 Bytes

Contents

module Logistics
  module Core
    class ContractService < ApplicationRecord
      belongs_to :contract
      belongs_to :chargeable_service_unit_of_charge
      belongs_to :chargeable_service
      belongs_to :unit_of_charge
      belongs_to :service_delivery_unit

      delegate(:name, to: :chargeable_service, prefix: true, allow_nil: true)
      delegate(:contract_number, to: :contract, prefix: false, allow_nil: true)
      def unit_of_charge_name
        chargeable_service_unit_of_charge&.unit_of_charge&.name
      end
      def service_delivery_unit_name
        chargeable_service_unit_of_charge&.service_delivery_unit&.name
      end
      def service_delivery_unit_id
        chargeable_service_unit_of_charge&.service_delivery_unit_id
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 app/models/logistics/core/contract_service.rb
logistics_core-21.11.1 app/models/logistics/core/contract_service.rb
logistics_core-21.08.1 app/models/logistics/core/contract_service.rb
logistics_core-21.03.1 app/models/logistics/core/contract_service.rb
logistics_core-20.10.3 app/models/logistics/core/contract_service.rb
logistics_core-20.10.2 app/models/logistics/core/contract_service.rb
logistics_core-20.10.1 app/models/logistics/core/contract_service.rb
logistics_core-20.9.1 app/models/logistics/core/contract_service.rb
logistics_core-20.8.1 app/models/logistics/core/contract_service.rb