Sha256: b8bd2a683bd1e5759a41a69e56e8b626170f530a9d6e942b6f819460b1da06e1

Contents?: true

Size: 979 Bytes

Versions: 5

Compression:

Stored size: 979 Bytes

Contents

# frozen_string_literal: true

module Dhis2
  module Api
    module Version227
      class Event < ::Dhis2::Api::Base
        include ::Dhis2::Api::Listable
        include ::Dhis2::Api::Findable
        include ::Dhis2::Api::BulkCreatable
        include ::Dhis2::Api::Creatable
        include ::Dhis2::Api::Deletable
        include ::Dhis2::Api::Shared::SaveValidator
        include ::Dhis2::Api::Shared::Event

        def bulk_creation_status_class
          ::Dhis2::Api::EventCreationStatus
        end

        # args for a program without registration
        # and a  program with a program_stage
        Schema = Dry::Validation.Schema do
          required(:program).filled # program must be linked to the org unit
          required(:org_unit).filled
          required(:event_date).filled
          required(:data_values).each do
            required(:data_element).filled
            required(:value).filled
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dhis2-3.3.1 lib/dhis2/api/version227/event.rb
dhis2-3.2.1 lib/dhis2/api/version227/event.rb
dhis2-3.0.7 lib/dhis2/api/version227/event.rb
dhis2-3.0.5 lib/dhis2/api/version227/event.rb
dhis2-3.0.4 lib/dhis2/api/version227/event.rb