netsuite 0.8.12 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql-analysis.yml +3 -3
  3. data/HISTORY.md +21 -1
  4. data/lib/netsuite/actions/add.rb +2 -1
  5. data/lib/netsuite/actions/delete.rb +17 -0
  6. data/lib/netsuite/configuration.rb +16 -3
  7. data/lib/netsuite/records/assembly_item.rb +2 -1
  8. data/lib/netsuite/records/customer.rb +225 -23
  9. data/lib/netsuite/records/customer_refund.rb +1 -1
  10. data/lib/netsuite/records/description_item.rb +1 -1
  11. data/lib/netsuite/records/discount_item.rb +1 -1
  12. data/lib/netsuite/records/file.rb +1 -1
  13. data/lib/netsuite/records/gift_certificate_item.rb +1 -1
  14. data/lib/netsuite/records/item_availability.rb +46 -0
  15. data/lib/netsuite/records/item_fulfillment.rb +4 -1
  16. data/lib/netsuite/records/item_fulfillment_package_fed_ex.rb +28 -0
  17. data/lib/netsuite/records/item_fulfillment_package_fed_ex_list.rb +32 -0
  18. data/lib/netsuite/records/item_fulfillment_package_ups.rb +27 -0
  19. data/lib/netsuite/records/item_fulfillment_package_ups_list.rb +32 -0
  20. data/lib/netsuite/records/item_fulfillment_package_usps.rb +26 -0
  21. data/lib/netsuite/records/item_fulfillment_package_usps_list.rb +32 -0
  22. data/lib/netsuite/records/item_group.rb +1 -1
  23. data/lib/netsuite/records/kit_item.rb +1 -1
  24. data/lib/netsuite/records/lot_numbered_assembly_item.rb +1 -1
  25. data/lib/netsuite/records/non_inventory_purchase_item.rb +1 -1
  26. data/lib/netsuite/records/non_inventory_resale_item.rb +1 -1
  27. data/lib/netsuite/records/non_inventory_sale_item.rb +1 -1
  28. data/lib/netsuite/records/other_charge_sale_item.rb +1 -1
  29. data/lib/netsuite/records/payment_item.rb +1 -1
  30. data/lib/netsuite/records/sales_order.rb +1 -0
  31. data/lib/netsuite/records/sales_order_item.rb +2 -1
  32. data/lib/netsuite/records/serialized_assembly_item.rb +1 -1
  33. data/lib/netsuite/records/serialized_inventory_item.rb +1 -1
  34. data/lib/netsuite/records/service_resale_item.rb +1 -1
  35. data/lib/netsuite/records/service_sale_item.rb +1 -1
  36. data/lib/netsuite/records/{customer_subscription.rb → subscription.rb} +1 -1
  37. data/lib/netsuite/records/subscriptions_list.rb +10 -0
  38. data/lib/netsuite/records/subtotal_item.rb +1 -1
  39. data/lib/netsuite/support/sublist.rb +1 -1
  40. data/lib/netsuite/utilities.rb +20 -13
  41. data/lib/netsuite/version.rb +1 -1
  42. data/lib/netsuite.rb +9 -2
  43. data/netsuite.gemspec +3 -0
  44. data/spec/netsuite/actions/add_spec.rb +4 -2
  45. data/spec/netsuite/actions/delete_spec.rb +74 -14
  46. data/spec/netsuite/actions/get_select_value_spec.rb +43 -0
  47. data/spec/netsuite/configuration_spec.rb +35 -0
  48. data/spec/netsuite/records/customer_spec.rb +287 -20
  49. data/spec/netsuite/records/item_availability_spec.rb +59 -0
  50. data/spec/netsuite/records/item_fulfillment_package_fed_ex_list_spec.rb +27 -0
  51. data/spec/netsuite/records/item_fulfillment_package_ups_list_spec.rb +27 -0
  52. data/spec/netsuite/records/item_fulfillment_package_usps_list_spec.rb +27 -0
  53. data/spec/netsuite/records/sales_order_item_spec.rb +4 -3
  54. data/spec/netsuite/records/sales_order_spec.rb +17 -0
  55. data/spec/netsuite/records/{customer_subscription_spec.rb → subscription_spec.rb} +2 -2
  56. data/spec/netsuite/records/{customer_subscriptions_list_spec.rb → subscriptions_list_spec.rb} +2 -2
  57. data/spec/support/fixtures/add/add_invoice.xml +9 -5
  58. data/spec/support/fixtures/delete/delete_customer_error.xml +21 -0
  59. data/spec/support/fixtures/delete/delete_customer_multiple_errors.xml +25 -0
  60. data/spec/support/fixtures/get_item_availability/get_item_availability.xml +46 -0
  61. data/spec/support/fixtures/get_select_value/empty_result.xml +22 -0
  62. data/spec/support/fixtures/get_select_value/item_fulfillment_ship_method.xml +43 -0
  63. metadata +39 -10
  64. data/lib/netsuite/records/customer_subscriptions_list.rb +0 -10
@@ -5,30 +5,268 @@ describe NetSuite::Records::Customer do
5
5
 
6
6
  it 'has all the right fields' do
7
7
  [
8
- :account_number, :aging, :alt_email, :alt_name, :alt_phone, :balance, :bill_pay,
9
- :buying_reason, :buying_time_frame, :campaign_category, :click_stream, :comments, :company_name,
10
- :consol_aging, :consol_balance, :consol_days_overdue, :consol_deposit_balance, :consol_overdue_balance,
11
- :consol_unbilled_orders, :contrib_pct, :credit_hold_override, :credit_limit,
12
- :date_created, :days_overdue, :default_address,
13
- :deposit_balance, :download_list, :email, :email_preference, :email_transactions, :end_date, :entity_id,
14
- :estimated_budget, :fax, :fax_transactions, :first_name, :first_visit, :give_access, :global_subscription_status,
15
- :group_pricing_list, :home_phone, :image, :is_budget_approved, :is_inactive, :is_person, :item_pricing_list, :keywords,
16
- :language, :last_modified_date, :last_name, :last_page_visited, :last_visit, :middle_name, :mobile_phone,
17
- :opening_balance, :opening_balance_account, :opening_balance_date, :overdue_balance,
18
- :password, :password2, :phone, :phonetic_name, :pref_cc_processor,:print_on_check_as,
19
- :print_transactions, :referrer, :reminder_days, :representing_subsidiary, :require_pwd_change, :resale_number,
20
- :sales_group, :sales_readiness, :salutation, :send_email, :ship_complete,
21
- :stage, :start_date, :sync_partner_teams, :tax_exempt, :taxable,
22
- :third_party_acct, :third_party_country, :third_party_zipcode, :title, :unbilled_orders, :url,
23
- :vat_reg_number, :visits, :web_lead
8
+ :account_number,
9
+ :aging,
10
+ :aging1,
11
+ :aging2,
12
+ :aging3,
13
+ :aging4,
14
+ :alcohol_recipient_type,
15
+ :alt_email,
16
+ :alt_name,
17
+ :alt_phone,
18
+ :bill_pay,
19
+ :click_stream,
20
+ :comments,
21
+ :company_name,
22
+ :consol_aging,
23
+ :consol_aging1,
24
+ :consol_aging2,
25
+ :consol_aging3,
26
+ :consol_aging4,
27
+ :consol_days_overdue,
28
+ :contrib_pct,
29
+ :credit_hold_override,
30
+ :credit_limit,
31
+ :date_created,
32
+ :days_overdue,
33
+ :default_address,
34
+ :default_order_priority,
35
+ :display_symbol,
36
+ :email,
37
+ :email_preference,
38
+ :email_transactions,
39
+ :end_date,
40
+ :entity_id,
41
+ :estimated_budget,
42
+ :fax,
43
+ :fax_transactions,
44
+ :first_name,
45
+ :first_visit,
46
+ :give_access,
47
+ :global_subscription_status,
48
+ :home_phone,
49
+ :is_budget_approved,
50
+ :is_inactive,
51
+ :is_person,
52
+ :keywords,
53
+ :language,
54
+ :last_modified_date,
55
+ :last_name,
56
+ :last_page_visited,
57
+ :last_visit,
58
+ :middle_name,
59
+ :mobile_phone,
60
+ :monthly_closing,
61
+ :negative_number_format,
62
+ :number_format,
63
+ :opening_balance,
64
+ :opening_balance_date,
65
+ :override_currency_format,
66
+ :password,
67
+ :password2,
68
+ :phone,
69
+ :phonetic_name,
70
+ :print_on_check_as,
71
+ :print_transactions,
72
+ :referrer,
73
+ :reminder_days,
74
+ :require_pwd_change,
75
+ :resale_number,
76
+ :salutation,
77
+ :send_email,
78
+ :ship_complete,
79
+ :stage,
80
+ :start_date,
81
+ :symbol_placement,
82
+ :sync_partner_teams,
83
+ :taxable,
84
+ :tax_exempt,
85
+ :third_party_acct,
86
+ :third_party_country,
87
+ :third_party_zipcode,
88
+ :title,
89
+ :url,
90
+ :vat_reg_number,
91
+ :visits,
92
+ :web_lead,
24
93
  ].each do |field|
25
94
  expect(customer).to have_field(field)
26
95
  end
27
96
  end
28
97
 
98
+ it 'has all the right fields with specific classes' do
99
+ {
100
+ addressbook_list: NetSuite::Records::CustomerAddressbookList,
101
+ contact_roles_list: NetSuite::Records::ContactAccessRolesList,
102
+ credit_cards_list: NetSuite::Records::CustomerCreditCardsList,
103
+ currency_list: NetSuite::Records::CustomerCurrencyList,
104
+ custom_field_list: NetSuite::Records::CustomFieldList,
105
+ # download_list: NetSuite::Records::CustomerDownloadList, # TODO Implement me
106
+ # group_pricing_list: NetSuite::Records::CustomerGroupPricingList, # TODO: Implement me
107
+ # item_pricing_list: NetSuite::Records::CustomerItemPricingList, # TODO: Implement me
108
+ partners_list: NetSuite::Records::CustomerPartnersList,
109
+ sales_team_list: NetSuite::Records::CustomerSalesTeamList,
110
+ subscriptions_list: NetSuite::Records::SubscriptionsList,
111
+ # tax_registration_list: NetSuite::Records::CustomerTaxRegistrationList, # TODO: Implement me
112
+ }.each do |field, klass|
113
+ expect(customer).to have_field(field, klass)
114
+ end
115
+ end
116
+
117
+ it 'has all the right read_only_fields' do
118
+ [
119
+ :balance,
120
+ :consol_balance,
121
+ :deposit_balance,
122
+ :consol_deposit_balance,
123
+ :overdue_balance,
124
+ :consol_overdue_balance,
125
+ :unbilled_orders,
126
+ :consol_unbilled_orders,
127
+ ].each do |field|
128
+ expect(NetSuite::Records::Customer).to have_read_only_field(field)
129
+ end
130
+ end
131
+
132
+ it 'has all the right search_only_fields' do
133
+ [
134
+ :address,
135
+ :address1,
136
+ :address2,
137
+ :address3,
138
+ :addressee,
139
+ :address_internal_id,
140
+ :address_label,
141
+ :address_phone,
142
+ :alt_contact,
143
+ :assigned_site,
144
+ :assigned_site_id,
145
+ :attention,
146
+ :available_offline,
147
+ :bill_address,
148
+ :bill_address1,
149
+ :bill_address2,
150
+ :bill_address3,
151
+ :bill_addressee,
152
+ :bill_attention,
153
+ :bill_city,
154
+ :bill_country,
155
+ :bill_country_code,
156
+ :bill_phone,
157
+ :bill_state,
158
+ :bill_zip_code,
159
+ :cc_customer_code,
160
+ :cc_default,
161
+ :cc_exp_date,
162
+ :cc_holder_name,
163
+ :cc_internal_id,
164
+ :cc_number,
165
+ :cc_state,
166
+ :cc_state_from,
167
+ :cc_type,
168
+ :city,
169
+ :contact,
170
+ :contribution,
171
+ :contribution_primary,
172
+ :conversion_date,
173
+ :country,
174
+ :country_code,
175
+ :credit_hold,
176
+ :date_closed,
177
+ :entity_number,
178
+ :explicit_conversion,
179
+ :first_order_date,
180
+ :first_sale_date,
181
+ :fx_balance,
182
+ :fx_consol_balance,
183
+ :fx_consol_unbilled_orders,
184
+ :fx_unbilled_orders,
185
+ :group_pricing_level,
186
+ :has_duplicates,
187
+ :is_default_billing,
188
+ :is_default_shipping,
189
+ :is_ship_address,
190
+ :item_pricing_level,
191
+ :item_pricing_unit_price,
192
+ :job_end_date,
193
+ :job_projected_end,
194
+ :job_start_date,
195
+ :job_type,
196
+ :last_order_date,
197
+ :last_sale_date,
198
+ :lead_date,
199
+ :level,
200
+ :manual_credit_hold,
201
+ :on_credit_hold,
202
+ :partner_contribution,
203
+ :partner_role,
204
+ :partner_team_member,
205
+ :pec,
206
+ :permission,
207
+ :pricing_group,
208
+ :pricing_item,
209
+ :prospect_date,
210
+ :role,
211
+ :sales_team_member,
212
+ :sales_team_role,
213
+ :ship_address,
214
+ :ship_address1,
215
+ :ship_address2,
216
+ :ship_address3,
217
+ :ship_addressee,
218
+ :ship_attention,
219
+ :ship_city,
220
+ :ship_country,
221
+ :ship_country_code,
222
+ :ship_phone,
223
+ :ship_state,
224
+ :ship_zip,
225
+ :source_site,
226
+ :source_site_id,
227
+ :state,
228
+ :subscription,
229
+ :subscription_date,
230
+ :subscription_status,
231
+ :zip_code,
232
+ ].each do |field|
233
+ expect(NetSuite::Records::Customer).to have_search_only_field(field)
234
+ end
235
+ end
236
+
29
237
  it 'has the right record_refs' do
30
238
  [
31
- :access_role, :currency, :custom_form, :entity_status, :partner, :sales_rep, :terms, :parent, :territory, :shipping_item, :tax_item
239
+ :access_role,
240
+ :assigned_web_site,
241
+ :buying_reason,
242
+ :buying_time_frame,
243
+ :campaign_category,
244
+ :category,
245
+ :currency,
246
+ :custom_form,
247
+ :default_allocation_strategy,
248
+ :default_tax_reg,
249
+ :dr_account,
250
+ :entity_status,
251
+ :fx_account,
252
+ :image,
253
+ :lead_source,
254
+ :opening_balance_account,
255
+ :parent,
256
+ :partner,
257
+ :pref_cc_processor,
258
+ :price_level,
259
+ :receivables_account,
260
+ :representing_subsidiary,
261
+ :sales_group,
262
+ :sales_readiness,
263
+ :sales_rep,
264
+ :shipping_item,
265
+ :source_web_site,
266
+ :subsidiary,
267
+ :tax_item,
268
+ :terms,
269
+ :territory,
32
270
  ].each do |record_ref|
33
271
  expect(customer).to have_record_ref(record_ref)
34
272
  end
@@ -115,12 +353,12 @@ describe NetSuite::Records::Customer do
115
353
  }
116
354
  ]
117
355
  }
118
- expect(customer.subscriptions_list).to be_kind_of(NetSuite::Records::CustomerSubscriptionsList)
356
+ expect(customer.subscriptions_list).to be_kind_of(NetSuite::Records::SubscriptionsList)
119
357
  expect(customer.subscriptions_list.subscriptions.length).to eql(1)
120
358
  end
121
359
 
122
- it 'can be set from a CustomerSubscriptionsList object' do
123
- customer_subscriptions_list = NetSuite::Records::CustomerSubscriptionsList.new
360
+ it 'can be set from a SubscriptionsList object' do
361
+ customer_subscriptions_list = NetSuite::Records::SubscriptionsList.new
124
362
  customer.subscriptions_list = customer_subscriptions_list
125
363
  expect(customer.subscriptions_list).to eql(customer_subscriptions_list)
126
364
  end
@@ -202,6 +440,35 @@ describe NetSuite::Records::Customer do
202
440
  end
203
441
  end
204
442
 
443
+ describe '#attach_file' do
444
+ let(:test_data) { { :email => 'test@example.com', :fax => '1234567890' } }
445
+ let(:file) { double('file') }
446
+
447
+ context 'when the response is successful' do
448
+ let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
449
+
450
+ it 'returns true' do
451
+ customer = NetSuite::Records::Customer.new(test_data)
452
+ expect(NetSuite::Actions::AttachFile).to receive(:call).
453
+ with([customer, file], {}).
454
+ and_return(response)
455
+ expect(customer.attach_file(file)).to be_truthy
456
+ end
457
+ end
458
+
459
+ context 'when the response is unsuccessful' do
460
+ let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
461
+
462
+ it 'returns false' do
463
+ customer = NetSuite::Records::Customer.new(test_data)
464
+ expect(NetSuite::Actions::AttachFile).to receive(:call).
465
+ with([customer, file], {}).
466
+ and_return(response)
467
+ expect(customer.attach_file(file)).to be_falsey
468
+ end
469
+ end
470
+ end
471
+
205
472
  describe '#to_record' do
206
473
  let(:customer) { NetSuite::Records::Customer.new(:entity_id => 'TEST CUSTOMER', :is_person => true) }
207
474
 
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::ItemAvailability do
4
+ before(:all) { savon.mock! }
5
+ after(:all) { savon.unmock! }
6
+
7
+ let(:item_availability) { NetSuite::Records::ItemAvailability.new }
8
+
9
+ it 'has all the right fields' do
10
+ [
11
+ :quantity_on_hand,
12
+ :on_hand_value_mli,
13
+ :reorder_point,
14
+ :quantity_on_order,
15
+ :quantity_committed,
16
+ :quantity_available,
17
+ ].each do |field|
18
+ expect(item_availability).to have_field(field)
19
+ end
20
+ end
21
+
22
+ it { expect(item_availability).to have_field(:item, NetSuite::Records::InventoryItem) }
23
+ it { expect(item_availability).to have_field(:location_id, NetSuite::Records::Location) }
24
+
25
+ describe 'get_item_availability' do
26
+ let(:inventory_item_ref_list) {
27
+ NetSuite::Records::RecordRefList.new(
28
+ record_ref: [
29
+ NetSuite::Records::RecordRef.new(internal_id: 57)
30
+ ]
31
+ )
32
+ }
33
+ let(:result) { NetSuite::Records::ItemAvailability.get_item_availability(inventory_item_ref_list) }
34
+
35
+ before do
36
+ savon.expects(:get_item_availability).with(:message => {
37
+ "platformMsgs:itemAvailabilityFilter" => {
38
+ "platformCore:item"=>{"platformCore:recordRef"=>[{:@internalId=>57}]}
39
+ }
40
+ }).returns(File.read('spec/support/fixtures/get_item_availability/get_item_availability.xml'))
41
+ end
42
+
43
+ it 'returns ItemAvailability records' do
44
+ expect(result).to be_kind_of(Array)
45
+ expect(result).not_to be_empty
46
+ expect(result[0]).to be_kind_of(NetSuite::Records::ItemAvailability)
47
+ expect(result[0]).to have_attributes(
48
+ item: be_kind_of(NetSuite::Records::InventoryItem),
49
+ location_id: NetSuite::Records::Location,
50
+ quantity_on_hand: '264.0',
51
+ on_hand_value_mli: '129.36',
52
+ reorder_point: '50.0',
53
+ quantity_on_order: '0.0',
54
+ quantity_committed: '0.0',
55
+ quantity_available: '264.0',
56
+ )
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::ItemFulfillmentPackageFedExList do
4
+ let(:list) { NetSuite::Records::ItemFulfillmentPackageFedExList.new }
5
+
6
+ it 'has a packages attribute' do
7
+ expect(list.packages).to be_kind_of(Array)
8
+ end
9
+
10
+ describe '#to_record' do
11
+ before do
12
+ list.packages << NetSuite::Records::ItemFulfillmentPackageFedEx.new(
13
+ :package_tracking_number_fed_ex => '1Z12354645757686786'
14
+ )
15
+ end
16
+
17
+ it 'can represent itself as a SOAP record' do
18
+ record = {
19
+ 'tranSales:packageFedEx' => [
20
+ 'tranSales:packageTrackingNumberFedEx' => '1Z12354645757686786'
21
+ ]
22
+ }
23
+
24
+ expect(list.to_record).to eql(record)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::ItemFulfillmentPackageUpsList do
4
+ let(:list) { NetSuite::Records::ItemFulfillmentPackageUpsList.new }
5
+
6
+ it 'has a packages attribute' do
7
+ expect(list.packages).to be_kind_of(Array)
8
+ end
9
+
10
+ describe '#to_record' do
11
+ before do
12
+ list.packages << NetSuite::Records::ItemFulfillmentPackageUps.new(
13
+ :package_tracking_number_ups => '1Z12354645757686786'
14
+ )
15
+ end
16
+
17
+ it 'can represent itself as a SOAP record' do
18
+ record = {
19
+ 'tranSales:packageUps' => [
20
+ 'tranSales:packageTrackingNumberUps' => '1Z12354645757686786'
21
+ ]
22
+ }
23
+
24
+ expect(list.to_record).to eql(record)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe NetSuite::Records::ItemFulfillmentPackageUspsList do
4
+ let(:list) { NetSuite::Records::ItemFulfillmentPackageUspsList.new }
5
+
6
+ it 'has a packages attribute' do
7
+ expect(list.packages).to be_kind_of(Array)
8
+ end
9
+
10
+ describe '#to_record' do
11
+ before do
12
+ list.packages << NetSuite::Records::ItemFulfillmentPackageUsps.new(
13
+ :package_tracking_number_usps => '1Z12354645757686786'
14
+ )
15
+ end
16
+
17
+ it 'can represent itself as a SOAP record' do
18
+ record = {
19
+ 'tranSales:packageUsps' => [
20
+ 'tranSales:packageTrackingNumberUsps' => '1Z12354645757686786'
21
+ ]
22
+ }
23
+
24
+ expect(list.to_record).to eql(record)
25
+ end
26
+ end
27
+ end
@@ -13,9 +13,10 @@ describe NetSuite::Records::SalesOrderItem do
13
13
  :quantity, :quantity_back_ordered, :quantity_billed,
14
14
  :quantity_committed, :quantity_fulfilled,
15
15
  :rate, :rev_rec_end_date, :rev_rec_start_date,
16
- :rev_rec_term_in_months, :serial_numbers, :tax1_amt, :tax_rate1,
17
- :tax_rate2, :vsoe_allocation, :vsoe_amount, :vsoe_deferral,
18
- :vsoe_delivered, :vsoe_permit_discount, :vsoe_price
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,
19
20
  ].each do |field|
20
21
  expect(item).to have_field(field)
21
22
  end
@@ -23,6 +23,23 @@ describe NetSuite::Records::SalesOrder do
23
23
  end
24
24
  end
25
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
+
26
43
  it 'has all the right record refs' do
27
44
  [
28
45
  :account, :bill_address_list, :created_from, :currency, :custom_form, :department, :discount_item,
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe NetSuite::Records::CustomerSubscription do
3
+ describe NetSuite::Records::Subscription do
4
4
 
5
5
  before do
6
6
  NetSuite::Configuration.api_version = '2014_2'
@@ -16,7 +16,7 @@ describe NetSuite::Records::CustomerSubscription do
16
16
  }
17
17
  end
18
18
 
19
- let(:list) { NetSuite::Records::CustomerSubscription.new(attributes) }
19
+ let(:list) { NetSuite::Records::Subscription.new(attributes) }
20
20
 
21
21
  it 'has all the right fields' do
22
22
  [
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe NetSuite::Records::CustomerSubscriptionsList do
4
- let(:list) { NetSuite::Records::CustomerSubscriptionsList.new }
3
+ describe NetSuite::Records::SubscriptionsList do
4
+ let(:list) { NetSuite::Records::SubscriptionsList.new }
5
5
 
6
6
  it 'has a subscriptions attribute' do
7
7
  expect(list.subscriptions).to be_kind_of(Array)
@@ -1,15 +1,19 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
3
  <soapenv:Header>
4
- <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2011_2.platform.webservices.netsuite.com">
4
+ <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2018_2.platform.webservices.netsuite.com">
5
5
  <platformMsgs:nsId>WEBSERVICES_3392464_1220201115821392011296470399_67055c545d0</platformMsgs:nsId>
6
6
  </platformMsgs:documentInfo>
7
7
  </soapenv:Header>
8
8
  <soapenv:Body>
9
- <addResponse xmlns="urn:messages_2_5.platform.webservices.netsuite.com">
10
- <writeResponse xmlns="urn:messages_2_5.platform.webservices.netsuite.com">
11
- <ns1:status isSuccess="true" xmlns:ns1="urn:core_2_5.platform.webservices.netsuite.com"/>
12
- <baseRef internalId="999" type="invoice" xsi:type="ns2:RecordRef" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:core_2_5.platform.webservices.netsuite.com"/>
9
+ <addResponse xmlns="urn:messages_2018_2.platform.webservices.netsuite.com">
10
+ <writeResponse>
11
+ <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2018_2.platform.webservices.netsuite.com">
12
+ <platformCore:statusDetail>
13
+ <platformCore:afterSubmitFailed>false</platformCore:afterSubmitFailed>
14
+ </platformCore:statusDetail>
15
+ </platformCore:status>
16
+ <baseRef internalId="999" type="invoice" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2018_2.platform.webservices.netsuite.com"/>
13
17
  </writeResponse>
14
18
  </addResponse>
15
19
  </soapenv:Body>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
+ <soapenv:Header>
4
+ <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2020_2.platform.webservices.netsuite.com">
5
+ <platformMsgs:nsId>WEBSERVICES_3392464_1220201115821392011296470399_67055c545d0</platformMsgs:nsId>
6
+ </platformMsgs:documentInfo>
7
+ </soapenv:Header>
8
+ <soapenv:Body>
9
+ <deleteResponse xmlns="urn:messages_2020_2.platform.webservices.netsuite.com">
10
+ <writeResponse>
11
+ <platformCore:status xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com" isSuccess="false">
12
+ <platformCore:statusDetail type="ERROR">
13
+ <platformCore:code>INSUFFICIENT_PERMISSION</platformCore:code>
14
+ <platformCore:message>Permission Violation: You need a higher level of the 'Lists -&gt; Documents and Files' permission to access this page. Please contact your account administrator.</platformCore:message>
15
+ </platformCore:statusDetail>
16
+ </platformCore:status>
17
+ <baseRef xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com" internalId="118519" type="file" xsi:type="platformCore:RecordRef"/>
18
+ </writeResponse>
19
+ </deleteResponse>
20
+ </soapenv:Body>
21
+ </soapenv:Envelope>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
+ <soapenv:Header>
4
+ <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2020_2.platform.webservices.netsuite.com">
5
+ <platformMsgs:nsId>WEBSERVICES_3392464_1220201115821392011296470399_67055c545d0</platformMsgs:nsId>
6
+ </platformMsgs:documentInfo>
7
+ </soapenv:Header>
8
+ <soapenv:Body>
9
+ <deleteResponse xmlns="urn:messages_2020_2.platform.webservices.netsuite.com">
10
+ <writeResponse>
11
+ <platformCore:status xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com" isSuccess="false">
12
+ <platformCore:statusDetail type="ERROR">
13
+ <platformCore:code>INSUFFICIENT_PERMISSION</platformCore:code>
14
+ <platformCore:message>Permission Violation: You need a higher level of the 'Lists -&gt; Documents and Files' permission to access this page. Please contact your account administrator.</platformCore:message>
15
+ </platformCore:statusDetail>
16
+ <platformCore:statusDetail type="ERROR">
17
+ <platformCore:code>SOMETHING_ELSE</platformCore:code>
18
+ <platformCore:message>Another error.</platformCore:message>
19
+ </platformCore:statusDetail>
20
+ </platformCore:status>
21
+ <baseRef xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com" internalId="118519" type="file" xsi:type="platformCore:RecordRef"/>
22
+ </writeResponse>
23
+ </deleteResponse>
24
+ </soapenv:Body>
25
+ </soapenv:Envelope>
@@ -0,0 +1,46 @@
1
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2
+ <soapenv:Header>
3
+ <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2016_2.platform.webservices.netsuite.com">
4
+ <platformMsgs:nsId>WEBSERVICES_3868171_122020162073815481885806769_24761121647f</platformMsgs:nsId>
5
+ </platformMsgs:documentInfo>
6
+ </soapenv:Header>
7
+ <soapenv:Body>
8
+ <getItemAvailabilityResponse xmlns="urn:messages_2016_2.platform.webservices.netsuite.com">
9
+ <platformCore:getItemAvailabilityResult xmlns:platformCore="urn:core_2016_2.platform.webservices.netsuite.com">
10
+ <platformCore:status isSuccess="true"/>
11
+ <platformCore:itemAvailabilityList>
12
+ <platformCore:itemAvailability>
13
+ <platformCore:item internalId="57" type="inventoryItem">
14
+ <platformCore:name>CD-R</platformCore:name>
15
+ </platformCore:item>
16
+ <platformCore:lastQtyAvailableChange>2022-05-05T03:40:06.000-07:00</platformCore:lastQtyAvailableChange>
17
+ <platformCore:locationId internalId="1" type="location">
18
+ <platformCore:name>Warehouse - East Coast</platformCore:name>
19
+ </platformCore:locationId>
20
+ <platformCore:quantityOnHand>264.0</platformCore:quantityOnHand>
21
+ <platformCore:onHandValueMli>129.36</platformCore:onHandValueMli>
22
+ <platformCore:reorderPoint>50.0</platformCore:reorderPoint>
23
+ <platformCore:quantityOnOrder>0.0</platformCore:quantityOnOrder>
24
+ <platformCore:quantityCommitted>0.0</platformCore:quantityCommitted>
25
+ <platformCore:quantityAvailable>264.0</platformCore:quantityAvailable>
26
+ </platformCore:itemAvailability>
27
+ <platformCore:itemAvailability>
28
+ <platformCore:item internalId="57" type="inventoryItem">
29
+ <platformCore:name>CD-R</platformCore:name>
30
+ </platformCore:item>
31
+ <platformCore:lastQtyAvailableChange>2020-04-27T08:38:20.000-07:00</platformCore:lastQtyAvailableChange>
32
+ <platformCore:locationId internalId="2" type="location">
33
+ <platformCore:name>Warehouse - West Coast</platformCore:name>
34
+ </platformCore:locationId>
35
+ <platformCore:quantityOnHand>-1.0</platformCore:quantityOnHand>
36
+ <platformCore:onHandValueMli>0.0</platformCore:onHandValueMli>
37
+ <platformCore:reorderPoint>50.0</platformCore:reorderPoint>
38
+ <platformCore:quantityOnOrder>0.0</platformCore:quantityOnOrder>
39
+ <platformCore:quantityCommitted>0.0</platformCore:quantityCommitted>
40
+ <platformCore:quantityAvailable>0.0</platformCore:quantityAvailable>
41
+ </platformCore:itemAvailability>
42
+ </platformCore:itemAvailabilityList>
43
+ </platformCore:getItemAvailabilityResult>
44
+ </getItemAvailabilityResponse>
45
+ </soapenv:Body>
46
+ </soapenv:Envelope>