| 1 |
|
defmodule WalletNotifications.Adapters.StubAdapter do |
| 2 |
|
@moduledoc """ |
| 3 |
|
Stub channel adapter for Phase 5 CI operation. |
| 4 |
|
|
| 5 |
|
In Phase 6, replace each channel with a real adapter: |
| 6 |
|
- email: SES/SendGrid adapter |
| 7 |
|
- sms: Twilio/Clickatell adapter |
| 8 |
|
- push: FCM/APNs adapter |
| 9 |
|
- in_app: internal PubSub push |
| 10 |
|
|
| 11 |
|
Returns `:ok` for all deliveries in stub mode. |
| 12 |
|
Configurable via Application env to simulate failures in tests: |
| 13 |
|
|
| 14 |
|
Application.put_env(:wallet_notifications, :stub_adapter_result, {:error, :timeout}) |
| 15 |
|
""" |
| 16 |
|
|
| 17 |
|
@doc "Stub deliver/1 — always succeeds unless overridden by test env." |
| 18 |
|
@spec deliver(notification :: map()) :: :ok | {:error, term()} |
| 19 |
|
def deliver(_notification) do |
| 20 |
16 |
Application.get_env(:wallet_notifications, :stub_adapter_result, :ok) |
| 21 |
|
end |
| 22 |
|
end |