03 · Events and real time
A deal moves on every open board.
After every change to a deal commits, the API broadcasts it as deal.updated on private-crm.deals, and every open board moves the card. Winning or reassigning a deal also emits DealWon or DealAssigned: a queued listener notifies the owner, stored for the bell, pushed to their browser and mailed.
impl DealsModule {
/// The owner notifications (a queued listener of both events) and
/// their mail template.
fn wire(&self, m: &mut ModuleBuilder) {
m.listen::<DealAssigned, NotifyDealOwner>()
.on::<DealWon, NotifyDealOwner>()
.templates(notification::TEMPLATES);
}
}














