Sha256: b029cf16563e51049f14feb9986ce6bf9bfb35ae21ed851cffc574a6bb05eb37

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require 'dry-validation'

module TochkaCyclopsApi
  module Schemas
    module Requests
      # https://api.tochka.com/static/v1/tender-docs/cyclops/main/api_v2.html#api-v2-list-beneficiary
      class ListBeneficiary < Dry::Validation::Contract
        # Schema for beneficiary_data field of main schema
        class Filters < Dry::Validation::Contract
          params do
            optional(:inn).value(:string)
            optional(:is_active).value(:bool)
            optional(:legal_type).value(:string)
            optional(:nominal_account_code).value(:string)
            optional(:nominal_account_bic).value(:string)
          end
        end

        schema do
          optional(:page).value(:integer)
          optional(:per_page).value(:integer)
          optional(:filters).schema(
            TochkaCyclopsApi::Schemas::Requests::ListBeneficiary::Filters.schema
          )
        end

        EXAMPLE = "
{
  page: 2,
  per_page: 20,
  filters: {
    is_active: true,
    legal_type: 'F',
    nominal_account_code: '000000000000000000000',
    nominal_account_bic: '0000000000',
  }
}
"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tochka_cyclops_api-0.4.0 lib/tochka_cyclops_api/schemas/requests/list_beneficiary.rb