ledger_sync 1.3.3 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +13 -2
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +0 -3
- data/.travis.yml +7 -2
- data/Dockerfile +2 -2
- data/Gemfile.lock +115 -58
- data/LICENSE.txt +5 -21
- data/README.md +9 -489
- data/bin/quickbooks_online_oauth_server.rb +102 -0
- data/docs/.gitignore +4 -0
- data/documentation/build.sh +10 -0
- data/documentation/generate.rb +32 -0
- data/documentation/generators/generator.rb +80 -0
- data/documentation/generators/guides/generator.rb +36 -0
- data/documentation/generators/reference/generator.rb +76 -0
- data/documentation/generators/reference/ledger/generator.rb +74 -0
- data/documentation/generators/template.rb +22 -0
- data/documentation/helper_methods.rb +17 -0
- data/documentation/site/CNAME +1 -0
- data/documentation/site/LICENSE.md +40 -0
- data/documentation/site/README.md +8 -0
- data/documentation/site/_config.yml +119 -0
- data/documentation/site/_data/guides_sections.yml +10 -0
- data/documentation/site/_data/reference_sections.yml +5 -0
- data/documentation/site/_includes/action_link.html +11 -0
- data/documentation/site/_includes/alerts/base.html +3 -0
- data/documentation/site/_includes/alerts/danger.html +1 -0
- data/documentation/site/_includes/alerts/info.html +1 -0
- data/documentation/site/_includes/alerts/success.html +1 -0
- data/documentation/site/_includes/alerts/warning.html +1 -0
- data/documentation/site/_includes/cta_buttons.html +4 -0
- data/documentation/site/_includes/example.md +8 -0
- data/documentation/site/_includes/footer.html +20 -0
- data/documentation/site/_includes/getting_help.md +8 -0
- data/documentation/site/_includes/guides_menu.html +29 -0
- data/documentation/site/_includes/guides_submenu.html +7 -0
- data/documentation/site/_includes/header.html +35 -0
- data/documentation/site/_includes/installation_instructions.md +17 -0
- data/documentation/site/_includes/ledgers/netsuite_soap_summary.md +1 -0
- data/documentation/site/_includes/ledgers/netsuite_summary.md +1 -0
- data/documentation/site/_includes/ledgers/netsuite_summary_shared.md +1 -0
- data/documentation/site/_includes/ledgers/quickbooks_online_summary.md +1 -0
- data/documentation/site/_includes/ledgers/stripe_summary.md +1 -0
- data/documentation/site/_includes/reference/netsuite/authentication/_token_based_authentication.md +99 -0
- data/documentation/site/_includes/reference/netsuite/authentication/index.md +15 -0
- data/documentation/site/_includes/reference/netsuite/authentication/token_based_authentication.md +6 -0
- data/documentation/site/_includes/reference/netsuite/index.md +25 -0
- data/documentation/site/_includes/reference/netsuite_soap/index.md +11 -0
- data/documentation/site/_includes/reference/quickbooks_online/authentication/index.md +55 -0
- data/documentation/site/_includes/reference/quickbooks_online/errors/index.md +9 -0
- data/documentation/site/_includes/reference/quickbooks_online/index.md +6 -0
- data/documentation/site/_includes/reference/quickbooks_online/webhooks/index.md +42 -0
- data/documentation/site/_includes/reference/stripe/index.md +6 -0
- data/documentation/site/_includes/section_content.html +34 -0
- data/documentation/site/_includes/section_cta.html +28 -0
- data/documentation/site/_includes/section_grid.html +60 -0
- data/documentation/site/_includes/section_guides.html +35 -0
- data/documentation/site/_includes/section_hero.html +28 -0
- data/documentation/site/_includes/submenu.html +8 -0
- data/documentation/site/_layouts/advanced.html +9 -0
- data/documentation/site/_layouts/base.html +34 -0
- data/documentation/site/_layouts/blog.html +51 -0
- data/documentation/site/_layouts/body.html +11 -0
- data/documentation/site/_layouts/guides.html +46 -0
- data/documentation/site/_layouts/page.html +26 -0
- data/documentation/site/_layouts/post.html +52 -0
- data/documentation/site/_layouts/reference.html +46 -0
- data/documentation/site/_layouts/reference_netsuite.html +46 -0
- data/documentation/site/_layouts/reference_netsuite_soap.html +46 -0
- data/documentation/site/_layouts/reference_quickbooks_online.html +46 -0
- data/documentation/site/_layouts/reference_stripe.html +46 -0
- data/documentation/site/_plugins/filters.rb +122 -0
- data/documentation/site/_plugins/hooks.rb +9 -0
- data/documentation/site/_posts/2020-06-01-introducing-docs.md +17 -0
- data/documentation/site/_posts/2020-06-10-netsuite-authentication.md +382 -0
- data/documentation/site/_sass/imports/_animations.scss +19 -0
- data/documentation/site/_sass/imports/_footer.scss +94 -0
- data/documentation/site/_sass/imports/_functions.scss +69 -0
- data/documentation/site/_sass/imports/_general.scss +687 -0
- data/documentation/site/_sass/imports/_guides.scss +300 -0
- data/documentation/site/_sass/imports/_header.scss +358 -0
- data/documentation/site/_sass/imports/_icons.scss +90 -0
- data/documentation/site/_sass/imports/_post-navigation.scss +67 -0
- data/documentation/site/_sass/imports/_posts-pages.scss +165 -0
- data/documentation/site/_sass/imports/_prism.scss +174 -0
- data/documentation/site/_sass/imports/_reset.scss +210 -0
- data/documentation/site/_sass/imports/_sections.scss +370 -0
- data/documentation/site/_sass/imports/_structure.scss +44 -0
- data/documentation/site/_templates/_layouts/reference_ledger.html.erb +46 -0
- data/documentation/site/_templates/guides/ledger.md.erb +9 -0
- data/documentation/site/_templates/reference/resources/index.md.erb +9 -0
- data/documentation/site/_templates/reference/resources/resource.md.erb +27 -0
- data/documentation/site/assets/css/brands.min.css +5 -0
- data/documentation/site/assets/css/fontawesome.min.css +5 -0
- data/documentation/site/assets/css/main.scss +45 -0
- data/documentation/site/assets/css/monokai.css +441 -0
- data/documentation/site/assets/js/main.js +214 -0
- data/documentation/site/assets/js/plugins.js +22 -0
- data/documentation/site/assets/js/prism.js +9 -0
- data/documentation/site/assets/webfonts/fa-brands-400.eot +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.svg +3452 -0
- data/documentation/site/assets/webfonts/fa-brands-400.ttf +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.woff +0 -0
- data/documentation/site/assets/webfonts/fa-brands-400.woff2 +0 -0
- data/documentation/site/blog/index.md +6 -0
- data/documentation/site/guides/architecture/clients.md +35 -0
- data/documentation/site/guides/architecture/index.md +14 -0
- data/documentation/site/guides/architecture/operations.md +45 -0
- data/documentation/site/guides/architecture/resources.md +40 -0
- data/documentation/site/guides/architecture/results.md +6 -0
- data/documentation/site/guides/architecture/searchers.md +28 -0
- data/documentation/site/guides/architecture/serialization.md +59 -0
- data/documentation/site/guides/community/index.md +8 -0
- data/documentation/site/guides/contribute/console.md +6 -0
- data/documentation/site/guides/contribute/deployment.md +17 -0
- data/documentation/site/guides/contribute/documentation.md +37 -0
- data/documentation/site/guides/contribute/index.md +18 -0
- data/documentation/site/guides/contribute/qa.md +16 -0
- data/documentation/site/guides/contribute/testing.md +6 -0
- data/documentation/site/guides/customization/custom_resources.md +50 -0
- data/documentation/site/guides/customization/custom_serializers.md +47 -0
- data/documentation/site/guides/customization/index.md +15 -0
- data/documentation/site/guides/customization/resource_converters.md +79 -0
- data/documentation/site/guides/getting-started/get-help.md +7 -0
- data/documentation/site/guides/getting-started/index.md +8 -0
- data/documentation/site/guides/getting-started/installation.md +7 -0
- data/documentation/site/guides/getting-started/quick-start.md +123 -0
- data/documentation/site/guides/index.md +16 -0
- data/documentation/site/guides/ledgers/index.md +12 -0
- data/documentation/site/guides/ledgers/netsuite.md +9 -0
- data/documentation/site/guides/ledgers/netsuite_soap.md +9 -0
- data/documentation/site/guides/ledgers/quickbooks_online.md +9 -0
- data/documentation/site/guides/ledgers/stripe.md +9 -0
- data/documentation/site/guides/modern-treasury/index.md +14 -0
- data/documentation/site/guides/tips_and_more/index.md +76 -0
- data/documentation/site/images/1.jpg +0 -0
- data/documentation/site/images/10.jpg +0 -0
- data/documentation/site/images/2.jpg +0 -0
- data/documentation/site/images/3.jpg +0 -0
- data/documentation/site/images/4.jpg +0 -0
- data/documentation/site/images/5.jpg +0 -0
- data/documentation/site/images/6.jpg +0 -0
- data/documentation/site/images/7.jpg +0 -0
- data/documentation/site/images/8.jpg +0 -0
- data/documentation/site/images/9.jpg +0 -0
- data/documentation/site/images/logo.svg +8 -0
- data/documentation/site/index.md +99 -0
- data/documentation/site/overview.md +21 -0
- data/documentation/site/reference/architecture/clients.md +33 -0
- data/documentation/site/reference/architecture/index.md +14 -0
- data/documentation/site/reference/architecture/operations.md +6 -0
- data/documentation/site/reference/architecture/resources.md +38 -0
- data/documentation/site/reference/architecture/results.md +6 -0
- data/documentation/site/reference/architecture/searchers.md +6 -0
- data/documentation/site/reference/architecture/serialization.md +6 -0
- data/documentation/site/reference/index.md +6 -0
- data/documentation/site/reference/netsuite/authentication/_token_based_authentication.md +99 -0
- data/documentation/site/reference/netsuite/authentication/index.md +15 -0
- data/documentation/site/reference/netsuite/authentication/token_based_authentication.md +6 -0
- data/documentation/site/reference/netsuite/index.md +25 -0
- data/documentation/site/reference/netsuite/resources/account.md +38 -0
- data/documentation/site/reference/netsuite/resources/check.md +49 -0
- data/documentation/site/reference/netsuite/resources/check_line_item.md +23 -0
- data/documentation/site/reference/netsuite/resources/currency.md +45 -0
- data/documentation/site/reference/netsuite/resources/customer.md +48 -0
- data/documentation/site/reference/netsuite/resources/customer_deposit.md +46 -0
- data/documentation/site/reference/netsuite/resources/department.md +47 -0
- data/documentation/site/reference/netsuite/resources/deposit.md +25 -0
- data/documentation/site/reference/netsuite/resources/deposit_line_item.md +23 -0
- data/documentation/site/reference/netsuite/resources/index.md +25 -0
- data/documentation/site/reference/netsuite/resources/invoice.md +25 -0
- data/documentation/site/reference/netsuite/resources/invoice_line_item.md +22 -0
- data/documentation/site/reference/netsuite/resources/item.md +19 -0
- data/documentation/site/reference/netsuite/resources/journal_entry.md +48 -0
- data/documentation/site/reference/netsuite/resources/journal_entry_line_item.md +24 -0
- data/documentation/site/reference/netsuite/resources/ledger_class.md +47 -0
- data/documentation/site/reference/netsuite/resources/location.md +43 -0
- data/documentation/site/reference/netsuite/resources/resource.md +18 -0
- data/documentation/site/reference/netsuite/resources/subsidiary.md +20 -0
- data/documentation/site/reference/netsuite/resources/vendor.md +49 -0
- data/documentation/site/reference/netsuite_soap/index.md +11 -0
- data/documentation/site/reference/netsuite_soap/resources/customer.md +34 -0
- data/documentation/site/reference/netsuite_soap/resources/index.md +9 -0
- data/documentation/site/reference/netsuite_soap/resources/resource.md +18 -0
- data/documentation/site/reference/netsuite_soap/resources/subsidiary.md +32 -0
- data/documentation/site/reference/quickbooks_online/authentication/index.md +55 -0
- data/documentation/site/reference/quickbooks_online/errors/index.md +9 -0
- data/documentation/site/reference/quickbooks_online/index.md +6 -0
- data/documentation/site/reference/quickbooks_online/resources/account.md +44 -0
- data/documentation/site/reference/quickbooks_online/resources/bill.md +45 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_payment.md +49 -0
- data/documentation/site/reference/quickbooks_online/resources/bill_payment_line_item.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/currency.md +21 -0
- data/documentation/site/reference/quickbooks_online/resources/customer.md +40 -0
- data/documentation/site/reference/quickbooks_online/resources/department.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/deposit.md +43 -0
- data/documentation/site/reference/quickbooks_online/resources/deposit_line_item.md +23 -0
- data/documentation/site/reference/quickbooks_online/resources/expense.md +46 -0
- data/documentation/site/reference/quickbooks_online/resources/expense_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/index.md +33 -0
- data/documentation/site/reference/quickbooks_online/resources/invoice.md +43 -0
- data/documentation/site/reference/quickbooks_online/resources/invoice_sales_line_item.md +22 -0
- data/documentation/site/reference/quickbooks_online/resources/item.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/journal_entry.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/journal_entry_line_item.md +24 -0
- data/documentation/site/reference/quickbooks_online/resources/ledger_class.md +41 -0
- data/documentation/site/reference/quickbooks_online/resources/payment.md +46 -0
- data/documentation/site/reference/quickbooks_online/resources/payment_line_item.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/preferences.md +34 -0
- data/documentation/site/reference/quickbooks_online/resources/primary_email_addr.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/primary_phone.md +19 -0
- data/documentation/site/reference/quickbooks_online/resources/resource.md +18 -0
- data/documentation/site/reference/quickbooks_online/resources/subsidiary.md +20 -0
- data/documentation/site/reference/quickbooks_online/resources/transfer.md +42 -0
- data/documentation/site/reference/quickbooks_online/resources/vendor.md +43 -0
- data/documentation/site/reference/quickbooks_online/webhooks/index.md +42 -0
- data/documentation/site/reference/stripe/index.md +6 -0
- data/documentation/site/reference/stripe/resources/customer.md +45 -0
- data/documentation/site/reference/stripe/resources/index.md +8 -0
- data/documentation/site/reference/stripe/resources/resource.md +18 -0
- data/documentation/site/style-guide.md +137 -0
- data/ledger_sync.gemspec +6 -2
- data/lib/ledger_sync.rb +45 -57
- data/lib/ledger_sync/core_ext/resonad.rb +2 -2
- data/lib/ledger_sync/deserializer.rb +108 -0
- data/lib/ledger_sync/error.rb +15 -0
- data/lib/ledger_sync/error/{adaptor_errors.rb → ledger_errors.rb} +13 -13
- data/lib/ledger_sync/error/operation_errors.rb +0 -10
- data/lib/ledger_sync/error/resource_errors.rb +48 -19
- data/lib/ledger_sync/{adaptor_configuration.rb → ledger_configuration.rb} +12 -12
- data/lib/ledger_sync/ledger_configuration_store.rb +56 -0
- data/lib/ledger_sync/ledgers/client.rb +112 -0
- data/lib/ledger_sync/{adaptors → ledgers}/contract.rb +1 -1
- data/lib/ledger_sync/ledgers/dashboard_url_helper.rb +23 -0
- data/lib/ledger_sync/ledgers/mixins/infer_client_mixin.rb +28 -0
- data/lib/ledger_sync/{adaptors → ledgers}/mixins/infer_resource_class_mixin.rb +5 -2
- data/lib/ledger_sync/ledgers/mixins/infer_serializer_mixin.rb +52 -0
- data/lib/ledger_sync/{adaptors → ledgers}/mixins/infer_validation_contract_mixin.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/mixins/offset_and_limit_pagination_searcher_mixin.rb +1 -1
- data/lib/ledger_sync/ledgers/mixins/serialization_mixin.rb +41 -0
- data/lib/ledger_sync/ledgers/netsuite/account/deserializer.rb +23 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/account/operations/create.rb +5 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/account/operations/find.rb +4 -4
- data/lib/ledger_sync/ledgers/netsuite/account/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/account/searcher_deserializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/account/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/check/deserializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/create.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/delete.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/find.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/operations/update.rb +27 -0
- data/lib/ledger_sync/ledgers/netsuite/check/searcher.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/check/searcher_deserializer.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/check/serializer.rb +51 -0
- data/lib/ledger_sync/ledgers/netsuite/check_line_item/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/netsuite/check_line_item/serializer.rb +25 -0
- data/lib/ledger_sync/{adaptors/netsuite/adaptor.rb → ledgers/netsuite/client.rb} +57 -18
- data/lib/ledger_sync/ledgers/netsuite/config.rb +5 -0
- data/lib/ledger_sync/ledgers/netsuite/currency/deserializer.rb +23 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/currency/operations/create.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/currency/operations/delete.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/currency/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/currency/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/netsuite/currency/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/deserializer.rb +22 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/customer/operations/create.rb +8 -6
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/customer/operations/delete.rb +7 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/customer/operations/find.rb +7 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/customer/operations/update.rb +7 -5
- data/lib/ledger_sync/ledgers/netsuite/customer/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/searcher_deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/customer/serializer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/deserializer.rb +20 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/create.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/delete.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/find.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/operations/update.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/searcher_deserializer.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/customer_deposit/serializer.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/dashboard_url_helper.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/department/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/delete.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/department/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/department/searcher_deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/department/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/error.rb +18 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/deserializer.rb +31 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/delete.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/find.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/operations/update.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry/serializer.rb +36 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry_line_item/deserializer.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/journal_entry_line_item/serializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/create.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/delete.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/find.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/operations/update.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/searcher_deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/ledger_class/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/location/deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/create.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/delete.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/find.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/operations/update.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/location/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/location/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/operation.rb +40 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/operation/create.rb +6 -13
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/operation/delete.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/operation/find.rb +9 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/operation/update.rb +6 -13
- data/lib/ledger_sync/ledgers/netsuite/record/http_method.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/record/metadata.rb +105 -0
- data/lib/ledger_sync/ledgers/netsuite/record/parameter.rb +20 -0
- data/lib/ledger_sync/ledgers/netsuite/record/property.rb +22 -0
- data/lib/ledger_sync/ledgers/netsuite/reference/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/account.rb +44 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/check.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/check_line_item.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/currency.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/customer.rb +19 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/customer_deposit.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/department.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/deposit.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/deposit_line_item.rb +25 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/invoice.rb +28 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/invoice_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/item.rb +11 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/journal_entry.rb +26 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/journal_entry_line_item.rb +24 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/ledger_class.rb +16 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/location.rb +11 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/resources/vendor.rb +23 -0
- data/lib/ledger_sync/ledgers/netsuite/searcher.rb +64 -0
- data/lib/ledger_sync/ledgers/netsuite/serializer.rb +13 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/searcher_deserializer.rb +15 -0
- data/lib/ledger_sync/ledgers/netsuite/subsidiary/serializer.rb +15 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/token.rb +18 -22
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_active_type.rb +32 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_customer_type.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_entity_type.rb +30 -0
- data/lib/ledger_sync/ledgers/netsuite/type/deserializer_subsidiary_type.rb +33 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/deserializer.rb +30 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/vendor/operations/create.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/vendor/operations/delete.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/vendor/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite/vendor/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/netsuite/vendor/searcher.rb +12 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/searcher_deserializer.rb +21 -0
- data/lib/ledger_sync/ledgers/netsuite/vendor/serializer.rb +30 -0
- data/lib/ledger_sync/{adaptors/netsuite_soap/adaptor.rb → ledgers/netsuite_soap/client.rb} +2 -2
- data/lib/ledger_sync/ledgers/netsuite_soap/config.rb +5 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/customer/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/customer/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/operation.rb +5 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/operation/create.rb +5 -5
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/operation/find.rb +2 -2
- data/lib/ledger_sync/ledgers/netsuite_soap/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb +29 -0
- data/lib/ledger_sync/ledgers/netsuite_soap/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/subsidiary/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/netsuite_soap/subsidiary/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/operation.rb +39 -34
- data/lib/ledger_sync/ledgers/quickbooks_online/account/deserializer.rb +43 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/account/operations/create.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/account/operations/find.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/account/operations/update.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/account/searcher.rb +2 -2
- data/lib/ledger_sync/ledgers/quickbooks_online/account/serializer.rb +37 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/deserializer.rb +45 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/bill/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/bill/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/bill/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/bill/searcher.rb +2 -2
- data/lib/ledger_sync/ledgers/quickbooks_online/bill/serializer.rb +44 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_line_item/serializer.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/deserializer.rb +59 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/create.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/find.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/operations/update.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment/serializer.rb +77 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment_line_item/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/bill_payment_line_item/serializer.rb +18 -0
- data/lib/ledger_sync/{adaptors/quickbooks_online/adaptor.rb → ledgers/quickbooks_online/client.rb} +21 -21
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/config.rb +1 -1
- data/lib/ledger_sync/ledgers/quickbooks_online/currency/deserializer.rb +17 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/currency/serializer.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/deserializer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/operations/create.rb +26 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/operations/find.rb +26 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/customer/operations/update.rb +8 -6
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/customer/searcher.rb +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/customer/serializer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/dashboard_url_helper.rb +34 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb +28 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/department/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/department/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/department/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/department/searcher.rb +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/department/serializer.rb +49 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/deserializer.rb +39 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/deposit/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/deposit/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/deposit/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/deposit/searcher.rb +2 -2
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit/serializer.rb +39 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit_line_item/deserializer.rb +38 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deposit_line_item/serializer.rb +41 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/deserializer.rb +98 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/deserializer.rb +58 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/expense/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/expense/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/expense/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/expense/searcher.rb +2 -2
- data/lib/ledger_sync/ledgers/quickbooks_online/expense/serializer.rb +59 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/expense_line_item/serializer.rb +27 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/deserializer.rb +35 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/invoice/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/invoice/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/invoice/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice/serializer.rb +35 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice_sales_line_item/deserializer.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/invoice_sales_line_item/serializer.rb +29 -0
- data/lib/ledger_sync/{adaptors/quickbooks_online/item/ledger_serializer.rb → ledgers/quickbooks_online/item/deserializer.rb} +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/item/serializer.rb +12 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/deserializer.rb +33 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/journal_entry/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/journal_entry/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/journal_entry/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/journal_entry/searcher.rb +2 -2
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry/serializer.rb +33 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry_line_item/deserializer.rb +32 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/journal_entry_line_item/serializer.rb +36 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/ledger_class/deserializer.rb +29 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/ledger_class/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/ledger_class/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/ledger_class/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/ledger_class/searcher.rb +3 -3
- data/lib/ledger_sync/{adaptors/quickbooks_online/ledger_class/ledger_serializer.rb → ledgers/quickbooks_online/ledger_class/serializer.rb} +8 -9
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/oauth_client.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/operation.rb +8 -7
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/operation/create.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/operation/find.rb +3 -9
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/operation/full_update.rb +11 -12
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/operation/sparse_update.rb +5 -5
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/deserializer.rb +48 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/payment/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/payment/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/payment/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/payment/serializer.rb +48 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment_line_item/deserializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/payment_line_item/serializer.rb +18 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/deserializer.rb +43 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/operations/find.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/preferences/serializer.rb +43 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/request.rb +13 -13
- data/lib/ledger_sync/ledgers/quickbooks_online/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/account.rb +355 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill.rb +31 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment.rb +42 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/bill_payment_line_item.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/currency.rb +13 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/customer.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/department.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/deposit.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/deposit_line_item.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/expense.rb +40 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/expense_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/invoice.rb +28 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/invoice_sales_line_item.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/item.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_item.rb +29 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/ledger_class.rb +16 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/payment.rb +31 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/payment_line_item.rb +19 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/preferences.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/primary_email_addr.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/primary_phone.rb +11 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/subsidiary.rb +12 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/transfer.rb +24 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/resources/vendor.rb +23 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/searcher.rb +6 -7
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/amount_float_to_integer_type.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/deserialize_transaction_reference_type.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/integer_to_amount_float_type.rb +21 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialization/type/serialize_transaction_reference_type.rb +30 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serializer.rb +71 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/serialziation/type/mapping_type.rb +25 -0
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/deserializer.rb +34 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/transfer/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/transfer/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/transfer/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/quickbooks_online/transfer/serializer.rb +34 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/util/error_matcher.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/util/error_parser.rb +3 -3
- data/lib/ledger_sync/{adaptors/quickbooks_online/util/adaptor_error_parser.rb → ledgers/quickbooks_online/util/ledger_error_parser.rb} +16 -16
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/util/operation_error_parser.rb +7 -7
- data/lib/ledger_sync/ledgers/quickbooks_online/vendor/deserializer.rb +25 -0
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/vendor/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/vendor/operations/find.rb +4 -4
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/vendor/operations/update.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/vendor/searcher.rb +2 -2
- data/lib/ledger_sync/{adaptors/quickbooks_online/vendor/ledger_serializer.rb → ledgers/quickbooks_online/vendor/serializer.rb} +7 -7
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/webhook.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/webhook_event.rb +9 -9
- data/lib/ledger_sync/{adaptors → ledgers}/quickbooks_online/webhook_notification.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/request.rb +11 -7
- data/lib/ledger_sync/{adaptors → ledgers}/response.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/searcher.rb +13 -8
- data/lib/ledger_sync/ledgers/stripe/client.rb +37 -0
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/config.rb +1 -1
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/customer/operations/create.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/customer/operations/delete.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/customer/operations/find.rb +3 -3
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/customer/operations/update.rb +3 -3
- data/lib/ledger_sync/ledgers/stripe/dashboard_url_helper.rb +21 -0
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/operation.rb +5 -5
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/operation/create.rb +2 -2
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/operation/delete.rb +2 -2
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/operation/find.rb +2 -2
- data/lib/ledger_sync/{adaptors → ledgers}/stripe/operation/update.rb +2 -2
- data/lib/ledger_sync/ledgers/stripe/resource.rb +10 -0
- data/lib/ledger_sync/ledgers/stripe/resources/customer.rb +13 -0
- data/lib/ledger_sync/operation.rb +23 -0
- data/lib/ledger_sync/resource.rb +22 -10
- data/lib/ledger_sync/resource_adaptor.rb +52 -0
- data/lib/ledger_sync/resource_attribute.rb +31 -9
- data/lib/ledger_sync/resource_attribute/dirty_mixin.rb +4 -0
- data/lib/ledger_sync/resource_attribute/mixin.rb +14 -24
- data/lib/ledger_sync/resource_attribute/reference/many.rb +21 -23
- data/lib/ledger_sync/resource_attribute/reference/one.rb +16 -5
- data/lib/ledger_sync/resource_attribute_set.rb +3 -7
- data/lib/ledger_sync/result.rb +3 -3
- data/lib/ledger_sync/serialization/attribute.rb +41 -0
- data/lib/ledger_sync/serialization/attribute_set_mixin.rb +27 -0
- data/lib/ledger_sync/serialization/deserializer_attribute.rb +78 -0
- data/lib/ledger_sync/serialization/deserializer_attribute_set.rb +22 -0
- data/lib/ledger_sync/serialization/mixin.rb +70 -0
- data/lib/ledger_sync/serialization/serializer_attribute.rb +64 -0
- data/lib/ledger_sync/serialization/serializer_attribute_set.rb +22 -0
- data/lib/ledger_sync/serialization/type/deserializer_references_many_type.rb +26 -0
- data/lib/ledger_sync/serialization/type/deserializer_references_one_type.rb +12 -0
- data/lib/ledger_sync/serialization/type/deserializer_type.rb +29 -0
- data/lib/ledger_sync/serialization/type/format_date_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/mapping_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/parse_date_type.rb +23 -0
- data/lib/ledger_sync/serialization/type/serializer_references_many_type.rb +21 -0
- data/lib/ledger_sync/serialization/type/serializer_references_one_type.rb +12 -0
- data/lib/ledger_sync/serialization/type/serializer_type.rb +23 -0
- data/lib/ledger_sync/serializer.rb +95 -0
- data/lib/ledger_sync/type/boolean.rb +2 -0
- data/lib/ledger_sync/type/date.rb +3 -1
- data/lib/ledger_sync/type/float.rb +2 -0
- data/lib/ledger_sync/type/hash.rb +38 -0
- data/lib/ledger_sync/type/id.rb +8 -2
- data/lib/ledger_sync/type/integer.rb +2 -0
- data/lib/ledger_sync/type/reference_many.rb +15 -5
- data/lib/ledger_sync/type/reference_one.rb +9 -18
- data/lib/ledger_sync/type/string.rb +2 -0
- data/lib/ledger_sync/type/string_from_set.rb +43 -0
- data/lib/ledger_sync/type/value_mixin.rb +37 -7
- data/lib/ledger_sync/util/mixins/delegate_iterable_methods_mixin.rb +43 -0
- data/lib/ledger_sync/util/mixins/dupable_mixin.rb +13 -0
- data/lib/ledger_sync/util/mixins/resource_registerable_mixin.rb +29 -0
- data/lib/ledger_sync/util/read_only_object.rb +54 -0
- data/lib/ledger_sync/util/resource_converter.rb +113 -0
- data/lib/ledger_sync/util/resource_converter/attribute.rb +131 -0
- data/lib/ledger_sync/util/resource_converter/attribute_set.rb +42 -0
- data/lib/ledger_sync/util/resource_converter/type/references_many_type.rb +27 -0
- data/lib/ledger_sync/util/resource_converter/type/references_one_type.rb +14 -0
- data/lib/ledger_sync/util/resource_converter/type/resource_converter_type.rb +26 -0
- data/lib/ledger_sync/util/resources_builder.rb +19 -11
- data/lib/ledger_sync/util/string_helpers.rb +3 -3
- data/lib/ledger_sync/util/url_helpers.rb +38 -0
- data/lib/ledger_sync/util/validator.rb +3 -1
- data/lib/ledger_sync/version.rb +1 -1
- data/licenses/BSL.txt +97 -0
- data/licenses/documentation_site.txt +7 -0
- metadata +621 -229
- data/_config.yml +0 -1
- data/lib/ledger_sync/adaptor_configuration_store.rb +0 -56
- data/lib/ledger_sync/adaptors/adaptor.rb +0 -74
- data/lib/ledger_sync/adaptors/ledger_serializer.rb +0 -143
- data/lib/ledger_sync/adaptors/ledger_serializer_attribute.rb +0 -178
- data/lib/ledger_sync/adaptors/ledger_serializer_attribute_set.rb +0 -58
- data/lib/ledger_sync/adaptors/ledger_serializer_type/mapping_type.rb +0 -41
- data/lib/ledger_sync/adaptors/ledger_serializer_type/references_many_type.rb +0 -24
- data/lib/ledger_sync/adaptors/ledger_serializer_type/references_one_type.rb +0 -22
- data/lib/ledger_sync/adaptors/ledger_serializer_type/value_type.rb +0 -17
- data/lib/ledger_sync/adaptors/mixins/infer_adaptor_class_mixin.rb +0 -24
- data/lib/ledger_sync/adaptors/mixins/infer_ledger_serializer_mixin.rb +0 -45
- data/lib/ledger_sync/adaptors/netsuite/account/ledger_deserializer.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/account/ledger_serializer.rb +0 -22
- data/lib/ledger_sync/adaptors/netsuite/account/searcher.rb +0 -28
- data/lib/ledger_sync/adaptors/netsuite/config.rb +0 -5
- data/lib/ledger_sync/adaptors/netsuite/currency/deledger_serializer.rb +0 -28
- data/lib/ledger_sync/adaptors/netsuite/currency/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/netsuite/customer/ledger_deserializer.rb +0 -27
- data/lib/ledger_sync/adaptors/netsuite/customer/ledger_serializer.rb +0 -38
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer_type/reference_type.rb +0 -24
- data/lib/ledger_sync/adaptors/netsuite/ledger_serializer_type/subsidiary_type.rb +0 -22
- data/lib/ledger_sync/adaptors/netsuite/operation.rb +0 -19
- data/lib/ledger_sync/adaptors/netsuite/record/http_method.rb +0 -38
- data/lib/ledger_sync/adaptors/netsuite/record/metadata.rb +0 -75
- data/lib/ledger_sync/adaptors/netsuite/record/property.rb +0 -45
- data/lib/ledger_sync/adaptors/netsuite/searcher.rb +0 -17
- data/lib/ledger_sync/adaptors/netsuite/vendor/ledger_deserializer.rb +0 -32
- data/lib/ledger_sync/adaptors/netsuite/vendor/ledger_serializer.rb +0 -35
- data/lib/ledger_sync/adaptors/netsuite_soap/config.rb +0 -5
- data/lib/ledger_sync/adaptors/netsuite_soap/customer/ledger_serializer.rb +0 -13
- data/lib/ledger_sync/adaptors/netsuite_soap/ledger_serializer.rb +0 -25
- data/lib/ledger_sync/adaptors/quickbooks_online/account/ledger_serializer.rb +0 -37
- data/lib/ledger_sync/adaptors/quickbooks_online/bill/ledger_serializer.rb +0 -46
- data/lib/ledger_sync/adaptors/quickbooks_online/bill_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/currency/ledger_serializer.rb +0 -17
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/ledger_serializer.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/operations/create.rb +0 -22
- data/lib/ledger_sync/adaptors/quickbooks_online/customer/operations/find.rb +0 -22
- data/lib/ledger_sync/adaptors/quickbooks_online/dashboard_url_helper.rb +0 -59
- data/lib/ledger_sync/adaptors/quickbooks_online/department/ledger_serializer.rb +0 -38
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit/ledger_serializer.rb +0 -40
- data/lib/ledger_sync/adaptors/quickbooks_online/deposit_line_item/ledger_serializer.rb +0 -34
- data/lib/ledger_sync/adaptors/quickbooks_online/expense/ledger_serializer.rb +0 -52
- data/lib/ledger_sync/adaptors/quickbooks_online/expense_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice/ledger_serializer.rb +0 -36
- data/lib/ledger_sync/adaptors/quickbooks_online/invoice_sales_line_item/ledger_serializer.rb +0 -30
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry/ledger_serializer.rb +0 -34
- data/lib/ledger_sync/adaptors/quickbooks_online/journal_entry_line_item/ledger_serializer.rb +0 -37
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer.rb +0 -131
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/account_sub_type.rb +0 -305
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/account_type.rb +0 -51
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/amount_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/classification_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/date_type.rb +0 -23
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/entity_reference_type.rb +0 -49
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/journal_entry_line_item_type.rb +0 -20
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/payment_type.rb +0 -21
- data/lib/ledger_sync/adaptors/quickbooks_online/ledger_serializer_type/transaction_reference_type.rb +0 -49
- data/lib/ledger_sync/adaptors/quickbooks_online/payment/ledger_serializer.rb +0 -50
- data/lib/ledger_sync/adaptors/quickbooks_online/payment_line_item/ledger_serializer.rb +0 -19
- data/lib/ledger_sync/adaptors/quickbooks_online/transfer/ledger_serializer.rb +0 -36
- data/lib/ledger_sync/adaptors/stripe/adaptor.rb +0 -45
- data/lib/ledger_sync/adaptors/test/customer/ledger_serializer.rb +0 -12
- data/lib/ledger_sync/adaptors/test/ledger_serializer.rb +0 -12
- data/lib/ledger_sync/resources/account.rb +0 -17
- data/lib/ledger_sync/resources/bill.rb +0 -27
- data/lib/ledger_sync/resources/bill_line_item.rb +0 -17
- data/lib/ledger_sync/resources/currency.rb +0 -9
- data/lib/ledger_sync/resources/customer.rb +0 -25
- data/lib/ledger_sync/resources/department.rb +0 -14
- data/lib/ledger_sync/resources/deposit.rb +0 -24
- data/lib/ledger_sync/resources/deposit_line_item.rb +0 -22
- data/lib/ledger_sync/resources/expense.rb +0 -33
- data/lib/ledger_sync/resources/expense_line_item.rb +0 -17
- data/lib/ledger_sync/resources/invoice.rb +0 -24
- data/lib/ledger_sync/resources/invoice_sales_line_item.rb +0 -17
- data/lib/ledger_sync/resources/item.rb +0 -5
- data/lib/ledger_sync/resources/journal_entry.rb +0 -20
- data/lib/ledger_sync/resources/journal_entry_line_item.rb +0 -20
- data/lib/ledger_sync/resources/ledger_class.rb +0 -14
- data/lib/ledger_sync/resources/payment.rb +0 -27
- data/lib/ledger_sync/resources/payment_line_item.rb +0 -15
- data/lib/ledger_sync/resources/subsidiary.rb +0 -8
- data/lib/ledger_sync/resources/transfer.rb +0 -20
- data/lib/ledger_sync/resources/vendor.rb +0 -19
- data/qa/env_spec.rb +0 -5
- data/qa/netsuite/account_spec.rb +0 -20
- data/qa/netsuite/currency_spec.rb +0 -16
- data/qa/netsuite/customer.rb +0 -76
- data/qa/netsuite/customer_spec.rb +0 -21
- data/qa/netsuite/vendor.rb +0 -76
- data/qa/netsuite/vendor_spec.rb +0 -23
- data/qa/netsuite_soap/customer_spec.rb +0 -21
- data/qa/netsuite_soap/subsidiary_spec.rb +0 -0
- data/qa/qa_helper.rb +0 -58
- data/qa/quickbooks_online/account_spec.rb +0 -14
- data/qa/quickbooks_online/customer_spec.rb +0 -13
- data/qa/quickbooks_online/expense_spec.rb +0 -31
- data/qa/quickbooks_online/vendor_spec.rb +0 -13
- data/qa/stripe/customers_spec.rb +0 -15
- data/qa/support/adaptor_helpers.rb +0 -99
- data/qa/support/adaptor_support_setup.rb +0 -23
- data/qa/support/netsuite_helpers.rb +0 -33
- data/qa/support/netsuite_shared_examples.rb +0 -30
- data/qa/support/netsuite_soap_helpers.rb +0 -33
- data/qa/support/netsuite_soap_shared_examples.rb +0 -10
- data/qa/support/quickbooks_online_helpers.rb +0 -42
- data/qa/support/quickbooks_online_shared_examples.rb +0 -82
- data/qa/support/shared_examples.rb +0 -127
- data/qa/support/stripe_helpers.rb +0 -22
- data/qa/support/stripe_shared_examples.rb +0 -10
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../bill_line_item/serializer'
|
|
4
|
+
require_relative '../currency/serializer'
|
|
5
|
+
|
|
6
|
+
module LedgerSync
|
|
7
|
+
module Ledgers
|
|
8
|
+
module QuickBooksOnline
|
|
9
|
+
class Bill
|
|
10
|
+
class Serializer < QuickBooksOnline::Serializer
|
|
11
|
+
id
|
|
12
|
+
|
|
13
|
+
references_one :CurrencyRef,
|
|
14
|
+
resource_attribute: :currency,
|
|
15
|
+
serializer: Currency::Serializer
|
|
16
|
+
|
|
17
|
+
date 'DueDate',
|
|
18
|
+
resource_attribute: :due_date
|
|
19
|
+
|
|
20
|
+
attribute 'PrivateNote', resource_attribute: :memo
|
|
21
|
+
|
|
22
|
+
date 'TxnDate',
|
|
23
|
+
resource_attribute: :transaction_date
|
|
24
|
+
|
|
25
|
+
attribute 'VendorRef.value',
|
|
26
|
+
resource_attribute: 'vendor.ledger_id'
|
|
27
|
+
|
|
28
|
+
attribute 'APAccountRef.value',
|
|
29
|
+
resource_attribute: 'account.ledger_id'
|
|
30
|
+
|
|
31
|
+
attribute 'DepartmentRef.value',
|
|
32
|
+
resource_attribute: 'department.ledger_id'
|
|
33
|
+
|
|
34
|
+
attribute 'DocNumber',
|
|
35
|
+
resource_attribute: :reference_number
|
|
36
|
+
|
|
37
|
+
references_many 'Line',
|
|
38
|
+
resource_attribute: :line_items,
|
|
39
|
+
serializer: BillLineItem::Serializer
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillLineItem
|
|
7
|
+
class Deserializer < QuickBooksOnline::Deserializer
|
|
8
|
+
id
|
|
9
|
+
|
|
10
|
+
attribute 'account.ledger_id',
|
|
11
|
+
hash_attribute: 'AccountBasedExpenseLineDetail.AccountRef.value'
|
|
12
|
+
|
|
13
|
+
attribute 'ledger_class.ledger_id',
|
|
14
|
+
hash_attribute: 'AccountBasedExpenseLineDetail.ClassRef.value'
|
|
15
|
+
|
|
16
|
+
amount :amount,
|
|
17
|
+
hash_attribute: 'Amount'
|
|
18
|
+
|
|
19
|
+
attribute :description,
|
|
20
|
+
hash_attribute: 'Description'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillLineItem
|
|
7
|
+
class Serializer < QuickBooksOnline::Serializer
|
|
8
|
+
id
|
|
9
|
+
|
|
10
|
+
attribute 'DetailType' do
|
|
11
|
+
'AccountBasedExpenseLineDetail'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
attribute 'AccountBasedExpenseLineDetail.AccountRef.value',
|
|
15
|
+
resource_attribute: 'account.ledger_id'
|
|
16
|
+
|
|
17
|
+
attribute 'AccountBasedExpenseLineDetail.ClassRef.value',
|
|
18
|
+
resource_attribute: 'ledger_class.ledger_id'
|
|
19
|
+
|
|
20
|
+
amount 'Amount',
|
|
21
|
+
resource_attribute: :amount
|
|
22
|
+
|
|
23
|
+
attribute 'Description',
|
|
24
|
+
resource_attribute: :description
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../currency/deserializer'
|
|
4
|
+
require_relative '../department/deserializer'
|
|
5
|
+
require_relative '../bill_payment_line_item/deserializer'
|
|
6
|
+
|
|
7
|
+
module LedgerSync
|
|
8
|
+
module Ledgers
|
|
9
|
+
module QuickBooksOnline
|
|
10
|
+
class BillPayment
|
|
11
|
+
class Deserializer < QuickBooksOnline::Deserializer
|
|
12
|
+
id
|
|
13
|
+
|
|
14
|
+
amount :amount,
|
|
15
|
+
hash_attribute: 'TotalAmt'
|
|
16
|
+
|
|
17
|
+
references_one :currency,
|
|
18
|
+
hash_attribute: :CurrencyRef,
|
|
19
|
+
deserializer: Currency::Deserializer
|
|
20
|
+
|
|
21
|
+
attribute 'vendor.ledger_id',
|
|
22
|
+
hash_attribute: 'VendorRef.value'
|
|
23
|
+
|
|
24
|
+
attribute 'department.ledger_id',
|
|
25
|
+
hash_attribute: 'DepartmentRef.value'
|
|
26
|
+
|
|
27
|
+
attribute 'account.ledger_id',
|
|
28
|
+
hash_attribute: 'APAccountRef.value'
|
|
29
|
+
|
|
30
|
+
attribute :reference_number,
|
|
31
|
+
hash_attribute: 'DocNumber'
|
|
32
|
+
|
|
33
|
+
attribute :memo,
|
|
34
|
+
hash_attribute: 'PrivateNote'
|
|
35
|
+
|
|
36
|
+
attribute :exchange_rate,
|
|
37
|
+
hash_attribute: 'ExchangeRate'
|
|
38
|
+
|
|
39
|
+
date :transaction_date,
|
|
40
|
+
hash_attribute: 'TxnDate'
|
|
41
|
+
|
|
42
|
+
mapping :payment_type,
|
|
43
|
+
hash_attribute: 'PayType',
|
|
44
|
+
hash: BillPayment::PAYMENT_TYPES.invert
|
|
45
|
+
|
|
46
|
+
attribute 'credit_card_account.ledger_id',
|
|
47
|
+
hash_attribute: 'CreditCardPayment.CCAccountRef.value'
|
|
48
|
+
|
|
49
|
+
attribute 'bank_account.ledger_id',
|
|
50
|
+
hash_attribute: 'CheckPayment.BankAccountRef.value'
|
|
51
|
+
|
|
52
|
+
references_many :line_items,
|
|
53
|
+
hash_attribute: 'Line',
|
|
54
|
+
deserializer: BillPaymentLineItem::Deserializer
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillPayment
|
|
7
|
+
module Operations
|
|
8
|
+
class Create < Operation::Create
|
|
9
|
+
class Contract < LedgerSync::Ledgers::Contract
|
|
10
|
+
params do
|
|
11
|
+
required(:external_id).maybe(:string)
|
|
12
|
+
optional(:account).hash(Types::Reference)
|
|
13
|
+
required(:amount).filled(:integer)
|
|
14
|
+
optional(:bank_account).maybe(Types::Reference)
|
|
15
|
+
optional(:credit_card_account).maybe(Types::Reference)
|
|
16
|
+
required(:currency).filled(:hash, Types::Reference)
|
|
17
|
+
required(:department).hash(Types::Reference)
|
|
18
|
+
optional(:exchange_rate).maybe(:float)
|
|
19
|
+
required(:ledger_id).value(:nil)
|
|
20
|
+
required(:line_items).array(Types::Reference)
|
|
21
|
+
optional(:memo).filled(:string)
|
|
22
|
+
required(:payment_type).filled(:string)
|
|
23
|
+
optional(:reference_number).maybe(:string)
|
|
24
|
+
optional(:transaction_date).filled(:date?)
|
|
25
|
+
required(:vendor).hash(Types::Reference)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillPayment
|
|
7
|
+
module Operations
|
|
8
|
+
class Find < Operation::Find
|
|
9
|
+
class Contract < LedgerSync::Ledgers::Contract
|
|
10
|
+
schema do
|
|
11
|
+
required(:external_id).maybe(:string)
|
|
12
|
+
optional(:account).hash(Types::Reference)
|
|
13
|
+
optional(:amount).maybe(:integer)
|
|
14
|
+
optional(:bank_account).maybe(Types::Reference)
|
|
15
|
+
optional(:credit_card_account).maybe(Types::Reference)
|
|
16
|
+
required(:currency).maybe(:hash, Types::Reference)
|
|
17
|
+
optional(:department).hash(Types::Reference)
|
|
18
|
+
optional(:exchange_rate).maybe(:float)
|
|
19
|
+
required(:ledger_id).filled(:string)
|
|
20
|
+
optional(:line_items).array(Types::Reference)
|
|
21
|
+
optional(:memo).maybe(:string)
|
|
22
|
+
optional(:payment_type).maybe(:string)
|
|
23
|
+
optional(:reference_number).maybe(:string)
|
|
24
|
+
optional(:transaction_date).maybe(:date?)
|
|
25
|
+
optional(:vendor).hash(Types::Reference)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillPayment
|
|
7
|
+
module Operations
|
|
8
|
+
class Update < Operation::FullUpdate
|
|
9
|
+
class Contract < LedgerSync::Ledgers::Contract
|
|
10
|
+
schema do
|
|
11
|
+
required(:external_id).maybe(:string)
|
|
12
|
+
optional(:account).hash(Types::Reference)
|
|
13
|
+
required(:amount).filled(:integer)
|
|
14
|
+
optional(:bank_account).maybe(Types::Reference)
|
|
15
|
+
optional(:credit_card_account).maybe(Types::Reference)
|
|
16
|
+
required(:currency).filled(:hash, Types::Reference)
|
|
17
|
+
required(:department).hash(Types::Reference)
|
|
18
|
+
optional(:exchange_rate).maybe(:float)
|
|
19
|
+
required(:ledger_id).filled(:string)
|
|
20
|
+
required(:line_items).array(Types::Reference)
|
|
21
|
+
optional(:memo).filled(:string)
|
|
22
|
+
required(:payment_type).filled(:string)
|
|
23
|
+
optional(:reference_number).maybe(:string)
|
|
24
|
+
optional(:transaction_date).filled(:date?)
|
|
25
|
+
required(:vendor).hash(Types::Reference)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../currency/serializer'
|
|
4
|
+
require_relative '../department/serializer'
|
|
5
|
+
require_relative '../bill_payment_line_item/serializer'
|
|
6
|
+
|
|
7
|
+
module LedgerSync
|
|
8
|
+
module Ledgers
|
|
9
|
+
module QuickBooksOnline
|
|
10
|
+
class BillPayment
|
|
11
|
+
class Serializer < QuickBooksOnline::Serializer
|
|
12
|
+
id
|
|
13
|
+
|
|
14
|
+
amount 'TotalAmt',
|
|
15
|
+
resource_attribute: :amount
|
|
16
|
+
|
|
17
|
+
references_one :CurrencyRef,
|
|
18
|
+
resource_attribute: :currency,
|
|
19
|
+
serializer: Currency::Serializer
|
|
20
|
+
|
|
21
|
+
attribute 'VendorRef.value',
|
|
22
|
+
resource_attribute: 'vendor.ledger_id'
|
|
23
|
+
|
|
24
|
+
attribute 'DepartmentRef.value',
|
|
25
|
+
resource_attribute: 'department.ledger_id'
|
|
26
|
+
|
|
27
|
+
attribute 'APAccountRef.value',
|
|
28
|
+
resource_attribute: 'account.ledger_id'
|
|
29
|
+
|
|
30
|
+
attribute 'DocNumber',
|
|
31
|
+
resource_attribute: :reference_number
|
|
32
|
+
|
|
33
|
+
attribute 'PrivateNote',
|
|
34
|
+
resource_attribute: :memo
|
|
35
|
+
|
|
36
|
+
attribute 'ExchangeRate',
|
|
37
|
+
resource_attribute: :exchange_rate
|
|
38
|
+
|
|
39
|
+
date 'TxnDate',
|
|
40
|
+
resource_attribute: :transaction_date
|
|
41
|
+
|
|
42
|
+
mapping 'PayType',
|
|
43
|
+
resource_attribute: :payment_type,
|
|
44
|
+
hash: BillPayment::PAYMENT_TYPES
|
|
45
|
+
|
|
46
|
+
attribute 'CreditCardPayment' do |args = {}|
|
|
47
|
+
resource = args.fetch(:resource)
|
|
48
|
+
|
|
49
|
+
if resource.credit_card_account
|
|
50
|
+
{
|
|
51
|
+
'CCAccountRef' => {
|
|
52
|
+
'value' => resource.credit_card_account.ledger_id
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
attribute 'CheckPayment' do |args = {}|
|
|
59
|
+
resource = args.fetch(:resource)
|
|
60
|
+
|
|
61
|
+
if resource.bank_account
|
|
62
|
+
{
|
|
63
|
+
'BankAccountRef' => {
|
|
64
|
+
'value' => resource.bank_account.ledger_id
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
references_many 'Line',
|
|
71
|
+
resource_attribute: :line_items,
|
|
72
|
+
serializer: BillPaymentLineItem::Serializer
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillPaymentLineItem
|
|
7
|
+
class Deserializer < QuickBooksOnline::Deserializer
|
|
8
|
+
amount :amount,
|
|
9
|
+
hash_attribute: 'Amount'
|
|
10
|
+
|
|
11
|
+
attribute :ledger_transactions,
|
|
12
|
+
hash_attribute: 'LinkedTxn',
|
|
13
|
+
type: Serialization::Type::DeserializeTransactionReferenceType.new
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LedgerSync
|
|
4
|
+
module Ledgers
|
|
5
|
+
module QuickBooksOnline
|
|
6
|
+
class BillPaymentLineItem
|
|
7
|
+
class Serializer < QuickBooksOnline::Serializer
|
|
8
|
+
amount 'Amount',
|
|
9
|
+
resource_attribute: :amount
|
|
10
|
+
|
|
11
|
+
attribute 'LinkedTxn',
|
|
12
|
+
resource_attribute: :ledger_transactions,
|
|
13
|
+
type: Serialization::Type::SerializeTransactionReferenceType.new
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/ledger_sync/{adaptors/quickbooks_online/adaptor.rb → ledgers/quickbooks_online/client.rb}
RENAMED
|
@@ -4,18 +4,15 @@ require_relative 'oauth_client'
|
|
|
4
4
|
require_relative 'dashboard_url_helper'
|
|
5
5
|
|
|
6
6
|
module LedgerSync
|
|
7
|
-
module
|
|
7
|
+
module Ledgers
|
|
8
8
|
module QuickBooksOnline
|
|
9
|
-
class
|
|
9
|
+
class Client < Ledgers::Client
|
|
10
10
|
OAUTH_HEADERS = { 'Accept' => 'application/json', 'Content-Type' => 'application/json' }.freeze
|
|
11
11
|
ROOT_URI = 'https://quickbooks.api.intuit.com'
|
|
12
12
|
REVOKE_TOKEN_URI = 'https://developer.api.intuit.com/v2/oauth2/tokens/revoke'
|
|
13
13
|
ROOT_SANDBOX_URI = 'https://sandbox-quickbooks.api.intuit.com'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
LedgerSync::LedgerClass => 'class'
|
|
17
|
-
}
|
|
18
|
-
API_RESOURCE_MAPPING_OVERRIDE_REVERSE = API_RESOURCE_MAPPING_OVERRIDE.invert
|
|
14
|
+
PRODUCTION_APP_URL_BASE = 'https://qbo.intuit.com/app'
|
|
15
|
+
SANDBOX_APP_URL_BASE = 'https://app.sandbox.qbo.intuit.com/app'
|
|
19
16
|
|
|
20
17
|
attr_reader :access_token,
|
|
21
18
|
:client_id,
|
|
@@ -112,7 +109,7 @@ module LedgerSync
|
|
|
112
109
|
def refresh!
|
|
113
110
|
set_credentials_from_oauth_token(
|
|
114
111
|
token: Request.new(
|
|
115
|
-
|
|
112
|
+
client: self
|
|
116
113
|
).refresh!
|
|
117
114
|
)
|
|
118
115
|
self
|
|
@@ -120,7 +117,7 @@ module LedgerSync
|
|
|
120
117
|
|
|
121
118
|
def revoke_token!
|
|
122
119
|
headers = OAUTH_HEADERS.dup.merge('Authorization' => 'Basic ' + Base64.strict_encode64(client_id + ':' + client_secret))
|
|
123
|
-
LedgerSync::
|
|
120
|
+
LedgerSync::Ledgers::Request.new(
|
|
124
121
|
body: {
|
|
125
122
|
token: access_token
|
|
126
123
|
},
|
|
@@ -147,7 +144,7 @@ module LedgerSync
|
|
|
147
144
|
def update_secrets_in_dotenv
|
|
148
145
|
return if ENV['TEST_ENV'] && !ENV['USE_DOTENV_ADAPTOR_SECRETS']
|
|
149
146
|
|
|
150
|
-
filename = File.join(
|
|
147
|
+
filename = File.join(Dir.pwd, '.env')
|
|
151
148
|
return unless File.exist?(filename)
|
|
152
149
|
|
|
153
150
|
prefix = 'QUICKBOOKS_ONLINE_'
|
|
@@ -155,11 +152,11 @@ module LedgerSync
|
|
|
155
152
|
Tempfile.open(".#{File.basename(filename)}", File.dirname(filename)) do |tempfile|
|
|
156
153
|
File.open(filename).each do |line|
|
|
157
154
|
env_key = line.split('=').first
|
|
158
|
-
|
|
155
|
+
client_method = env_key.split(prefix).last.downcase
|
|
159
156
|
|
|
160
|
-
if line =~ /\A#{prefix}/ && respond_to?(
|
|
157
|
+
if line =~ /\A#{prefix}/ && respond_to?(client_method)
|
|
161
158
|
env_value = ENV[env_key]
|
|
162
|
-
new_value = send(
|
|
159
|
+
new_value = send(client_method)
|
|
163
160
|
tempfile.puts "#{env_key}=#{new_value}"
|
|
164
161
|
next if env_value == new_value
|
|
165
162
|
|
|
@@ -177,15 +174,22 @@ module LedgerSync
|
|
|
177
174
|
end
|
|
178
175
|
|
|
179
176
|
def url_for(resource:)
|
|
180
|
-
DashboardURLHelper.new(
|
|
177
|
+
DashboardURLHelper.new(
|
|
178
|
+
resource: resource,
|
|
179
|
+
base_url: (test ? SANDBOX_APP_URL_BASE : PRODUCTION_APP_URL_BASE)
|
|
180
|
+
).url
|
|
181
181
|
end
|
|
182
182
|
|
|
183
183
|
def self.ledger_attributes_to_save
|
|
184
184
|
%i[access_token expires_at refresh_token refresh_token_expires_at]
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
-
def self.
|
|
188
|
-
|
|
187
|
+
def self.ledger_resource_type_overrides
|
|
188
|
+
{
|
|
189
|
+
Expense => 'purchase',
|
|
190
|
+
LedgerClass => 'class',
|
|
191
|
+
Preferences => 'preferences'
|
|
192
|
+
}
|
|
189
193
|
end
|
|
190
194
|
|
|
191
195
|
def self.new_from_env(**override)
|
|
@@ -218,10 +222,6 @@ module LedgerSync
|
|
|
218
222
|
)
|
|
219
223
|
end
|
|
220
224
|
|
|
221
|
-
def self.resource_from_ledger_type(type:)
|
|
222
|
-
API_RESOURCE_MAPPING_OVERRIDE_REVERSE[type.downcase] || LedgerSync.resources[type.downcase.to_sym]
|
|
223
|
-
end
|
|
224
|
-
|
|
225
225
|
private
|
|
226
226
|
|
|
227
227
|
def oauth_base_uri
|
|
@@ -230,7 +230,7 @@ module LedgerSync
|
|
|
230
230
|
|
|
231
231
|
def request(body: nil, headers: {}, method:, url:)
|
|
232
232
|
Request.new(
|
|
233
|
-
|
|
233
|
+
client: self,
|
|
234
234
|
body: body,
|
|
235
235
|
headers: headers,
|
|
236
236
|
method: method,
|