300, // 5 minutes self::HIGH => 900, // 15 minutes self::MEDIUM => 3600, // 1 hour self::LOW => 86400, // 24 hours }; } /** * Gets notification channels for this urgency */ public function getNotificationChannels(): array { return match ($this) { self::URGENT => ['sms', 'call', 'slack', 'email'], self::HIGH => ['slack', 'email', 'push'], self::MEDIUM => ['email', 'slack'], self::LOW => ['email'], }; } /** * Gets retry strategy for failed notifications */ public function getRetryStrategy(): array { return match ($this) { self::URGENT => [ 'attempts' => 5, 'delays' => [30, 60, 120, 300, 600], // seconds ], self::HIGH => [ 'attempts' => 3, 'delays' => [60, 300, 900], ], self::MEDIUM => [ 'attempts' => 2, 'delays' => [300, 1800], ], self::LOW => [ 'attempts' => 1, 'delays' => [3600], ], }; } /** * Checks if this urgency requires immediate processing */ public function requiresImmediateProcessing(): bool { return in_array($this, [self::URGENT, self::HIGH]); } /** * Gets maximum delay before alert must be sent */ public function getMaxDelay(): int { return match ($this) { self::URGENT => 60, // 1 minute self::HIGH => 300, // 5 minutes self::MEDIUM => 1800, // 30 minutes self::LOW => 86400, // 24 hours }; } }