gotransverse-tract-api 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gotransverse-tract-api.rb +1 -6
  3. data/lib/gotransverse-tract-api/api_data.rb +1 -0
  4. data/lib/gotransverse-tract-api/billing_account/adjustment.rb +18 -12
  5. data/lib/gotransverse-tract-api/billing_account/adjustment_application.rb +6 -4
  6. data/lib/gotransverse-tract-api/billing_account/adjustment_reason.rb +12 -8
  7. data/lib/gotransverse-tract-api/billing_account/billing_account.rb +54 -38
  8. data/lib/gotransverse-tract-api/billing_account/counter.rb +24 -16
  9. data/lib/gotransverse-tract-api/billing_account/custom_field.rb +15 -10
  10. data/lib/gotransverse-tract-api/billing_account/custom_field_value.rb +47 -22
  11. data/lib/gotransverse-tract-api/billing_account/invoice.rb +27 -18
  12. data/lib/gotransverse-tract-api/billing_account/invoice_item.rb +9 -6
  13. data/lib/gotransverse-tract-api/billing_account/invoice_item_charge.rb +3 -2
  14. data/lib/gotransverse-tract-api/billing_account/payment.rb +21 -14
  15. data/lib/gotransverse-tract-api/billing_account/reason.rb +9 -6
  16. data/lib/gotransverse-tract-api/billing_account/recurring_payment.rb +9 -6
  17. data/lib/gotransverse-tract-api/billing_account/refund.rb +24 -16
  18. data/lib/gotransverse-tract-api/billing_account/scheduled_charge.rb +29 -8
  19. data/lib/gotransverse-tract-api/billing_account/standard_invoice_adjustment_application.rb +6 -4
  20. data/lib/gotransverse-tract-api/general_ledger/general_ledger.rb +10 -7
  21. data/lib/gotransverse-tract-api/general_ledger/gl_account.rb +13 -9
  22. data/lib/gotransverse-tract-api/general_ledger/gl_account_category.rb +10 -7
  23. data/lib/gotransverse-tract-api/general_ledger/gl_accounting_entry.rb +18 -12
  24. data/lib/gotransverse-tract-api/general_ledger/gl_accounting_transaction.rb +21 -14
  25. data/lib/gotransverse-tract-api/general_ledger/gl_adjustment_accounting_transaction.rb +21 -14
  26. data/lib/gotransverse-tract-api/general_ledger/gl_aggregate_batch.rb +18 -12
  27. data/lib/gotransverse-tract-api/general_ledger/gl_aggregate_entry.rb +15 -10
  28. data/lib/gotransverse-tract-api/general_ledger/gl_transaction_batch.rb +15 -10
  29. data/lib/gotransverse-tract-api/order/adjustment_category.rb +9 -6
  30. data/lib/gotransverse-tract-api/order/agreement.rb +24 -16
  31. data/lib/gotransverse-tract-api/order/bill_cycle.rb +15 -10
  32. data/lib/gotransverse-tract-api/order/billing_account_category.rb +9 -6
  33. data/lib/gotransverse-tract-api/order/order_item.rb +31 -18
  34. data/lib/gotransverse-tract-api/order/order_item_charge.rb +21 -14
  35. data/lib/gotransverse-tract-api/order/organization.rb +9 -6
  36. data/lib/gotransverse-tract-api/order/party_category.rb +12 -8
  37. data/lib/gotransverse-tract-api/order/payment_term.rb +12 -8
  38. data/lib/gotransverse-tract-api/order/people.rb +12 -8
  39. data/lib/gotransverse-tract-api/order/product_relation.rb +9 -6
  40. data/lib/gotransverse-tract-api/order/renewal_order.rb +30 -20
  41. data/lib/gotransverse-tract-api/order/sales_order.rb +31 -20
  42. data/lib/gotransverse-tract-api/product/action.rb +7 -5
  43. data/lib/gotransverse-tract-api/product/billing_account_segment_field.rb +15 -10
  44. data/lib/gotransverse-tract-api/product/discount.rb +15 -10
  45. data/lib/gotransverse-tract-api/product/discount_category.rb +9 -6
  46. data/lib/gotransverse-tract-api/product/discount_code.rb +30 -20
  47. data/lib/gotransverse-tract-api/product/discount_identifier.rb +9 -6
  48. data/lib/gotransverse-tract-api/product/one_time_product_price.rb +3 -2
  49. data/lib/gotransverse-tract-api/product/operation.rb +6 -5
  50. data/lib/gotransverse-tract-api/product/operation_attribute.rb +7 -5
  51. data/lib/gotransverse-tract-api/product/price_list.rb +6 -4
  52. data/lib/gotransverse-tract-api/product/product.rb +37 -25
  53. data/lib/gotransverse-tract-api/product/product_price.rb +21 -14
  54. data/lib/gotransverse-tract-api/product/product_price_range.rb +18 -12
  55. data/lib/gotransverse-tract-api/product/product_tag.rb +9 -6
  56. data/lib/gotransverse-tract-api/product/recurring_product_price.rb +56 -14
  57. data/lib/gotransverse-tract-api/product/usage_rule.rb +7 -5
  58. data/lib/gotransverse-tract-api/service/service.rb +30 -20
  59. data/lib/gotransverse-tract-api/service/service_device_inventory_item.rb +12 -8
  60. data/lib/gotransverse-tract-api/service/service_period.rb +15 -10
  61. data/lib/gotransverse-tract-api/service/service_price.rb +15 -10
  62. data/lib/gotransverse-tract-api/service/service_price_range.rb +6 -4
  63. data/lib/gotransverse-tract-api/service/service_resource.rb +21 -14
  64. data/lib/gotransverse-tract-api/service/service_resource_category.rb +22 -6
  65. data/lib/gotransverse-tract-api/usage/global_usage_rule.rb +9 -6
  66. data/lib/gotransverse-tract-api/usage/order_item_usage_rule.rb +47 -6
  67. data/lib/gotransverse-tract-api/usage/product_usage_rule.rb +41 -8
  68. data/lib/gotransverse-tract-api/usage/rate_table.rb +6 -4
  69. data/lib/gotransverse-tract-api/usage/service_usage_rule.rb +9 -6
  70. data/lib/gotransverse-tract-api/usage/usage_event.rb +15 -10
  71. data/lib/gotransverse-tract-api/usage/usage_lookup_table.rb +9 -6
  72. data/lib/gotransverse-tract-api/usage/usage_lookup_table_entry.rb +12 -8
  73. data/lib/gotransverse-tract-api/usage/usage_price_category.rb +6 -4
  74. data/lib/gotransverse-tract-api/{order → usage}/usage_rate.rb +1 -2
  75. data/lib/gotransverse-tract-api/usage/usage_rule.rb +6 -4
  76. data/lib/gotransverse-tract-api/version.rb +1 -1
  77. data/spec/gotransverse-tract-api/billing_account/adjustment_spec.rb +1 -1
  78. data/spec/gotransverse-tract-api/billing_account/billing_account_spec.rb +14 -0
  79. data/spec/gotransverse-tract-api/billing_account/counter_spec.rb +1 -1
  80. data/spec/gotransverse-tract-api/billing_account/invoice_spec.rb +1 -1
  81. data/spec/gotransverse-tract-api/billing_account/payment_spec.rb +1 -1
  82. data/spec/gotransverse-tract-api/billing_account/refund_spec.rb +1 -1
  83. data/spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb +1 -1
  84. data/spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb +1 -1
  85. data/spec/gotransverse-tract-api/order/order_item_spec.rb +2 -4
  86. data/spec/gotransverse-tract-api/order/organization_spec.rb +2 -4
  87. data/spec/gotransverse-tract-api/order/people_spec.rb +1 -5
  88. data/spec/gotransverse-tract-api/service/service_resource_spec.rb +1 -1
  89. data/spec/gotransverse-tract-api/service/service_spec.rb +1 -1
  90. data/spec/gotransverse-tract-api/{order → usage}/order_item_usage_rule_spec.rb +3 -2
  91. data/spec/gotransverse-tract-api/{order → usage}/product_usage_rule_spec.rb +1 -1
  92. metadata +7 -12
  93. data/lib/gotransverse-tract-api/order/order_item_usage_rule.rb +0 -65
  94. data/lib/gotransverse-tract-api/order/product_usage_rule.rb +0 -49
  95. data/lib/gotransverse-tract-api/order/recurring_product_price.rb +0 -48
  96. data/lib/gotransverse-tract-api/order/scheduled_charge.rb +0 -26
  97. data/lib/gotransverse-tract-api/product/service_resource_category.rb +0 -20
@@ -8,37 +8,42 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def self.find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def self.find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} service_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_service_eid service_eid
20
- GoTransverseTractApi.get_response_for(self, {service_eid: service_eid})
21
+ def find_by_service_eid service_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {service_eid: service_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  #
24
26
  # @param {Date} start_date
27
+ # @param {String} query_scope (default: 'SHALLOW')
25
28
  #
26
- def find_by_start_date start_date
27
- GoTransverseTractApi.get_response_for(self, {start_date: start_date})
29
+ def find_by_start_date start_date, query_scope=nil
30
+ GoTransverseTractApi.get_response_for(self, {start_date: start_date, queryScope: query_scope})
28
31
  end
29
32
 
30
33
  #
31
34
  # @param {Date} end_date
35
+ # @param {String} query_scope (default: 'SHALLOW')
32
36
  #
33
- def find_by_end_date end_date
34
- GoTransverseTractApi.get_response_for(self, {end_date: end_date})
37
+ def find_by_end_date end_date, query_scope=nil
38
+ GoTransverseTractApi.get_response_for(self, {end_date: end_date, queryScope: query_scope})
35
39
  end
36
40
 
37
41
  #
38
42
  # @param {Boolean} closed
43
+ # @param {String} query_scope (default: 'SHALLOW')
39
44
  #
40
- def find_by_closed closed
41
- GoTransverseTractApi.get_response_for(self, {closed: closed})
45
+ def find_by_closed closed, query_scope=nil
46
+ GoTransverseTractApi.get_response_for(self, {closed: closed, queryScope: query_scope})
42
47
  end
43
48
 
44
49
  end
@@ -8,37 +8,42 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def self.find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def self.find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} service_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_service_eid service_eid
20
- GoTransverseTractApi.get_response_for(self, {service_eid: service_eid})
21
+ def find_by_service_eid service_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {service_eid: service_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  #
24
26
  # @param {Date} start_date
27
+ # @param {String} query_scope (default: 'SHALLOW')
25
28
  #
26
- def find_by_start_date start_date
27
- GoTransverseTractApi.get_response_for(self, {start_date: start_date})
29
+ def find_by_start_date start_date, query_scope=nil
30
+ GoTransverseTractApi.get_response_for(self, {start_date: start_date, queryScope: query_scope})
28
31
  end
29
32
 
30
33
  #
31
34
  # @param {Date} end_date
35
+ # @param {String} query_scope (default: 'SHALLOW')
32
36
  #
33
- def find_by_end_date end_date
34
- GoTransverseTractApi.get_response_for(self, {end_date: end_date})
37
+ def find_by_end_date end_date, query_scope=nil
38
+ GoTransverseTractApi.get_response_for(self, {end_date: end_date, queryScope: query_scope})
35
39
  end
36
40
 
37
41
  #
38
42
  # @param {Long} recurrence_period
43
+ # @param {String} query_scope (default: 'SHALLOW')
39
44
  #
40
- def find_by_recurrence_period recurrence_period
41
- GoTransverseTractApi.get_response_for(self, {recurrence_period: recurrence_period})
45
+ def find_by_recurrence_period recurrence_period, query_scope=nil
46
+ GoTransverseTractApi.get_response_for(self, {recurrence_period: recurrence_period, queryScope: query_scope})
42
47
  end
43
48
 
44
49
  end
@@ -8,16 +8,18 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def self.find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def self.find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} service_price_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_service_price_eid service_price_eid
20
- GoTransverseTractApi.get_response_for(self, {service_price_eid: service_price_eid})
21
+ def find_by_service_price_eid service_price_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {service_price_eid: service_price_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  end
@@ -8,51 +8,58 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} service_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_service_eid service_eid
20
- GoTransverseTractApi.get_response_for(self, {service_eid: service_eid})
21
+ def find_by_service_eid service_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {service_eid: service_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  #
24
26
  # @param {Long} order_item_eid
27
+ # @param {String} query_scope (default: 'SHALLOW')
25
28
  #
26
- def find_by_order_item_eid order_item_eid
27
- GoTransverseTractApi.get_response_for(self, {order_item_eid: order_item_eid})
29
+ def find_by_order_item_eid order_item_eid, query_scope=nil
30
+ GoTransverseTractApi.get_response_for(self, {order_item_eid: order_item_eid, queryScope: query_scope})
28
31
  end
29
32
 
30
33
  #
31
34
  # @param {Long} service_resource_category_eid
35
+ # @param {String} query_scope (default: 'SHALLOW')
32
36
  #
33
- def find_by_service_resource_category_eid service_resource_category_eid
34
- GoTransverseTractApi.get_response_for(self, {service_resource_category_eid: service_resource_category_eid})
37
+ def find_by_service_resource_category_eid service_resource_category_eid, query_scope=nil
38
+ GoTransverseTractApi.get_response_for(self, {service_resource_category_eid: service_resource_category_eid, queryScope: query_scope})
35
39
  end
36
40
 
37
41
  #
38
42
  # @param {Long} identifier
43
+ # @param {String} query_scope (default: 'SHALLOW')
39
44
  #
40
- def find_by_identifier identifier
41
- GoTransverseTractApi.get_response_for(self, {identifier: identifier})
45
+ def find_by_identifier identifier, query_scope=nil
46
+ GoTransverseTractApi.get_response_for(self, {identifier: identifier, queryScope: query_scope})
42
47
  end
43
48
 
44
49
  #
45
50
  # @param {String} status
51
+ # @param {String} query_scope (default: 'SHALLOW')
46
52
  #
47
- def find_by_status status
48
- GoTransverseTractApi.get_response_for(self, {status: status})
53
+ def find_by_status status, query_scope=nil
54
+ GoTransverseTractApi.get_response_for(self, {status: status, queryScope: query_scope})
49
55
  end
50
56
 
51
57
  #
52
58
  # @param {String} description
59
+ # @param {String} query_scope (default: 'SHALLOW')
53
60
  #
54
- def find_by_description description
55
- GoTransverseTractApi.get_response_for(self, {description: description})
61
+ def find_by_description description, query_scope=nil
62
+ GoTransverseTractApi.get_response_for(self, {description: description, queryScope: query_scope})
56
63
  end
57
64
 
58
65
  #
@@ -12,25 +12,41 @@ module GoTransverseTractApi
12
12
 
13
13
  #
14
14
  # @param {Long} eid
15
+ # @param {String} query_scope (default: 'SHALLOW')
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 (default: 'SHALLOW')
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} type
31
+ # @param {String} query_scope (default: 'SHALLOW')
29
32
  #
30
- def find_by_type type
31
- GoTransverseTractApi.get_response_for(self, {type: type})
33
+ def find_by_type type, query_scope=nil
34
+ GoTransverseTractApi.get_response_for(self, {type: type, queryScope: query_scope})
32
35
  end
33
36
 
37
+ #
38
+ # @param {Hash} service_resource_category
39
+ #
40
+ def get_service_resource_category(service_resource_category)
41
+ svc_resource_category = {
42
+ name: service_resource_category[:name],
43
+ type: service_resource_category[:type],
44
+ status: service_resource_category[:status],
45
+ eid: service_resource_category[:eid]
46
+ }
47
+
48
+ svc_resource_category
49
+ end
34
50
  end
35
51
 
36
52
  end
@@ -12,23 +12,26 @@ module GoTransverseTractApi
12
12
 
13
13
  #
14
14
  # @param {Long} eid
15
+ # @param {String} query_scope (default: 'SHALLOW')
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 {Boolean} is_global
23
+ # @param {String} query_scope (default: 'SHALLOW')
22
24
  #
23
- def find_by_is_global is_global
24
- GoTransverseTractApi.get_response_for(self, {is_global: is_global})
25
+ def find_by_is_global is_global, query_scope=nil
26
+ GoTransverseTractApi.get_response_for(self, {is_global: is_global, queryScope: query_scope})
25
27
  end
26
28
 
27
29
  #
28
30
  # @param {String} status
31
+ # @param {String} query_scope (default: 'SHALLOW')
29
32
  #
30
- def find_by_status status
31
- GoTransverseTractApi.get_response_for(self, {status: status})
33
+ def find_by_status status, query_scope=nil
34
+ GoTransverseTractApi.get_response_for(self, {status: status, queryScope: query_scope})
32
35
  end
33
36
 
34
37
  end
@@ -8,25 +8,66 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} order_item_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_order_item_eid order_item_eid
20
- GoTransverseTractApi.get_response_for(self, {order_item_eid: order_item_eid})
21
+ def find_by_order_item_eid order_item_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {order_item_eid: order_item_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  #
24
26
  # @param {String} status
27
+ # @param {String} query_scope (default: 'SHALLOW')
25
28
  #
26
- def find_by_status status
27
- GoTransverseTractApi.get_response_for(self, {status: status})
29
+ def find_by_status status, query_scope=nil
30
+ GoTransverseTractApi.get_response_for(self, {status: status, queryScope: query_scope})
28
31
  end
29
32
 
33
+ #
34
+ # @param {Hash} order_item_usage_rule
35
+ #
36
+ def get_order_item_usage_rule(order_item_usage_rule)
37
+ if order_item_usage_rule.has_key?(:match_all_order_item_usage_rule)
38
+ if order_item_usage_rule[:match_all_order_item_usage_rule].has_key?(:usage_rate)
39
+ usage_rate = UsageRate.get_usage_rate(order_item_usage_rule[:match_all_order_item_usage_rule][:usage_rate])
40
+ end
41
+ end
42
+
43
+ order_item_usage_rules = {
44
+ attributes: {},
45
+ matchAllOrderItemUsageRule: {
46
+ attributes: {
47
+ eid: order_item_usage_rule[:match_all_order_item_usage_rule][:eid],
48
+ limit: order_item_usage_rule[:match_all_order_item_usage_rule][:limit],
49
+ usageUom: order_item_usage_rule[:match_all_order_item_usage_rule][:usage_uom],
50
+ name: order_item_usage_rule[:match_all_order_item_usage_rule][:name],
51
+ order: order_item_usage_rule[:match_all_order_item_usage_rule][:order],
52
+ proratedOnOrder: order_item_usage_rule[:match_all_order_item_usage_rule][:prorated_on_order],
53
+ proratedOnCancel: order_item_usage_rule[:match_all_order_item_usage_rule][:prorated_on_cancel],
54
+ rollOverType: order_item_usage_rule[:match_all_order_item_usage_rule][:roll_over_type],
55
+ allowanceType: order_item_usage_rule[:match_all_order_item_usage_rule][:allowance_type],
56
+ validFrom: order_item_usage_rule[:match_all_order_item_usage_rule][:valid_from],
57
+ validTo: order_item_usage_rule[:match_all_order_item_usage_rule][:valid_to],
58
+ ruleType: order_item_usage_rule[:match_all_order_item_usage_rule][:rule_type],
59
+ status: order_item_usage_rule[:match_all_order_item_usage_rule][:status],
60
+ chargeCategory: order_item_usage_rule[:match_all_order_item_usage_rule][:charge_category]
61
+ }.delete_if{|k,v| v.nil?},
62
+ matchAllProductUsageRule: {
63
+ eid: order_item_usage_rule[:match_all_order_item_usage_rule][:match_all_product_usage_rule][:eid]
64
+ },
65
+ usageRate: usage_rate
66
+ }
67
+ }
68
+
69
+ order_item_usage_rules.delete_if{|k,v| v.nil?}
70
+ end
30
71
  end
31
72
 
32
73
  end
@@ -8,32 +8,65 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {Long} product_eid
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_product_eid product_eid
20
- GoTransverseTractApi.get_response_for(self, {product_eid: product_eid})
21
+ def find_by_product_eid product_eid, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {product_eid: product_eid, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  #
24
26
  # @param {Long} product_price_eid
27
+ # @param {String} query_scope (default: 'SHALLOW')
25
28
  #
26
- def find_by_product_price_eid product_price_eid
27
- GoTransverseTractApi.get_response_for(self, {product_price_eid: product_price_eid})
29
+ def find_by_product_price_eid product_price_eid, query_scope=nil
30
+ GoTransverseTractApi.get_response_for(self, {product_price_eid: product_price_eid, queryScope: query_scope})
28
31
  end
29
32
 
30
33
  #
31
34
  # @param {String} status
35
+ # @param {String} query_scope (default: 'SHALLOW')
32
36
  #
33
- def find_by_status status
34
- GoTransverseTractApi.get_response_for(self, {status: status})
37
+ def find_by_status status, query_scope=nil
38
+ GoTransverseTractApi.get_response_for(self, {status: status, queryScope: query_scope})
35
39
  end
36
40
 
41
+ #
42
+ # @param {Hash} product_usage_rules
43
+ #
44
+ def get_product_usage_rules(product_usage_rules)
45
+ product_usage_rule = {
46
+ attributes: {},
47
+ matchAllProductUsageRule: {
48
+ attributes: {
49
+ eid: product_usage_rule[:eid],
50
+ limit: product_usage_rule[:limit],
51
+ usageUom: product_usage_rule[:usage_uom],
52
+ name: product_usage_rule[:name],
53
+ order: product_usage_rule[:order],
54
+ proratedOnOrder: product_usage_rule[:prorated_on_order],
55
+ proratedOnCancel: product_usage_rule[:prorated_on_cancel],
56
+ rollOverType: product_usage_rule[:roll_over_type],
57
+ allowanceType: product_usage_rule[:allowance_type],
58
+ validFrom: product_usage_rule[:valid_from],
59
+ validTo: product_usage_rule[:valid_to],
60
+ ruleType: product_usage_rule[:rule_type],
61
+ status: product_usage_rule[:status],
62
+ chargeCategory: product_usage_rule[:charge_category]
63
+ }.delete_if{|k,v| v.nil?},
64
+ usageRate: UsageRate.get_usage_rate(product_usage_rule[:usage_rate])
65
+ }
66
+ }
67
+
68
+ product_usage_rule
69
+ end
37
70
  end
38
71
 
39
72
  end
@@ -8,16 +8,18 @@ module GoTransverseTractApi
8
8
 
9
9
  #
10
10
  # @param {Long} eid
11
+ # @param {String} query_scope (default: 'SHALLOW')
11
12
  #
12
- def find_by_eid eid
13
- GoTransverseTractApi.get_response_for(self, {eid: eid})
13
+ def find_by_eid eid, query_scope=nil
14
+ GoTransverseTractApi.get_response_for(self, {eid: eid, queryScope: query_scope})
14
15
  end
15
16
 
16
17
  #
17
18
  # @param {String} name
19
+ # @param {String} query_scope (default: 'SHALLOW')
18
20
  #
19
- def find_by_name name
20
- GoTransverseTractApi.get_response_for(self, {name: name})
21
+ def find_by_name name, query_scope=nil
22
+ GoTransverseTractApi.get_response_for(self, {name: name, queryScope: query_scope})
21
23
  end
22
24
 
23
25
  end