Sha256: 3f10491b5bd9d3bd32ed15fa481e693fed74904961721098e45b7f07273f219f

Contents?: true

Size: 561 Bytes

Versions: 16

Compression:

Stored size: 561 Bytes

Contents

module Ecom
  module Core
    class MaintenanceServiceOrder < ApplicationRecord
      NEW = 'New'.freeze
      IN_PROGRESS = 'In Progress'.freeze
      COMPLETED = 'Completed'.freeze

      STATUSES = [NEW, IN_PROGRESS, COMPLETED].freeze

      belongs_to :equipment_item
      belongs_to :maintenance_type
      belongs_to :prepared_by, class_name: 'Ecom::Core::User'
      belongs_to :approved_by, class_name: 'Ecom::Core::User'

      validates :title, :status, :current_reading, presence: true
      validates :status, inclusion: STATUSES
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ecom_core-1.3.6 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.5 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.4 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.3 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.2 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.1 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.3.0 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.36 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.35 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.34 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.33 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.32 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.31 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.30 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.29 app/models/ecom/core/maintenance_service_order.rb
ecom_core-1.2.28 app/models/ecom/core/maintenance_service_order.rb