lib/lingutest_client/exam.rb in lingutest_client-0.2.4 vs lib/lingutest_client/exam.rb in lingutest_client-0.2.5

- old
+ new

@@ -5,12 +5,23 @@ OBJECT_NAME = :exam include Api::Resource include Api::Operations::List.module(ExamList) - attribute :id, Types::Coercible::Integer.optional.default(0) - attribute :name, Types::Coercible::String.optional.default('') + FilterSchema = Dry::Schema.Params do + config.validate_keys = true + optional(:page).filled(Types::Coercible::Integer) + optional(:per_page).filled(Types::Coercible::Integer) + + optional(:locale_eq).filled(Types::Coercible::String) + optional(:price_gt).filled(Types::Coercible::Integer) + end + + attribute :id, Types::Coercible::Integer.optional.default(0) + attribute :name, Types::Coercible::String.optional.default('') + attribute :locale, Types::Coercible::String.optional.default('') attribute :description, Types::Coercible::String.optional.default('') - attribute :price, Types::Coercible::Decimal.optional.default(0) - attribute :updated_at, Types::DateTime.optional.default(nil) + attribute :price, Types::Coercible::Decimal.optional.default(0) + attribute :updated_at, Types::DateTime.optional.default(nil) + attribute :created_at, Types::DateTime.optional.default(nil) end end