gotransverse-tract-api 0.8.1 → 0.9.0

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: 629fbb29593de4e0b5dcb20425b46be7212c6d42
4
- data.tar.gz: 4a9bc01c79cab95aac20fb72fcb6b60ddbc88ac5
3
+ metadata.gz: d136e4e8970fc607b94e22759b72fae2cddbb307
4
+ data.tar.gz: 307b3bd4ee70c747607d07ac053284750b81b205
5
5
  SHA512:
6
- metadata.gz: 6dedba363f8df2e6c1f08e22a6c90a80bc17982e88510f24d30dc16dd9f92e5b3e01004de07128e369b3577bfadeba8ff775527bc87f462f4126a62d77a2ff21
7
- data.tar.gz: 5875287dd99bffa326c666fb2b81be42594c8fe8cbb96a95455b9d17288a229d256dc71743c7fb69ab969ad7ae0273c666899584cf170d447bbe3902356f019e
6
+ metadata.gz: 0fd42419191b221da0191415b805636d922df1637a453243b8b9acd473f5a3f6214f9ccbc237b840487de81775f666286bc29ba2e2f049535ffe9288cb1d2f8a
7
+ data.tar.gz: f8b8777c10a99c76703bc1acf28a3beec27f087e5f1e6b8ab2f646c2310ca41eac8f928af26ee78f7732ded89ea4c25e0a1b66dda20309ed8f4115374ec0eba6
@@ -3,6 +3,7 @@ require "gotransverse-tract-api/version"
3
3
  require "gotransverse-tract-api/configuration"
4
4
  require "gotransverse-tract-api/hash"
5
5
  require "gotransverse-tract-api/api_data"
6
+ require "gotransverse-tract-api/common/base"
6
7
 
7
8
  require "gotransverse-tract-api/billing_account/adjustment"
8
9
  require "gotransverse-tract-api/billing_account/adjustment_application"
@@ -2,7 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module BillingAccount
4
4
 
5
- class CustomFieldValue
5
+ class CustomFieldValue < Common::OrderBase
6
6
 
7
7
  class << self
8
8
 
@@ -25,39 +25,6 @@ module GoTransverseTractApi
25
25
  GoTransverseTractApi.get_response_for(self, params)
26
26
  end
27
27
 
28
- #
29
- # @param {Long} account_num
30
- # @param {Hash} options
31
- #
32
- def find_by_account_num account_num, options={}
33
- return nil unless account_num.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({account_num: account_num}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
- #
40
- # @param {Long} external_account_num
41
- # @param {Hash} options
42
- #
43
- def find_by_external_account_num external_account_num, options={}
44
- return nil unless external_account_num.present?
45
-
46
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({external_account_num: external_account_num}, options)
47
- GoTransverseTractApi.get_response_for(self, params)
48
- end
49
-
50
- #
51
- # @param {Long} billing_account_eid
52
- # @param {Hash} options
53
- #
54
- def find_by_billing_account_eid billing_account_eid, options={}
55
- return nil unless billing_account_eid.present?
56
-
57
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({billing_account_eid: billing_account_eid}, options)
58
- GoTransverseTractApi.get_response_for(self, params)
59
- end
60
-
61
28
  #
62
29
  # @param {Long} custom_field_eid
63
30
  # @param {Hash} options
@@ -102,17 +69,6 @@ module GoTransverseTractApi
102
69
  GoTransverseTractApi.get_response_for(self, params)
103
70
  end
104
71
 
105
- #
106
- # @param {Long} order_num
107
- # @param {Hash} options
108
- #
109
- def find_by_order_num order_num, options={}
110
- return nil unless order_num.present?
111
-
112
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({order_num: order_num}, options)
113
- GoTransverseTractApi.get_response_for(self, params)
114
- end
115
-
116
72
  #
117
73
  # @param {String} custom_field_name
118
74
  # @param {Hash} options
@@ -0,0 +1,160 @@
1
+ module GoTransverseTractApi
2
+
3
+ module Common
4
+
5
+ class Base
6
+
7
+ class << self
8
+
9
+ #
10
+ # @param {Hash} options
11
+ #
12
+ def find_all options={}
13
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
14
+ GoTransverseTractApi.get_response_for(self, params)
15
+ end
16
+
17
+ #
18
+ # @param {Long} eid
19
+ # @param {Hash} options
20
+ #
21
+ def find_by_eid eid, options={}
22
+ return nil unless eid.present?
23
+
24
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
25
+ GoTransverseTractApi.get_response_for(self, params)
26
+ end
27
+
28
+ #
29
+ # @param {String} name
30
+ # @param {Hash} options
31
+ #
32
+ def find_by_name name, options={}
33
+ return nil unless name.present?
34
+
35
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
36
+ GoTransverseTractApi.get_response_for(self, params)
37
+ end
38
+
39
+ #
40
+ # @param {String} status
41
+ # @param {Hash} options
42
+ #
43
+ def find_by_status status, options={}
44
+ return nil unless status.present?
45
+
46
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
47
+ GoTransverseTractApi.get_response_for(self, params)
48
+ end
49
+
50
+ end
51
+
52
+ end
53
+
54
+ class OrderBase
55
+
56
+ class << self
57
+
58
+ #
59
+ # @param {Long} account_num
60
+ # @param {Hash} options
61
+ #
62
+ def find_by_account_num account_num, options={}
63
+ return nil unless account_num.present?
64
+
65
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({account_num: account_num}, options)
66
+ GoTransverseTractApi.get_response_for(self, params)
67
+ end
68
+
69
+ #
70
+ # @param {Long} external_account_num
71
+ # @param {Hash} options
72
+ #
73
+ def find_by_external_account_num external_account_num, options={}
74
+ return nil unless external_account_num.present?
75
+
76
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({external_account_num: external_account_num}, options)
77
+ GoTransverseTractApi.get_response_for(self, params)
78
+ end
79
+
80
+ #
81
+ # @param {Long} order_num
82
+ # @param {Hash} options
83
+ #
84
+ def find_by_order_num order_num, options={}
85
+ return nil unless order_num.present?
86
+
87
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({order_num: order_num}, options)
88
+ GoTransverseTractApi.get_response_for(self, params)
89
+ end
90
+
91
+ #
92
+ # @param {Long} billing_account_eid
93
+ # @param {Hash} options
94
+ #
95
+ def find_by_billing_account_eid billing_account_eid, options={}
96
+ return nil unless billing_account_eid.present?
97
+
98
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({billing_account_eid: billing_account_eid}, options)
99
+ GoTransverseTractApi.get_response_for(self, params)
100
+ end
101
+
102
+ end
103
+
104
+ end
105
+
106
+ class ServiceBase
107
+
108
+ class << self
109
+
110
+ #
111
+ # @param {Long} eid
112
+ # @param {Hash} options
113
+ #
114
+ def find_by_eid eid, options={}
115
+ return nil unless eid.present?
116
+
117
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
118
+ GoTransverseTractApi.get_response_for(self, params)
119
+ end
120
+
121
+ #
122
+ # @param {Long} service_eid
123
+ # @param {Hash} options
124
+ #
125
+ def find_by_service_eid service_eid, options={}
126
+ return nil unless service_eid.present?
127
+
128
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({service_eid: service_eid}, options)
129
+ GoTransverseTractApi.get_response_for(self, params)
130
+ end
131
+
132
+ #
133
+ # @param {Date} start_date
134
+ # @param {Hash} options
135
+ #
136
+ def find_by_start_date start_date, options={}
137
+ return nil unless start_date.present?
138
+
139
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({start_date: start_date}, options)
140
+ GoTransverseTractApi.get_response_for(self, params)
141
+ end
142
+
143
+ #
144
+ # @param {Date} end_date
145
+ # @param {Hash} options
146
+ #
147
+ def find_by_end_date end_date, options={}
148
+ return nil unless end_date.present?
149
+
150
+ params ||= GoTransverseTractApi::ApiData.new.get_query_params({end_date: end_date}, options)
151
+ GoTransverseTractApi.get_response_for(self, params)
152
+ end
153
+
154
+ end
155
+
156
+ end
157
+
158
+ end
159
+
160
+ end
@@ -2,52 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module GeneralLedger
4
4
 
5
- class GeneralLedger
6
-
7
- class << self
8
-
9
- #
10
- # @param {Hash} options
11
- #
12
- def find_all options={}
13
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
14
- GoTransverseTractApi.get_response_for(self, params)
15
- end
16
-
17
- #
18
- # @param {Long} eid
19
- # @param {Hash} options
20
- #
21
- def find_by_eid eid, options={}
22
- return nil unless eid.present?
23
-
24
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
25
- GoTransverseTractApi.get_response_for(self, params)
26
- end
27
-
28
- #
29
- # @param {Boolean} name
30
- # @param {Hash} options
31
- #
32
- def find_by_name name, options={}
33
- return nil unless name.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
- #
40
- # @param {String} status
41
- # @param {Hash} options
42
- #
43
- def find_by_status status, options={}
44
- return nil unless status.present?
45
-
46
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
47
- GoTransverseTractApi.get_response_for(self, params)
48
- end
49
-
50
- end
5
+ class GeneralLedger < Common::Base
51
6
 
52
7
  end
53
8
 
@@ -2,53 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module Order
4
4
 
5
- class AdjustmentCategory
6
-
7
- class << self
8
-
9
- #
10
- # @param {Hash} options
11
- #
12
- def find_all options={}
13
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
14
- GoTransverseTractApi.get_response_for(self, params)
15
- end
16
-
17
- #
18
- # @param {Long} eid
19
- # @param {Hash} options
20
- #
21
- def find_by_eid eid, options={}
22
- return nil unless eid.present?
23
-
24
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
25
- GoTransverseTractApi.get_response_for(self, params)
26
- end
27
-
28
- #
29
- # @param {String} name
30
- # @param {Hash} options
31
- #
32
- def find_by_name name, options={}
33
- return nil unless name.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
- #
40
- # @param {String} status
41
- # @param {Hash} options
42
- #
43
- def find_by_status status, options={}
44
- return nil unless status.present?
45
-
46
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
47
- GoTransverseTractApi.get_response_for(self, params)
48
- end
49
-
50
- end
51
-
5
+ class AdjustmentCategory < Common::Base
52
6
  end
53
7
 
54
8
  end
@@ -2,40 +2,10 @@ module GoTransverseTractApi
2
2
 
3
3
  module Order
4
4
 
5
- class Agreement
5
+ class Agreement < Common::Base
6
6
 
7
7
  class << self
8
8
 
9
- #
10
- # @param {Hash} options
11
- #
12
- def find_all options={}
13
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
14
- GoTransverseTractApi.get_response_for(self, params)
15
- end
16
-
17
- #
18
- # @param {Long} eid
19
- # @param {Hash} options
20
- #
21
- def find_by_eid eid, options={}
22
- return nil unless eid.present?
23
-
24
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
25
- GoTransverseTractApi.get_response_for(self, params)
26
- end
27
-
28
- #
29
- # @param {String} name
30
- # @param {Hash} options
31
- #
32
- def find_by_name name, options={}
33
- return nil unless name.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
9
  #
40
10
  # @param {Long} product_eid
41
11
  # @param {Hash} options
@@ -47,17 +17,6 @@ module GoTransverseTractApi
47
17
  GoTransverseTractApi.get_response_for(self, params)
48
18
  end
49
19
 
50
- #
51
- # @param {String} status
52
- # @param {Hash} options
53
- #
54
- def find_by_status status, options={}
55
- return nil unless status.present?
56
-
57
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
58
- GoTransverseTractApi.get_response_for(self, params)
59
- end
60
-
61
20
  #
62
21
  # @param {String} termination_fee_currency_type
63
22
  # @param {Hash} options
@@ -2,40 +2,10 @@ module GoTransverseTractApi
2
2
 
3
3
  module Order
4
4
 
5
- class BillCycle
5
+ class BillCycle < Common::Base
6
6
 
7
7
  class << self
8
8
 
9
- #
10
- # @param {Hash} options
11
- #
12
- def find_all options={}
13
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
14
- GoTransverseTractApi.get_response_for(self, params)
15
- end
16
-
17
- #
18
- # @param {Long} eid
19
- # @param {Hash} options
20
- #
21
- def find_by_eid eid, options={}
22
- return nil unless eid.present?
23
-
24
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
25
- GoTransverseTractApi.get_response_for(self, params)
26
- end
27
-
28
- #
29
- # @param {String} name
30
- # @param {Hash} options
31
- #
32
- def find_by_name name, options={}
33
- return nil unless name.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
9
  #
40
10
  # @param {String} type
41
11
  # @param {Hash} options
@@ -47,17 +17,6 @@ module GoTransverseTractApi
47
17
  GoTransverseTractApi.get_response_for(self, params)
48
18
  end
49
19
 
50
- #
51
- # @param {String} status
52
- # @param {Hash} options
53
- #
54
- def find_by_status status, options={}
55
- return nil unless status.present?
56
-
57
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
58
- GoTransverseTractApi.get_response_for(self, params)
59
- end
60
-
61
20
  #
62
21
  # @param {String} currency_type
63
22
  # @param {Hash} options
@@ -2,37 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module Order
4
4
 
5
- class PartyCategory
6
-
7
- #
8
- # @param {Hash} options
9
- #
10
- def self.find_all options={}
11
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
12
- GoTransverseTractApi.get_response_for(self, params)
13
- end
14
-
15
- #
16
- # @param {Long} eid
17
- # @param {Hash} options
18
- #
19
- def self.find_by_eid eid, options={}
20
- return nil unless eid.present?
21
-
22
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
23
- GoTransverseTractApi.get_response_for(self, params)
24
- end
25
-
26
- #
27
- # @param {String} name
28
- # @param {Hash} options
29
- #
30
- def self.find_by_name name, options={}
31
- return nil unless name.present?
32
-
33
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
34
- GoTransverseTractApi.get_response_for(self, params)
35
- end
5
+ class PartyCategory < Common::Base
36
6
 
37
7
  #
38
8
  # @param {String} description
@@ -45,17 +15,6 @@ module GoTransverseTractApi
45
15
  GoTransverseTractApi.get_response_for(self, params)
46
16
  end
47
17
 
48
- #
49
- # @param {String} status
50
- # @param {Hash} options
51
- #
52
- def self.find_by_status status, options={}
53
- return nil unless status.present?
54
-
55
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
56
- GoTransverseTractApi.get_response_for(self, params)
57
- end
58
-
59
18
  end
60
19
 
61
20
  end
@@ -17,50 +17,6 @@ module GoTransverseTractApi
17
17
  GoTransverseTractApi.get_response_for(self, params)
18
18
  end
19
19
 
20
- #
21
- # @param {Long} order_num
22
- # @param {Hash} options
23
- #
24
- def find_by_order_num order_num, options={}
25
- return nil unless order_num.present?
26
-
27
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({order_num: order_num}, options)
28
- GoTransverseTractApi.get_response_for(self, params)
29
- end
30
-
31
- #
32
- # @param {Long} billing_account_eid
33
- # @param {Hash} options
34
- #
35
- def find_by_billing_account_eid billing_account_eid, options={}
36
- return nil unless billing_account_eid.present?
37
-
38
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({billing_account_eid: billing_account_eid}, options)
39
- GoTransverseTractApi.get_response_for(self, params)
40
- end
41
-
42
- #
43
- # @param {Long} account_num
44
- # @param {Hash} options
45
- #
46
- def find_by_account_num account_num, options={}
47
- return nil unless account_num.present?
48
-
49
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({account_num: account_num}, options)
50
- GoTransverseTractApi.get_response_for(self, params)
51
- end
52
-
53
- #
54
- # @param {Long} external_account_num
55
- # @param {Hash} options
56
- #
57
- def find_by_external_account_num external_account_num, options={}
58
- return nil unless external_account_num.present?
59
-
60
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({external_account_num: external_account_num}, options)
61
- GoTransverseTractApi.get_response_for(self, params)
62
- end
63
-
64
20
  #
65
21
  # @param {Date} order_date
66
22
  # @param {Hash} options
@@ -2,7 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module Order
4
4
 
5
- class SalesOrder
5
+ class SalesOrder < Common::OrderBase
6
6
 
7
7
  class << self
8
8
 
@@ -25,50 +25,6 @@ module GoTransverseTractApi
25
25
  GoTransverseTractApi.get_response_for(self, params)
26
26
  end
27
27
 
28
- #
29
- # @param {Long} order_num
30
- # @param {Hash} options
31
- #
32
- def find_by_order_num order_num, options={}
33
- return nil unless order_num.present?
34
-
35
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({order_num: order_num}, options)
36
- GoTransverseTractApi.get_response_for(self, params)
37
- end
38
-
39
- #
40
- # @param {Long} billing_account_eid
41
- # @param {Hash} options
42
- #
43
- def find_by_billing_account_eid billing_account_eid, options={}
44
- return nil unless billing_account_eid.present?
45
-
46
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({billing_account_eid: billing_account_eid}, options)
47
- GoTransverseTractApi.get_response_for(self, params)
48
- end
49
-
50
- #
51
- # @param {Long} account_num
52
- # @param {Hash} options
53
- #
54
- def find_by_account_num account_num, options={}
55
- return nil unless account_num.present?
56
-
57
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({account_num: account_num}, options)
58
- GoTransverseTractApi.get_response_for(self, params)
59
- end
60
-
61
- #
62
- # @param {Long} external_account_num
63
- # @param {Hash} options
64
- #
65
- def find_by_external_account_num external_account_num, options={}
66
- return nil unless external_account_num.present?
67
-
68
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({external_account_num: external_account_num}, options)
69
- GoTransverseTractApi.get_response_for(self, params)
70
- end
71
-
72
28
  #
73
29
  # @param {Date} order_date
74
30
  # @param {Hash} options
@@ -2,48 +2,7 @@ module GoTransverseTractApi
2
2
 
3
3
  module Product
4
4
 
5
- class DiscountCategory
6
-
7
- #
8
- # @param {Hash} options
9
- #
10
- def self.find_all options={}
11
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({}, options)
12
- GoTransverseTractApi.get_response_for(self, params)
13
- end
14
-
15
- #
16
- # @param {Long} eid
17
- # @param {Hash} options
18
- #
19
- def self.find_by_eid eid, options={}
20
- return nil unless eid.present?
21
-
22
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
23
- GoTransverseTractApi.get_response_for(self, params)
24
- end
25
-
26
- #
27
- # @param {String} name
28
- # @param {Hash} options
29
- #
30
- def self.find_by_name name, options={}
31
- return nil unless name.present?
32
-
33
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({name: name}, options)
34
- GoTransverseTractApi.get_response_for(self, params)
35
- end
36
-
37
- #
38
- # @param {String} status
39
- # @param {Hash} options
40
- #
41
- def self.find_by_status status, options={}
42
- return nil unless status.present?
43
-
44
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({status: status}, options)
45
- GoTransverseTractApi.get_response_for(self, params)
46
- end
5
+ class DiscountCategory < Common::Base
47
6
 
48
7
  end
49
8
 
@@ -2,54 +2,10 @@ module GoTransverseTractApi
2
2
 
3
3
  module Service
4
4
 
5
- class ServicePeriod
5
+ class ServicePeriod < Common::ServiceBase
6
6
 
7
7
  class << self
8
8
 
9
- #
10
- # @param {Long} eid
11
- # @param {Hash} options
12
- #
13
- def find_by_eid eid, options={}
14
- return nil unless eid.present?
15
-
16
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
17
- GoTransverseTractApi.get_response_for(self, params)
18
- end
19
-
20
- #
21
- # @param {Long} service_eid
22
- # @param {Hash} options
23
- #
24
- def find_by_service_eid service_eid, options={}
25
- return nil unless service_eid.present?
26
-
27
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({service_eid: service_eid}, options)
28
- GoTransverseTractApi.get_response_for(self, params)
29
- end
30
-
31
- #
32
- # @param {Date} start_date
33
- # @param {Hash} options
34
- #
35
- def find_by_start_date start_date, options={}
36
- return nil unless start_date.present?
37
-
38
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({start_date: start_date}, options)
39
- GoTransverseTractApi.get_response_for(self, params)
40
- end
41
-
42
- #
43
- # @param {Date} end_date
44
- # @param {Hash} options
45
- #
46
- def find_by_end_date end_date, options={}
47
- return nil unless end_date.present?
48
-
49
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({end_date: end_date}, options)
50
- GoTransverseTractApi.get_response_for(self, params)
51
- end
52
-
53
9
  #
54
10
  # @param {Boolean} closed
55
11
  # @param {Hash} options
@@ -2,54 +2,10 @@ module GoTransverseTractApi
2
2
 
3
3
  module Service
4
4
 
5
- class ServicePrice
5
+ class ServicePrice < Common::ServiceBase
6
6
 
7
7
  class << self
8
8
 
9
- #
10
- # @param {Long} eid
11
- # @param {Hash} options
12
- #
13
- def find_by_eid eid, options={}
14
- return nil unless eid.present?
15
-
16
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
17
- GoTransverseTractApi.get_response_for(self, params)
18
- end
19
-
20
- #
21
- # @param {Long} service_eid
22
- # @param {Hash} options
23
- #
24
- def find_by_service_eid service_eid, options={}
25
- return nil unless service_eid.present?
26
-
27
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({service_eid: service_eid}, options)
28
- GoTransverseTractApi.get_response_for(self, params)
29
- end
30
-
31
- #
32
- # @param {Date} start_date
33
- # @param {Hash} options
34
- #
35
- def find_by_start_date start_date, options={}
36
- return nil unless start_date.present?
37
-
38
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({start_date: start_date}, options)
39
- GoTransverseTractApi.get_response_for(self, params)
40
- end
41
-
42
- #
43
- # @param {Date} end_date
44
- # @param {Hash} options
45
- #
46
- def find_by_end_date end_date, options={}
47
- return nil unless end_date.present?
48
-
49
- params ||= GoTransverseTractApi::ApiData.new.get_query_params({end_date: end_date}, options)
50
- GoTransverseTractApi.get_response_for(self, params)
51
- end
52
-
53
9
  #
54
10
  # @param {Long} recurrence_period
55
11
  # @param {Hash} options
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.8.1"
3
+ VERSION = "0.9.0"
4
4
  TARGET_API_VERSION = "1.29"
5
5
 
6
6
  end
@@ -0,0 +1,96 @@
1
+ require 'spec_helper'
2
+
3
+ module GoTransverseTractApi
4
+
5
+ RSpec.describe Common::Base do
6
+ before(:each) { http_auth }
7
+
8
+ let(:response) { {a: 'b', c: 'd'} }
9
+
10
+ describe ".find_all" do
11
+ it "returns all details" do
12
+ allow(subject).to receive(:find_all).and_return(response)
13
+ expect(subject.find_all).to eq(response)
14
+ end
15
+ end
16
+
17
+ describe ".find_by_eid" do
18
+ it "returns details for a given eid" do
19
+ eid = 165
20
+
21
+ allow(subject).to receive(:find_by_eid).with(eid).and_return(response)
22
+ expect(subject.find_by_eid(eid)).to eq(response)
23
+ end
24
+ end
25
+
26
+ describe ".find_by_name" do
27
+ it "returns details for a given name" do
28
+ name = 'abc'
29
+
30
+ allow(subject).to receive(:find_by_name).with(name).and_return(response)
31
+ expect(subject.find_by_name(name)).to eq(response)
32
+ end
33
+ end
34
+
35
+ describe ".find_by_stat" do
36
+ it "returns details for a given status" do
37
+ status = 'ACTIVE'
38
+
39
+ allow(subject).to receive(:find_by_status).with(status).and_return(response)
40
+ expect(subject.find_by_status(status)).to eq(response)
41
+ end
42
+ end
43
+
44
+ end
45
+
46
+ RSpec.describe Common::OrderBase do
47
+ before(:each) { http_auth }
48
+
49
+ let(:response) { {a: 'b', c: 'd'} }
50
+
51
+ describe ".find_by_account_num" do
52
+ it "returns details for a given account number" do
53
+ account_num = 100
54
+
55
+ allow(subject).to receive(:find_by_account_num).with(account_num).and_return(response)
56
+ expect(subject.find_by_account_num(account_num)).to eq(response)
57
+ end
58
+ end
59
+
60
+ describe ".find_by_external_account_num" do
61
+ it "returns details for a given external account number" do
62
+ ext_account_num = 100
63
+
64
+ allow(subject).to receive(:find_by_external_account_num).with(ext_account_num).and_return(response)
65
+ expect(subject.find_by_external_account_num(ext_account_num)).to eq(response)
66
+ end
67
+ end
68
+
69
+ end
70
+
71
+ RSpec.describe Common::ServiceBase do
72
+ before(:each) { http_auth }
73
+
74
+ let(:response) { {a: 'b', c: 'd'} }
75
+
76
+ describe ".find_by_service_eid" do
77
+ it "returns details for a given service eid" do
78
+ service_eid = 100
79
+
80
+ allow(subject).to receive(:find_by_service_eid).with(service_eid).and_return(response)
81
+ expect(subject.find_by_service_eid(service_eid)).to eq(response)
82
+ end
83
+ end
84
+
85
+ describe ".find_by_start_dat" do
86
+ it "returns details for a given start date" do
87
+ start_date = '01/01/2016'
88
+
89
+ allow(subject).to receive(:find_by_start_date).with(start_date).and_return(response)
90
+ expect(subject.find_by_start_date(start_date)).to eq(response)
91
+ end
92
+ end
93
+
94
+ end
95
+
96
+ end
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.8.1
4
+ version: 0.9.0
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-03-08 00:00:00.000000000 Z
12
+ date: 2016-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -135,6 +135,7 @@ files:
135
135
  - lib/gotransverse-tract-api/billing_account/refund.rb
136
136
  - lib/gotransverse-tract-api/billing_account/scheduled_charge.rb
137
137
  - lib/gotransverse-tract-api/billing_account/standard_invoice_adjustment_application.rb
138
+ - lib/gotransverse-tract-api/common/base.rb
138
139
  - lib/gotransverse-tract-api/configuration.rb
139
140
  - lib/gotransverse-tract-api/general/system_setting.rb
140
141
  - lib/gotransverse-tract-api/general_ledger/general_ledger.rb
@@ -213,6 +214,7 @@ files:
213
214
  - spec/gotransverse-tract-api/billing_account/payment_spec.rb
214
215
  - spec/gotransverse-tract-api/billing_account/recurring_payment_spec.rb
215
216
  - spec/gotransverse-tract-api/billing_account/refund_spec.rb
217
+ - spec/gotransverse-tract-api/common/base_spec.rb
216
218
  - spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
217
219
  - spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
218
220
  - spec/gotransverse-tract-api/order/agreement_spec.rb
@@ -267,6 +269,7 @@ test_files:
267
269
  - spec/gotransverse-tract-api/billing_account/payment_spec.rb
268
270
  - spec/gotransverse-tract-api/billing_account/recurring_payment_spec.rb
269
271
  - spec/gotransverse-tract-api/billing_account/refund_spec.rb
272
+ - spec/gotransverse-tract-api/common/base_spec.rb
270
273
  - spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
271
274
  - spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
272
275
  - spec/gotransverse-tract-api/order/agreement_spec.rb