killbill-aviate 2.6.0.pre.4 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/aviate/usage_controller.rb +20 -1
- data/lib/aviate/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 104ee64669364a77b73ba0d59f042e06f3a222cd4b790e556199bd9f70b6c110
|
|
4
|
+
data.tar.gz: 24576e306ad01f0a7b75b2fc717e9c3f8f560ce7d7bcedec26094fea4398550f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0244dbde14c4ec59ff94e2bd5fead2df4a3a8890451f2675faa9b7630cfde3f319b84164ad1088f0dea16bf16fe0780b8221b1b8c7f9f2047b8663c1a3a12286
|
|
7
|
+
data.tar.gz: 43f04902f065943fd1dbb3217fcddff64aa0e2800727175efdec94687f85b45857a4c95d79e174e583f90e8c0a01fa2824b3cf599e9d8b396630d5b8158b9f15
|
|
@@ -151,7 +151,7 @@ module Aviate
|
|
|
151
151
|
"#{KillBillClient::Model::Catalog::KILLBILL_API_CATALOG_PREFIX}/phase",
|
|
152
152
|
{
|
|
153
153
|
subscriptionId: subscription.subscription_id,
|
|
154
|
-
requestedDate: start_date
|
|
154
|
+
requestedDate: phase_requested_date(subscription, start_date)
|
|
155
155
|
},
|
|
156
156
|
cached_options
|
|
157
157
|
)
|
|
@@ -193,6 +193,25 @@ module Aviate
|
|
|
193
193
|
nil
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
+
# The catalog phase API rejects a requestedDate before the subscription start date-time
|
|
197
|
+
# ("<date> is before the subscription start date"). A plain date is interpreted as
|
|
198
|
+
# midnight, which is before the actual start time on the subscription's first day:
|
|
199
|
+
# fall forward to the subscription start in that case.
|
|
200
|
+
def phase_requested_date(subscription, start_date)
|
|
201
|
+
requested = start_date.in_time_zone('UTC')
|
|
202
|
+
subscription_start = parse_kb_datetime(subscription.start_date)
|
|
203
|
+
requested = subscription_start if subscription_start.present? && subscription_start > requested
|
|
204
|
+
requested.strftime('%Y-%m-%dT%H:%M:%S')
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def parse_kb_datetime(date_str)
|
|
208
|
+
return nil if date_str.blank?
|
|
209
|
+
|
|
210
|
+
Time.iso8601(date_str.to_s).utc
|
|
211
|
+
rescue ArgumentError
|
|
212
|
+
nil
|
|
213
|
+
end
|
|
214
|
+
|
|
196
215
|
def fetch_all_samples(subscription_id, unit_types, start_date, end_date, cached_options)
|
|
197
216
|
samples_by_unit = {}
|
|
198
217
|
from = start_date.to_s
|
data/lib/aviate/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: killbill-aviate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.6.0
|
|
4
|
+
version: 2.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kill Bill core team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: killbill-assets-ui
|
|
@@ -125,9 +125,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
125
125
|
version: '0'
|
|
126
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
|
-
- - "
|
|
128
|
+
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version:
|
|
130
|
+
version: '0'
|
|
131
131
|
requirements: []
|
|
132
132
|
rubygems_version: 3.4.10
|
|
133
133
|
signing_key:
|