Sha256: 264a0f4c19bbd38287a8455e0b980b999d30c0d0ab3660c25e545e2fcd3e438d

Contents?: true

Size: 851 Bytes

Versions: 7

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

require 'fortnox/api/types'
require 'fortnox/api/models/base'

module Fortnox
  module API
    module Model
      class TermsOfPayment < Fortnox::API::Model::Base
        UNIQUE_ID = :code
        STUB = { code: '', description: '' }.freeze

        # Direct URL to the record
        attribute :url, Types::Nullable::String.with(read_only: true)

        # The code of the term of payment. Sortable
        # TODO: Only writable during POST.
        # TODO: Must be alphanumeric
        # TODO: 30days is a valid value, but the API rewrites it as 30DAYS
        #       and you will not find the resource with a GET with value '30days'
        attribute :code, Types::Required::String

        # The description of the term of payment
        attribute :description, Types::Required::String
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fortnox-api-0.8.0 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.7.2 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.7.1 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.7.0 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.6.3 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.6.2 lib/fortnox/api/models/terms_of_payment.rb
fortnox-api-0.6.1 lib/fortnox/api/models/terms_of_payment.rb