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,156 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::JournalEntry do
|
|
4
|
+
let(:entry) { NetSuite::Records::JournalEntry.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:approved, :created_date, :exchange_rate, :last_modified_date, :reversal_date,
|
|
9
|
+
:reversal_defer, :reversal_entry, :tran_date, :tran_id
|
|
10
|
+
].each do |field|
|
|
11
|
+
expect(entry).to have_field(field)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'has all the right record refs' do
|
|
16
|
+
[
|
|
17
|
+
:created_from, :currency, :custom_form, :department, :klass, :location, :parent_expense_alloc, :posting_period,
|
|
18
|
+
:subsidiary, :to_subsidiary
|
|
19
|
+
].each do |record_ref|
|
|
20
|
+
expect(entry).to have_record_ref(record_ref)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
describe '#custom_field_list' do
|
|
25
|
+
it 'can be set from attributes' do
|
|
26
|
+
attributes = {
|
|
27
|
+
:custom_field => {
|
|
28
|
+
:amount => 10,
|
|
29
|
+
:script_id => 'custfield_amount'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
entry.custom_field_list = attributes
|
|
33
|
+
expect(entry.custom_field_list).to be_kind_of(NetSuite::Records::CustomFieldList)
|
|
34
|
+
expect(entry.custom_field_list.custom_fields.length).to eql(1)
|
|
35
|
+
expect(entry.custom_field_list.custfield_amount.attributes[:amount]).to eq(10)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'can be set from a CustomFieldList object' do
|
|
39
|
+
custom_field_list = NetSuite::Records::CustomFieldList.new
|
|
40
|
+
entry.custom_field_list = custom_field_list
|
|
41
|
+
expect(entry.custom_field_list).to eql(custom_field_list)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe '#line_list' do
|
|
46
|
+
it 'can be set from attributes' do
|
|
47
|
+
attributes = {
|
|
48
|
+
:line => {
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
entry.line_list = attributes
|
|
53
|
+
expect(entry.line_list).to be_kind_of(NetSuite::Records::JournalEntryLineList)
|
|
54
|
+
expect(entry.line_list.lines.length).to eql(1)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'can be set from a JournalEntryLineList object' do
|
|
58
|
+
line_list = NetSuite::Records::JournalEntryLineList.new
|
|
59
|
+
entry.line_list = line_list
|
|
60
|
+
expect(entry.line_list).to eql(line_list)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe '.get' do
|
|
65
|
+
context 'when the response is successful' do
|
|
66
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :approved => true }) }
|
|
67
|
+
|
|
68
|
+
it 'returns a JournalEntry instance populated with the data from the response object' do
|
|
69
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::JournalEntry, {:external_id => 1}], {}).and_return(response)
|
|
70
|
+
customer = NetSuite::Records::JournalEntry.get(:external_id => 1)
|
|
71
|
+
expect(customer).to be_kind_of(NetSuite::Records::JournalEntry)
|
|
72
|
+
expect(customer.approved).to be_truthy
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
context 'when the response is unsuccessful' do
|
|
77
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
78
|
+
|
|
79
|
+
it 'raises a RecordNotFound exception' do
|
|
80
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::JournalEntry, {:external_id => 1}], {}).and_return(response)
|
|
81
|
+
expect {
|
|
82
|
+
NetSuite::Records::JournalEntry.get(:external_id => 1)
|
|
83
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
84
|
+
/NetSuite::Records::JournalEntry with OPTIONS=(.*) could not be found/)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
describe '#add' do
|
|
90
|
+
let(:entry) { NetSuite::Records::JournalEntry.new(:approved => true) }
|
|
91
|
+
|
|
92
|
+
context 'when the response is successful' do
|
|
93
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
94
|
+
|
|
95
|
+
it 'returns true' do
|
|
96
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
97
|
+
with([entry], {}).
|
|
98
|
+
and_return(response)
|
|
99
|
+
expect(entry.add).to be_truthy
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
context 'when the response is unsuccessful' do
|
|
104
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
105
|
+
|
|
106
|
+
it 'returns false' do
|
|
107
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
108
|
+
with([entry], {}).
|
|
109
|
+
and_return(response)
|
|
110
|
+
expect(entry.add).to be_falsey
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
describe '#delete' do
|
|
116
|
+
context 'when the response is successful' do
|
|
117
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
118
|
+
|
|
119
|
+
it 'returns true' do
|
|
120
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
121
|
+
with([entry], {}).
|
|
122
|
+
and_return(response)
|
|
123
|
+
expect(entry.delete).to be_truthy
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
context 'when the response is unsuccessful' do
|
|
128
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
129
|
+
|
|
130
|
+
it 'returns false' do
|
|
131
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
132
|
+
with([entry], {}).
|
|
133
|
+
and_return(response)
|
|
134
|
+
expect(entry.delete).to be_falsey
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
describe '#to_record' do
|
|
140
|
+
let(:entry) { NetSuite::Records::JournalEntry.new(:tran_id => '1234', :approved => true) }
|
|
141
|
+
|
|
142
|
+
it 'returns a hash of attributes that can be used in a SOAP request' do
|
|
143
|
+
expect(entry.to_record).to eql({
|
|
144
|
+
'tranGeneral:tranId' => '1234',
|
|
145
|
+
'tranGeneral:approved' => true
|
|
146
|
+
})
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
describe '#record_type' do
|
|
151
|
+
it 'returns a string type for the record to be used in a SOAP request' do
|
|
152
|
+
expect(entry.record_type).to eql('tranGeneral:JournalEntry')
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::KitItem do
|
|
4
|
+
let(:item) { NetSuite::Records::KitItem.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:available_to_partners, :cost_estimate, :created_date, :defer_rev_rec, :description, :display_name, :dont_show_price, :enforce_min_qty_internally, :exclude_from_sitemap, :featured_description, :handling_cost, :hazmat_hazard_class, :hazmat_id, :hazmat_item_units, :hazmat_item_units_qty, :hazmat_shipping_name, :include_children, :is_donation_item, :is_fulfillable, :is_gco_compliant, :is_hazmat_item, :is_inactive, :is_online, :is_taxable, :item_id, :last_modified_date, :manufacturer, :manufactureraddr1, :manufacturer_city, :manufacturer_state, :manufacturer_tariff, :manufacturer_tax_id, :manufacturer_zip, :max_donation_amount, :meta_tag_html, :minimum_quantity, :mpn, :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support, :on_special, :out_of_stock_message, :page_title, :prices_include_tax, :print_items, :producer, :rate, :related_items_description, :schedule_b_number, :schedule_b_quantity, :search_keywords, :ship_individually, :shipping_cost, :shopping_dot_com_category, :shopzilla_category_id, :show_default_donation_amount, :specials_description, :stock_description, :store_description, :store_detailed_description, :store_display_name, :upc_code, :url_component, :use_marginal_rates, :vsoe_delivered, :vsoe_price, :weight
|
|
9
|
+
].each do |field|
|
|
10
|
+
expect(item).to have_field(field)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it 'has all the right record refs' do
|
|
15
|
+
[
|
|
16
|
+
:billing_schedule, :custom_form, :default_item_ship_method, :deferred_revenue_account, :department, :income_account, :issue_product, :item_revenue_category, :location, :parent, :pricing_group, :quantity_pricing_schedule, :revenue_allocation_group, :revenue_recognition_rule, :rev_rec_schedule, :sales_tax_code, :schedule_b_code, :ship_package, :soft_descriptor, :store_display_image, :store_display_thumbnail, :store_item_template, :tax_schedule, :weight_unit
|
|
17
|
+
].each do |record_ref|
|
|
18
|
+
expect(item).to have_record_ref(record_ref)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe '.get' do
|
|
23
|
+
context 'when the response is successful' do
|
|
24
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :item_id => "Item100" }) }
|
|
25
|
+
|
|
26
|
+
it 'returns a KitItem instance populated with the data from the response object' do
|
|
27
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::KitItem, {:external_id => 1}], {}).and_return(response)
|
|
28
|
+
item = NetSuite::Records::KitItem.get(:external_id => 1)
|
|
29
|
+
expect(item).to be_kind_of(NetSuite::Records::KitItem)
|
|
30
|
+
expect(item.item_id).to eql("Item100")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
context 'when the response is unsuccessful' do
|
|
35
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
36
|
+
|
|
37
|
+
it 'raises a RecordNotFound exception' do
|
|
38
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::KitItem, {:external_id => 1}], {}).and_return(response)
|
|
39
|
+
expect {
|
|
40
|
+
NetSuite::Records::KitItem.get(:external_id => 1)
|
|
41
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
42
|
+
/NetSuite::Records::KitItem with OPTIONS=(.*) could not be found/)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe '#add' do
|
|
48
|
+
let(:item) { NetSuite::Records::KitItem.new(:item_id => "Item100", :is_inactive => false) }
|
|
49
|
+
|
|
50
|
+
context 'when the response is successful' do
|
|
51
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
52
|
+
|
|
53
|
+
it 'returns true' do
|
|
54
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
55
|
+
with([item], {}).
|
|
56
|
+
and_return(response)
|
|
57
|
+
expect(item.add).to be_truthy
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
context 'when the response is unsuccessful' do
|
|
62
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
63
|
+
|
|
64
|
+
it 'returns false' do
|
|
65
|
+
expect(NetSuite::Actions::Add).to receive(:call).
|
|
66
|
+
with([item], {}).
|
|
67
|
+
and_return(response)
|
|
68
|
+
expect(item.add).to be_falsey
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe '#delete' do
|
|
74
|
+
context 'when the response is successful' do
|
|
75
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
|
|
76
|
+
|
|
77
|
+
it 'returns true' do
|
|
78
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
79
|
+
with([item], {}).
|
|
80
|
+
and_return(response)
|
|
81
|
+
expect(item.delete).to be_truthy
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
context 'when the response is unsuccessful' do
|
|
86
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
87
|
+
|
|
88
|
+
it 'returns false' do
|
|
89
|
+
expect(NetSuite::Actions::Delete).to receive(:call).
|
|
90
|
+
with([item], {}).
|
|
91
|
+
and_return(response)
|
|
92
|
+
expect(item.delete).to be_falsey
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
describe '#to_record' do
|
|
98
|
+
before do
|
|
99
|
+
item.item_id = "Item100"
|
|
100
|
+
item.is_inactive = false
|
|
101
|
+
end
|
|
102
|
+
it 'can represent itself as a SOAP record' do
|
|
103
|
+
record = {
|
|
104
|
+
'listAcct:itemId' => "Item100",
|
|
105
|
+
'listAcct:isInactive' => false
|
|
106
|
+
}
|
|
107
|
+
expect(item.to_record).to eql(record)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
describe '#record_type' do
|
|
112
|
+
it 'returns a string representation of the SOAP type' do
|
|
113
|
+
expect(item.record_type).to eql('listAcct:KitItem')
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::Location do
|
|
4
|
+
let(:location) { NetSuite::Records::Location.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right attributes' do
|
|
7
|
+
[
|
|
8
|
+
:addr1, :addr2, :addr3, :addr_phone, :addr_text, :addressee, :attention, :city, :country, :include_children, :is_inactive,
|
|
9
|
+
:make_inventory_available, :make_inventory_available_store, :name, :override, :state, :tran_prefix, :zip
|
|
10
|
+
].each do |field|
|
|
11
|
+
expect(location).to have_field(field)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'has all the right record refs' do
|
|
16
|
+
[
|
|
17
|
+
:logo, :parent
|
|
18
|
+
].each do |record_ref|
|
|
19
|
+
expect(location).to have_record_ref(record_ref)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
describe '.get' do
|
|
27
|
+
context 'when the response is successful' do
|
|
28
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => { :city => 'Los Angeles' }) }
|
|
29
|
+
|
|
30
|
+
it 'returns a Location instance populated with the data from the response object' do
|
|
31
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Location, {:external_id => 1}], {}).and_return(response)
|
|
32
|
+
location = NetSuite::Records::Location.get(:external_id => 1)
|
|
33
|
+
expect(location).to be_kind_of(NetSuite::Records::Location)
|
|
34
|
+
expect(location.city).to eql('Los Angeles')
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
context 'when the response is unsuccessful' do
|
|
39
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
40
|
+
|
|
41
|
+
it 'raises a RecordNotFound exception' do
|
|
42
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Location, {:external_id => 1}], {}).and_return(response)
|
|
43
|
+
expect {
|
|
44
|
+
NetSuite::Records::Location.get(:external_id => 1)
|
|
45
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
46
|
+
/NetSuite::Records::Location with OPTIONS=(.*) could not be found/)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::LotNumberedInventoryItem do
|
|
4
|
+
let(:item) { described_class.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:auto_lead_time,
|
|
9
|
+
:auto_preferred_stock_level,
|
|
10
|
+
:auto_reorder_point,
|
|
11
|
+
:available_to_partners,
|
|
12
|
+
:average_cost,
|
|
13
|
+
:backward_consumption_days,
|
|
14
|
+
:conversion_rate,
|
|
15
|
+
:copy_description,
|
|
16
|
+
:cost,
|
|
17
|
+
:cost_estimate,
|
|
18
|
+
:cost_estimate_type,
|
|
19
|
+
:costing_method,
|
|
20
|
+
:costing_method_display,
|
|
21
|
+
:cost_units,
|
|
22
|
+
:country_of_manufacture,
|
|
23
|
+
:created_date,
|
|
24
|
+
:currency,
|
|
25
|
+
:default_return_cost,
|
|
26
|
+
:demand_modifier,
|
|
27
|
+
:demand_time_fence,
|
|
28
|
+
:direct_revenue_posting,
|
|
29
|
+
:display_name,
|
|
30
|
+
:dont_show_price,
|
|
31
|
+
:enable_catch_weight,
|
|
32
|
+
:enforce_min_qty_internally,
|
|
33
|
+
:exclude_from_sitemap,
|
|
34
|
+
:expiration_date,
|
|
35
|
+
:featured_description,
|
|
36
|
+
:fixed_lot_size,
|
|
37
|
+
:forward_consumption_days,
|
|
38
|
+
:future_horizon,
|
|
39
|
+
:handling_cost,
|
|
40
|
+
:handling_cost_units,
|
|
41
|
+
:hazmat_hazard_class,
|
|
42
|
+
:hazmat_id,
|
|
43
|
+
:hazmat_item_units,
|
|
44
|
+
:hazmat_item_units_qty,
|
|
45
|
+
:hazmat_packing_group,
|
|
46
|
+
:hazmat_shipping_name,
|
|
47
|
+
:include_children,
|
|
48
|
+
:invt_classification,
|
|
49
|
+
:invt_count_interval,
|
|
50
|
+
:is_donation_item,
|
|
51
|
+
:is_drop_ship_item,
|
|
52
|
+
:is_gco_compliant,
|
|
53
|
+
:is_hazmat_item,
|
|
54
|
+
:is_inactive,
|
|
55
|
+
:is_online,
|
|
56
|
+
:is_special_order_item,
|
|
57
|
+
:is_store_pickup_allowed,
|
|
58
|
+
:is_taxable,
|
|
59
|
+
:item_carrier,
|
|
60
|
+
:item_id,
|
|
61
|
+
:last_invt_count_date,
|
|
62
|
+
:last_modified_date,
|
|
63
|
+
:last_purchase_price,
|
|
64
|
+
:lead_time,
|
|
65
|
+
:lower_warning_limit,
|
|
66
|
+
:manufacturer,
|
|
67
|
+
:manufacturer_addr1,
|
|
68
|
+
:manufacturer_city,
|
|
69
|
+
:manufacturer_state,
|
|
70
|
+
:manufacturer_tariff,
|
|
71
|
+
:manufacturer_tax_id,
|
|
72
|
+
:manufacturer_zip,
|
|
73
|
+
:match_bill_to_receipt,
|
|
74
|
+
:matrix_item_name_template,
|
|
75
|
+
:matrix_type,
|
|
76
|
+
:max_donation_amount,
|
|
77
|
+
:maximum_quantity,
|
|
78
|
+
:meta_tag_html,
|
|
79
|
+
:minimum_quantity,
|
|
80
|
+
:minimum_quantity_units,
|
|
81
|
+
:mpn,
|
|
82
|
+
:mult_manufacture_addr,
|
|
83
|
+
:nex_tag_category,
|
|
84
|
+
:next_invt_count_date,
|
|
85
|
+
:no_price_message,
|
|
86
|
+
:offer_support,
|
|
87
|
+
:on_hand_value_mli,
|
|
88
|
+
:on_special,
|
|
89
|
+
:out_of_stock_behavior,
|
|
90
|
+
:out_of_stock_message,
|
|
91
|
+
:overall_quantity_pricing_type,
|
|
92
|
+
:page_title,
|
|
93
|
+
:periodic_lot_size_days,
|
|
94
|
+
:periodic_lot_size_type,
|
|
95
|
+
:preference_criterion,
|
|
96
|
+
:preferred_stock_level,
|
|
97
|
+
:preferred_stock_level_days,
|
|
98
|
+
:preferred_stock_level_units,
|
|
99
|
+
:prices_include_tax,
|
|
100
|
+
:producer,
|
|
101
|
+
:purchase_description,
|
|
102
|
+
:purchase_order_amount,
|
|
103
|
+
:purchase_order_quantity,
|
|
104
|
+
:purchase_order_quantity_diff,
|
|
105
|
+
:quantity_available,
|
|
106
|
+
:quantity_back_ordered,
|
|
107
|
+
:quantity_committed,
|
|
108
|
+
:quantity_on_hand,
|
|
109
|
+
:quantity_on_hand_units,
|
|
110
|
+
:quantity_on_order,
|
|
111
|
+
:quantity_reorder_units,
|
|
112
|
+
:rate,
|
|
113
|
+
:receipt_amount,
|
|
114
|
+
:receipt_quantity,
|
|
115
|
+
:receipt_quantity_diff,
|
|
116
|
+
:related_items_description,
|
|
117
|
+
:reorder_multiple,
|
|
118
|
+
:reorder_point,
|
|
119
|
+
:reorder_point_units,
|
|
120
|
+
:reschedule_in_days,
|
|
121
|
+
:reschedule_out_days,
|
|
122
|
+
:round_up_as_component,
|
|
123
|
+
:safety_stock_level,
|
|
124
|
+
:safety_stock_level_days,
|
|
125
|
+
:safety_stock_level_units,
|
|
126
|
+
:sales_description,
|
|
127
|
+
:schedule_b_code,
|
|
128
|
+
:schedule_b_number,
|
|
129
|
+
:schedule_b_quantity,
|
|
130
|
+
:search_keywords,
|
|
131
|
+
:seasonal_demand,
|
|
132
|
+
:serial_numbers,
|
|
133
|
+
:ship_individually,
|
|
134
|
+
:shipping_cost,
|
|
135
|
+
:shipping_cost_units,
|
|
136
|
+
:shopping_dot_com_category,
|
|
137
|
+
:shopzilla_category_id,
|
|
138
|
+
:show_default_donation_amount,
|
|
139
|
+
:sitemap_priority,
|
|
140
|
+
:specials_description,
|
|
141
|
+
:stock_description,
|
|
142
|
+
:store_description,
|
|
143
|
+
:store_detailed_description,
|
|
144
|
+
:store_display_name,
|
|
145
|
+
:supply_time_fence,
|
|
146
|
+
:total_value,
|
|
147
|
+
:track_landed_cost,
|
|
148
|
+
:transfer_price,
|
|
149
|
+
:upc_code,
|
|
150
|
+
:upper_warning_limit,
|
|
151
|
+
:url_component,
|
|
152
|
+
:use_bins,
|
|
153
|
+
:use_marginal_rates,
|
|
154
|
+
:vendor_name,
|
|
155
|
+
:vsoe_deferral,
|
|
156
|
+
:vsoe_delivered,
|
|
157
|
+
:vsoe_permit_discount,
|
|
158
|
+
:vsoe_price,
|
|
159
|
+
:vsoe_sop_group,
|
|
160
|
+
:weight,
|
|
161
|
+
:weight_unit,
|
|
162
|
+
:weight_units,
|
|
163
|
+
].each do |field|
|
|
164
|
+
expect(item).to have_field(field)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
it 'has all the right fields with specific classes' do
|
|
169
|
+
{
|
|
170
|
+
bin_number_list: NetSuite::Records::BinNumberList,
|
|
171
|
+
custom_field_list: NetSuite::Records::CustomFieldList,
|
|
172
|
+
item_number_options_list: NetSuite::Records::RecordRefList,
|
|
173
|
+
item_ship_method_list: NetSuite::Records::RecordRefList,
|
|
174
|
+
item_vendor_list: NetSuite::Records::ItemVendorList,
|
|
175
|
+
locations_list: NetSuite::Records::LocationsList,
|
|
176
|
+
matrix_option_list: NetSuite::Records::MatrixOptionList,
|
|
177
|
+
pricing_matrix: NetSuite::Records::PricingMatrix,
|
|
178
|
+
subsidiary_list: NetSuite::Records::RecordRefList,
|
|
179
|
+
translations_list: NetSuite::Records::TranslationList,
|
|
180
|
+
}.each do |field, klass|
|
|
181
|
+
expect(item).to have_field(field, klass)
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
it 'has all the right record refs' do
|
|
186
|
+
[
|
|
187
|
+
:alternate_demand_source_item,
|
|
188
|
+
:asset_account,
|
|
189
|
+
:bill_exch_rate_variance_acct,
|
|
190
|
+
:billing_schedule,
|
|
191
|
+
:bill_price_variance_acct,
|
|
192
|
+
:bill_qty_variance_acct,
|
|
193
|
+
:klass,
|
|
194
|
+
:cogs_account,
|
|
195
|
+
:consumption_unit,
|
|
196
|
+
:cost_category,
|
|
197
|
+
:create_revenue_plans_on,
|
|
198
|
+
:custom_form,
|
|
199
|
+
:default_item_ship_method,
|
|
200
|
+
:deferred_revenue_account,
|
|
201
|
+
:demand_source,
|
|
202
|
+
:department,
|
|
203
|
+
:dropship_expense_account,
|
|
204
|
+
:gain_loss_account,
|
|
205
|
+
:income_account,
|
|
206
|
+
:interco_cogs_account,
|
|
207
|
+
:interco_income_account,
|
|
208
|
+
:issue_product,
|
|
209
|
+
:item_revenue_category,
|
|
210
|
+
:location,
|
|
211
|
+
:parent,
|
|
212
|
+
:planning_item_category,
|
|
213
|
+
:preferred_location,
|
|
214
|
+
:pricing_group,
|
|
215
|
+
:purchase_price_variance_acct,
|
|
216
|
+
:purchase_tax_code,
|
|
217
|
+
:purchase_unit,
|
|
218
|
+
:quantity_pricing_schedule,
|
|
219
|
+
:revenue_allocation_group,
|
|
220
|
+
:revenue_recognition_rule,
|
|
221
|
+
:rev_rec_forecast_rule,
|
|
222
|
+
:rev_rec_schedule,
|
|
223
|
+
:sales_tax_code,
|
|
224
|
+
:sale_unit,
|
|
225
|
+
:secondary_base_unit,
|
|
226
|
+
:secondary_consumption_unit,
|
|
227
|
+
:secondary_purchase_unit,
|
|
228
|
+
:secondary_sale_unit,
|
|
229
|
+
:secondary_stock_unit,
|
|
230
|
+
:secondary_units_type,
|
|
231
|
+
:ship_package,
|
|
232
|
+
:soft_descriptor,
|
|
233
|
+
:stock_unit,
|
|
234
|
+
:store_display_image,
|
|
235
|
+
:store_display_thumbnail,
|
|
236
|
+
:store_item_template,
|
|
237
|
+
:supply_lot_sizing_method,
|
|
238
|
+
:supply_replenishment_method,
|
|
239
|
+
:supply_type,
|
|
240
|
+
:tax_schedule,
|
|
241
|
+
:units_type,
|
|
242
|
+
:vendor,
|
|
243
|
+
].each do |record_ref|
|
|
244
|
+
expect(item).to have_record_ref(record_ref)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'ostruct'
|
|
3
|
+
|
|
4
|
+
module NetSuite
|
|
5
|
+
module Records
|
|
6
|
+
describe MatrixOptionList do
|
|
7
|
+
let(:list) { described_class.new }
|
|
8
|
+
|
|
9
|
+
it "deals with hash properly" do
|
|
10
|
+
hash = {:value=>{:@internal_id=>"1", :@type_id=>"36", :name=>"some value"}, :@script_id=>'cust_field_1'}
|
|
11
|
+
|
|
12
|
+
list = described_class.new({ matrix_option: hash })
|
|
13
|
+
option = list.options.first
|
|
14
|
+
expect(option.value_id).to eq "1"
|
|
15
|
+
expect(option.type_id).to eq "36"
|
|
16
|
+
expect(option.name).to eq "some value"
|
|
17
|
+
expect(option.script_id).to eq "cust_field_1"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "deals with arrays properly" do
|
|
21
|
+
array = [
|
|
22
|
+
{:value=>{:@internal_id=>"2", :@type_id=>"28", :name=>"some value 28"}, :@script_id=>'cust_field_28'},
|
|
23
|
+
{:value=>{:@internal_id=>"1", :@type_id=>"29", :name=>"some value 29"}, :@script_id=>'cust_field_29'}
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
list = described_class.new({ matrix_option: array })
|
|
27
|
+
expect(list.options.count).to eq 2
|
|
28
|
+
|
|
29
|
+
option = list.options.first
|
|
30
|
+
expect(option.value_id).to eq "2"
|
|
31
|
+
expect(option.type_id).to eq "28"
|
|
32
|
+
expect(option.name).to eq "some value 28"
|
|
33
|
+
expect(option.script_id).to eq "cust_field_28"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe '#to_record' do
|
|
37
|
+
before do
|
|
38
|
+
list.options << OpenStruct.new(
|
|
39
|
+
type_id: 'TYPE',
|
|
40
|
+
value_id: 'VALUE',
|
|
41
|
+
script_id: 'SCRIPT',
|
|
42
|
+
name: 'NAME',
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'can represent itself as a SOAP record' do
|
|
47
|
+
record = {
|
|
48
|
+
'listAcct:matrixOption' => [{
|
|
49
|
+
'@scriptId' => 'SCRIPT',
|
|
50
|
+
'platformCore:value' => {
|
|
51
|
+
'@internalId' => 'VALUE',
|
|
52
|
+
'@typeId' => 'TYPE',
|
|
53
|
+
},
|
|
54
|
+
}],
|
|
55
|
+
}
|
|
56
|
+
expect(list.to_record).to eql(record)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe NetSuite::Records::Message do
|
|
4
|
+
let(:message) { NetSuite::Records::Message.new }
|
|
5
|
+
|
|
6
|
+
it 'has all the right fields' do
|
|
7
|
+
[
|
|
8
|
+
:bcc, :cc, :compress_attachments, :date_time, :emailed,
|
|
9
|
+
:incoming, :message, :record_name, :record_type_name, :subject,
|
|
10
|
+
:last_modified_date, :message_date
|
|
11
|
+
].each do |field|
|
|
12
|
+
expect(message).to have_field(field)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'has the right record_refs' do
|
|
17
|
+
[
|
|
18
|
+
:activity, :author, :recipient, :transaction
|
|
19
|
+
].each do |record_ref|
|
|
20
|
+
expect(message).to have_record_ref(record_ref)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
describe '.get' do
|
|
25
|
+
context 'when the response is successful' do
|
|
26
|
+
let(:response) { NetSuite::Response.new(:success => true, :body => {message: 'message text'})}
|
|
27
|
+
|
|
28
|
+
it 'returns a Message instance populated with data from the response object' do
|
|
29
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Message, :external_id => 1], {}).and_return(response)
|
|
30
|
+
|
|
31
|
+
message = NetSuite::Records::Message.get(:external_id => 1)
|
|
32
|
+
expect(message).to be_kind_of(NetSuite::Records::Message)
|
|
33
|
+
expect(message.message).to eq('message text')
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
context 'when response is unsuccessful' do
|
|
38
|
+
let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
|
|
39
|
+
it 'raises a RecordNotFound exception' do
|
|
40
|
+
expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Message, :external_id => 1], {}).and_return(response)
|
|
41
|
+
expect {
|
|
42
|
+
NetSuite::Records::Message.get(:external_id => 1)
|
|
43
|
+
}.to raise_error(NetSuite::RecordNotFound,
|
|
44
|
+
/NetSuite::Records::Message with OPTIONS=(.*) could not be found/)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|