Sha256: 99d0ab72f1280fff492526cb02fdc65723a527199ba6924ce4c7f1517bbd0341

Contents?: true

Size: 664 Bytes

Versions: 28

Compression:

Stored size: 664 Bytes

Contents

require 'kb/fake/bounded_context/rest_resource'

module BoundedContext
  module PetFamily
    module Products
      extend ActiveSupport::Concern
      include RestResource

      included do
        include RestResource

        resource :products, except: %i[create update destroy]

        def products_filterable_attributes
          [:country]
        end

        def on_products_index(_version)
          return json_response 400, {} if params['country'].nil?

          return json_response 422, {} if ISO3166::Country.search(params['country']).nil?

          json_response 200, filter_resources(:products, params)
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
barkibu-kb-fake-0.27.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.27.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.26.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.26.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.25.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.25.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.24.1 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.24.1 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.24.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.24.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.23.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.23.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.22.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.22.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.21.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.21.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.20.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.20.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-fake-0.19.0 lib/kb/fake/bounded_context/pet_family/products.rb
barkibu-kb-0.19.0 lib/kb/fake/bounded_context/pet_family/products.rb