path-reporting 0.1.2 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d37d78cfbdf517535d51c48f43a69899a7d5c00b57dc76e6d450551ddc157ed3
4
- data.tar.gz: 12f2ca0f0c8de09d5a0467793461ea2bd8a678c8086a63062f5e13b256958dca
3
+ metadata.gz: 9cf8b0c5159e89a7fde5da0bf0c2d4912f05f03d62fa5c66e2f5f48143916f36
4
+ data.tar.gz: ee8d74820b4f6c194813448700c0eb66c4d72b3b84d8431955c7a297c4db01f0
5
5
  SHA512:
6
- metadata.gz: b4159af503e477b87299ac911e8e7d935cd2dff29b30af85a3a2d9e0492b52abae5ebf54adfb247a6b31a27225b1c6e095178f43785857e5b58a298cf4b21792
7
- data.tar.gz: c8af462a40b0240a3b54da2793345ba25446a50a7699ef2ac39482992021618d570f1e7c73dcc677d1a796971382f1f66d6da8023c23d147f1948331492dae43
6
+ metadata.gz: '0528361202c2f3750e68181a3203a63c43c7c731710f9bd03814da1416bd46861650337df5f56351b774e0226a4eebb83e9de13119303c6b76822e5f374747c6'
7
+ data.tar.gz: ecee15c13b20cbfbabdc9040212bd392ef28ceb8c24dd0cac7e4e7394c16f85f39e5a602543a30fe5b005ef90757c444bbe33480d5fdea3903d5b6260489a835
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.0.3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- path-reporting (0.1.2)
4
+ path-reporting (0.1.5)
5
5
  amplitude-api
6
6
 
7
7
  GEM
@@ -61,6 +61,7 @@ GEM
61
61
 
62
62
  PLATFORMS
63
63
  arm64-darwin-21
64
+ x86_64-linux
64
65
 
65
66
  DEPENDENCIES
66
67
  amplitude-api (~> 0.4.1)
data/README.md CHANGED
@@ -37,13 +37,13 @@ After initialing the module, record an analytics event with the following code.
37
37
 
38
38
  ```ruby
39
39
 
40
- PathReporting.analytics.record(
40
+ Path::Reporting.analytics.record(
41
41
  product_code: Constants::ANALYTICS_PRODUCT_CODE,
42
42
  product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
43
43
  name: 'Preferred provider multiple valid matches',
44
44
  user: @contact.analytics_friendly_hash,
45
- user_type: PathReporting::UserType.PATIENT,
46
- trigger: PathReporting::Trigger.PAGE_VIEW,
45
+ user_type: Path::Reporting::UserType::PATIENT,
46
+ trigger: Path::Reporting::Trigger::PAGE_VIEW,
47
47
  metadata: analytics_metadata,
48
48
  )
49
49
  ```
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "reporters/amplitude"
4
- require_relative "reporters/console"
5
- require_relative "../types/trigger"
6
- require_relative "../types/user_type"
3
+ require_relative "analytics/amplitude"
4
+ require_relative "analytics/console"
5
+ require_relative "types/trigger"
6
+ require_relative "types/user_type"
7
7
 
8
8
  module Path
9
9
  module Reporting
@@ -122,7 +122,7 @@ module Path
122
122
  # product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
123
123
  # name: 'Preferred provider multiple valid matches',
124
124
  # user: @contact.analytics_friendly_hash,
125
- # user_type: PathReporting::UserType.PATIENT,
125
+ # user_type: PathReporting::UserType::PATIENT,
126
126
  # trigger: PathReporting::Trigger.PAGE_VIEW,
127
127
  # metadata: analytics_metadata,
128
128
  # )
@@ -132,7 +132,7 @@ module Path
132
132
  # product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
133
133
  # name: 'No preferred provider',
134
134
  # user: @contact.analytics_friendly_hash,
135
- # user_type: PathReporting::UserType.PATIENT,
135
+ # user_type: PathReporting::UserType::PATIENT,
136
136
  # trigger: PathReporting::Trigger.PAGE_VIEW,
137
137
  # )
138
138
  #
@@ -158,8 +158,8 @@ module Path
158
158
  product_area:,
159
159
  name:,
160
160
  user:,
161
- user_type: UserType.PATIENT,
162
- trigger: Trigger.INTERACTION,
161
+ user_type: UserType::PATIENT,
162
+ trigger: Trigger::INTERACTION,
163
163
  metadata: {}
164
164
  )
165
165
  throw Error("No user provided when reporting analytics") if !user || !user[:id]
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Path
4
+ module Reporting
5
+ # The trigger or cause of reporting events
6
+ class Trigger
7
+ # Interaction: When a direct intentional user action is the cause of
8
+ # this event that is not a simple navigation. E.g. Submitted form or
9
+ # changed password
10
+ INTERACTION = "Interaction"
11
+ # Page view: When the event was an indirect result of viewing something.
12
+ # E.g. auto-assigning a provider or appointment because the user has an
13
+ # existing provider already
14
+ # @note Because of usage limits, we do not want to record page views
15
+ # as a separate action, this is only for indirect consequences that
16
+ # result in a change in something either for the user or for our
17
+ # systems
18
+ PAGE_VIEW = "Page view"
19
+ # Automation: Some automation or tool was the cause of this event
20
+ AUTOMATION = "Automation"
21
+
22
+ class << self
23
+ # @private
24
+ def triggers
25
+ [
26
+ INTERACTION,
27
+ PAGE_VIEW,
28
+ AUTOMATION
29
+ ]
30
+ end
31
+
32
+ # Check if a given item is a valid Trigger
33
+ # @param maybe_trigger [Any] item to check
34
+ def valid?(maybe_trigger)
35
+ triggers.include? maybe_trigger
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -4,20 +4,20 @@ module Path
4
4
  module Reporting
5
5
  # User types that data may be recorded for or on
6
6
  class UserType
7
- class << self
8
- # Patient or potential patient
9
- PATIENT = "Patient"
10
- # Provider, which can be any sub-type (e.g. therapist)
11
- PROVIDER = "Provider"
12
- # Insurer, not currently in-use
13
- INSURER = "Insurer"
14
- # Operator or any internal non-developer
15
- OPERATOR = "Operator"
16
- # Developer; mostly relevant for backfills or manual intervention
17
- DEVELOPER = "Developer"
18
- # System, either first-party or third-party
19
- SYSTEM = "System"
7
+ # Patient or potential patient
8
+ PATIENT = "Patient"
9
+ # Provider, which can be any sub-type (e.g. therapist)
10
+ PROVIDER = "Provider"
11
+ # Insurer, not currently in-use
12
+ INSURER = "Insurer"
13
+ # Operator or any internal non-developer
14
+ OPERATOR = "Operator"
15
+ # Developer; mostly relevant for backfills or manual intervention
16
+ DEVELOPER = "Developer"
17
+ # System, either first-party or third-party
18
+ SYSTEM = "System"
20
19
 
20
+ class << self
21
21
  # @private
22
22
  def types
23
23
  [
@@ -33,7 +33,7 @@ module Path
33
33
  # Check if a given item is a valid UserType
34
34
  # @param maybe_type [Any] item to check
35
35
  def valid?(maybe_type)
36
- types.includes? maybe_type
36
+ types.include? maybe_type
37
37
  end
38
38
  end
39
39
  end
@@ -3,6 +3,6 @@
3
3
  module Path
4
4
  module Reporting
5
5
  # Current version of the module
6
- VERSION = "0.1.2"
6
+ VERSION = "0.1.5"
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "analytics/analytics"
4
- require_relative "configuration"
3
+ require_relative "reporting/analytics"
4
+ require_relative "reporting/configuration"
5
5
  require_relative "reporting/version"
6
6
 
7
7
  # Path is just a wrapper module so we can group any path specific gems under
@@ -52,7 +52,7 @@ module Path
52
52
  def analytics
53
53
  raise Error, "Must call init on Path::Reporting library before using" unless @initialized
54
54
 
55
- @analyitcs
55
+ @analytics
56
56
  end
57
57
 
58
58
  # Resets the module to an uninitialized state. Mostly used for testing
@@ -60,7 +60,7 @@ module Path
60
60
  def reset!
61
61
  @initialized = false
62
62
  @config = nil
63
- @analyitcs = nil
63
+ @analytics = nil
64
64
  self
65
65
  end
66
66
  end
data/lib/path.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ # defines the Path namespace
4
+ module Path
5
+ end
data/reporting.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/reporting/version"
3
+ require_relative "lib/path/reporting/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "path-reporting"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: path-reporting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Hushbeck
@@ -47,21 +47,23 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".rspec"
49
49
  - ".rubocop.yml"
50
+ - ".tool-versions"
50
51
  - ".yardopts"
51
52
  - Gemfile
52
53
  - Gemfile.lock
53
54
  - LICENSE.md
54
55
  - README.md
55
56
  - Rakefile
56
- - lib/analytics/analytics.rb
57
- - lib/analytics/configuration.rb
58
- - lib/analytics/reporters/amplitude.rb
59
- - lib/analytics/reporters/console.rb
60
- - lib/configuration.rb
61
- - lib/reporting.rb
62
- - lib/reporting/version.rb
63
- - lib/types/trigger.rb
64
- - lib/types/user_type.rb
57
+ - lib/path.rb
58
+ - lib/path/reporting.rb
59
+ - lib/path/reporting/analytics.rb
60
+ - lib/path/reporting/analytics/amplitude.rb
61
+ - lib/path/reporting/analytics/configuration.rb
62
+ - lib/path/reporting/analytics/console.rb
63
+ - lib/path/reporting/configuration.rb
64
+ - lib/path/reporting/types/trigger.rb
65
+ - lib/path/reporting/types/user_type.rb
66
+ - lib/path/reporting/version.rb
65
67
  - reporting.gemspec
66
68
  - sig/reporting.rbs
67
69
  homepage: https://github.com/pathccm/reporting
data/lib/types/trigger.rb DELETED
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Path
4
- module Reporting
5
- # The trigger or cause of reporting events
6
- class Trigger
7
- class << self
8
- # Interaction: When a direct intentional user action is the cause of
9
- # this event
10
- INTERACTION = "Interaction"
11
- # Page view: When the event was an indirect result of viewing something.
12
- # @note Because of usage limits, we do not want to record page views
13
- # as a separate action, this is only for indirect consequences
14
- PAGE_VIEW = "Page view"
15
- # Automation: Some automation or tool was the cause of this event
16
- AUTOMATION = "Automation"
17
-
18
- # @private
19
- def triggers
20
- [
21
- INTERACTION,
22
- PAGE_VIEW,
23
- AUTOMATION
24
- ]
25
- end
26
-
27
- # Check if a given item is a valid Trigger
28
- # @param maybe_trigger [Any] item to check
29
- def valid?(maybe_trigger)
30
- triggers.includes? maybe_trigger
31
- end
32
- end
33
- end
34
- end
35
- end