Skip to content

Commit

Permalink
Burial 97131 ZSF Notification Callback (#20410)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayne-weibel authored Jan 23, 2025
1 parent edc06ed commit 271d768
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
17 changes: 17 additions & 0 deletions lib/burials/notification_callback.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require 'burials/monitor'
require 'veteran_facing_services/notification_callback/saved_claim'

module Burials
# @see ::VeteranFacingServices::NotificationCallback::SavedClaim
class NotificationCallback < ::VeteranFacingServices::NotificationCallback::SavedClaim
private

# the monitor to be used
# @see Burials::Monitor
def monitor
@monitor ||= Burials::Monitor.new
end
end
end
7 changes: 7 additions & 0 deletions lib/burials/notification_email.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'burials/notification_callback'
require 'veteran_facing_services/notification_email/saved_claim'

# Form 21P-530EZ
Expand All @@ -13,6 +14,7 @@ def initialize(saved_claim_id)

private

# @see VeteranFacingServices::NotificationEmail::SavedClaim#claim_class
def claim_class
SavedClaim::Burial
end
Expand Down Expand Up @@ -41,5 +43,10 @@ def personalization

default.merge(burials)
end

# @see VeteranFacingServices::NotificationEmail::SavedClaim#callback_class
def callback_klass
Burials::NotificationCallback.to_s
end
end
end
12 changes: 12 additions & 0 deletions spec/lib/burials/notification_callback_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

require 'burials/monitor'
require 'burials/notification_callback'

# relative to `spec` folder
require 'rails_helper'
require 'lib/veteran_facing_services/notification_callback/shared/saved_claim'

RSpec.describe Burials::NotificationCallback do
it_behaves_like 'a SavedClaim Notification Callback', Burials::NotificationCallback, Burials::Monitor
end
3 changes: 2 additions & 1 deletion spec/lib/burials/notification_email_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

# lib
require 'burials/notification_callback'
require 'burials/notification_email'

# spec
Expand All @@ -19,7 +20,7 @@
Settings.vanotify.services['21p_530ez'].email.confirmation.template_id,
anything,
Settings.vanotify.services['21p_530ez'].api_key,
{ callback_klass: VeteranFacingServices::NotificationCallback::SavedClaim.to_s,
{ callback_klass: Burials::NotificationCallback.to_s,
callback_metadata: anything }
]
expect(VANotify::EmailJob).to receive(:perform_async).with(*args)
Expand Down

0 comments on commit 271d768

Please sign in to comment.