Sha256: f572033077155f5ae5a59314a99aa75ef27389cd27cd68b83fbf714ca8725810

Contents?: true

Size: 1.41 KB

Versions: 27

Compression:

Stored size: 1.41 KB

Contents

module Ecoportal
  module API
    class V2
      class Page
        class Component
          class Action < Common::Content::DoubleModel
            class << self
              def new_doc
                {
                  "id"         => new_uuid,
                  "weight"     => 99
                }
              end
            end

            passkey     :id
            passforced  :patch_ver, default: 1
            passthrough :name
            passthrough :weight, :other_information
            passboolean :complete

            passdate    :created_at, read_only: true #, :completed_at
            passthrough :created_by, read_only: true
            passthrough :assigned_person_member_id, :assigned_person_member

            passdate    :due_date, :reminder_date
            passboolean :overdue, read_only: true

            passthrough :duration_in_days, read_only: true
            passarray   :file_container_ids

            def to_s
              stat = case
                when overdue
                  "Overdue"
                when complete
                  "Complete"
                else
                  "Pending"
              end
              assignee = assigned_person_member["name"] || assigned_person_member["email"]
              "#{name}, #{created_at.to_s}, #{stat}, #{assignee}"
            end
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ecoportal-api-v2-2.0.6 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.5 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.4 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.3 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.2 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.1 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-2.0.0 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.8 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.7 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.6 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.5 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.4 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.3 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.2 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.1.1 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-1.0.1 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-0.9.7 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-0.9.6 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-0.9.5 lib/ecoportal/api/v2/page/component/action.rb
ecoportal-api-v2-0.9.4 lib/ecoportal/api/v2/page/component/action.rb