netsuite 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acf21d9a2b7a9ee0eedee971c7ebd1af50c05c28a1a5a03dea740fc1eb22529c
4
- data.tar.gz: 6b740ed5e9b8d76926d63ca2895d0370b11b0c0656bd2581f15b9133f7d7edec
3
+ metadata.gz: 322dc4e1ca618901cbe11d81ed9d22351557188e4c64db465e433d9a26079e19
4
+ data.tar.gz: dd9aebc4902c3fbb61ad2df4feb2d0ea634606e6778bf2981b2722803596af99
5
5
  SHA512:
6
- metadata.gz: 2a7d9f98b1574b63a6da20d65376e1edb936f8d16d44019871b8d7e2e7f1354956eac101d038f756bc8a2256977c6afbd0742c7f7badbd6ec89a8165fdde77f8
7
- data.tar.gz: 6a268c38ec15d63e50f5c713363b7cf9f8b5faf67b1a4f40c4cdadc8728a27b1d2928d36debab70db278b26d36661d5e908ba04a3235464f0b23487ac1c6b91c
6
+ metadata.gz: 0b9f90448959b2ee6abf9d93480700bf15cca9758d2e9632ac3e755edc09eec033a2248f9ee40bfbd21dfb8b992c4bd53bc1af3d7bb322aa9e8428a6ca055553
7
+ data.tar.gz: 15666ea4627c96749dfa5bc9f664466f78aeeaf54d0f9bf95c21d568e4e5f429b44edc2bad5b4336507c068aa1657cd4cabbe8d13a54360b4722611122d585e1
data/HISTORY.md CHANGED
@@ -10,6 +10,12 @@
10
10
  *
11
11
  *
12
12
 
13
+ ## 0.8.9
14
+
15
+ ### Fixed
16
+
17
+ * Fixed issue where search only fields could be specified when an existing field exists. https://github.com/NetSweet/netsuite/pull/488
18
+
13
19
  ## 0.8.8
14
20
 
15
21
  ### Added
data/README.md CHANGED
@@ -421,7 +421,10 @@ NetSuite::Records::SalesOrder.search({
421
421
  'tranSales:basic' => [
422
422
  'platformCommon:internalId/' => {},
423
423
  'platformCommon:email/' => {},
424
- 'platformCommon:tranDate/' => {}
424
+ 'platformCommon:tranDate/' => {},
425
+ # If you include columns that are only part of the *SearchRowBasic (ie. TransactionSearchRowBasic),
426
+ # they'll be readable on the resulting record just like regular fields (my_record.close_date).
427
+ 'platformCommon:closeDate/' => {}
425
428
  ],
426
429
  'tranSales:accountJoin' => [
427
430
  'platformCommon:internalId/' => {}
@@ -12,7 +12,7 @@ module NetSuite
12
12
  :search
13
13
 
14
14
  fields :bin_numbers, :built, :created_date, :expiration_date,
15
- :last_modified_date, :memo, :quantity, :serial_numbers, :total,
15
+ :last_modified_date, :memo, :quantity, :serial_numbers,
16
16
  :tran_date, :tran_id
17
17
 
18
18
  read_only_fields :total
@@ -36,5 +36,3 @@ module NetSuite
36
36
  end
37
37
  end
38
38
  end
39
-
40
-
@@ -12,7 +12,7 @@ module NetSuite
12
12
 
13
13
  actions :get, :get_list, :search
14
14
 
15
- fields :base_currency, :effective_date, :exchange_rate, :transaction_currency
15
+ fields :effective_date, :exchange_rate
16
16
 
17
17
  record_refs :base_currency, :transaction_currency
18
18
 
@@ -10,12 +10,12 @@ module NetSuite
10
10
  actions :get, :get_list, :add, :initialize, :delete, :update, :upsert, :search
11
11
 
12
12
  fields :alt_handling_cost, :alt_sales_total, :alt_shipping_cost, :balance,
13
- :bill_address, :billing_address, :billing_schedule, :bill_is_residential,
13
+ :bill_address, :billing_schedule, :bill_is_residential,
14
14
  :created_date, :currency_name, :discount_rate, :email, :end_date,
15
15
  :est_gross_profit, :exchange_rate, :handling_cost, :handling_tax1_rate, :is_taxable,
16
- :last_modified_date, :memo, :message, :other_ref_num, :ship_date, :shipping_cost,
17
- :shipping_tax1_rate, :source, :start_date, :status, :sync_partner_teams, :sync_sales_teams,
18
- :to_be_emailed, :to_be_faxed, :to_be_printed, :total_cost_estimate, :tran_date, :tran_id,
16
+ :last_modified_date, :memo, :message, :other_ref_num, :ship_date, :shipping_cost,
17
+ :shipping_tax1_rate, :source, :start_date, :status, :sync_partner_teams, :sync_sales_teams,
18
+ :to_be_emailed, :to_be_faxed, :to_be_printed, :total_cost_estimate, :tran_date, :tran_id,
19
19
  :linked_tracking_numbers, :is_multi_ship_to
20
20
 
21
21
  field :shipping_address, Address
@@ -24,8 +24,8 @@ module NetSuite
24
24
  field :item_list, EstimateItemList
25
25
  field :custom_field_list, CustomFieldList
26
26
 
27
- record_refs :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item, :entity,
28
- :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel, :opportunity, :partner,
27
+ record_refs :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item, :entity,
28
+ :handling_tax_code, :job, :klass, :lead_source, :location, :message_sel, :opportunity, :partner,
29
29
  :promo_code, :sales_group, :sales_rep, :ship_method, :shipping_tax_code, :subsidiary, :terms
30
30
 
31
31
  attr_reader :internal_id
@@ -94,12 +94,12 @@ module NetSuite
94
94
  :obsolete_date, :obsolete_revision, :online_customer_price,
95
95
  :online_price, :other_prices, :other_vendor, :overhead_type,
96
96
  :preferred_bin, :primary_category, :prod_price_variance_acct,
97
- :prod_qty_variance_acct, :purchase_unit, :reserve_price,
98
- :revenue_recognition_rule, :same_as_primary_book_amortization,
97
+ :prod_qty_variance_acct, :reserve_price,
98
+ :same_as_primary_book_amortization,
99
99
  :same_as_primary_book_rev_rec, :scrap_acct, :sell_on_ebay,
100
100
  :serial_number, :serial_number_location, :shipping_carrier,
101
101
  :shipping_rate, :shopping_product_feed, :shopzilla_product_feed,
102
- :soft_descriptor, :starting_price, :subsidiary, :sub_type,
102
+ :starting_price, :subsidiary, :sub_type,
103
103
  :thumb_nail_url, :type, :unbuild_variance_account, :use_component_yield,
104
104
  :vendor_code, :vendor_cost, :vendor_cost_entered,
105
105
  :vendor_price_currency, :vendor_schedule, :vend_return_variance_account,
@@ -11,8 +11,8 @@ module NetSuite
11
11
 
12
12
  actions :get, :get_deleted, :get_list, :initialize, :add, :update, :delete, :upsert, :upsert_list, :search
13
13
 
14
- fields :balance, :bill_address,
15
- :billing_schedule, :contrib_pct, :created_date, :currency_name, :custom_field_list,
14
+ fields :balance,
15
+ :billing_schedule, :contrib_pct, :created_date, :currency_name,
16
16
  :deferred_revenue, :discount_amount, :discount_date, :discount_rate,
17
17
  :due_date, :email, :end_date, :est_gross_profit, :est_gross_profit_percent, :exchange_rate,
18
18
  :exclude_commission, :exp_cost_disc_amount, :exp_cost_disc_print, :exp_cost_disc_rate, :exp_cost_disc_tax_1_amt,
@@ -24,13 +24,13 @@ module NetSuite
24
24
  :linked_tracking_numbers, :memo, :message, :message_sel, :on_credit_hold, :opportunity,
25
25
  :other_ref_num, :partners_list, :rev_rec_end_date,
26
26
  :rev_rec_on_rev_commitment, :rev_rec_schedule, :rev_rec_start_date, :revenue_status, :sales_effective_date,
27
- :sales_group, :sales_team_list, :ship_address, :ship_date, :ship_group_list,
27
+ :sales_group, :sales_team_list, :ship_date, :ship_group_list,
28
28
  :shipping_cost, :shipping_tax_1_rate, :shipping_tax_2_rate, :shipping_tax_code, :source, :start_date,
29
29
  :status, :sync_partner_teams, :sync_sales_teams, :tax_2_total,
30
30
  :tax_total, :time_disc_amount, :time_disc_print, :time_disc_rate, :time_disc_tax_1_amt, :time_disc_taxable,
31
31
  :time_discount, :time_list, :time_tax_code, :time_tax_rate_1, :time_tax_rate_2, :to_be_emailed, :to_be_faxed,
32
32
  :to_be_printed, :total_cost_estimate, :tracking_numbers, :tran_date, :tran_id, :tran_is_vsoe_bundle,
33
- :transaction_bill_address, :transaction_ship_address, :vat_reg_num, :vsoe_auto_calc, :tax_rate
33
+ :vat_reg_num, :vsoe_auto_calc, :tax_rate
34
34
 
35
35
  field :transaction_bill_address, BillAddress
36
36
  field :transaction_ship_address, ShipAddress
@@ -39,7 +39,7 @@ module NetSuite
39
39
  field :shipping_address, Address
40
40
  field :billing_address, Address
41
41
 
42
- read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid, :amount,
42
+ read_only_fields :sub_total, :discount_total, :total, :recognized_revenue, :amount_remaining, :amount_paid,
43
43
  :alt_shipping_cost, :gift_cert_applied, :handling_cost, :alt_handling_cost
44
44
 
45
45
  # https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_2/schema/search/transactionsearchrowbasic.html?mode=package
@@ -97,7 +97,7 @@ module NetSuite
97
97
  :merchant_account, :multi_subsidiary, :net_amount, :net_amount_no_tax,
98
98
  :next_bill_date, :no_auto_assign_location, :non_reimbursable,
99
99
  :one_time_total, :options, :order_allocation_strategy, :order_priority,
100
- :originator, :other_ref_num, :overhead_parent_item,
100
+ :originator, :overhead_parent_item,
101
101
  :override_installments, :package_count, :paid_amount, :paid_transaction,
102
102
  :partner_contribution, :partner_role, :partner_team_member,
103
103
  :paying_amount, :paying_transaction, :payment_approved,
@@ -9,7 +9,7 @@ module NetSuite
9
9
  fields :amount, :amount_ordered, :bin_numbers, :cost_estimate, :cost_estimate_type, :current_percent,
10
10
  :defer_rev_rec, :description, :gift_cert_from, :gift_cert_message, :gift_cert_number, :gift_cert_recipient_email,
11
11
  :gift_cert_recipient_name, :gross_amt, :inventory_detail, :is_taxable, :item_is_fulfilled, :license_code, :line,
12
- :klass, :options, :order_line, :percent_complete, :quantity, :quantity_available, :quantity_fulfilled,
12
+ :options, :order_line, :percent_complete, :quantity, :quantity_available, :quantity_fulfilled,
13
13
  :quantity_on_hand, :quantity_ordered, :rate, :rev_rec_end_date, :rev_rec_start_date,
14
14
  :serial_numbers, :ship_group, :tax1_amt, :tax_rate1, :tax_rate2, :vsoe_allocation, :vsoe_amount, :vsoe_deferral,
15
15
  :vsoe_delivered, :vsoe_permit_discount, :vsoe_price
@@ -9,7 +9,7 @@ module NetSuite
9
9
  fields :amount, :amount_ordered, :bin_numbers, :cost_estimate, :cost_estimate_type, :current_percent,
10
10
  :defer_rev_rec, :description, :gift_cert_from, :gift_cert_message, :gift_cert_number, :gift_cert_recipient_email,
11
11
  :gift_cert_recipient_name, :gross_amt, :inventory_detail, :is_taxable, :item_is_fulfilled, :license_code, :line,
12
- :klass, :options, :order_line, :percent_complete, :quantity, :quantity_available, :quantity_fulfilled,
12
+ :options, :order_line, :percent_complete, :quantity, :quantity_available, :quantity_fulfilled,
13
13
  :quantity_on_hand, :quantity_ordered, :rate, :rev_rec_end_date, :rev_rec_start_date,
14
14
  :serial_numbers, :ship_group, :tax1_amt, :tax_rate1, :tax_rate2, :vsoe_allocation, :vsoe_amount, :vsoe_deferral,
15
15
  :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :item_receive
@@ -7,7 +7,7 @@ module NetSuite
7
7
  include Namespaces::TranPurch
8
8
 
9
9
  fields :bin_numbers, :currency, :description, :expiration_date, :is_drop_shipment,
10
- :item_name, :item_receive, :job_name, :line, :on_hand, :options, :order_line,
10
+ :item_name, :item_receive, :job_name, :line, :on_hand, :order_line,
11
11
  :quantity, :quantity_remaining, :rate, :restock, :serial_numbers,
12
12
  :unit_cost_override, :units_display
13
13
 
@@ -3,8 +3,6 @@ module NetSuite
3
3
  class MemberList < Support::Sublist
4
4
  include Namespaces::ListAcct
5
5
 
6
- fields :replace_all
7
-
8
6
  sublist :item_member, ItemMember
9
7
 
10
8
  end
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :manufacturer_zip, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity,
18
18
  :minimum_quantity_units, :mpn, :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support,
19
19
  :on_special, :out_of_stock_behavior, :out_of_stock_message, :overall_quantity_pricing_type, :page_title,
20
- :preference_criterion, :presentation_item_list, :prices_include_tax, :pricing_matrix, :producer, :product_feed_list,
20
+ :preference_criterion, :presentation_item_list, :prices_include_tax, :producer, :product_feed_list,
21
21
  :rate, :related_items_description, :sales_description, :schedule_b_code, :schedule_b_number, :schedule_b_quantity,
22
22
  :search_keywords, :ship_individually, :shipping_cost, :shipping_cost_units, :shopping_dot_com_category,
23
23
  :shopzilla_category_id, :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor,
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :manufacturer_zip, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity,
18
18
  :minimum_quantity_units, :mpn, :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support,
19
19
  :on_special, :out_of_stock_behavior, :out_of_stock_message, :overall_quantity_pricing_type, :page_title,
20
- :preference_criterion, :presentation_item_list, :prices_include_tax, :pricing_matrix, :producer, :product_feed_list,
20
+ :preference_criterion, :presentation_item_list, :prices_include_tax, :producer, :product_feed_list,
21
21
  :rate, :related_items_description, :sales_description, :schedule_b_code, :schedule_b_number, :schedule_b_quantity,
22
22
  :search_keywords, :ship_individually, :shipping_cost, :shipping_cost_units, :shopping_dot_com_category,
23
23
  :shopzilla_category_id, :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor,
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :manufacturer_zip, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html, :minimum_quantity,
18
18
  :minimum_quantity_units, :mpn, :mult_manufacture_addr, :nex_tag_category, :no_price_message, :offer_support,
19
19
  :on_special, :out_of_stock_behavior, :out_of_stock_message, :overall_quantity_pricing_type, :page_title,
20
- :preference_criterion, :presentation_item_list, :prices_include_tax, :pricing_matrix, :producer, :product_feed_list,
20
+ :preference_criterion, :presentation_item_list, :prices_include_tax, :producer, :product_feed_list,
21
21
  :rate, :related_items_description, :sales_description, :schedule_b_code, :schedule_b_number, :schedule_b_quantity,
22
22
  :search_keywords, :ship_individually, :shipping_cost, :shipping_cost_units, :shopping_dot_com_category,
23
23
  :shopzilla_category_id, :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor,
@@ -17,7 +17,7 @@ module NetSuite
17
17
  :memo, :probability, :proj_alt_sales_amt, :projected_total,
18
18
  :range_high, :range_low,
19
19
  :ship_is_residential, :source, :status, :sync_partner_teams, :sync_sales_teams,
20
- :tax2_total, :tax_total, :title, :total_cost_estimate, :tran_date, :tran_id,
20
+ :tax2_total, :title, :total_cost_estimate, :tran_date, :tran_id,
21
21
  :vat_reg_num, :weighted_total
22
22
 
23
23
  field :ship_address, ShipAddress
@@ -43,4 +43,4 @@ module NetSuite
43
43
 
44
44
  end
45
45
  end
46
- end
46
+ end
@@ -10,7 +10,7 @@ module NetSuite
10
10
  actions :get, :get_list, :add, :delete, :update, :upsert
11
11
 
12
12
  fields :title, :message, :phone, :status, :priority, :start_date, :end_date,
13
- :start_time, :end_time, :completed_date, :timed_event, :access_level, :timed_event
13
+ :start_time, :end_time, :completed_date, :timed_event, :access_level
14
14
 
15
15
  field :contact_list, ContactList
16
16
 
@@ -180,7 +180,6 @@ module NetSuite
180
180
  :store_display_name,
181
181
  :store_display_thumbnail,
182
182
  :store_item_template,
183
- :subsidiary_list,
184
183
  :supply_lot_sizing_method,
185
184
  :supply_replenishment_method,
186
185
  :supply_time_fence,
@@ -15,7 +15,7 @@ module NetSuite
15
15
  :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html,
16
16
  :minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior,
17
17
  :out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax,
18
- :pricing_matrix, :rate, :related_items_description, :sales_description, :search_keywords,
18
+ :rate, :related_items_description, :sales_description, :search_keywords,
19
19
  :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description,
20
20
  :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component,
21
21
  :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
@@ -15,7 +15,7 @@ module NetSuite
15
15
  :item_id, :last_modified_date, :matrix_option_list, :matrix_type, :max_donation_amount, :meta_tag_html,
16
16
  :minimum_quantity, :minimum_quantity_units, :no_price_message, :offer_support, :on_special, :out_of_stock_behavior,
17
17
  :out_of_stock_message, :overall_quantity_pricing_type, :page_title, :presentation_item_list, :prices_include_tax,
18
- :pricing_matrix, :rate, :related_items_description, :sales_description, :search_keywords,
18
+ :rate, :related_items_description, :sales_description, :search_keywords,
19
19
  :show_default_donation_amount, :site_category_list, :sitemap_priority, :soft_descriptor, :specials_description,
20
20
  :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component,
21
21
  :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
@@ -8,7 +8,7 @@ module NetSuite
8
8
 
9
9
  fields :amount, :average_cost, :klass, :commit_inventory, :description,
10
10
  :expected_receipt_date, :expected_ship_date, :inventory_detail, :is_closed, :last_purchase_price,
11
- :line, :options, :order_priority, :quantity, :quantity_available,
11
+ :line, :order_priority, :quantity, :quantity_available,
12
12
  :quantity_back_ordered, :quantity_committed, :quantity_fulfilled,
13
13
  :quantity_on_hand, :quantity_packed, :quantity_picked, :quantity_received,
14
14
  :rate, :serial_numbers
@@ -9,16 +9,16 @@ module NetSuite
9
9
 
10
10
  actions :get, :get_list, :add, :update, :upsert, :delete, :search
11
11
 
12
- fields :account_number, :alt_email, :alt_name, :alt_phone, :balance,
13
- :balance_primary, :bcn, :bill_pay, :comments, :company_name, :credit_limit,
12
+ fields :account_number, :alt_email, :alt_name, :alt_phone,
13
+ :bcn, :bill_pay, :comments, :company_name, :credit_limit,
14
14
  :date_created, :default_address, :eligible_for_commission,
15
15
  :email, :email_preference, :email_transactions, :entity_id, :fax, :fax_transactions,
16
16
  :first_name, :give_access, :global_subscription_status, :home_phone, :is1099_eligible,
17
17
  :is_accountant, :is_inactive, :is_job_resource_vend, :is_person, :labor_cost,
18
- :last_modified_date, :last_name, :legal_name, :middle_name, :mobile_phone, :opening_balance,
18
+ :last_name, :legal_name, :middle_name, :mobile_phone, :opening_balance,
19
19
  :opening_balance_date, :password, :password2, :phone, :phonetic_name, :pricing_schedule_list,
20
20
  :print_on_check_as, :print_transactions, :require_pwd_change, :roles_list, :salutation,
21
- :send_email, :subscriptions_list, :tax_id_num, :title, :unbilled_orders, :unbilled_orders_primary,
21
+ :send_email, :subscriptions_list, :tax_id_num, :title,
22
22
  :url, :vat_reg_number
23
23
 
24
24
  field :custom_field_list, CustomFieldList
@@ -21,6 +21,7 @@ module NetSuite
21
21
 
22
22
  def field(name, klass = nil)
23
23
  name_sym = name.to_sym
24
+ raise "#{name} already defined on #{self.name}" if fields.include?(name_sym)
24
25
  fields << name_sym
25
26
  if klass
26
27
  define_method(name_sym) do
@@ -1,3 +1,3 @@
1
1
  module NetSuite
2
- VERSION = '0.8.8'
2
+ VERSION = '0.8.9'
3
3
  end
@@ -80,12 +80,12 @@ describe NetSuite::Records::InventoryItem do
80
80
  :number_allowed_downloads, :num_currently_listed, :obsolete_date,
81
81
  :obsolete_revision, :online_customer_price, :online_price, :other_prices,
82
82
  :other_vendor, :overhead_type, :preferred_bin, :primary_category,
83
- :prod_price_variance_acct, :prod_qty_variance_acct, :purchase_unit,
84
- :reserve_price, :revenue_recognition_rule,
83
+ :prod_price_variance_acct, :prod_qty_variance_acct,
84
+ :reserve_price,
85
85
  :same_as_primary_book_amortization, :same_as_primary_book_rev_rec,
86
86
  :scrap_acct, :sell_on_ebay, :serial_number, :serial_number_location,
87
87
  :shipping_carrier, :shipping_rate, :shopping_product_feed,
88
- :shopzilla_product_feed, :soft_descriptor, :starting_price, :subsidiary,
88
+ :shopzilla_product_feed, :starting_price, :subsidiary,
89
89
  :sub_type, :thumb_nail_url, :type, :unbuild_variance_account,
90
90
  :use_component_yield, :vendor_code, :vendor_cost, :vendor_cost_entered,
91
91
  :vendor_price_currency, :vendor_schedule, :vend_return_variance_account,
@@ -94,7 +94,7 @@ describe NetSuite::Records::Invoice do
94
94
  :merchant_account, :multi_subsidiary, :net_amount, :net_amount_no_tax,
95
95
  :next_bill_date, :no_auto_assign_location, :non_reimbursable,
96
96
  :one_time_total, :options, :order_allocation_strategy, :order_priority,
97
- :originator, :other_ref_num, :overhead_parent_item,
97
+ :originator, :overhead_parent_item,
98
98
  :override_installments, :package_count, :paid_amount, :paid_transaction,
99
99
  :partner_contribution, :partner_role, :partner_team_member,
100
100
  :paying_amount, :paying_transaction, :payment_approved,
@@ -1,9 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe NetSuite::Support::Fields do
4
- let(:klass) { Class.new.send(:include, NetSuite::Support::Fields) }
4
+ DummyRecord = Class.new.send(:include, NetSuite::Support::Fields)
5
+ let(:klass) { DummyRecord }
5
6
  let(:instance) { klass.new }
6
7
 
8
+ before { klass.fields.clear }
9
+
7
10
  describe '.fields' do
8
11
  context 'with arguments' do
9
12
  it 'calls .field with each argument passed to it' do
@@ -29,6 +32,12 @@ describe NetSuite::Support::Fields do
29
32
  instance.one = 1
30
33
  expect(instance.one).to eql(1)
31
34
  end
35
+
36
+ it 'errors when already a field' do
37
+ klass.field :one
38
+
39
+ expect { klass.field :one }.to raise_error('one already defined on DummyRecord')
40
+ end
32
41
  end
33
42
 
34
43
  describe '.read_only_fields' do
@@ -57,4 +66,30 @@ describe NetSuite::Support::Fields do
57
66
  end
58
67
  end
59
68
 
69
+ describe '.search_only_fields' do
70
+ context 'with arguments' do
71
+ it 'calls .search_only_field with each argument passed to it' do
72
+ [:one, :two, :three].each do |field|
73
+ expect(klass).to receive(:search_only_field).with(field)
74
+ end
75
+ klass.search_only_fields(:one, :two, :three)
76
+ end
77
+ end
78
+
79
+ context 'without arguments' do
80
+ it 'returns a Set of the search_only_field arguments' do
81
+ arguments = [:one, :two, :three]
82
+ klass.search_only_fields(*arguments)
83
+ expect(klass.search_only_fields).to eql(Set.new(arguments))
84
+ end
85
+ end
86
+ end
87
+
88
+ describe '.search_only_field' do
89
+ it 'defines instance accessor methods for the given field' do
90
+ expect(klass).to receive(:field).with(:one)
91
+ klass.search_only_field(:one)
92
+ end
93
+ end
94
+
60
95
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsuite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Moran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-10 00:00:00.000000000 Z
12
+ date: 2021-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon