Sha256: 94ff491d6337d733e3fa97bec2b4b95d8c0310f828bd1b6ab8d9f01da63723d5

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module Nova
  module API
    module Resource
      class Company < Nova::API::Base
        ALLOWED_ATTRIBUTES = %i[]

        attribute? :active, Dry::Types['strict.bool'].optional
        attribute? :address, Dry::Types['coercible.string'].optional
        attribute? :id, Dry::Types['coercible.integer'].optional
        attribute? :identification, Dry::Types['coercible.string'].optional
        attribute? :name, Dry::Types['coercible.string'].optional
        attribute? :phone, Dry::Types['coercible.string'].optional
        attribute? :social_contract_date, Dry::Types['coercible.string'].constrained(format: DATE_REGEX)
        attribute? :social_contract_number, Dry::Types['coercible.string'].optional
        attribute? :state_inscription, Dry::Types['coercible.string'].optional
        attribute? :trading_name, Dry::Types['coercible.string'].optional

        def self.endpoint
          '/api/companies'
        end

        def self.list
          do_get_search(endpoint, nil)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nova-api-1.4.0 lib/nova/api/resource/company.rb