Sha256: 9683b1b618491b159d19c0ef704ac27b2177ee54f69768dbd62bfd040d41a24b

Contents?: true

Size: 638 Bytes

Versions: 16

Compression:

Stored size: 638 Bytes

Contents

module Ecom
  module Core
    class ResourceRequisition < ApplicationRecord
      DRAFT = 'Draft'.freeze
      SUBMITTED = 'Submitted'.freeze
      APPROVED = 'Approved'.freeze
      REJECTED = 'Rejected'.freeze

      STATUSES = [DRAFT, SUBMITTED, APPROVED, REJECTED].freeze

      belongs_to :lookahead_plan
      belongs_to :reviewed_by, class_name: 'Ecom::Core::User', optional: true
      belongs_to :approved_by, class_name: 'Ecom::Core::User', optional: true
      has_many :resource_requisition_items

      validates :delivery_point, presence: true

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ecom_core-1.3.14 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.13 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.12 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.11 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.10 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.9 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.8 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.7 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.6 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.5 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.4 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.3 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.2 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.1 app/models/ecom/core/resource_requisition.rb
ecom_core-1.3.0 app/models/ecom/core/resource_requisition.rb
ecom_core-1.2.36 app/models/ecom/core/resource_requisition.rb