services/notifications/dnd

DND (Do Not Disturb) — runtime-managed quiet hours. DND rules are stored in SQLite and managed via admin commands. The is_quiet_now function is called by notification tools before sending.

Types

pub type DndRule {
  DndRule(
    id: Int,
    rule_type: String,
    start_time: String,
    end_time: String,
    enabled: Bool,
    created_at: String,
  )
}

Constructors

  • DndRule(
      id: Int,
      rule_type: String,
      start_time: String,
      end_time: String,
      enabled: Bool,
      created_at: String,
    )

Values

pub fn add_rule(
  conn: sqlight.Connection,
  rule_type: String,
  start_time: String,
  end_time: String,
) -> Result(String, String)
pub fn is_quiet_now(
  conn: sqlight.Connection,
  timezone: String,
) -> Bool
pub fn list_active(
  conn: sqlight.Connection,
) -> Result(List(DndRule), String)
pub fn list_all(
  conn: sqlight.Connection,
) -> Result(List(DndRule), String)
pub fn remove_all(
  conn: sqlight.Connection,
) -> Result(Int, String)
pub fn remove_rule(
  conn: sqlight.Connection,
  id: Int,
) -> Result(Nil, String)
pub fn toggle_indefinite(
  conn: sqlight.Connection,
) -> Result(String, String)
Search Document