chartmogul-ruby 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/changelog.md +7 -0
  4. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARPA/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  5. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ARR/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  6. data/fixtures/vcr_cassettes/ChartMogul_Metrics_ASP/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  7. data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_entries.yml +1 -1
  8. data/fixtures/vcr_cassettes/ChartMogul_Metrics_AllKeyMetric/should_have_summary.yml +42 -0
  9. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  10. data/fixtures/vcr_cassettes/ChartMogul_Metrics_CustomerCount/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  11. data/fixtures/vcr_cassettes/ChartMogul_Metrics_LTV/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  12. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRR/should_have_entries.yml +1 -1
  13. data/fixtures/vcr_cassettes/ChartMogul_Metrics_MRRChurnRate/behaves_like_Metrics_API_resource/should_have_entries.yml +1 -1
  14. data/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/creates_a_new_subscription_event.yml +320 -0
  15. data/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/deletes_the_subscription_event.yml +377 -0
  16. data/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/lists_all_subscription_events.yml +320 -0
  17. data/fixtures/vcr_cassettes/ChartMogul_SubscriptionEvent/API_interactions/updates_the_subscription_event.yml +377 -0
  18. data/lib/chartmogul/api/actions/destroy_with_params.rb +29 -0
  19. data/lib/chartmogul/api_resource.rb +1 -1
  20. data/lib/chartmogul/concerns/summary_all.rb +21 -0
  21. data/lib/chartmogul/metrics/all_key_metrics.rb +9 -0
  22. data/lib/chartmogul/metrics/arpa.rb +1 -0
  23. data/lib/chartmogul/metrics/arr.rb +1 -0
  24. data/lib/chartmogul/metrics/asp.rb +1 -0
  25. data/lib/chartmogul/metrics/customer_churn_rate.rb +1 -0
  26. data/lib/chartmogul/metrics/customer_count.rb +1 -0
  27. data/lib/chartmogul/metrics/ltv.rb +1 -0
  28. data/lib/chartmogul/metrics/mrr.rb +1 -0
  29. data/lib/chartmogul/metrics/mrr_churn_rate.rb +1 -0
  30. data/lib/chartmogul/subscription_event.rb +62 -0
  31. data/lib/chartmogul/summary_all.rb +30 -0
  32. data/lib/chartmogul/version.rb +1 -1
  33. data/lib/chartmogul.rb +4 -0
  34. metadata +12 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11764c4ea2047d068ef4a7de177763aad2cffd7bf5db14482bea9c14fbf3f0bb
4
- data.tar.gz: 70a0fb241323b87f03e67c2a5bf662594f38e567d5ceafbc8c2d7f1b68d1d4b9
3
+ metadata.gz: f66ab5d08210ccfa0d00db3b35a92d63c038db6fd7dd3608b945425705406edf
4
+ data.tar.gz: e56d59d45b74eed18d088bb6832d9d6478d16c1c472bf2178d7f0cdc26b30a8d
5
5
  SHA512:
6
- metadata.gz: b7103c010405cc5bf453885fe6f96950aea533c01024f420426bf89521a64d1a1ab1a7122651d913be5e95eed14fa3c4f64a41875f439a351ba81c798b9fca8c
7
- data.tar.gz: f392443972c1cc32d0a1000cb6e7ac65622cacd20908489f10ad5e691434f9f538f39ed922528da5d94b482d570c127c8b14046490263aca3ded0f8b01745fab
6
+ metadata.gz: 6fd45ab42d6ffb9cac4a808f734d7be91f670b59c3c71beaa691d6bc41cfcc264adf9b7547bfb898eb595b52d8ed609559af1128ba1c72a72061790fb56f3f5e
7
+ data.tar.gz: 5c17e4848789a138ef77879e7335977f524ee5e905f15b714d2d5994a06f75ce7537a16347e551cfaf67bbcf65d2cf505e543f0975dc0513c4c2166307ec751f
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7]
12
+ ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0]
13
13
  steps:
14
14
  - uses: actions/checkout@v2
15
15
  - name: Set up Ruby ${{ matrix.ruby-version }}
data/changelog.md CHANGED
@@ -1,7 +1,14 @@
1
1
  # chartmogul-ruby Change Log
2
2
 
3
+ ## Version 3.0.2 - 22 Jun 2022
4
+ - Adds percentage change support
5
+
6
+ ## Version 3.0.1 - 30 May 2022
7
+ - Add Subscription Events support
8
+
3
9
  ## Version 3.0.0 - 29 October 2021
4
10
  - Update ChartMogul::Configuration to use `api_key` instead of `account_token`& `secret_key` combo for authentication
11
+ - Send library version as part of `User-Agent` header
5
12
 
6
13
  ## Version 2.9.0 - 3 Nov 2021
7
14
  - Adds post install message informing about authentication changes *& deprecation warning.
@@ -36,7 +36,7 @@ http_interactions:
36
36
  - 'true'
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"entries":[{"date":"2015-01-01","arpa":0},{"date":"2015-01-02","arpa":0},{"date":"2015-01-03","arpa":0},{"date":"2015-01-04","arpa":0},{"date":"2015-01-05","arpa":0},{"date":"2015-01-06","arpa":0},{"date":"2015-01-07","arpa":0},{"date":"2015-01-08","arpa":0},{"date":"2015-01-09","arpa":11371},{"date":"2015-01-10","arpa":11371},{"date":"2015-01-11","arpa":11371},{"date":"2015-01-12","arpa":16092},{"date":"2015-01-13","arpa":16092},{"date":"2015-01-14","arpa":13963},{"date":"2015-01-15","arpa":13963},{"date":"2015-01-16","arpa":13963},{"date":"2015-01-17","arpa":13963},{"date":"2015-01-18","arpa":13171},{"date":"2015-01-19","arpa":13171},{"date":"2015-01-20","arpa":13171},{"date":"2015-01-21","arpa":13171},{"date":"2015-01-22","arpa":10996},{"date":"2015-01-23","arpa":13474},{"date":"2015-01-24","arpa":13474},{"date":"2015-01-25","arpa":13474},{"date":"2015-01-26","arpa":0},{"date":"2015-01-27","arpa":10000},{"date":"2015-01-28","arpa":10000},{"date":"2015-01-29","arpa":3436},{"date":"2015-01-30","arpa":15620},{"date":"2015-01-31","arpa":15620},{"date":"2015-02-01","arpa":15620}],"summary":{"current":10843,"previous":10843,"percentage-change":0.0}}'
39
+ string: '{"entries":[{"date":"2022-04-30","arpa":656170,"percentage-change":0.0},{"date":"2022-05-31","arpa":1113423,"percentage-change":69.69}],"summary":{"current":1102906,"previous":1111529,"percentage-change":-0.78}}'
40
40
  http_version:
41
41
  recorded_at: Fri, 01 Jul 2016 14:47:45 GMT
42
42
  recorded_with: VCR 3.0.3
@@ -36,7 +36,7 @@ http_interactions:
36
36
  - 'true'
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"entries":[{"date":"2015-01-01","arr":0},{"date":"2015-01-02","arr":0},{"date":"2015-01-03","arr":0},{"date":"2015-01-04","arr":0},{"date":"2015-01-05","arr":0},{"date":"2015-01-06","arr":0},{"date":"2015-01-07","arr":0},{"date":"2015-01-08","arr":0},{"date":"2015-01-09","arr":409344},{"date":"2015-01-10","arr":409344},{"date":"2015-01-11","arr":409344},{"date":"2015-01-12","arr":772392},{"date":"2015-01-13","arr":772392},{"date":"2015-01-14","arr":670236},{"date":"2015-01-15","arr":670236},{"date":"2015-01-16","arr":670236},{"date":"2015-01-17","arr":670236},{"date":"2015-01-18","arr":790236},{"date":"2015-01-19","arr":790236},{"date":"2015-01-20","arr":790236},{"date":"2015-01-21","arr":790236},{"date":"2015-01-22","arr":659784},{"date":"2015-01-23","arr":646740},{"date":"2015-01-24","arr":646740},{"date":"2015-01-25","arr":646740},{"date":"2015-01-26","arr":0},{"date":"2015-01-27","arr":120000},{"date":"2015-01-28","arr":120000},{"date":"2015-01-29","arr":82452},{"date":"2015-01-30","arr":187440},{"date":"2015-01-31","arr":187440},{"date":"2015-02-01","arr":187440}],"summary":{"current":520452,"previous":520452,"percentage-change":0.0}}'
39
+ string: '{"entries":[{"date":"2022-04-30","arr":4606319628,"percentage-change":0.0},{"date":"2022-05-31","arr":8043370848,"percentage-change":74.62}],"summary":{"current":8046802440,"previous":8043027072,"percentage-change":0.05}}'
40
40
  http_version:
41
41
  recorded_at: Fri, 01 Jul 2016 14:47:45 GMT
42
42
  recorded_with: VCR 3.0.3
@@ -34,7 +34,7 @@ http_interactions:
34
34
  - 'true'
35
35
  body:
36
36
  encoding: UTF-8
37
- string: '{"entries":[{"date":"2015-01-31","asp":12731},{"date":"2015-02-01","asp":0}],"summary":{"current":0,"previous":0,"percentage-change":0.0}}'
37
+ string: '{"entries":[{"date":"2022-04-30","asp":46107,"percentage-change":0.0},{"date":"2022-05-31","asp":22035,"percentage-change":-52.21}],"summary":{"current":18160,"previous":23087,"percentage-change":-21.34}}'
38
38
  http_version:
39
39
  recorded_at: Fri, 01 Jul 2016 14:47:44 GMT
40
40
  recorded_with: VCR 3.0.3
@@ -36,7 +36,7 @@ http_interactions:
36
36
  - 'true'
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"entries":[{"date":"2015-01-01","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-02","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-03","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-04","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-05","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-06","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-07","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-08","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-09","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":3,"asp":12731,"arpa":11371,"arr":409344,"mrr":34112},{"date":"2015-01-10","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":3,"asp":12731,"arpa":11371,"arr":409344,"mrr":34112},{"date":"2015-01-11","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":3,"asp":12731,"arpa":11371,"arr":409344,"mrr":34112},{"date":"2015-01-12","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":16092,"arr":772392,"mrr":64366},{"date":"2015-01-13","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":16092,"arr":772392,"mrr":64366},{"date":"2015-01-14","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13963,"arr":670236,"mrr":55853},{"date":"2015-01-15","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13963,"arr":670236,"mrr":55853},{"date":"2015-01-16","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13963,"arr":670236,"mrr":55853},{"date":"2015-01-17","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13963,"arr":670236,"mrr":55853},{"date":"2015-01-18","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":5,"asp":12731,"arpa":13171,"arr":790236,"mrr":65853},{"date":"2015-01-19","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":5,"asp":12731,"arpa":13171,"arr":790236,"mrr":65853},{"date":"2015-01-20","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":5,"asp":12731,"arpa":13171,"arr":790236,"mrr":65853},{"date":"2015-01-21","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":5,"asp":12731,"arpa":13171,"arr":790236,"mrr":65853},{"date":"2015-01-22","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":10996,"arr":659784,"mrr":54982},{"date":"2015-01-23","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13474,"arr":646740,"mrr":53895},{"date":"2015-01-24","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13474,"arr":646740,"mrr":53895},{"date":"2015-01-25","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":4,"asp":12731,"arpa":13474,"arr":646740,"mrr":53895},{"date":"2015-01-26","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":0,"asp":12731,"arpa":0,"arr":0,"mrr":0},{"date":"2015-01-27","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":1,"asp":12731,"arpa":10000,"arr":120000,"mrr":10000},{"date":"2015-01-28","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":1,"asp":12731,"arpa":10000,"arr":120000,"mrr":10000},{"date":"2015-01-29","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":1,"asp":12731,"arpa":3436,"arr":82452,"mrr":6871},{"date":"2015-01-30","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":1,"asp":12731,"arpa":15620,"arr":187440,"mrr":15620},{"date":"2015-01-31","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":0,"customers":1,"asp":12731,"arpa":15620,"arr":187440,"mrr":15620},{"date":"2015-02-01","customer-churn-rate":0.0,"mrr-churn-rate":0.0,"ltv":15620.0,"customers":1,"asp":0,"arpa":15620,"arr":187440,"mrr":15620}]}'
39
+ string: '{"entries":[{"date":"2022-04-30","mrr":383859969,"mrr-percentage-change":0.0,"arr":4606319628,"arr-percentage-change":0.0,"customer-churn-rate":0.56,"customer-churn-rate-percentage-change":0.0,"mrr-churn-rate":-0.17,"mrr-churn-rate-percentage-change":0.0,"ltv":117173214,"ltv-percentage-change":0.0,"customers":585,"customers-percentage-change":0.0,"asp":46107,"asp-percentage-change":0.0,"arpa":656170,"arpa-percentage-change":0.0},{"date":"2022-05-31","mrr":670280904,"mrr-percentage-change":74.62,"arr":8043370848,"arr-percentage-change":74.62,"customer-churn-rate":1.71,"customer-churn-rate-percentage-change":205.36,"mrr-churn-rate":-74.52,"mrr-churn-rate-percentage-change":-43735.29,"ltv":65112456,"ltv-percentage-change":-44.43,"customers":602,"customers-percentage-change":2.91,"asp":22035,"asp-percentage-change":-52.21,"arpa":1113423,"arpa-percentage-change":69.69}],"summary":{"current-mrr":670566870,"previous-mrr":670252256,"mrr-percentage-change":0.05,"current-arr":8046802440,"previous-arr":8043027072,"arr-percentage-change":0.05,"current-customer-churn-rate":1.71,"previous-customer-churn-rate":0.56,"customer-churn-rate-percentage-change":205.36,"current-mrr-churn-rate":-74.52,"previous-mrr-churn-rate":-0.17,"mrr-churn-rate-percentage-change":-43735.29,"current-ltv":65112456,"previous-ltv":117173214,"ltv-percentage-change":-44.43,"current-customers":608,"previous-customers":603,"customers-percentage-change":0.83,"current-asp":18160,"previous-asp":23087,"asp-percentage-change":-21.34,"current-arpa":1102906,"previous-arpa":1111529,"arpa-percentage-change":-0.78}}'
40
40
  http_version:
41
41
  recorded_at: Fri, 01 Jul 2016 14:47:46 GMT
42
42
  recorded_with: VCR 3.0.3
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.chartmogul.com/v1/metrics/all?end-date=2015-02-01&start-date=2015-01-01
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.2
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic hidden
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ server:
22
+ - nginx/1.9.10
23
+ date:
24
+ - Fri, 01 Jul 2016 14:47:46 GMT
25
+ content-type:
26
+ - application/json
27
+ content-length:
28
+ - '4407'
29
+ connection:
30
+ - close
31
+ vary:
32
+ - Accept-Encoding
33
+ status:
34
+ - 200 OK
35
+ access-control-allow-credentials:
36
+ - 'true'
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"entries":[{"date":"2022-04-30","mrr":383859969,"mrr-percentage-change":0.0,"arr":4606319628,"arr-percentage-change":0.0,"customer-churn-rate":0.56,"customer-churn-rate-percentage-change":0.0,"mrr-churn-rate":-0.17,"mrr-churn-rate-percentage-change":0.0,"ltv":117173214,"ltv-percentage-change":0.0,"customers":585,"customers-percentage-change":0.0,"asp":46107,"asp-percentage-change":0.0,"arpa":656170,"arpa-percentage-change":0.0},{"date":"2022-05-31","mrr":670280904,"mrr-percentage-change":74.62,"arr":8043370848,"arr-percentage-change":74.62,"customer-churn-rate":1.71,"customer-churn-rate-percentage-change":205.36,"mrr-churn-rate":-74.52,"mrr-churn-rate-percentage-change":-43735.29,"ltv":65112456,"ltv-percentage-change":-44.43,"customers":602,"customers-percentage-change":2.91,"asp":22035,"asp-percentage-change":-52.21,"arpa":1113423,"arpa-percentage-change":69.69}],"summary":{"current-mrr":670566870,"previous-mrr":670252256,"mrr-percentage-change":0.05,"current-arr":8046802440,"previous-arr":8043027072,"arr-percentage-change":0.05,"current-customer-churn-rate":1.71,"previous-customer-churn-rate":0.56,"customer-churn-rate-percentage-change":205.36,"current-mrr-churn-rate":-74.52,"previous-mrr-churn-rate":-0.17,"mrr-churn-rate-percentage-change":-43735.29,"current-ltv":65112456,"previous-ltv":117173214,"ltv-percentage-change":-44.43,"current-customers":608,"previous-customers":603,"customers-percentage-change":0.83,"current-asp":18160,"previous-asp":23087,"asp-percentage-change":-21.34,"current-arpa":1102906,"previous-arpa":1111529,"arpa-percentage-change":-0.78}}'
40
+ http_version:
41
+ recorded_at: Fri, 01 Jul 2016 14:47:46 GMT
42
+ recorded_with: VCR 3.0.3
@@ -34,7 +34,7 @@ http_interactions:
34
34
  - 'true'
35
35
  body:
36
36
  encoding: UTF-8
37
- string: '{"entries":[{"date":"2015-01-31","customer-churn-rate":0.0},{"date":"2015-02-01","customer-churn-rate":0.0}],"summary":{"current":0,"previous":0,"percentage-change":0.0}}'
37
+ string: '{"entries":[{"date":"2022-04-30","customer-churn-rate":0.56,"percentage-change":0.0},{"date":"2022-05-31","customer-churn-rate":1.71,"percentage-change":205.36}],"summary":{"current":1.71,"previous":0.56,"percentage-change":205.36}}'
38
38
  http_version:
39
39
  recorded_at: Fri, 01 Jul 2016 14:47:49 GMT
40
40
  recorded_with: VCR 3.0.3
@@ -36,7 +36,7 @@ http_interactions:
36
36
  - 'true'
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"entries":[{"date":"2015-01-01","customers":0},{"date":"2015-01-02","customers":0},{"date":"2015-01-03","customers":0},{"date":"2015-01-04","customers":0},{"date":"2015-01-05","customers":0},{"date":"2015-01-06","customers":0},{"date":"2015-01-07","customers":0},{"date":"2015-01-08","customers":0},{"date":"2015-01-09","customers":3},{"date":"2015-01-10","customers":3},{"date":"2015-01-11","customers":3},{"date":"2015-01-12","customers":4},{"date":"2015-01-13","customers":4},{"date":"2015-01-14","customers":4},{"date":"2015-01-15","customers":4},{"date":"2015-01-16","customers":4},{"date":"2015-01-17","customers":4},{"date":"2015-01-18","customers":5},{"date":"2015-01-19","customers":5},{"date":"2015-01-20","customers":5},{"date":"2015-01-21","customers":5},{"date":"2015-01-22","customers":4},{"date":"2015-01-23","customers":4},{"date":"2015-01-24","customers":4},{"date":"2015-01-25","customers":4},{"date":"2015-01-26","customers":0},{"date":"2015-01-27","customers":1},{"date":"2015-01-28","customers":1},{"date":"2015-01-29","customers":1},{"date":"2015-01-30","customers":1},{"date":"2015-01-31","customers":1},{"date":"2015-02-01","customers":1}],"summary":{"current":4,"previous":4,"percentage-change":0.0}}'
39
+ string: '{"entries":[{"date":"2022-04-30","customers":585,"percentage-change":0.0},{"date":"2022-05-31","customers":602,"percentage-change":2.91}],"summary":{"current":608,"previous":603,"percentage-change":0.83}}'
40
40
  http_version:
41
41
  recorded_at: Fri, 01 Jul 2016 14:47:50 GMT
42
42
  recorded_with: VCR 3.0.3
@@ -34,7 +34,7 @@ http_interactions:
34
34
  - 'true'
35
35
  body:
36
36
  encoding: UTF-8
37
- string: '{"entries":[{"date":"2015-01-31","ltv":0},{"date":"2015-02-01","ltv":15620.0}],"summary":{"current":54213,"previous":54213,"percentage-change":0.0}}'
37
+ string: '{"entries":[{"date":"2022-04-30","ltv":117173214,"percentage-change":0.0},{"date":"2022-05-31","ltv":65112456,"percentage-change":-44.43}],"summary":{"current":65112456,"previous":117173214,"percentage-change":-44.43}}'
38
38
  http_version:
39
39
  recorded_at: Fri, 01 Jul 2016 14:47:48 GMT
40
40
  recorded_with: VCR 3.0.3
@@ -36,7 +36,7 @@ http_interactions:
36
36
  - 'true'
37
37
  body:
38
38
  encoding: UTF-8
39
- string: '{"entries":[{"date":"2015-01-01","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-02","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-03","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-04","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-05","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-06","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-07","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-08","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-09","mrr":34112,"mrr-new-business":34112,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-10","mrr":34112,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-11","mrr":34112,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-12","mrr":64366,"mrr-new-business":30254,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-13","mrr":64366,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-14","mrr":55853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":-30254,"mrr-reactivation":21741},{"date":"2015-01-15","mrr":55853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-16","mrr":55853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-17","mrr":55853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-18","mrr":65853,"mrr-new-business":10000,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-19","mrr":65853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-20","mrr":65853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-21","mrr":65853,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-22","mrr":54982,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":-10871,"mrr-reactivation":0},{"date":"2015-01-23","mrr":53895,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":-1087,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-24","mrr":53895,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-25","mrr":53895,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-26","mrr":0,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":-64766,"mrr-reactivation":10871},{"date":"2015-01-27","mrr":10000,"mrr-new-business":10000,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-28","mrr":10000,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-29","mrr":6871,"mrr-new-business":4750,"mrr-expansion":12121,"mrr-contraction":0,"mrr-churn":-20000,"mrr-reactivation":0},{"date":"2015-01-30","mrr":15620,"mrr-new-business":0,"mrr-expansion":8749,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-01-31","mrr":15620,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0},{"date":"2015-02-01","mrr":15620,"mrr-new-business":0,"mrr-expansion":0,"mrr-contraction":0,"mrr-churn":0,"mrr-reactivation":0}],"summary":{"current":43371,"previous":43371,"percentage-change":0.0}}'
39
+ string: '{"entries":[{"date":"2022-04-30","mrr":383859969,"percentage-change":0.0,"mrr-new-business":2489791,"mrr-expansion":1502311,"mrr-contraction":-813307,"mrr-churn":-96723,"mrr-reactivation":54879},{"date":"2022-05-31","mrr":670280904,"percentage-change":74.62,"mrr-new-business":572899,"mrr-expansion":286342340,"mrr-contraction":-226820,"mrr-churn":-64750,"mrr-reactivation":5000}],"summary":{"current":670566870,"previous":670252256,"percentage-change":0.05}}'
40
40
  http_version:
41
41
  recorded_at: Fri, 01 Jul 2016 14:47:47 GMT
42
42
  recorded_with: VCR 3.0.3
@@ -34,7 +34,7 @@ http_interactions:
34
34
  - 'true'
35
35
  body:
36
36
  encoding: UTF-8
37
- string: '{"entries":[{"date":"2015-01-31","mrr-churn-rate":0.0},{"date":"2015-02-01","mrr-churn-rate":0.0}],"summary":{"current":0,"previous":0,"percentage-change":0.0}}'
37
+ string: '{"entries":[{"date":"2022-04-30","mrr-churn-rate":-0.17,"percentage-change":0.0},{"date":"2022-05-31","mrr-churn-rate":-74.52,"percentage-change":-43735.29}],"summary":{"current":-74.52,"previous":-0.17,"percentage-change":-43735.29}}'
38
38
  http_version:
39
39
  recorded_at: Fri, 01 Jul 2016 16:56:25 GMT
40
40
  recorded_with: VCR 3.0.3
@@ -0,0 +1,320 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.chartmogul.com/v1/data_sources
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"name":"Subscription Events Test ds_create"}'
9
+ headers:
10
+ User-Agent:
11
+ - chartmogul-ruby/3.0.0
12
+ Content-Type:
13
+ - application/json
14
+ Authorization:
15
+ - Basic hidden
16
+ response:
17
+ status:
18
+ code: 201
19
+ message: Created
20
+ headers:
21
+ access-control-allow-credentials:
22
+ - 'true'
23
+ content-type:
24
+ - application/json
25
+ date:
26
+ - Fri, 27 May 2022 21:54:10 GMT
27
+ status:
28
+ - 201 Created
29
+ content-length:
30
+ - '172'
31
+ connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: '{"uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","name":"Subscription
36
+ Events Test ds_create","system":"Import API","created_at":"2022-05-27T21:54:10.897Z","status":"idle"}'
37
+ http_version:
38
+ recorded_at: Fri, 27 May 2022 21:54:10 GMT
39
+ - request:
40
+ method: post
41
+ uri: https://api.chartmogul.com/v1/customers
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"external_id":"test_cus_ext_id","name":"Test Customer","data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3"}'
45
+ headers:
46
+ User-Agent:
47
+ - chartmogul-ruby/3.0.0
48
+ Content-Type:
49
+ - application/json
50
+ Authorization:
51
+ - Basic hidden
52
+ response:
53
+ status:
54
+ code: 201
55
+ message: Created
56
+ headers:
57
+ access-control-allow-credentials:
58
+ - 'true'
59
+ content-type:
60
+ - application/json
61
+ date:
62
+ - Fri, 27 May 2022 21:54:11 GMT
63
+ status:
64
+ - 201 Created
65
+ content-length:
66
+ - '772'
67
+ connection:
68
+ - keep-alive
69
+ body:
70
+ encoding: UTF-8
71
+ string: '{"id":131944224,"uuid":"cus_8a9bfcc2-de07-11ec-bf87-330a0f8a4736","external_id":"test_cus_ext_id","name":"Test
72
+ Customer","email":"","status":"Lead","customer-since":null,"attributes":{"custom":{},"clearbit":{},"stripe":{},"tags":[]},"data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","data_source_uuids":["ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3"],"external_ids":["test_cus_ext_id"],"company":"","country":null,"state":null,"city":"","zip":null,"lead_created_at":null,"free_trial_started_at":null,"address":{"country":null,"state":null,"city":"","address_zip":null},"mrr":0,"arr":0,"billing-system-url":null,"chartmogul-url":"https://app.chartmogul.com/#/customers/131944224-Test_Customer","billing-system-type":"Import
73
+ API","currency":"USD","currency-sign":"$"}'
74
+ http_version:
75
+ recorded_at: Fri, 27 May 2022 21:54:11 GMT
76
+ - request:
77
+ method: post
78
+ uri: https://api.chartmogul.com/v1/plans
79
+ body:
80
+ encoding: UTF-8
81
+ string: '{"name":"Test Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3"}'
82
+ headers:
83
+ User-Agent:
84
+ - chartmogul-ruby/3.0.0
85
+ Content-Type:
86
+ - application/json
87
+ Authorization:
88
+ - Basic hidden
89
+ response:
90
+ status:
91
+ code: 201
92
+ message: Created
93
+ headers:
94
+ access-control-allow-credentials:
95
+ - 'true'
96
+ cache-control:
97
+ - max-age=0, private, must-revalidate
98
+ content-type:
99
+ - application/json; charset=utf-8
100
+ date:
101
+ - Fri, 27 May 2022 21:54:12 GMT
102
+ etag:
103
+ - W/"3242b5ebeda79192d6f7f67c13b958d9"
104
+ referrer-policy:
105
+ - strict-origin-when-cross-origin
106
+ status:
107
+ - 201 Created
108
+ x-content-type-options:
109
+ - nosniff
110
+ x-download-options:
111
+ - noopen
112
+ x-frame-options:
113
+ - DENY
114
+ x-permitted-cross-domain-policies:
115
+ - none
116
+ x-request-id:
117
+ - 9d52d66d6610321598d3b723786c28ab
118
+ x-runtime:
119
+ - '0.052711'
120
+ x-xss-protection:
121
+ - 1; mode=block
122
+ content-length:
123
+ - '225'
124
+ connection:
125
+ - keep-alive
126
+ body:
127
+ encoding: UTF-8
128
+ string: '{"external_id":"77b16a30-c035-013a-fdad-62658d22be5b","name":"Test
129
+ Plan1","interval_count":7,"interval_unit":"day","data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","uuid":"pl_77b16a30-c035-013a-fdad-62658d22be5b"}'
130
+ http_version:
131
+ recorded_at: Fri, 27 May 2022 21:54:12 GMT
132
+ - request:
133
+ method: post
134
+ uri: https://api.chartmogul.com/v1/subscription_events
135
+ body:
136
+ encoding: UTF-8
137
+ string: '{"subscription_event":{"id":null,"data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":null,"created_at":null,"updated_at":null,"quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}}'
138
+ headers:
139
+ User-Agent:
140
+ - chartmogul-ruby/3.0.0
141
+ Content-Type:
142
+ - application/json
143
+ Authorization:
144
+ - Basic hidden
145
+ response:
146
+ status:
147
+ code: 201
148
+ message: Created
149
+ headers:
150
+ access-control-allow-credentials:
151
+ - 'true'
152
+ cache-control:
153
+ - max-age=0, private, must-revalidate
154
+ content-type:
155
+ - application/json; charset=utf-8
156
+ date:
157
+ - Fri, 27 May 2022 21:54:12 GMT
158
+ etag:
159
+ - W/"9394c4479530dec99d1ae768f24144ac"
160
+ referrer-policy:
161
+ - strict-origin-when-cross-origin
162
+ status:
163
+ - 201 Created
164
+ x-content-type-options:
165
+ - nosniff
166
+ x-download-options:
167
+ - noopen
168
+ x-frame-options:
169
+ - DENY
170
+ x-permitted-cross-domain-policies:
171
+ - none
172
+ x-request-id:
173
+ - cf699a67b6d807a4e5ae9e0b657ee067
174
+ x-runtime:
175
+ - '0.041647'
176
+ x-xss-protection:
177
+ - 1; mode=block
178
+ content-length:
179
+ - '560'
180
+ connection:
181
+ - keep-alive
182
+ body:
183
+ encoding: UTF-8
184
+ string: '{"id":138979488,"data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2022-05-27T21:54:12Z","updated_at":"2022-05-27T21:54:12Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}'
185
+ http_version:
186
+ recorded_at: Fri, 27 May 2022 21:54:12 GMT
187
+ - request:
188
+ method: get
189
+ uri: https://api.chartmogul.com/v1/subscription_events?data_source_uuid=ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3
190
+ body:
191
+ encoding: US-ASCII
192
+ string: ''
193
+ headers:
194
+ User-Agent:
195
+ - chartmogul-ruby/3.0.0
196
+ Content-Type:
197
+ - application/json
198
+ Authorization:
199
+ - Basic hidden
200
+ response:
201
+ status:
202
+ code: 200
203
+ message: OK
204
+ headers:
205
+ access-control-allow-credentials:
206
+ - 'true'
207
+ cache-control:
208
+ - max-age=0, private, must-revalidate
209
+ content-type:
210
+ - application/json; charset=utf-8
211
+ date:
212
+ - Fri, 27 May 2022 21:54:13 GMT
213
+ etag:
214
+ - W/"284a193c365cecb97517c5b3f7732e01"
215
+ referrer-policy:
216
+ - strict-origin-when-cross-origin
217
+ status:
218
+ - 200 OK
219
+ vary:
220
+ - Accept-Encoding, Accept-Encoding
221
+ x-content-type-options:
222
+ - nosniff
223
+ x-download-options:
224
+ - noopen
225
+ x-frame-options:
226
+ - DENY
227
+ x-permitted-cross-domain-policies:
228
+ - none
229
+ x-request-id:
230
+ - c1886a231273596512261eb400777323
231
+ x-runtime:
232
+ - '0.016469'
233
+ x-xss-protection:
234
+ - 1; mode=block
235
+ content-length:
236
+ - '370'
237
+ connection:
238
+ - keep-alive
239
+ body:
240
+ encoding: ASCII-8BIT
241
+ string: '{"subscription_events":[{"id":138979488,"data_source_uuid":"ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3","customer_external_id":"test_cus_ext_id","subscription_set_external_id":"","subscription_external_id":"test_cus_sub_ext_id1","plan_external_id":"","event_date":"2022-05-18T09:48:34Z","effective_date":"2021-12-30T00:01:00Z","event_type":"subscription_cancelled","external_id":"test_ev_id_create_1","errors":{},"created_at":"2022-05-27T21:54:12Z","updated_at":"2022-05-27T21:54:12Z","quantity":"","currency":"","amount_in_cents":"","tax_amount_in_cents":null,"retracted_event_id":null}],"meta":{"next_key":null,"prev_key":null,"before_key":"2022-05-27T21:54:13.079Z","page":1,"total_pages":1}}'
242
+ http_version:
243
+ recorded_at: Fri, 27 May 2022 21:54:13 GMT
244
+ - request:
245
+ method: delete
246
+ uri: https://api.chartmogul.com/v1/subscription_events?subscription_event%5Bid%5D=138979488
247
+ body:
248
+ encoding: US-ASCII
249
+ string: ''
250
+ headers:
251
+ User-Agent:
252
+ - chartmogul-ruby/3.0.0
253
+ Authorization:
254
+ - Basic hidden
255
+ response:
256
+ status:
257
+ code: 204
258
+ message: No Content
259
+ headers:
260
+ access-control-allow-credentials:
261
+ - 'true'
262
+ cache-control:
263
+ - no-cache
264
+ date:
265
+ - Fri, 27 May 2022 21:54:13 GMT
266
+ referrer-policy:
267
+ - strict-origin-when-cross-origin
268
+ status:
269
+ - 204 No Content
270
+ x-content-type-options:
271
+ - nosniff
272
+ x-download-options:
273
+ - noopen
274
+ x-frame-options:
275
+ - DENY
276
+ x-permitted-cross-domain-policies:
277
+ - none
278
+ x-request-id:
279
+ - d8fae1b2be5b11017e900b87748532fc
280
+ x-runtime:
281
+ - '0.037148'
282
+ x-xss-protection:
283
+ - 1; mode=block
284
+ connection:
285
+ - keep-alive
286
+ body:
287
+ encoding: UTF-8
288
+ string: ''
289
+ http_version:
290
+ recorded_at: Fri, 27 May 2022 21:54:13 GMT
291
+ - request:
292
+ method: delete
293
+ uri: https://api.chartmogul.com/v1/data_sources/ds_8a5c8aa6-de07-11ec-bf86-afa844e0d0e3
294
+ body:
295
+ encoding: US-ASCII
296
+ string: ''
297
+ headers:
298
+ User-Agent:
299
+ - chartmogul-ruby/3.0.0
300
+ Authorization:
301
+ - Basic hidden
302
+ response:
303
+ status:
304
+ code: 204
305
+ message: No Content
306
+ headers:
307
+ access-control-allow-credentials:
308
+ - 'true'
309
+ date:
310
+ - Fri, 27 May 2022 21:54:13 GMT
311
+ status:
312
+ - 204 No Content
313
+ connection:
314
+ - keep-alive
315
+ body:
316
+ encoding: UTF-8
317
+ string: ''
318
+ http_version:
319
+ recorded_at: Fri, 27 May 2022 21:54:13 GMT
320
+ recorded_with: VCR 5.1.0