netsuite-soap 2025.2.3
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 +7 -0
- data/.envrc +9 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/dependabot.yml +14 -0
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/main.yml +55 -0
- data/.github/workflows/publish.yml +53 -0
- data/.gitignore +23 -0
- data/.rspec +6 -0
- data/.ruby-version +1 -0
- data/.tool-versions +1 -0
- data/AGENTS.md +150 -0
- data/CLAUDE.md +111 -0
- data/DEVELOPMENT.md +34 -0
- data/Gemfile +10 -0
- data/HISTORY.md +171 -0
- data/LICENSE +22 -0
- data/README.md +87 -0
- data/Rakefile +130 -0
- data/docs/async.md +46 -0
- data/docs/configuration.md +88 -0
- data/docs/contributing.md +36 -0
- data/docs/usage.md +149 -0
- data/lib/netsuite/actions/abstract_action.rb +32 -0
- data/lib/netsuite/actions/add.rb +93 -0
- data/lib/netsuite/actions/async_add_list.rb +74 -0
- data/lib/netsuite/actions/async_delete_list.rb +40 -0
- data/lib/netsuite/actions/async_get_list.rb +46 -0
- data/lib/netsuite/actions/async_initialize_list.rb +85 -0
- data/lib/netsuite/actions/async_response.rb +52 -0
- data/lib/netsuite/actions/async_search.rb +36 -0
- data/lib/netsuite/actions/async_update_list.rb +53 -0
- data/lib/netsuite/actions/async_upsert_list.rb +53 -0
- data/lib/netsuite/actions/attach_file.rb +87 -0
- data/lib/netsuite/actions/check_async_status.rb +29 -0
- data/lib/netsuite/actions/delete.rb +102 -0
- data/lib/netsuite/actions/delete_list.rb +108 -0
- data/lib/netsuite/actions/get.rb +87 -0
- data/lib/netsuite/actions/get_all.rb +78 -0
- data/lib/netsuite/actions/get_async_result.rb +35 -0
- data/lib/netsuite/actions/get_deleted.rb +92 -0
- data/lib/netsuite/actions/get_list.rb +98 -0
- data/lib/netsuite/actions/get_select_value.rb +80 -0
- data/lib/netsuite/actions/initialize.rb +86 -0
- data/lib/netsuite/actions/search.rb +265 -0
- data/lib/netsuite/actions/update.rb +86 -0
- data/lib/netsuite/actions/update_list.rb +113 -0
- data/lib/netsuite/actions/upsert.rb +86 -0
- data/lib/netsuite/actions/upsert_list.rb +118 -0
- data/lib/netsuite/client.rb +19 -0
- data/lib/netsuite/configuration.rb +470 -0
- data/lib/netsuite/errors.rb +18 -0
- data/lib/netsuite/namespaces/act_sched.rb +11 -0
- data/lib/netsuite/namespaces/comm_general.rb +11 -0
- data/lib/netsuite/namespaces/file_cabinet.rb +11 -0
- data/lib/netsuite/namespaces/list_acct.rb +11 -0
- data/lib/netsuite/namespaces/list_emp.rb +12 -0
- data/lib/netsuite/namespaces/list_mkt.rb +12 -0
- data/lib/netsuite/namespaces/list_rel.rb +11 -0
- data/lib/netsuite/namespaces/list_support.rb +11 -0
- data/lib/netsuite/namespaces/list_website.rb +11 -0
- data/lib/netsuite/namespaces/platform_common.rb +11 -0
- data/lib/netsuite/namespaces/platform_core.rb +11 -0
- data/lib/netsuite/namespaces/setup_custom.rb +11 -0
- data/lib/netsuite/namespaces/tran_bank.rb +11 -0
- data/lib/netsuite/namespaces/tran_cust.rb +11 -0
- data/lib/netsuite/namespaces/tran_emp.rb +11 -0
- data/lib/netsuite/namespaces/tran_general.rb +11 -0
- data/lib/netsuite/namespaces/tran_invt.rb +11 -0
- data/lib/netsuite/namespaces/tran_purch.rb +11 -0
- data/lib/netsuite/namespaces/tran_sales.rb +11 -0
- data/lib/netsuite/passports/token.rb +55 -0
- data/lib/netsuite/passports/user.rb +25 -0
- data/lib/netsuite/records/account.rb +30 -0
- data/lib/netsuite/records/accounting_period.rb +25 -0
- data/lib/netsuite/records/address.rb +46 -0
- data/lib/netsuite/records/assembly_build.rb +39 -0
- data/lib/netsuite/records/assembly_component.rb +26 -0
- data/lib/netsuite/records/assembly_component_list.rb +12 -0
- data/lib/netsuite/records/assembly_item.rb +66 -0
- data/lib/netsuite/records/assembly_unbuild.rb +37 -0
- data/lib/netsuite/records/base_ref_list.rb +17 -0
- data/lib/netsuite/records/bill_address.rb +17 -0
- data/lib/netsuite/records/billing_schedule.rb +33 -0
- data/lib/netsuite/records/billing_schedule_milestone.rb +28 -0
- data/lib/netsuite/records/billing_schedule_milestone_list.rb +14 -0
- data/lib/netsuite/records/billing_schedule_recurrence.rb +28 -0
- data/lib/netsuite/records/billing_schedule_recurrence_list.rb +14 -0
- data/lib/netsuite/records/bin.rb +30 -0
- data/lib/netsuite/records/bin_number.rb +18 -0
- data/lib/netsuite/records/bin_number_list.rb +11 -0
- data/lib/netsuite/records/bin_transfer.rb +38 -0
- data/lib/netsuite/records/bin_transfer_inventory.rb +20 -0
- data/lib/netsuite/records/bin_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/campaign.rb +28 -0
- data/lib/netsuite/records/cash_refund.rb +135 -0
- data/lib/netsuite/records/cash_refund_item.rb +32 -0
- data/lib/netsuite/records/cash_refund_item_list.rb +13 -0
- data/lib/netsuite/records/cash_sale.rb +51 -0
- data/lib/netsuite/records/cash_sale_item.rb +40 -0
- data/lib/netsuite/records/cash_sale_item_list.rb +13 -0
- data/lib/netsuite/records/classification.rb +30 -0
- data/lib/netsuite/records/contact.rb +44 -0
- data/lib/netsuite/records/contact_access_roles.rb +23 -0
- data/lib/netsuite/records/contact_access_roles_list.rb +9 -0
- data/lib/netsuite/records/contact_addressbook.rb +64 -0
- data/lib/netsuite/records/contact_addressbook_list.rb +11 -0
- data/lib/netsuite/records/contact_list.rb +49 -0
- data/lib/netsuite/records/contact_role.rb +23 -0
- data/lib/netsuite/records/cost_category.rb +28 -0
- data/lib/netsuite/records/credit_memo.rb +59 -0
- data/lib/netsuite/records/credit_memo_apply.rb +16 -0
- data/lib/netsuite/records/credit_memo_apply_list.rb +15 -0
- data/lib/netsuite/records/credit_memo_item.rb +34 -0
- data/lib/netsuite/records/credit_memo_item_list.rb +11 -0
- data/lib/netsuite/records/currency.rb +30 -0
- data/lib/netsuite/records/currency_rate.rb +34 -0
- data/lib/netsuite/records/custom_field.rb +23 -0
- data/lib/netsuite/records/custom_field_list.rb +186 -0
- data/lib/netsuite/records/custom_list.rb +27 -0
- data/lib/netsuite/records/custom_list_custom_value.rb +22 -0
- data/lib/netsuite/records/custom_list_custom_value_list.rb +13 -0
- data/lib/netsuite/records/custom_record.rb +56 -0
- data/lib/netsuite/records/custom_record_ref.rb +50 -0
- data/lib/netsuite/records/custom_record_type.rb +30 -0
- data/lib/netsuite/records/customer.rb +265 -0
- data/lib/netsuite/records/customer_addressbook.rb +64 -0
- data/lib/netsuite/records/customer_addressbook_list.rb +11 -0
- data/lib/netsuite/records/customer_category.rb +26 -0
- data/lib/netsuite/records/customer_credit_cards.rb +36 -0
- data/lib/netsuite/records/customer_credit_cards_list.rb +10 -0
- data/lib/netsuite/records/customer_currency.rb +28 -0
- data/lib/netsuite/records/customer_currency_list.rb +9 -0
- data/lib/netsuite/records/customer_deposit.rb +47 -0
- data/lib/netsuite/records/customer_deposit_apply.rb +17 -0
- data/lib/netsuite/records/customer_deposit_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_partner.rb +24 -0
- data/lib/netsuite/records/customer_partners_list.rb +9 -0
- data/lib/netsuite/records/customer_payment.rb +56 -0
- data/lib/netsuite/records/customer_payment_apply.rb +17 -0
- data/lib/netsuite/records/customer_payment_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_payment_credit.rb +17 -0
- data/lib/netsuite/records/customer_payment_credit_list.rb +12 -0
- data/lib/netsuite/records/customer_refund.rb +52 -0
- data/lib/netsuite/records/customer_refund_apply.rb +16 -0
- data/lib/netsuite/records/customer_refund_apply_list.rb +12 -0
- data/lib/netsuite/records/customer_refund_deposit.rb +16 -0
- data/lib/netsuite/records/customer_refund_deposit_list.rb +11 -0
- data/lib/netsuite/records/customer_sales_team.rb +24 -0
- data/lib/netsuite/records/customer_sales_team_list.rb +9 -0
- data/lib/netsuite/records/customer_status.rb +29 -0
- data/lib/netsuite/records/department.rb +27 -0
- data/lib/netsuite/records/deposit.rb +40 -0
- data/lib/netsuite/records/deposit_application.rb +64 -0
- data/lib/netsuite/records/deposit_cash_back.rb +42 -0
- data/lib/netsuite/records/deposit_cash_back_list.rb +9 -0
- data/lib/netsuite/records/deposit_other.rb +35 -0
- data/lib/netsuite/records/deposit_other_list.rb +9 -0
- data/lib/netsuite/records/deposit_payment.rb +48 -0
- data/lib/netsuite/records/deposit_payment_list.rb +14 -0
- data/lib/netsuite/records/description_item.rb +34 -0
- data/lib/netsuite/records/discount_item.rb +37 -0
- data/lib/netsuite/records/duration.rb +15 -0
- data/lib/netsuite/records/employee.rb +42 -0
- data/lib/netsuite/records/entity_custom_field.rb +53 -0
- data/lib/netsuite/records/estimate.rb +122 -0
- data/lib/netsuite/records/estimate_item.rb +47 -0
- data/lib/netsuite/records/estimate_item_list.rb +11 -0
- data/lib/netsuite/records/file.rb +31 -0
- data/lib/netsuite/records/folder.rb +26 -0
- data/lib/netsuite/records/gift_cert_redemption.rb +22 -0
- data/lib/netsuite/records/gift_cert_redemption_list.rb +11 -0
- data/lib/netsuite/records/gift_certificate.rb +30 -0
- data/lib/netsuite/records/gift_certificate_item.rb +84 -0
- data/lib/netsuite/records/inbound_shipment.rb +32 -0
- data/lib/netsuite/records/inbound_shipment_item.rb +39 -0
- data/lib/netsuite/records/inbound_shipment_item_list.rb +11 -0
- data/lib/netsuite/records/inter_company_journal_entry.rb +48 -0
- data/lib/netsuite/records/inter_company_journal_entry_line.rb +28 -0
- data/lib/netsuite/records/inter_company_journal_entry_line_list.rb +12 -0
- data/lib/netsuite/records/inventory_adjustment.rb +30 -0
- data/lib/netsuite/records/inventory_adjustment_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_adjustment_inventory_list.rb +10 -0
- data/lib/netsuite/records/inventory_assignment.rb +24 -0
- data/lib/netsuite/records/inventory_assignment_list.rb +35 -0
- data/lib/netsuite/records/inventory_detail.rb +18 -0
- data/lib/netsuite/records/inventory_item.rb +341 -0
- data/lib/netsuite/records/inventory_number.rb +34 -0
- data/lib/netsuite/records/inventory_number_locations.rb +16 -0
- data/lib/netsuite/records/inventory_number_locations_list.rb +10 -0
- data/lib/netsuite/records/inventory_transfer.rb +30 -0
- data/lib/netsuite/records/inventory_transfer_inventory.rb +21 -0
- data/lib/netsuite/records/inventory_transfer_inventory_list.rb +10 -0
- data/lib/netsuite/records/invoice.rb +167 -0
- data/lib/netsuite/records/invoice_item.rb +46 -0
- data/lib/netsuite/records/invoice_item_list.rb +15 -0
- data/lib/netsuite/records/item_availability.rb +45 -0
- data/lib/netsuite/records/item_fulfillment.rb +62 -0
- data/lib/netsuite/records/item_fulfillment_item.rb +45 -0
- data/lib/netsuite/records/item_fulfillment_item_list.rb +14 -0
- data/lib/netsuite/records/item_fulfillment_package.rb +24 -0
- data/lib/netsuite/records/item_fulfillment_package_fed_ex.rb +28 -0
- data/lib/netsuite/records/item_fulfillment_package_fed_ex_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_list.rb +37 -0
- data/lib/netsuite/records/item_fulfillment_package_ups.rb +27 -0
- data/lib/netsuite/records/item_fulfillment_package_ups_list.rb +32 -0
- data/lib/netsuite/records/item_fulfillment_package_usps.rb +26 -0
- data/lib/netsuite/records/item_fulfillment_package_usps_list.rb +32 -0
- data/lib/netsuite/records/item_group.rb +37 -0
- data/lib/netsuite/records/item_member.rb +26 -0
- data/lib/netsuite/records/item_member_list.rb +12 -0
- data/lib/netsuite/records/item_option_custom_field.rb +52 -0
- data/lib/netsuite/records/item_receipt.rb +46 -0
- data/lib/netsuite/records/item_receipt_item.rb +43 -0
- data/lib/netsuite/records/item_receipt_item_list.rb +11 -0
- data/lib/netsuite/records/item_vendor.rb +24 -0
- data/lib/netsuite/records/item_vendor_list.rb +11 -0
- data/lib/netsuite/records/job.rb +41 -0
- data/lib/netsuite/records/job_status.rb +25 -0
- data/lib/netsuite/records/journal_entry.rb +48 -0
- data/lib/netsuite/records/journal_entry_line.rb +27 -0
- data/lib/netsuite/records/journal_entry_line_list.rb +12 -0
- data/lib/netsuite/records/kit_item.rb +71 -0
- data/lib/netsuite/records/location.rb +40 -0
- data/lib/netsuite/records/locations_list.rb +15 -0
- data/lib/netsuite/records/lot_numbered_assembly_item.rb +64 -0
- data/lib/netsuite/records/lot_numbered_inventory_item.rb +260 -0
- data/lib/netsuite/records/matrix_option_list.rb +71 -0
- data/lib/netsuite/records/member_list.rb +10 -0
- data/lib/netsuite/records/message.rb +30 -0
- data/lib/netsuite/records/non_inventory_purchase_item.rb +52 -0
- data/lib/netsuite/records/non_inventory_resale_item.rb +189 -0
- data/lib/netsuite/records/non_inventory_sale_item.rb +165 -0
- data/lib/netsuite/records/note.rb +33 -0
- data/lib/netsuite/records/note_type.rb +27 -0
- data/lib/netsuite/records/null_field_list.rb +15 -0
- data/lib/netsuite/records/opportunity.rb +45 -0
- data/lib/netsuite/records/opportunity_item.rb +41 -0
- data/lib/netsuite/records/opportunity_item_list.rb +9 -0
- data/lib/netsuite/records/other_charge_sale_item.rb +73 -0
- data/lib/netsuite/records/partner.rb +35 -0
- data/lib/netsuite/records/payment_item.rb +36 -0
- data/lib/netsuite/records/payment_method.rb +28 -0
- data/lib/netsuite/records/payroll_item.rb +36 -0
- data/lib/netsuite/records/phone_call.rb +29 -0
- data/lib/netsuite/records/price.rb +17 -0
- data/lib/netsuite/records/price_level.rb +26 -0
- data/lib/netsuite/records/price_list.rb +9 -0
- data/lib/netsuite/records/pricing.rb +20 -0
- data/lib/netsuite/records/pricing_matrix.rb +11 -0
- data/lib/netsuite/records/promotion_code.rb +38 -0
- data/lib/netsuite/records/promotions.rb +26 -0
- data/lib/netsuite/records/promotions_list.rb +9 -0
- data/lib/netsuite/records/purchase_order.rb +52 -0
- data/lib/netsuite/records/purchase_order_item.rb +42 -0
- data/lib/netsuite/records/purchase_order_item_list.rb +11 -0
- data/lib/netsuite/records/record_ref.rb +38 -0
- data/lib/netsuite/records/record_ref_list.rb +22 -0
- data/lib/netsuite/records/return_authorization.rb +135 -0
- data/lib/netsuite/records/return_authorization_item.rb +43 -0
- data/lib/netsuite/records/return_authorization_item_list.rb +11 -0
- data/lib/netsuite/records/rev_rec_schedule.rb +32 -0
- data/lib/netsuite/records/rev_rec_template.rb +25 -0
- data/lib/netsuite/records/role_list.rb +24 -0
- data/lib/netsuite/records/roles.rb +17 -0
- data/lib/netsuite/records/sales_order.rb +61 -0
- data/lib/netsuite/records/sales_order_item.rb +49 -0
- data/lib/netsuite/records/sales_order_item_list.rb +11 -0
- data/lib/netsuite/records/sales_order_ship_group_list.rb +11 -0
- data/lib/netsuite/records/sales_role.rb +26 -0
- data/lib/netsuite/records/sales_tax_item.rb +34 -0
- data/lib/netsuite/records/serialized_assembly_item.rb +240 -0
- data/lib/netsuite/records/serialized_inventory_item.rb +248 -0
- data/lib/netsuite/records/serialized_inventory_item_location.rb +36 -0
- data/lib/netsuite/records/serialized_inventory_item_locations_list.rb +10 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers.rb +15 -0
- data/lib/netsuite/records/serialized_inventory_item_numbers_list.rb +10 -0
- data/lib/netsuite/records/service_resale_item.rb +154 -0
- data/lib/netsuite/records/service_sale_item.rb +50 -0
- data/lib/netsuite/records/ship_address.rb +17 -0
- data/lib/netsuite/records/site_category.rb +33 -0
- data/lib/netsuite/records/subscription.rb +18 -0
- data/lib/netsuite/records/subscriptions_list.rb +10 -0
- data/lib/netsuite/records/subsidiary.rb +38 -0
- data/lib/netsuite/records/subtotal_item.rb +34 -0
- data/lib/netsuite/records/support_case.rb +32 -0
- data/lib/netsuite/records/support_case_type.rb +26 -0
- data/lib/netsuite/records/task.rb +31 -0
- data/lib/netsuite/records/tax_group.rb +35 -0
- data/lib/netsuite/records/tax_type.rb +22 -0
- data/lib/netsuite/records/term.rb +27 -0
- data/lib/netsuite/records/time_bill.rb +32 -0
- data/lib/netsuite/records/transaction_body_custom_field.rb +61 -0
- data/lib/netsuite/records/transaction_column_custom_field.rb +59 -0
- data/lib/netsuite/records/transaction_ship_group.rb +40 -0
- data/lib/netsuite/records/transfer_order.rb +45 -0
- data/lib/netsuite/records/transfer_order_item.rb +43 -0
- data/lib/netsuite/records/transfer_order_item_list.rb +11 -0
- data/lib/netsuite/records/translation.rb +17 -0
- data/lib/netsuite/records/translation_list.rb +11 -0
- data/lib/netsuite/records/units_type.rb +25 -0
- data/lib/netsuite/records/units_type_uom.rb +20 -0
- data/lib/netsuite/records/units_type_uom_list.rb +12 -0
- data/lib/netsuite/records/vendor.rb +46 -0
- data/lib/netsuite/records/vendor_bill.rb +53 -0
- data/lib/netsuite/records/vendor_bill_expense.rb +40 -0
- data/lib/netsuite/records/vendor_bill_expense_list.rb +13 -0
- data/lib/netsuite/records/vendor_bill_item.rb +46 -0
- data/lib/netsuite/records/vendor_bill_item_list.rb +12 -0
- data/lib/netsuite/records/vendor_category.rb +26 -0
- data/lib/netsuite/records/vendor_credit.rb +54 -0
- data/lib/netsuite/records/vendor_credit_apply.rb +18 -0
- data/lib/netsuite/records/vendor_credit_apply_list.rb +12 -0
- data/lib/netsuite/records/vendor_credit_expense.rb +31 -0
- data/lib/netsuite/records/vendor_credit_expense_list.rb +12 -0
- data/lib/netsuite/records/vendor_credit_item.rb +34 -0
- data/lib/netsuite/records/vendor_credit_item_list.rb +12 -0
- data/lib/netsuite/records/vendor_currency.rb +26 -0
- data/lib/netsuite/records/vendor_currency_list.rb +9 -0
- data/lib/netsuite/records/vendor_payment.rb +52 -0
- data/lib/netsuite/records/vendor_payment_apply.rb +16 -0
- data/lib/netsuite/records/vendor_payment_apply_list.rb +12 -0
- data/lib/netsuite/records/vendor_return_authorization.rb +30 -0
- data/lib/netsuite/records/vendor_return_authorization_item.rb +23 -0
- data/lib/netsuite/records/vendor_return_authorization_item_list.rb +12 -0
- data/lib/netsuite/records/work_order.rb +45 -0
- data/lib/netsuite/records/work_order_item.rb +30 -0
- data/lib/netsuite/records/work_order_item_list.rb +11 -0
- data/lib/netsuite/response.rb +20 -0
- data/lib/netsuite/rest/utilities/request.rb +62 -0
- data/lib/netsuite/rest/utilities/roles.rb +47 -0
- data/lib/netsuite/support/actions.rb +74 -0
- data/lib/netsuite/support/attributes.rb +22 -0
- data/lib/netsuite/support/country.rb +289 -0
- data/lib/netsuite/support/fields.rb +86 -0
- data/lib/netsuite/support/record_refs.rb +30 -0
- data/lib/netsuite/support/records.rb +89 -0
- data/lib/netsuite/support/requests.rb +56 -0
- data/lib/netsuite/support/search_result.rb +150 -0
- data/lib/netsuite/support/sublist.rb +71 -0
- data/lib/netsuite/utilities/data_center.rb +53 -0
- data/lib/netsuite/utilities/strings.rb +15 -0
- data/lib/netsuite/utilities.rb +324 -0
- data/lib/netsuite/version.rb +3 -0
- data/lib/netsuite.rb +348 -0
- data/netsuite.gemspec +30 -0
- data/spec/integration/soap_http_spec.rb +76 -0
- data/spec/netsuite/actions/add_spec.rb +155 -0
- data/spec/netsuite/actions/async_add_list_spec.rb +123 -0
- data/spec/netsuite/actions/async_delete_list_spec.rb +60 -0
- data/spec/netsuite/actions/async_get_list_spec.rb +78 -0
- data/spec/netsuite/actions/async_initialize_list_spec.rb +106 -0
- data/spec/netsuite/actions/async_lifecycle_spec.rb +51 -0
- data/spec/netsuite/actions/async_response_spec.rb +187 -0
- data/spec/netsuite/actions/async_search_spec.rb +27 -0
- data/spec/netsuite/actions/async_update_list_spec.rb +80 -0
- data/spec/netsuite/actions/async_upsert_list_spec.rb +157 -0
- data/spec/netsuite/actions/attach_file_spec.rb +59 -0
- data/spec/netsuite/actions/check_async_status_spec.rb +29 -0
- data/spec/netsuite/actions/delete_list_spec.rb +86 -0
- data/spec/netsuite/actions/delete_spec.rb +93 -0
- data/spec/netsuite/actions/get_all_spec.rb +100 -0
- data/spec/netsuite/actions/get_async_result_spec.rb +78 -0
- data/spec/netsuite/actions/get_deleted_spec.rb +60 -0
- data/spec/netsuite/actions/get_list_spec.rb +157 -0
- data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
- data/spec/netsuite/actions/get_spec.rb +72 -0
- data/spec/netsuite/actions/initialize_spec.rb +34 -0
- data/spec/netsuite/actions/search_spec.rb +387 -0
- data/spec/netsuite/actions/update_list_spec.rb +107 -0
- data/spec/netsuite/actions/update_spec.rb +133 -0
- data/spec/netsuite/actions/upsert_list_spec.rb +112 -0
- data/spec/netsuite/actions/upsert_spec.rb +117 -0
- data/spec/netsuite/configuration_spec.rb +661 -0
- data/spec/netsuite/records/account_spec.rb +107 -0
- data/spec/netsuite/records/accounting_period_spec.rb +138 -0
- data/spec/netsuite/records/address_spec.rb +139 -0
- data/spec/netsuite/records/assembly_item_spec.rb +64 -0
- data/spec/netsuite/records/basic_record_spec.rb +128 -0
- data/spec/netsuite/records/bill_address_spec.rb +52 -0
- data/spec/netsuite/records/billing_schedule_milestone_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_milestone_spec.rb +51 -0
- data/spec/netsuite/records/billing_schedule_recurrence_list_spec.rb +24 -0
- data/spec/netsuite/records/billing_schedule_recurrence_spec.rb +49 -0
- data/spec/netsuite/records/billing_schedule_spec.rb +164 -0
- data/spec/netsuite/records/bin_number_spec.rb +23 -0
- data/spec/netsuite/records/campaign_spec.rb +43 -0
- data/spec/netsuite/records/cash_refund_item_list_spec.rb +27 -0
- data/spec/netsuite/records/cash_refund_item_spec.rb +27 -0
- data/spec/netsuite/records/cash_refund_spec.rb +152 -0
- data/spec/netsuite/records/cash_sale_item_list_spec.rb +27 -0
- data/spec/netsuite/records/cash_sale_item_spec.rb +23 -0
- data/spec/netsuite/records/cash_sale_spec.rb +34 -0
- data/spec/netsuite/records/classification_spec.rb +77 -0
- data/spec/netsuite/records/cost_category_spec.rb +105 -0
- data/spec/netsuite/records/credit_memo_apply_list_spec.rb +27 -0
- data/spec/netsuite/records/credit_memo_apply_spec.rb +14 -0
- data/spec/netsuite/records/credit_memo_item_list_spec.rb +26 -0
- data/spec/netsuite/records/credit_memo_item_spec.rb +29 -0
- data/spec/netsuite/records/credit_memo_spec.rb +213 -0
- data/spec/netsuite/records/currency_rate_spec.rb +45 -0
- data/spec/netsuite/records/custom_field_list_spec.rb +276 -0
- data/spec/netsuite/records/custom_list_spec.rb +21 -0
- data/spec/netsuite/records/custom_record_spec.rb +125 -0
- data/spec/netsuite/records/custom_record_type_spec.rb +114 -0
- data/spec/netsuite/records/customer_addressbook_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_addressbook_spec.rb +105 -0
- data/spec/netsuite/records/customer_credit_cards_list_spec.rb +23 -0
- data/spec/netsuite/records/customer_payment_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_payment_credit_list_spec.rb +26 -0
- data/spec/netsuite/records/customer_payment_spec.rb +168 -0
- data/spec/netsuite/records/customer_refund_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_refund_apply_spec.rb +14 -0
- data/spec/netsuite/records/customer_refund_deposit_list_spec.rb +25 -0
- data/spec/netsuite/records/customer_refund_deposit_spec.rb +14 -0
- data/spec/netsuite/records/customer_refund_spec.rb +205 -0
- data/spec/netsuite/records/customer_sales_team_list_spec.rb +41 -0
- data/spec/netsuite/records/customer_spec.rb +561 -0
- data/spec/netsuite/records/department_spec.rb +103 -0
- data/spec/netsuite/records/deposit_spec.rb +165 -0
- data/spec/netsuite/records/discount_item_spec.rb +125 -0
- data/spec/netsuite/records/duration_spec.rb +14 -0
- data/spec/netsuite/records/employee_spec.rb +148 -0
- data/spec/netsuite/records/entity_custom_field_spec.rb +34 -0
- data/spec/netsuite/records/estimate_item_list_spec.rb +26 -0
- data/spec/netsuite/records/estimate_item_spec.rb +35 -0
- data/spec/netsuite/records/estimate_spec.rb +274 -0
- data/spec/netsuite/records/file_spec.rb +11 -0
- data/spec/netsuite/records/folder_spec.rb +33 -0
- data/spec/netsuite/records/gift_cert_redemption_list_spec.rb +26 -0
- data/spec/netsuite/records/gift_cert_redemption_spec.rb +21 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/inter_company_journal_entry_line_spec.rb +60 -0
- data/spec/netsuite/records/inter_company_journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/inventory_assignment_list_spec.rb +59 -0
- data/spec/netsuite/records/inventory_assignment_spec.rb +21 -0
- data/spec/netsuite/records/inventory_detail_spec.rb +13 -0
- data/spec/netsuite/records/inventory_item_spec.rb +532 -0
- data/spec/netsuite/records/inventory_transfer_spec.rb +79 -0
- data/spec/netsuite/records/invoice_item_list_spec.rb +24 -0
- data/spec/netsuite/records/invoice_item_spec.rb +79 -0
- data/spec/netsuite/records/invoice_spec.rb +494 -0
- data/spec/netsuite/records/item_availability_spec.rb +59 -0
- data/spec/netsuite/records/item_fulfillment_package_fed_ex_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_ups_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_package_usps_list_spec.rb +27 -0
- data/spec/netsuite/records/item_fulfillment_spec.rb +49 -0
- data/spec/netsuite/records/item_group_spec.rb +117 -0
- data/spec/netsuite/records/item_member_list_spec.rb +26 -0
- data/spec/netsuite/records/item_option_custom_field_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_list_spec.rb +27 -0
- data/spec/netsuite/records/item_vendor_spec.rb +27 -0
- data/spec/netsuite/records/job_spec.rb +201 -0
- data/spec/netsuite/records/journal_entry_line_list_spec.rb +26 -0
- data/spec/netsuite/records/journal_entry_line_spec.rb +59 -0
- data/spec/netsuite/records/journal_entry_spec.rb +156 -0
- data/spec/netsuite/records/kit_item_spec.rb +117 -0
- data/spec/netsuite/records/location_spec.rb +51 -0
- data/spec/netsuite/records/lot_numbered_inventory_item_spec.rb +247 -0
- data/spec/netsuite/records/matrix_option_list_spec.rb +61 -0
- data/spec/netsuite/records/message_spec.rb +49 -0
- data/spec/netsuite/records/non_inventory_resale_item_spec.rb +300 -0
- data/spec/netsuite/records/non_inventory_sale_item_spec.rb +278 -0
- data/spec/netsuite/records/note_spec.rb +134 -0
- data/spec/netsuite/records/note_type_spec.rb +88 -0
- data/spec/netsuite/records/null_field_list_spec.rb +30 -0
- data/spec/netsuite/records/partner_spec.rb +143 -0
- data/spec/netsuite/records/payment_item_spec.rb +117 -0
- data/spec/netsuite/records/payment_method_spec.rb +49 -0
- data/spec/netsuite/records/phone_call_spec.rb +17 -0
- data/spec/netsuite/records/pomo_code_spec.rb +40 -0
- data/spec/netsuite/records/price_level_spec.rb +16 -0
- data/spec/netsuite/records/pricing_matrix_spec.rb +27 -0
- data/spec/netsuite/records/record_ref_spec.rb +87 -0
- data/spec/netsuite/records/return_authorization_item_list_spec.rb +26 -0
- data/spec/netsuite/records/return_authorization_item_spec.rb +31 -0
- data/spec/netsuite/records/return_authorization_spec.rb +62 -0
- data/spec/netsuite/records/rev_rec_template_spec.rb +39 -0
- data/spec/netsuite/records/sales_order_item_list_spec.rb +26 -0
- data/spec/netsuite/records/sales_order_item_spec.rb +36 -0
- data/spec/netsuite/records/sales_order_spec.rb +250 -0
- data/spec/netsuite/records/sales_tax_item_spec.rb +26 -0
- data/spec/netsuite/records/service_resale_item_spec.rb +239 -0
- data/spec/netsuite/records/service_sale_item_spec.rb +135 -0
- data/spec/netsuite/records/ship_address_spec.rb +36 -0
- data/spec/netsuite/records/site_category_spec.rb +51 -0
- data/spec/netsuite/records/subscription_spec.rb +37 -0
- data/spec/netsuite/records/subscriptions_list_spec.rb +19 -0
- data/spec/netsuite/records/subsidiary_spec.rb +25 -0
- data/spec/netsuite/records/support_case_spec.rb +157 -0
- data/spec/netsuite/records/support_case_type_spec.rb +22 -0
- data/spec/netsuite/records/tax_type_spec.rb +11 -0
- data/spec/netsuite/records/term_spec.rb +96 -0
- data/spec/netsuite/records/transaction_body_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/transaction_column_custom_field_spec.rb +32 -0
- data/spec/netsuite/records/translation_list_spec.rb +34 -0
- data/spec/netsuite/records/translation_spec.rb +28 -0
- data/spec/netsuite/records/units_type_spec.rb +33 -0
- data/spec/netsuite/records/units_type_uom_list_spec.rb +23 -0
- data/spec/netsuite/records/units_type_uom_spec.rb +14 -0
- data/spec/netsuite/records/vendor_bill_expense_list_spec.rb +36 -0
- data/spec/netsuite/records/vendor_bill_expense_spec.rb +72 -0
- data/spec/netsuite/records/vendor_bill_item_list_spec.rb +36 -0
- data/spec/netsuite/records/vendor_bill_item_spec.rb +118 -0
- data/spec/netsuite/records/vendor_bill_spec.rb +187 -0
- data/spec/netsuite/records/vendor_credit_spec.rb +29 -0
- data/spec/netsuite/records/vendor_payment_apply_list_spec.rb +25 -0
- data/spec/netsuite/records/vendor_payment_apply_spec.rb +15 -0
- data/spec/netsuite/records/vendor_payment_spec.rb +164 -0
- data/spec/netsuite/records/vendor_spec.rb +145 -0
- data/spec/netsuite/records/work_order_item_list_spec.rb +26 -0
- data/spec/netsuite/records/work_order_item_spec.rb +45 -0
- data/spec/netsuite/records/work_order_spec.rb +92 -0
- data/spec/netsuite/response_spec.rb +34 -0
- data/spec/netsuite/support/fields_spec.rb +107 -0
- data/spec/netsuite/support/record_refs_spec.rb +14 -0
- data/spec/netsuite/support/records_spec.rb +60 -0
- data/spec/netsuite/support/refresh_spec.rb +28 -0
- data/spec/netsuite/support/requests_spec.rb +38 -0
- data/spec/netsuite/support/search_result_spec.rb +53 -0
- data/spec/netsuite/support/sublist_spec.rb +42 -0
- data/spec/netsuite/utilities/data_center_spec.rb +110 -0
- data/spec/netsuite/utilities/request_spec.rb +29 -0
- data/spec/netsuite/utilities/roles_spec.rb +145 -0
- data/spec/netsuite/utilities_spec.rb +140 -0
- data/spec/netsuite_spec.rb +41 -0
- data/spec/spec_helper.rb +50 -0
- data/spec/support/configuration.rb +23 -0
- data/spec/support/field_matcher.rb +21 -0
- data/spec/support/fixtures/add/add_customer.xml +16 -0
- data/spec/support/fixtures/add/add_file.xml +20 -0
- data/spec/support/fixtures/add/add_invoice.xml +20 -0
- data/spec/support/fixtures/add/add_invoice_error.xml +19 -0
- data/spec/support/fixtures/add/add_invoice_multiple_errors.xml +24 -0
- data/spec/support/fixtures/async_add_list/async_add_list_pending.xml +18 -0
- data/spec/support/fixtures/async_delete_list/async_delete_list_pending.xml +18 -0
- data/spec/support/fixtures/async_get_list/async_get_list_pending.xml +18 -0
- data/spec/support/fixtures/async_initialize_list/async_initialize_list_pending.xml +18 -0
- data/spec/support/fixtures/async_search/async_search_pending.xml +18 -0
- data/spec/support/fixtures/async_update_list/async_update_list_pending.xml +18 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_customers.xml +16 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_one_customer.xml +16 -0
- data/spec/support/fixtures/async_upsert_list/async_upsert_list_with_errors.xml +21 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order.xml +16 -0
- data/spec/support/fixtures/attach/attach_file_to_sales_order_error.xml +20 -0
- data/spec/support/fixtures/check_async_status/check_async_status_pending.xml +18 -0
- data/spec/support/fixtures/custom_fields/multi_select.xml +47 -0
- data/spec/support/fixtures/delete/delete_customer.xml +16 -0
- data/spec/support/fixtures/delete/delete_customer_error.xml +21 -0
- data/spec/support/fixtures/delete/delete_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/delete_list/delete_list_customers.xml +26 -0
- data/spec/support/fixtures/delete_list/delete_list_customers_with_errors.xml +31 -0
- data/spec/support/fixtures/get/get_customer.xml +61 -0
- data/spec/support/fixtures/get/get_invoice.xml +101 -0
- data/spec/support/fixtures/get_all/get_all_currencies.xml +24 -0
- data/spec/support/fixtures/get_all/get_all_error.xml +15 -0
- data/spec/support/fixtures/get_async_result/get_async_result_finished.xml +22 -0
- data/spec/support/fixtures/get_async_result/get_async_result_upsert_list_finished.xml +26 -0
- data/spec/support/fixtures/get_async_result/get_async_result_write_list_multiple.xml +34 -0
- data/spec/support/fixtures/get_deleted/get_deleted_invoices.xml +38 -0
- data/spec/support/fixtures/get_item_availability/get_item_availability.xml +46 -0
- data/spec/support/fixtures/get_list/get_list_customer_error.xml +22 -0
- data/spec/support/fixtures/get_list/get_list_customers.xml +21 -0
- data/spec/support/fixtures/get_list/get_list_customers_multiple.xml +28 -0
- data/spec/support/fixtures/get_select_value/empty_result.xml +22 -0
- data/spec/support/fixtures/get_select_value/item_fulfillment_ship_method.xml +43 -0
- data/spec/support/fixtures/initialize/initialize_invoice_from_customer.xml +69 -0
- data/spec/support/fixtures/login/failure_concurrent_requests.xml +15 -0
- data/spec/support/fixtures/login/failure_invalid_credentials.xml +15 -0
- data/spec/support/fixtures/login/success.xml +35 -0
- data/spec/support/fixtures/search/basic_search_contact.xml +39 -0
- data/spec/support/fixtures/search/saved_search_customer.xml +54 -0
- data/spec/support/fixtures/search/saved_search_item.xml +55 -0
- data/spec/support/fixtures/search/saved_search_joined_custom_customer.xml +101 -0
- data/spec/support/fixtures/search/single_search_result.xml +46 -0
- data/spec/support/fixtures/soap/v2025_2_0/wsdl/netsuite.wsdl +2531 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/activities/scheduling.xsd +603 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/activities/schedulingTypes.xsd +198 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/documents/fileCabinet.xsd +159 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/documents/fileCabinetTypes.xsd +110 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/general/communication.xsd +210 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/general/communicationTypes.xsd +20 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/accounting.xsd +6768 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/accountingTypes.xsd +1043 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/employeeTypes.xsd +344 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/employees.xsd +518 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/marketing.xsd +528 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/marketingTypes.xsd +145 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/relationshipTypes.xsd +190 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/relationships.xsd +1658 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supplyChain.xsd +282 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supplyChainTypes.xsd +26 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/support.xsd +534 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/supportTypes.xsd +74 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/website.xsd +99 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/lists/websiteTypes.xsd +2 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/common.xsd +8411 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/commonTypes.xsd +1371 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/core.xsd +1096 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/coreTypes.xsd +877 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/faultTypes.xsd +1446 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/faults.xsd +82 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/platform/messages.xsd +664 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/setup/customization.xsd +1604 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/setup/customizationTypes.xsd +119 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/bank.xsd +212 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/bankTypes.xsd +2 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/customerTypes.xsd +99 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/customers.xsd +1131 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/demandPlanning.xsd +173 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/demandPlanningTypes.xsd +52 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/employeeTypes.xsd +10 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/employees.xsd +723 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/financial.xsd +88 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/financialTypes.xsd +9 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/general.xsd +364 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/inventory.xsd +780 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/inventoryTypes.xsd +49 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/purchaseTypes.xsd +44 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/purchases.xsd +986 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/saleTypes.xsd +754 -0
- data/spec/support/fixtures/soap/v2025_2_0/xsd/transactions/sales.xsd +2025 -0
- data/spec/support/fixtures/update/update_customer.xml +16 -0
- data/spec/support/fixtures/update/update_customer_error.xml +21 -0
- data/spec/support/fixtures/update/update_customer_multiple_errors.xml +25 -0
- data/spec/support/fixtures/update/update_invoice.xml +16 -0
- data/spec/support/fixtures/update_list/update_list_items.xml +22 -0
- data/spec/support/fixtures/update_list/update_list_one_item.xml +18 -0
- data/spec/support/fixtures/update_list/update_list_with_errors.xml +32 -0
- data/spec/support/fixtures/upsert/upsert_customer.xml +16 -0
- data/spec/support/fixtures/upsert/upsert_invoice.xml +16 -0
- data/spec/support/fixtures/upsert/upsert_invoice_error.xml +20 -0
- data/spec/support/fixtures/upsert/upsert_invoice_multiple_errors.xml +24 -0
- data/spec/support/fixtures/upsert_list/upsert_list_customers.xml +21 -0
- data/spec/support/fixtures/upsert_list/upsert_list_one_customer.xml +17 -0
- data/spec/support/fixtures/upsert_list/upsert_list_with_errors.xml +32 -0
- data/spec/support/read_only_field_matcher.rb +7 -0
- data/spec/support/record_ref_matcher.rb +25 -0
- data/spec/support/savon.rb +5 -0
- data/spec/support/search_only_field_matcher.rb +7 -0
- data/spec/support/webmock_soap_helper.rb +15 -0
- data/workflow.md +368 -0
- metadata +764 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::ReturnAuthorization do
|
|
4
|
+
let(:return_authorization) { NetSuite::Records::ReturnAuthorization.new }
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
describe '#shipping_address' do
|
|
8
|
+
it 'can be set from attributes' do
|
|
9
|
+
attributes = {
|
|
10
|
+
:country => "_unitedStates",
|
|
11
|
+
:attention => "William Sanders",
|
|
12
|
+
:addressee => "William Sanders",
|
|
13
|
+
:addr1 => "test1",
|
|
14
|
+
:addr2 => "test2",
|
|
15
|
+
:city => "San Francisco",
|
|
16
|
+
:state => "CA",
|
|
17
|
+
:zip => "94131",
|
|
18
|
+
:addr_text => "William Sanders<br>William Sanders<br>test1<br>test2<br>San Francisco CA 94131",
|
|
19
|
+
:override => false,
|
|
20
|
+
:"@xmlns:platform_common" => "urn:common_2016_1.platform.webservices.netsuite.com"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return_authorization.shipping_address = attributes
|
|
24
|
+
expect(return_authorization.shipping_address).to be_kind_of(NetSuite::Records::Address)
|
|
25
|
+
expect(return_authorization.shipping_address.addressee).to eql("William Sanders")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'can be set from a ItemVendorList object' do
|
|
29
|
+
shipping_address = NetSuite::Records::Address.new
|
|
30
|
+
return_authorization.shipping_address = shipping_address
|
|
31
|
+
expect(return_authorization.shipping_address).to eql(shipping_address)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe '#billing_address' do
|
|
36
|
+
it 'can be set from attributes' do
|
|
37
|
+
attributes = {
|
|
38
|
+
:country => "_unitedStates",
|
|
39
|
+
:attention => "William Sanders",
|
|
40
|
+
:addressee => "William Sanders",
|
|
41
|
+
:addr1 => "test1",
|
|
42
|
+
:addr2 => "test2",
|
|
43
|
+
:city => "San Francisco",
|
|
44
|
+
:state => "CA",
|
|
45
|
+
:zip => "94131",
|
|
46
|
+
:addr_text => "William Sanders<br>William Sanders<br>test1<br>test2<br>San Francisco CA 94131",
|
|
47
|
+
:override => false,
|
|
48
|
+
:"@xmlns:platform_common" => "urn:common_2016_1.platform.webservices.netsuite.com"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return_authorization.billing_address = attributes
|
|
52
|
+
expect(return_authorization.billing_address).to be_kind_of(NetSuite::Records::Address)
|
|
53
|
+
expect(return_authorization.billing_address.addressee).to eql("William Sanders")
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it 'can be set from a ItemVendorList object' do
|
|
57
|
+
billing_address = NetSuite::Records::Address.new
|
|
58
|
+
return_authorization.billing_address = billing_address
|
|
59
|
+
expect(return_authorization.billing_address).to eql(billing_address)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::RevRecTemplate do
|
|
4
|
+
let(:template) { NetSuite::Records::RevRecTemplate.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:name, :is_inactive
|
|
9
|
+
].each do |field|
|
|
10
|
+
expect(template).to have_field(field)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe '.get' do
|
|
15
|
+
context 'when the response is successful' do
|
|
16
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :name => 'A template' }) }
|
|
17
|
+
|
|
18
|
+
it 'returns an RevRecTemplate instance populated with the data from the response object' do
|
|
19
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::RevRecTemplate, :external_id => 10], {}).and_return(response)
|
|
20
|
+
template = NetSuite::Records::RevRecTemplate.get(:external_id => 10)
|
|
21
|
+
expect(template).to be_kind_of(NetSuite::Records::RevRecTemplate)
|
|
22
|
+
expect(template.name).to eql('A template')
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
context 'when the response is unsuccessful' do
|
|
27
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
28
|
+
|
|
29
|
+
it 'raises a RecordNotFound exception' do
|
|
30
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::RevRecTemplate, :external_id => 10], {}).and_return(response)
|
|
31
|
+
expect {
|
|
32
|
+
NetSuite::Records::RevRecTemplate.get(:external_id => 10)
|
|
33
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
34
|
+
/NetSuite::Records::RevRecTemplate with OPTIONS=(.*) could not be found/)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::SalesOrderItemList do
|
|
4
|
+
let(:list) { NetSuite::Records::SalesOrderItemList.new }
|
|
5
|
+
|
|
6
|
+
it 'has a items attribute' do
|
|
7
|
+
expect(list.items).to be_kind_of(Array)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
describe '#to_record' do
|
|
11
|
+
before do
|
|
12
|
+
list.items << NetSuite::Records::SalesOrderItem.new(
|
|
13
|
+
:rate => 10
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'can represent itself as a SOAP record' do
|
|
18
|
+
record = {
|
|
19
|
+
'tranSales:item' => [{
|
|
20
|
+
'tranSales:rate' => 10
|
|
21
|
+
}]
|
|
22
|
+
}
|
|
23
|
+
expect(list.to_record).to eql(record)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::SalesOrderItem do
|
|
4
|
+
let(:item) { NetSuite::Records::SalesOrderItem.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:amount, :bin_numbers, :cost_estimate, :cost_estimate_type,
|
|
9
|
+
:defer_rev_rec, :description, :expand_item_group,
|
|
10
|
+
:gift_cert_from, :gift_cert_message, :gift_cert_number,
|
|
11
|
+
:gift_cert_recipient_email, :gift_cert_recipient_name,
|
|
12
|
+
:gross_amt, :is_taxable, :line, :order_line, :po_currency,
|
|
13
|
+
:quantity, :quantity_back_ordered, :quantity_billed,
|
|
14
|
+
:quantity_committed, :quantity_fulfilled,
|
|
15
|
+
:rate, :rev_rec_end_date, :rev_rec_start_date,
|
|
16
|
+
:rev_rec_term_in_months, :serial_numbers, :ship_group,
|
|
17
|
+
:tax1_amt, :tax_rate1, :tax_rate2,
|
|
18
|
+
:vsoe_allocation, :vsoe_amount, :vsoe_deferral,
|
|
19
|
+
:vsoe_delivered, :vsoe_permit_discount, :vsoe_price,
|
|
20
|
+
].each do |field|
|
|
21
|
+
expect(item).to have_field(field)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'has all the right record refs' do
|
|
26
|
+
[
|
|
27
|
+
:department, :item, :job, :klass, :location, :price, :rev_rec_schedule, :tax_code, :units
|
|
28
|
+
].each do |record_ref|
|
|
29
|
+
expect(item).to have_record_ref(record_ref)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::SalesOrder do
|
|
4
|
+
let(:salesorder) { NetSuite::Records::SalesOrder.new }
|
|
5
|
+
let(:customer) { NetSuite::Records::Customer.new }
|
|
6
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
7
|
+
|
|
8
|
+
it 'has all the right fields' do
|
|
9
|
+
[
|
|
10
|
+
:alt_handling_cost, :alt_shipping_cost, :amount_paid, :amount_remaining, :applied, :auto_apply,
|
|
11
|
+
:balance, :bill_address, :contrib_pct, :created_date, :currency_name, :deferred_revenue,
|
|
12
|
+
:discount_rate, :discount_total, :email, :end_date, :est_gross_profit, :est_gross_profit_percent,
|
|
13
|
+
:exchange_rate, :exclude_commission, :fax, :gift_cert_applied, :gift_cert_available,
|
|
14
|
+
:gift_cert_total, :handling_cost, :handling_tax1_rate, :handling_tax2_rate, :is_taxable,
|
|
15
|
+
:last_modified_date, :memo, :message, :on_credit_hold, :other_ref_num, :recognized_revenue,
|
|
16
|
+
:rev_rec_on_rev_commitment, :sales_effective_date, :shipping_cost, :shipping_tax1_rate,
|
|
17
|
+
:shipping_tax2_rate, :source, :start_date, :status, :sub_total, :sync_partner_teams,
|
|
18
|
+
:sync_sales_teams, :tax2_total, :tax_rate, :tax_total, :to_be_emailed, :to_be_faxed, :to_be_printed,
|
|
19
|
+
:total, :total_cost_estimate, :tran_date, :tran_id, :tran_is_vsoe_bundle, :unapplied, :vat_reg_num,
|
|
20
|
+
:vsoe_auto_calc, :cc_approved
|
|
21
|
+
].each do |field|
|
|
22
|
+
expect(salesorder).to have_field(field)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'has all the right fields with specific classes' do
|
|
27
|
+
{
|
|
28
|
+
billing_address: NetSuite::Records::Address,
|
|
29
|
+
custom_field_list: NetSuite::Records::CustomFieldList,
|
|
30
|
+
gift_cert_redemption_list: NetSuite::Records::GiftCertRedemptionList,
|
|
31
|
+
item_list: NetSuite::Records::SalesOrderItemList,
|
|
32
|
+
null_field_list: NetSuite::Records::NullFieldList,
|
|
33
|
+
promotions_list: NetSuite::Records::PromotionsList,
|
|
34
|
+
ship_group_list: NetSuite::Records::SalesOrderShipGroupList,
|
|
35
|
+
shipping_address: NetSuite::Records::Address,
|
|
36
|
+
transaction_bill_address: NetSuite::Records::BillAddress,
|
|
37
|
+
transaction_ship_address: NetSuite::Records::ShipAddress,
|
|
38
|
+
}.each do |field, klass|
|
|
39
|
+
expect(salesorder).to have_field(field, klass)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'has all the right record refs' do
|
|
44
|
+
[
|
|
45
|
+
:account, :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item,
|
|
46
|
+
:entity, :gift_cert, :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel,
|
|
47
|
+
:opportunity, :partner, :posting_period, :promo_code, :sales_group, :sales_rep,
|
|
48
|
+
:ship_method, :shipping_tax_code, :subsidiary, :tax_item
|
|
49
|
+
].each do |record_ref|
|
|
50
|
+
expect(salesorder).to have_record_ref(record_ref)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
describe '#item_list' do
|
|
56
|
+
it 'can be set from attributes' do
|
|
57
|
+
attributes = {
|
|
58
|
+
:item => {
|
|
59
|
+
:amount => 10
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
salesorder.item_list = attributes
|
|
63
|
+
expect(salesorder.item_list).to be_kind_of(NetSuite::Records::SalesOrderItemList)
|
|
64
|
+
expect(salesorder.item_list.items.length).to eql(1)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it 'can be set from a SalesOrderItemList object' do
|
|
68
|
+
item_list = NetSuite::Records::SalesOrderItemList.new
|
|
69
|
+
salesorder.item_list = item_list
|
|
70
|
+
expect(salesorder.item_list).to eql(item_list)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
describe '#gift_cert_redemption_list' do
|
|
75
|
+
it 'can be set from attributes' do
|
|
76
|
+
attributes = {
|
|
77
|
+
:gift_cert_redemption => {
|
|
78
|
+
:auth_code_amt_remaining => 20
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
salesorder.gift_cert_redemption_list = attributes
|
|
82
|
+
expect(salesorder.gift_cert_redemption_list).to be_kind_of(NetSuite::Records::GiftCertRedemptionList)
|
|
83
|
+
expect(salesorder.gift_cert_redemption_list.gift_cert_redemptions.length).to eql(1)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it 'can be set from a GiftCertRedemptionList object' do
|
|
87
|
+
gift_cert_redemption_list = NetSuite::Records::GiftCertRedemptionList.new
|
|
88
|
+
salesorder.gift_cert_redemption_list = gift_cert_redemption_list
|
|
89
|
+
expect(salesorder.gift_cert_redemption_list).to eql(gift_cert_redemption_list)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
describe '.get' do
|
|
100
|
+
context 'when the response is successful' do
|
|
101
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :alt_shipping_cost => 100 }) }
|
|
102
|
+
|
|
103
|
+
it 'returns a SalesOrder instance populated with the data from the response object' do
|
|
104
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SalesOrder, :external_id => 1], {}).and_return(response)
|
|
105
|
+
salesorder = NetSuite::Records::SalesOrder.get(:external_id => 1)
|
|
106
|
+
expect(salesorder).to be_kind_of(NetSuite::Records::SalesOrder)
|
|
107
|
+
expect(salesorder.alt_shipping_cost).to eql(100)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
context 'when the response is unsuccessful' do
|
|
112
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
113
|
+
|
|
114
|
+
it 'raises a RecordNotFound exception' do
|
|
115
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SalesOrder, :external_id => 1], {}).and_return(response)
|
|
116
|
+
expect {
|
|
117
|
+
NetSuite::Records::SalesOrder.get(:external_id => 1)
|
|
118
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
119
|
+
/NetSuite::Records::SalesOrder with OPTIONS=(.*) could not be found/)
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
describe '.initialize' do
|
|
125
|
+
context 'when the request is successful' do
|
|
126
|
+
it 'returns an initialized sales order from the customer entity' do
|
|
127
|
+
expect(NetSuite::Actions::Initialize).to receive(:call).with([NetSuite::Records::SalesOrder, customer], {}).and_return(response)
|
|
128
|
+
salesorder = NetSuite::Records::SalesOrder.initialize(customer)
|
|
129
|
+
expect(salesorder).to be_kind_of(NetSuite::Records::SalesOrder)
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
context 'when the response is unsuccessful' do
|
|
134
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
135
|
+
|
|
136
|
+
it 'raises a InitializationError exception' do
|
|
137
|
+
expect(NetSuite::Actions::Initialize).to receive(:call).with([NetSuite::Records::SalesOrder, customer], {}).and_return(response)
|
|
138
|
+
expect {
|
|
139
|
+
NetSuite::Records::SalesOrder.initialize(customer)
|
|
140
|
+
}.to raise_error(NetSuite::InitializationError,
|
|
141
|
+
/NetSuite::Records::SalesOrder.initialize with .+ failed./)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
describe '#add' do
|
|
147
|
+
let(:test_data) { { :email => 'test@example.com', :fax => '1234567890' } }
|
|
148
|
+
|
|
149
|
+
context 'when the response is successful' do
|
|
150
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
151
|
+
|
|
152
|
+
it 'returns true' do
|
|
153
|
+
salesorder = NetSuite::Records::SalesOrder.new(test_data)
|
|
154
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
155
|
+
with([salesorder], {}).
|
|
156
|
+
and_return(response)
|
|
157
|
+
expect(salesorder.add).to be_truthy
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
context 'when the response is unsuccessful' do
|
|
162
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
163
|
+
|
|
164
|
+
it 'returns false' do
|
|
165
|
+
salesorder = NetSuite::Records::SalesOrder.new(test_data)
|
|
166
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
167
|
+
with([salesorder], {}).
|
|
168
|
+
and_return(response)
|
|
169
|
+
expect(salesorder.add).to be_falsey
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
describe '#attach_file' do
|
|
175
|
+
let(:test_data) { { :email => 'test@example.com', :fax => '1234567890' } }
|
|
176
|
+
let(:file) { double('file') }
|
|
177
|
+
|
|
178
|
+
context 'when the response is successful' do
|
|
179
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
180
|
+
|
|
181
|
+
it 'returns true' do
|
|
182
|
+
sales_order = NetSuite::Records::SalesOrder.new(test_data)
|
|
183
|
+
expect(NetSuite::Actions::AttachFile).to receive(:call).
|
|
184
|
+
with([sales_order, file], {}).
|
|
185
|
+
and_return(response)
|
|
186
|
+
expect(sales_order.attach_file(file)).to be_truthy
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
context 'when the response is unsuccessful' do
|
|
191
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
192
|
+
|
|
193
|
+
it 'returns false' do
|
|
194
|
+
sales_order = NetSuite::Records::SalesOrder.new(test_data)
|
|
195
|
+
expect(NetSuite::Actions::AttachFile).to receive(:call).
|
|
196
|
+
with([sales_order, file], {}).
|
|
197
|
+
and_return(response)
|
|
198
|
+
expect(sales_order.attach_file(file)).to be_falsey
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
describe '#delete' do
|
|
204
|
+
let(:test_data) { { :internal_id => '1' } }
|
|
205
|
+
|
|
206
|
+
context 'when the response is successful' do
|
|
207
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
208
|
+
|
|
209
|
+
it 'returns true' do
|
|
210
|
+
salesorder = NetSuite::Records::SalesOrder.new(test_data)
|
|
211
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
212
|
+
with([salesorder], {}).
|
|
213
|
+
and_return(response)
|
|
214
|
+
expect(salesorder.delete).to be_truthy
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
context 'when the response is unsuccessful' do
|
|
219
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
220
|
+
|
|
221
|
+
it 'returns false' do
|
|
222
|
+
salesorder = NetSuite::Records::SalesOrder.new(test_data)
|
|
223
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
224
|
+
with([salesorder], {}).
|
|
225
|
+
and_return(response)
|
|
226
|
+
expect(salesorder.delete).to be_falsey
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
describe '#to_record' do
|
|
232
|
+
before do
|
|
233
|
+
salesorder.email = 'something@example.com'
|
|
234
|
+
salesorder.tran_id = '4'
|
|
235
|
+
end
|
|
236
|
+
it 'can represent itself as a SOAP record' do
|
|
237
|
+
record = {
|
|
238
|
+
'tranSales:email' => 'something@example.com',
|
|
239
|
+
'tranSales:tranId' => '4'
|
|
240
|
+
}
|
|
241
|
+
expect(salesorder.to_record).to eql(record)
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
describe '#record_type' do
|
|
246
|
+
it 'returns a string representation of the SOAP type' do
|
|
247
|
+
expect(salesorder.record_type).to eql('tranSales:SalesOrder')
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::SalesTaxItem do
|
|
4
|
+
subject(:sales_tax_item) { described_class.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:item_id, :display_name, :description, :rate, :is_inactive, :effective_from,
|
|
9
|
+
:valid_until, :include_children, :eccode, :reverse_charge, :service,
|
|
10
|
+
:exempt, :is_default, :exclude_from_tax_reports, :available, :export,
|
|
11
|
+
:county, :city, :state, :zip
|
|
12
|
+
].each do |field|
|
|
13
|
+
expect(sales_tax_item).to have_field(field)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it 'has all the right record refs' do
|
|
18
|
+
[
|
|
19
|
+
:tax_type, :tax_agency, :tax_account, :purchase_account, :sale_account,
|
|
20
|
+
:parent, :nexus_country
|
|
21
|
+
].each do |record_ref|
|
|
22
|
+
expect(sales_tax_item).to have_record_ref(record_ref)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::ServiceResaleItem do
|
|
4
|
+
let(:item) { NetSuite::Records::ServiceResaleItem.new }
|
|
5
|
+
|
|
6
|
+
it 'has the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:amortization_period,
|
|
9
|
+
:available_to_partners,
|
|
10
|
+
:contingent_revenue_handling,
|
|
11
|
+
:cost,
|
|
12
|
+
:cost_estimate,
|
|
13
|
+
:cost_estimate_type,
|
|
14
|
+
:cost_estimate_units,
|
|
15
|
+
:cost_units,
|
|
16
|
+
:created_date,
|
|
17
|
+
:create_job,
|
|
18
|
+
:currency,
|
|
19
|
+
:defer_rev_rec,
|
|
20
|
+
:direct_revenue_posting,
|
|
21
|
+
:display_name,
|
|
22
|
+
:dont_show_price,
|
|
23
|
+
:enforce_min_qty_internally,
|
|
24
|
+
:exclude_from_sitemap,
|
|
25
|
+
:featured_description,
|
|
26
|
+
:generate_accruals,
|
|
27
|
+
:include_children,
|
|
28
|
+
:is_donation_item,
|
|
29
|
+
:is_fulfillable,
|
|
30
|
+
:is_gco_compliant,
|
|
31
|
+
:is_inactive,
|
|
32
|
+
:is_online,
|
|
33
|
+
:is_taxable,
|
|
34
|
+
:item_id,
|
|
35
|
+
:last_modified_date,
|
|
36
|
+
:manufacturing_charge_item,
|
|
37
|
+
:matrix_item_name_template,
|
|
38
|
+
:matrix_type,
|
|
39
|
+
:max_donation_amount,
|
|
40
|
+
:maximum_quantity,
|
|
41
|
+
:meta_tag_html,
|
|
42
|
+
:minimum_quantity,
|
|
43
|
+
:minimum_quantity_units,
|
|
44
|
+
:no_price_message,
|
|
45
|
+
:offer_support,
|
|
46
|
+
:on_special,
|
|
47
|
+
:out_of_stock_behavior,
|
|
48
|
+
:out_of_stock_message,
|
|
49
|
+
:overall_quantity_pricing_type,
|
|
50
|
+
:page_title,
|
|
51
|
+
:prices_include_tax,
|
|
52
|
+
:purchase_description,
|
|
53
|
+
:purchase_order_amount,
|
|
54
|
+
:purchase_order_quantity,
|
|
55
|
+
:purchase_order_quantity_diff,
|
|
56
|
+
:rate,
|
|
57
|
+
:receipt_amount,
|
|
58
|
+
:receipt_quantity,
|
|
59
|
+
:receipt_quantity_diff,
|
|
60
|
+
:related_items_description,
|
|
61
|
+
:residual,
|
|
62
|
+
:sales_description,
|
|
63
|
+
:search_keywords,
|
|
64
|
+
:show_default_donation_amount,
|
|
65
|
+
:sitemap_priority,
|
|
66
|
+
:soft_descriptor,
|
|
67
|
+
:specials_description,
|
|
68
|
+
:store_description,
|
|
69
|
+
:store_detailed_description,
|
|
70
|
+
:store_display_name,
|
|
71
|
+
:upc_code,
|
|
72
|
+
:url_component,
|
|
73
|
+
:use_marginal_rates,
|
|
74
|
+
:vendor_name,
|
|
75
|
+
:vsoe_deferral,
|
|
76
|
+
:vsoe_delivered,
|
|
77
|
+
:vsoe_permit_discount,
|
|
78
|
+
:vsoe_price,
|
|
79
|
+
:vsoe_sop_group,
|
|
80
|
+
].each do |field|
|
|
81
|
+
expect(item).to have_field(field)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'has all the right fields with specific classes' do
|
|
86
|
+
{
|
|
87
|
+
custom_field_list: NetSuite::Records::CustomFieldList,
|
|
88
|
+
item_vendor_list: NetSuite::Records::ItemVendorList,
|
|
89
|
+
matrix_option_list: NetSuite::Records::MatrixOptionList,
|
|
90
|
+
pricing_matrix: NetSuite::Records::PricingMatrix,
|
|
91
|
+
subsidiary_list: NetSuite::Records::RecordRefList,
|
|
92
|
+
}.each do |field, klass|
|
|
93
|
+
expect(item).to have_field(field, klass)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it 'has the right record_refs' do
|
|
98
|
+
[
|
|
99
|
+
:amortization_template,
|
|
100
|
+
:bill_exch_rate_variance_acct,
|
|
101
|
+
:billing_schedule,
|
|
102
|
+
:bill_price_variance_acct,
|
|
103
|
+
:bill_qty_variance_acct,
|
|
104
|
+
:klass,
|
|
105
|
+
:consumption_unit,
|
|
106
|
+
:cost_category,
|
|
107
|
+
:create_revenue_plans_on,
|
|
108
|
+
:custom_form,
|
|
109
|
+
:deferral_account,
|
|
110
|
+
:deferred_revenue_account,
|
|
111
|
+
:department,
|
|
112
|
+
:expense_account,
|
|
113
|
+
:income_account,
|
|
114
|
+
:interco_def_rev_account,
|
|
115
|
+
:interco_expense_account,
|
|
116
|
+
:interco_income_account,
|
|
117
|
+
:issue_product,
|
|
118
|
+
:item_revenue_category,
|
|
119
|
+
:location,
|
|
120
|
+
:parent,
|
|
121
|
+
:pricing_group,
|
|
122
|
+
:purchase_tax_code,
|
|
123
|
+
:purchase_unit,
|
|
124
|
+
:quantity_pricing_schedule,
|
|
125
|
+
:revenue_allocation_group,
|
|
126
|
+
:revenue_recognition_rule,
|
|
127
|
+
:rev_rec_forecast_rule,
|
|
128
|
+
:rev_reclass_f_x_account,
|
|
129
|
+
:rev_rec_schedule,
|
|
130
|
+
:sales_tax_code,
|
|
131
|
+
:sale_unit,
|
|
132
|
+
:store_display_image,
|
|
133
|
+
:store_display_thumbnail,
|
|
134
|
+
:store_item_template,
|
|
135
|
+
:tax_schedule,
|
|
136
|
+
:units_type,
|
|
137
|
+
:vendor,
|
|
138
|
+
].each do |record_ref|
|
|
139
|
+
expect(item).to have_record_ref(record_ref)
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
describe '.get' do
|
|
144
|
+
context 'when the response is successful' do
|
|
145
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :item_id => 'penguins' }) }
|
|
146
|
+
|
|
147
|
+
it 'returns a ServiceResaleItem instance populated with the data from the response object' do
|
|
148
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceResaleItem, :external_id => 20], {}).and_return(response)
|
|
149
|
+
customer = NetSuite::Records::ServiceResaleItem.get(:external_id => 20)
|
|
150
|
+
expect(customer).to be_kind_of(NetSuite::Records::ServiceResaleItem)
|
|
151
|
+
expect(customer.item_id).to eql('penguins')
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
context 'when the response is unsuccessful' do
|
|
156
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
157
|
+
|
|
158
|
+
it 'raises a RecordNotFound exception' do
|
|
159
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceResaleItem, :external_id => 20], {}).and_return(response)
|
|
160
|
+
expect {
|
|
161
|
+
NetSuite::Records::ServiceResaleItem.get(:external_id => 20)
|
|
162
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
163
|
+
/NetSuite::Records::ServiceResaleItem with OPTIONS=(.*) could not be found/)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
describe '#add' do
|
|
169
|
+
let(:item) { NetSuite::Records::ServiceResaleItem.new(:cost => 100, :is_inactive => false) }
|
|
170
|
+
|
|
171
|
+
context 'when the response is successful' do
|
|
172
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
173
|
+
|
|
174
|
+
it 'returns true' do
|
|
175
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
176
|
+
with([item], {}).
|
|
177
|
+
and_return(response)
|
|
178
|
+
expect(item.add).to be_truthy
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
context 'when the response is unsuccessful' do
|
|
183
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
184
|
+
|
|
185
|
+
it 'returns false' do
|
|
186
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
187
|
+
with([item], {}).
|
|
188
|
+
and_return(response)
|
|
189
|
+
expect(item.add).to be_falsey
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
describe '#delete' do
|
|
195
|
+
context 'when the response is successful' do
|
|
196
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
197
|
+
|
|
198
|
+
it 'returns true' do
|
|
199
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
200
|
+
with([item], {}).
|
|
201
|
+
and_return(response)
|
|
202
|
+
expect(item.delete).to be_truthy
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
context 'when the response is unsuccessful' do
|
|
207
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
208
|
+
|
|
209
|
+
it 'returns false' do
|
|
210
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
211
|
+
with([item], {}).
|
|
212
|
+
and_return(response)
|
|
213
|
+
expect(item.delete).to be_falsey
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
describe '#to_record' do
|
|
219
|
+
before do
|
|
220
|
+
item.item_id = 'penguins'
|
|
221
|
+
item.is_online = true
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
it 'can represent itself as a SOAP record' do
|
|
225
|
+
record = {
|
|
226
|
+
'listAcct:itemId' => 'penguins',
|
|
227
|
+
'listAcct:isOnline' => true
|
|
228
|
+
}
|
|
229
|
+
expect(item.to_record).to eql(record)
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
describe '#record_type' do
|
|
234
|
+
it 'returns a string of the SOAP type' do
|
|
235
|
+
expect(item.record_type).to eql('listAcct:ServiceResaleItem')
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
end
|