Skip to main content

ferro_notifications/channels/
future.rs

1//! Placeholder message types for channels not yet implemented.
2//!
3//! These types exist so the [`crate::Notification`] trait can declare
4//! `to_sms()` and `to_push()` with stable signatures across phases.
5//! No adapter consumes these types in the current phase — the dispatcher
6//! emits a structured "channel not configured" no-op for both.
7
8use serde::{Deserialize, Serialize};
9
10/// Placeholder SMS message. Shape will be finalized when an SMS adapter ships.
11#[derive(Debug, Clone, Default, Serialize, Deserialize)]
12pub struct SmsMessage {
13    /// Message body text.
14    pub body: String,
15}
16
17/// Placeholder push notification. Shape will be finalized when an APNs/FCM adapter ships.
18#[derive(Debug, Clone, Default, Serialize, Deserialize)]
19pub struct PushMessage {
20    /// Notification title.
21    pub title: String,
22    /// Notification body.
23    pub body: String,
24}
25
26#[cfg(test)]
27mod tests {
28    use super::*;
29
30    #[test]
31    fn test_sms_message_default() {
32        let m = SmsMessage::default();
33        assert_eq!(m.body, "");
34    }
35
36    #[test]
37    fn test_push_message_default() {
38        let m = PushMessage::default();
39        assert_eq!(m.title, "");
40        assert_eq!(m.body, "");
41    }
42}