Sha256: ef8ee22efda4548b6945b16ea1fc4d5b2d929626ec650382808bff5ba4d49da1

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

Contents

require "fortnox/api/repositories/base"
require "fortnox/api/models/invoice"

module Fortnox
  module API
    module Repository
      class Invoice < Fortnox::API::Repository::Base

        CONFIGURATION = Fortnox::API::Repository::Base::Options.new(
          uri: '/invoices/',
          json_collection_wrapper: 'Invoices',
          json_entity_wrapper: 'Invoice',
          unique_id: 'DocumentNumber',
          attribute_name_to_json_key_map: {
            administration_fee_vat: 'AdministrationFeeVAT',
            edi_information: 'EDIInformation',
            eu_quarterly_report: 'EUQuarterlyReport',
            freight_vat: 'FreightVAT',
            ocr: 'OCR',
            total_vat: 'TotalVAT',
            vat_included: 'VATIncluded'
          },
          keys_filtered_on_save: [
            :url,
          ]
        )
        MODEL = Fortnox::API::Model::Invoice

        def initialize
          super( CONFIGURATION )
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fortnox-api-0.1.0 lib/fortnox/api/repositories/invoice.rb