gotransverse-tract-api 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 1340d5bebe6cca5359967a7b96282e234aa5ec03
4
- data.tar.gz: 6d944de781f4a991719829fd87ace1de13fafc83
3
+ metadata.gz: 7c7f435163db5b1137f0375d2e9c8e58aa8610b3
4
+ data.tar.gz: 42fb7ca3c1b81b1be6f9bc0115fe9859d07f7727
5
5
  SHA512:
6
- metadata.gz: 08606f90f2de2b87b6d0bdee0c49e2710a58d42d87573d3d83340f27567fbb90ef8952bf662fbfcdfc73cebeb1a81996adbdf0e9343de6a7e755951218091710
7
- data.tar.gz: f7a22b021f12a963c3f9f66a8f2e6fffb3b247888887f72e5ab33065a2829c3767a878b4c2499b23a649db96a69b5f6d372bed6121f6c70eef981b7b369bd001
6
+ metadata.gz: b15ce602d1686d11a4ae79ada887d6d017b4c0b9ce8ffbaa5598473bff638033ebcbef5feb2d006f5e2867156676928b023e45320f6a65d0bbcb313364a2f7c9
7
+ data.tar.gz: 3fffa4c91445462473355a3f90bad190ba92c01d00d9d80667cebc2108f79d0be5f682f571f565f17733426cb7114ddec8203ae7f0b6729dcb6601a9860c1ce2
@@ -187,6 +187,18 @@ module GoTransverseTractApi
187
187
  self.call(klass, api_url, api_params, :put, request_body.to_xml)
188
188
  end
189
189
 
190
+ #
191
+ # self.delete_request_for
192
+ #
193
+ # @param {Class} klass
194
+ # @param {Hash} api_params (optional)
195
+ # @param {Hash} request_body
196
+ #
197
+ def self.delete_request_for(klass, api_params={}, request_body)
198
+ api_url = GoTransverseTractApi.get_api_url_for(klass)
199
+ self.call(klass, api_url, api_params, :delete, request_body)
200
+ end
201
+
190
202
  #
191
203
  # Generate XML for request body
192
204
  #
@@ -252,6 +264,8 @@ module GoTransverseTractApi
252
264
  response = http_client.post(api_url, request_body, {'Content-Type' => 'application/xml', 'Accept' => 'application/xml'})
253
265
  when :put
254
266
  response = http_client.put(api_url, request_body, api_params)
267
+ when :delete
268
+ response = http_client.delete(api_url, request_body, api_params)
255
269
  end
256
270
 
257
271
  xml_response = Nokogiri::XML(response.body.to_s)
@@ -232,8 +232,7 @@ module GoTransverseTractApi
232
232
  emailAddress: {
233
233
  purpose: entity[:addresses][:email_address][:purpose],
234
234
  email: entity[:addresses][:email_address][:email],
235
- eid: entity[:addresses][:email_address][:eid] || ''
236
- },
235
+ }.delete_if{|k,v| v.nil?},
237
236
  postalAddress: {
238
237
  purpose: entity[:addresses][:postal_address][:purpose],
239
238
  country: entity[:addresses][:postal_address][:country],
@@ -242,20 +241,26 @@ module GoTransverseTractApi
242
241
  attention: entity[:addresses][:postal_address][:attention],
243
242
  postalCode: entity[:addresses][:postal_address][:postal_code],
244
243
  line1: entity[:addresses][:postal_address][:line1],
245
- eid: entity[:addresses][:postal_address][:eid] || ''
246
- },
247
- telecomAddress: {
248
- dialingPrefix: entity[:addresses][:telecom_address][:dialing_prefix],
249
- countryCode: entity[:addresses][:telecom_address][:country_code],
250
- areaCode: entity[:addresses][:telecom_address][:area_code],
251
- number: entity[:addresses][:telecom_address][:number],
252
- extension: entity[:addresses][:telecom_address][:extension],
253
- purpose: entity[:addresses][:telecom_address][:purpose],
254
- eid: entity[:addresses][:telecom_address][:eid] || ''
255
- }
244
+ }.delete_if{|k,v| v.nil?}
256
245
  }
257
246
 
258
- addresses.each{|k,v| v.delete_if{|tags,data| data == ''}}
247
+ if entity[:addresses].has_key?(:telecom_address)
248
+ tele_address = {
249
+ telecomAddress: {
250
+ dialingPrefix: entity[:addresses].try(:[],:telecom_address).try(:[],:dialing_prefix),
251
+ countryCode: entity[:addresses].try(:[],:telecom_address).try(:[],:country_code),
252
+ areaCode: entity[:addresses].try(:[],:telecom_address).try(:[],:area_code),
253
+ number: entity[:addresses].try(:[],:telecom_address).try(:[],:number),
254
+ extension: entity[:addresses].try(:[],:telecom_address).try(:[],:extension),
255
+ purpose: entity[:addresses].try(:[],:telecom_address).try(:[],:purpose),
256
+ eid: entity[:addresses].try(:[],:telecom_address).try(:[],:eid)
257
+ }.delete_if{|k,v| v.nil?}
258
+ }
259
+
260
+ addresses.merge! tele_address
261
+ end
262
+
263
+ addresses
259
264
  end
260
265
 
261
266
  end
@@ -335,6 +335,10 @@ module GoTransverseTractApi
335
335
  },
336
336
  billingAccountCategory: {
337
337
  eid: billing_account[:billing_account_category][:eid]
338
+ },
339
+ paymentTerm: {
340
+ name: billing_account[:payment_term][:name],
341
+ eid: billing_account[:payment_term][:eid]
338
342
  }
339
343
  }
340
344
  xml_data = GoTransverseTractApi.generateXML(data, 'billingAccount')
@@ -207,6 +207,10 @@ module GoTransverseTractApi
207
207
  scheduled_charges = ScheduledCharge.get_scheduled_charges(order_item[:scheduled_charges])
208
208
  end
209
209
 
210
+ if order_item.has_key?(:discount_configurations)
211
+ discount_configurations = DiscountConfiguration.get_discount_configurations(order_item[:discount_configurations])
212
+ end
213
+
210
214
  orderItem = {
211
215
  attributes: {
212
216
  awaitingApproval: order_item[:awaiting_approval],
@@ -227,7 +231,7 @@ module GoTransverseTractApi
227
231
  inventoryItem: inventory_item,
228
232
  agreementConfiguration: AgreementConfiguration.get_agreement_conf(order_item[:agreement_configuration]),
229
233
  scheduledCharges: scheduled_charges,
230
- discountConfigurations: DiscountConfiguration.get_discount_configurations(order_item[:discount_configurations])
234
+ discountConfigurations: discount_configurations
231
235
  }
232
236
 
233
237
  orderItem.delete_if{|k,v| v.nil?}
@@ -5,9 +5,18 @@ module GoTransverseTractApi
5
5
  class ProductUsageRule
6
6
 
7
7
  class << self
8
+
9
+ #
10
+ # @param {Long} product_price_eid
11
+ # @param {String} query_scope
12
+ #
13
+ def find_by_product_price_eid product_price_eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {productPriceEid: product_price_eid, queryScope: query_scope})
15
+ end
16
+
8
17
  def get_product_usage_rules(product_usage_rules)
9
18
  product_usage_rule = {
10
- attributes: api_data.get_page_info(product_usage_rule),
19
+ attributes: {},
11
20
  matchAllProductUsageRule: {
12
21
  attributes: {
13
22
  eid: product_usage_rule[:eid],
@@ -24,7 +33,7 @@ module GoTransverseTractApi
24
33
  ruleType: product_usage_rule[:rule_type],
25
34
  status: product_usage_rule[:status],
26
35
  chargeCategory: product_usage_rule[:charge_category]
27
- },
36
+ }.delete_if{|k,v| v.nil?},
28
37
  usageRate: UsageRate.get_usage_rate(product_usage_rule[:usage_rate])
29
38
  }
30
39
  }
@@ -128,7 +128,7 @@ module GoTransverseTractApi
128
128
  }
129
129
 
130
130
  xml_data = GoTransverseTractApi.generateXML(data,'addCustomFieldValue')
131
- GoTransverseTractApi.post_request_for(self, {eid: eid}, sales_order, "addCustomFieldValue")
131
+ GoTransverseTractApi.post_request_for(self, {eid: eid}, xml_data, "addCustomFieldValue")
132
132
  end
133
133
 
134
134
  #
@@ -143,7 +143,7 @@ module GoTransverseTractApi
143
143
  }
144
144
 
145
145
  xml_data = GoTransverseTractApi.generateXML(data,'removeCustomFieldValue')
146
- GoTransverseTractApi.post_request_for(self, {eid: eid}, sales_order, "removeCustomFieldValue")
146
+ GoTransverseTractApi.post_request_for(self, {eid: eid}, xml_data, "removeCustomFieldValue")
147
147
  end
148
148
 
149
149
  #
@@ -207,7 +207,21 @@ module GoTransverseTractApi
207
207
  GoTransverseTractApi.post_request_for(self, xml_data, "")
208
208
  end
209
209
 
210
+ #
211
+ # @param {Long} eid
212
+ #
213
+ def delete_draft_order order_eid
214
+ data = {
215
+ voidDraftOrder: {},
216
+ salesOrder: {
217
+ attributes: { eid: order_eid },
218
+ orderItems: {}
219
+ }
220
+ }
210
221
 
222
+ xml_data = GoTransverseTractApi.generateXML(data, 'voidDraftOrder')
223
+ GoTransverseTractApi.delete_request_for(self, {eid: order_eid}, xml_data)
224
+ end
211
225
 
212
226
  private
213
227
 
@@ -12,23 +12,26 @@ module GoTransverseTractApi
12
12
 
13
13
  #
14
14
  # @param {Long} eid
15
+ # @param {String} query_scope
15
16
  #
16
- def find_by_eid eid
17
- GoTransverseTractApi.get_response_for(self, {eid: eid})
17
+ def find_by_eid eid, query_scope=nil
18
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
18
19
  end
19
20
 
20
21
  #
21
22
  # @param {String} name
23
+ # @param {String} query_scope
22
24
  #
23
- def find_by_name name
24
- GoTransverseTractApi.get_response_for(self, {name: name})
25
+ def find_by_name name, query_scope=nil
26
+ GoTransverseTractApi.get_response_for(self, {name: name, queryScope: query_scope})
25
27
  end
26
28
 
27
29
  #
28
30
  # @param {String} internal_name
31
+ # @param {String} query_scope
29
32
  #
30
- def find_by_internal_name internal_name
31
- GoTransverseTractApi.get_response_for(self, {internal_name: internal_name})
33
+ def find_by_internal_name internal_name, query_scope=nil
34
+ GoTransverseTractApi.get_response_for(self, {internal_name: internal_name, queryScope: query_scope})
32
35
  end
33
36
 
34
37
  #
@@ -65,13 +65,31 @@ module GoTransverseTractApi
65
65
  GoTransverseTractApi.get_response_for(self, {reference_id: reference_id, sequence_id: sequence_id})
66
66
  end
67
67
 
68
+ #
69
+ # @param {Hash} usage_event
70
+ #
71
+ def simulate usage_event
72
+ data = {
73
+ simulateUsageEvent: {},
74
+ usageEvent: {
75
+ attributes: get_usage_event(usage_event),
76
+ serviceResourceType: usage_event[:service_resource_type]
77
+ }
78
+ }
79
+
80
+ xml_data = GoTransverseTractApi.generateXML(data, 'simulateUsageEvent')
81
+ GoTransverseTractApi.post_request_for(self, xml_data, "simulate")
82
+ end
83
+
68
84
  #
69
85
  # @param {Hash} usage_event
70
86
  #
71
87
  def create_usage_event usage_event
72
88
  data = {
73
- usageEvent: get_usage_event(usage_event),
74
- serviceResourceType: usage_event[:service_resource_type]
89
+ usageEvent: {
90
+ attributes: get_usage_event(usage_event),
91
+ serviceResourceType: usage_event[:service_resource_type]
92
+ }
75
93
  }
76
94
 
77
95
  xml_data = GoTransverseTractApi.generateXML(data, 'usageEvent')
@@ -1,7 +1,7 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.5.1"
4
- TARGET_API_VERSION = "1.28"
3
+ VERSION = "0.5.2"
4
+ TARGET_API_VERSION = "1.29"
5
5
 
6
6
  end
7
7
 
@@ -5,8 +5,8 @@ module GoTransverseTractApi
5
5
  RSpec.describe BillingAccount::BillingAccount do
6
6
  before(:each) { http_auth }
7
7
 
8
- let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
9
- let(:eid) { '136' }
8
+ let(:response) { {a: 'b', c: 'd'} }
9
+ let(:eid) { '165' }
10
10
  let(:addresses) { {
11
11
  :email_address => {
12
12
  :purpose => 'PRIMARY',
@@ -31,6 +31,12 @@ module GoTransverseTractApi
31
31
  }
32
32
  } }
33
33
 
34
+ context ".find_by_eid" do
35
+ it "returns a billing account details for a given eid" do
36
+ data = described_class.find_by_eid('165')
37
+ expect(data).to_not be_nil
38
+ end
39
+ end
34
40
 
35
41
  context ".apply_payment" do
36
42
  it "applies a payment to the invoice" do
@@ -95,16 +101,16 @@ module GoTransverseTractApi
95
101
 
96
102
  context ".add_recurring_payment" do
97
103
  it "adds a recurring payment to the billing account" do
98
- eid = '29'
104
+ eid = '165'
99
105
 
100
106
  data = {
101
107
  :billing_account => {eid: eid},
102
108
  :recurring_payment => {
103
109
  :credit_card_payment_method => {
104
- :card_type => 'VISA',
110
+ :card_type => 'MASTERCARD',
105
111
  :card_holder_first_name => 'Mary',
106
112
  :card_holder_last_name => 'Smith',
107
- :card_identifier_number => '4111111111111111',
113
+ :card_identifier_number => '5454545454545454',
108
114
  :card_expiration => '12/2016'
109
115
  }
110
116
  }
@@ -181,14 +187,18 @@ module GoTransverseTractApi
181
187
  context ".create_billing_account" do
182
188
  it "creates a billing account" do
183
189
  data = {
184
- :bill_type => 'EMAIL',
185
- :daily_bill_cycle => { eid: '29' },
186
- :organization => {
187
- :name => 'LMH Services',
188
- :addresses => addresses
190
+ bill_type: 'NONE',
191
+ daily_bill_cycle: { eid: '38' },
192
+ organization: {
193
+ name: 'LMH Services',
194
+ addresses: addresses.delete_if{|k,v| k == :telecom_address}
189
195
  },
190
- :billing_account_category => {
196
+ billing_account_category: {
191
197
  eid: '6'
198
+ },
199
+ payment_term: {
200
+ name: 'Immediate',
201
+ eid: '8'
192
202
  }
193
203
  }
194
204
 
@@ -227,11 +237,11 @@ module GoTransverseTractApi
227
237
  end
228
238
 
229
239
  context ".create_draft_order" do
230
- it "creates a draft sales order for the billing account" do
231
- data = {
240
+ let(:data) {
241
+ {
232
242
  sales_order: {
233
243
  referral: 'Unit Test Referral',
234
- order_date: '2015-07-09T17:22:13',
244
+ order_date: '2016-01-28T17:22:13',
235
245
  order_status: 'DRAFT',
236
246
  order_items: {
237
247
  order_item: {
@@ -239,18 +249,18 @@ module GoTransverseTractApi
239
249
  quantity: '1',
240
250
  sequence: '1',
241
251
  description: 'dsfsgegebdbb',
242
- product: { eid: '67' },
252
+ product: { eid: '79' },
243
253
  selected_agreement: { eid: '15' },
244
- recurring_product_price: { eid: '102' },
254
+ recurring_product_price: { eid: '174' },
245
255
  order_item_usage_rules: {
246
256
  match_all_order_item_usage_rule: {
247
257
  name: 'allowance',
248
258
  status: 'ACTIVE',
249
259
  allowance_type: 'One Time',
250
- limit: '500',
260
+ limit: '100',
251
261
  usage_uom: 'COUNT',
252
- charge_category: '34',
253
- match_all_product_usage_rule: { eid: '22' },
262
+ charge_category: '39',
263
+ match_all_product_usage_rule: { eid: '74' },
254
264
  usage_rate: {
255
265
  flat_usage_rate: {
256
266
  rate: '2.00',
@@ -267,23 +277,31 @@ module GoTransverseTractApi
267
277
  },
268
278
  service_resources: {
269
279
  service_resource: {
270
- identifier: 'rg36',
280
+ identifier: 'PCFC2000098765',
271
281
  category: { eid: '9' }
272
282
  }
273
- },
274
- discount_configurations: {
275
- discount_configuration: {
276
- discount_identifier: { eid: '35' }
277
- }
278
283
  }
279
284
  }
280
285
  },
281
286
  billing_account: { eid: eid }
282
287
  }
283
288
  }
284
-
285
- #res = described_class.create_draft_order(eid, data)
289
+ }
290
+ it "creates a draft sales order without a promo code for the billing account" do
291
+ allow(subject).to receive(:create_draft_order).with(eid, data).and_return(response)
292
+ expect(subject.create_draft_order(eid, data)).to eq(response)
293
+ end
294
+
295
+ it "creates a draft sales order with promo code for the billing account" do
296
+ promo_code = {
297
+ discount_configurations: {
298
+ discount_configuration: {
299
+ discount_identifier: { eid: '35' }
300
+ }
301
+ }
302
+ }
286
303
 
304
+ data[:sales_order][:order_items][:order_item].merge! promo_code
287
305
  allow(subject).to receive(:create_draft_order).with(eid, data).and_return(response)
288
306
  expect(subject.create_draft_order(eid, data)).to eq(response)
289
307
  end
@@ -10,8 +10,8 @@ module GoTransverseTractApi
10
10
 
11
11
  context ".find_by_eid" do
12
12
  it "returns a payment for the given eid" do
13
- #data = described_class.find_by_eid(1)
14
- #expect(data['eid']).to eq('1')
13
+ data = described_class.find_by_eid(1)
14
+ expect(data.count).to be >= 0
15
15
  end
16
16
  end
17
17
 
@@ -97,28 +97,10 @@ module GoTransverseTractApi
97
97
  it "creates a payment" do
98
98
  data = {
99
99
  use_recurring_payment: 'true',
100
- amount: '20.00',
100
+ amount: '100.00',
101
101
  description: 'Credit Card Payment',
102
102
  billing_account: {
103
- eid: '146'
104
- },
105
- credit_card_payment: {
106
- card_type: 'VISA',
107
- card_holder_first_name: 'Mary',
108
- card_holder_last_name: 'Smith',
109
- card_identifier_number: '4111111111111111111',
110
- card_expiration: '12/2016'
111
- },
112
- phone_number: {
113
- country_code: '1',
114
- area_code: '512',
115
- number: '00000',
116
- extension: '123',
117
- purpose: 'PAYMENT'
118
- },
119
- email_address: {
120
- email: 'test@test.com',
121
- purpose: 'PAYMENT'
103
+ eid: '165'
122
104
  }
123
105
  }
124
106
 
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Order::Agreement do
6
+ before(:each) { http_auth }
7
+
8
+ context ".find_all" do
9
+ it "returns all agreements" do
10
+ data = described_class.find_all
11
+ expect(data.count).to be >= 0
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Order::BillCycle do
6
+ before(:each) { http_auth }
7
+
8
+ let(:eid) { '4086' }
9
+
10
+ context ".find_by_eid" do
11
+ it "returns a billing cycle for the given eid" do
12
+ data = described_class.find_by_eid(eid)
13
+ expect(data.count).to be >= 0
14
+ end
15
+ end
16
+
17
+ context ".find_all" do
18
+ it "returns all billing cycles" do
19
+ data = described_class.find_all
20
+ expect(data.count).to be >= 0
21
+ end
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Order::BillingAccountCategory do
6
+ before(:each) { http_auth }
7
+
8
+ context ".find_all" do
9
+ it "returns all billing account categories" do
10
+ data = described_class.find_all
11
+ expect(data).to_not be_nil
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Order::PaymentTerm do
6
+ before(:each) { http_auth }
7
+
8
+ context ".find_all" do
9
+ it "returns all payment terms" do
10
+ data = described_class.find_all
11
+ expect(data).to_not be_nil
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Order::ProductUsageRule do
6
+ before(:each) { http_auth }
7
+
8
+ context ".find_by_product_price_eid" do
9
+ it "returns product usage rules for a given product price eid" do
10
+ data = described_class.find_by_product_price_eid(174)
11
+ expect(data.count).to be >= 0
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -5,8 +5,15 @@ module GoTransverseTractApi
5
5
  RSpec.describe Order::SalesOrder do
6
6
  before(:each) { http_auth }
7
7
 
8
- let(:eid) { '48406'}
9
- let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
8
+ let(:eid) { '296'}
9
+ let(:response) { {a: 'b', c: 'd'} }
10
+
11
+ context ".find_by_eid" do
12
+ it "returns a sales order for the given eid" do
13
+ data = described_class.find_by_eid(eid)
14
+ expect(data).to_not be_nil
15
+ end
16
+ end
10
17
 
11
18
  context ".add_custom_field_value" do
12
19
  it "adds custom field value for the sales order" do
@@ -19,10 +26,8 @@ module GoTransverseTractApi
19
26
 
20
27
  context ".confirm" do
21
28
  it "confirms the sales order" do
22
- described_class.confirm(eid)
23
-
24
- #allow(subject).to receive(:confirm).with(eid).and_return(response)
25
- #expect(subject.confirm(eid)).to eq(response)
29
+ allow(subject).to receive(:confirm).with(eid).and_return(response)
30
+ expect(subject.confirm(eid)).to eq(response)
26
31
  end
27
32
  end
28
33
 
@@ -102,6 +107,13 @@ module GoTransverseTractApi
102
107
  end
103
108
  end
104
109
 
110
+ context ".delete_draft_order" do
111
+ it "deletes an existing draft sales order for a given id" do
112
+ allow(subject).to receive(:delete_draft_order).with(eid).and_return(response)
113
+ expect(subject.delete_draft_order(eid)).to eq(response)
114
+ end
115
+ end
116
+
105
117
  end
106
118
  end
107
119
 
@@ -18,6 +18,13 @@ module GoTransverseTractApi
18
18
  expect(data['eid']).to be_nil
19
19
  end
20
20
  end
21
+
22
+ context ".find_by_name" do
23
+ it "returns a product for the given name" do
24
+ data = described_class.find_by_name('Postcards 1st Class', 'DEEP')
25
+ expect(data).to_not be_nil
26
+ end
27
+ end
21
28
  end
22
29
  end
23
30
 
@@ -5,27 +5,33 @@ module GoTransverseTractApi
5
5
  RSpec.describe Usage::UsageEvent do
6
6
  before(:each) { http_auth }
7
7
 
8
- let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
8
+ let(:response) { {a: 'b', c: 'd'} }
9
9
  let(:event) {
10
10
  {
11
- :start_time => '20151125T10:10:10',
12
- :service_resource_id => 'LAP',
13
- :usage_uom => 'EVENT',
11
+ :start_time => '2015-11-25T10:10:10',
12
+ :service_resource_id => 'quote6',
13
+ :usage_uom => 'COUNT',
14
14
  :usage_amount => '1200.00',
15
15
  :description => 'Testing',
16
- :service_resource_type => 'GENERICSVC'
16
+ :service_resource_type => 'GENERICSRVCRESOURCE'
17
17
  }
18
18
  }
19
19
 
20
- context ".create_usage_event" do
21
- it "creates a usage event" do
22
- elem = { number01: '90', text01: 'LAP' }
20
+ context ".simulate" do
21
+ it "simulates a usage event" do
22
+ elem = { number01: '100', text01: 'PC_FC' }
23
23
 
24
- data = event.delete_if do|k,v|
25
- k.to_s == 'description'
26
- end
24
+ data = event.merge!(elem)
27
25
 
28
- #described_class.create_usage_event(data.merge!(elem))
26
+ allow(subject).to receive(:simulate).with(data).and_return(response)
27
+ expect(subject.simulate(data)).to eq(response)
28
+ end
29
+ end
30
+
31
+ context ".create_usage_event" do
32
+ it "creates a usage event" do
33
+ elem = { number01: '90', text01: 'PC_FC' }
34
+ data = event.merge!(elem)
29
35
 
30
36
  allow(subject).to receive(:create_usage_event).with(data).and_return(response)
31
37
  expect(subject.create_usage_event(data)).to eq(response)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gotransverse-tract-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien DeFrance
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-26 00:00:00.000000000 Z
12
+ date: 2016-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -221,10 +221,15 @@ files:
221
221
  - spec/gotransverse-tract-api/billing_account/refund_spec.rb
222
222
  - spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
223
223
  - spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
224
+ - spec/gotransverse-tract-api/order/agreement_spec.rb
225
+ - spec/gotransverse-tract-api/order/bill_cycle_spec.rb
226
+ - spec/gotransverse-tract-api/order/billing_account_category_spec.rb
224
227
  - spec/gotransverse-tract-api/order/order_item_spec.rb
225
228
  - spec/gotransverse-tract-api/order/order_item_usage_rule_spec.rb
226
229
  - spec/gotransverse-tract-api/order/organization_spec.rb
230
+ - spec/gotransverse-tract-api/order/payment_term_spec.rb
227
231
  - spec/gotransverse-tract-api/order/people_spec.rb
232
+ - spec/gotransverse-tract-api/order/product_usage_rule_spec.rb
228
233
  - spec/gotransverse-tract-api/order/sales_order_spec.rb
229
234
  - spec/gotransverse-tract-api/product/product_price_spec.rb
230
235
  - spec/gotransverse-tract-api/product/product_spec.rb
@@ -268,10 +273,15 @@ test_files:
268
273
  - spec/gotransverse-tract-api/billing_account/refund_spec.rb
269
274
  - spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
270
275
  - spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
276
+ - spec/gotransverse-tract-api/order/agreement_spec.rb
277
+ - spec/gotransverse-tract-api/order/bill_cycle_spec.rb
278
+ - spec/gotransverse-tract-api/order/billing_account_category_spec.rb
271
279
  - spec/gotransverse-tract-api/order/order_item_spec.rb
272
280
  - spec/gotransverse-tract-api/order/order_item_usage_rule_spec.rb
273
281
  - spec/gotransverse-tract-api/order/organization_spec.rb
282
+ - spec/gotransverse-tract-api/order/payment_term_spec.rb
274
283
  - spec/gotransverse-tract-api/order/people_spec.rb
284
+ - spec/gotransverse-tract-api/order/product_usage_rule_spec.rb
275
285
  - spec/gotransverse-tract-api/order/sales_order_spec.rb
276
286
  - spec/gotransverse-tract-api/product/product_price_spec.rb
277
287
  - spec/gotransverse-tract-api/product/product_spec.rb