Module: CommandTower::Messaging::Preferences

Defined in:
app/services/command_tower/messaging/preferences.rb,
app/services/command_tower/messaging/preferences/error.rb,
app/services/command_tower/messaging/preferences/store.rb,
app/services/command_tower/messaging/preferences/update.rb,
app/services/command_tower/messaging/preferences/catalog.rb,
app/services/command_tower/messaging/preferences/resolve.rb,
app/services/command_tower/messaging/preferences/evaluator.rb,
app/services/command_tower/messaging/preferences/store_error.rb,
app/services/command_tower/messaging/preferences/catalog_result.rb,
app/services/command_tower/messaging/preferences/reason_classes.rb,
app/services/command_tower/messaging/preferences/preference_state.rb,
app/services/command_tower/messaging/preferences/evaluation_result.rb,
app/services/command_tower/messaging/preferences/unknown_type_error.rb,
app/services/command_tower/messaging/preferences/suppressed_destination.rb,
app/services/command_tower/messaging/preferences/catalog_category_result.rb,
app/services/command_tower/messaging/preferences/not_settings_visible_error.rb,
app/services/command_tower/messaging/preferences/catalog_notification_result.rb,
app/services/command_tower/messaging/preferences/invalid_preference_state_error.rb,
app/services/command_tower/messaging/preferences/invalid_preference_write_error.rb

Defined Under Namespace

Modules: ReasonClasses Classes: Catalog, CatalogCategoryResult, CatalogNotificationResult, CatalogResult, Error, EvaluationResult, Evaluator, InvalidPreferenceStateError, InvalidPreferenceWriteError, NotSettingsVisibleError, PreferenceState, Resolve, Store, StoreError, SuppressedDestination, UnknownTypeError, Update

Class Method Summary collapse

Class Method Details

.catalog(recipient_id:, platform_enabled_channels: []) ⇒ Object



34
35
36
37
38
39
# File 'app/services/command_tower/messaging/preferences.rb', line 34

def catalog(recipient_id:, platform_enabled_channels: [])
  Catalog.call(
    recipient_id:,
    platform_enabled_channels:,
  )
end

.delete_stored!(recipient_id:, notification_type_key:) ⇒ Object



49
50
51
# File 'app/services/command_tower/messaging/preferences.rb', line 49

def delete_stored!(recipient_id:, notification_type_key:)
  Store.delete!(recipient_id:, notification_type_key:)
end

.evaluate(notification_type_key:, recipient_id:, preference_state: nil, platform_enabled_channels: []) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/command_tower/messaging/preferences.rb', line 8

def evaluate(
  notification_type_key:,
  recipient_id:,
  preference_state: nil,
  platform_enabled_channels: []
)
  Evaluator.call(
    notification_type_key:,
    recipient_id:,
    preference_state:,
    platform_enabled_channels:,
  )
end

.find_stored(recipient_id:, notification_type_key:) ⇒ Object



41
42
43
# File 'app/services/command_tower/messaging/preferences.rb', line 41

def find_stored(recipient_id:, notification_type_key:)
  Store.find(recipient_id:, notification_type_key:)
end

.resolve(notification_type_key:, recipient_id:, platform_enabled_channels: []) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'app/services/command_tower/messaging/preferences.rb', line 22

def resolve(
  notification_type_key:,
  recipient_id:,
  platform_enabled_channels: []
)
  Resolve.call(
    notification_type_key:,
    recipient_id:,
    platform_enabled_channels:,
  )
end

.update(recipient_id:, notification_type_key:, preference_state:, platform_enabled_channels: []) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'app/services/command_tower/messaging/preferences.rb', line 53

def update(
  recipient_id:,
  notification_type_key:,
  preference_state:,
  platform_enabled_channels: []
)
  Update.call(
    recipient_id:,
    notification_type_key:,
    preference_state:,
    platform_enabled_channels:,
  )
end

.upsert_stored!(recipient_id:, notification_type_key:, preference_state:) ⇒ Object



45
46
47
# File 'app/services/command_tower/messaging/preferences.rb', line 45

def upsert_stored!(recipient_id:, notification_type_key:, preference_state:)
  Store.upsert!(recipient_id:, notification_type_key:, preference_state:)
end