Add methods to handle user notification preferences and update booking notification logic

- Introduced `wantsSmsNotifications`, `wantsEmailNotifications`, and `getWashCertificateEmail` methods in `users_o`.
- Updated `order_bookings_o` to incorporate user notification preferences for sending SMS and email confirmations.
This commit is contained in:
Jeppe Bundgaard
2025-11-11 14:48:32 +01:00
parent eca3b79f26
commit 8b2aa76070
2 changed files with 33 additions and 3 deletions
+28
View File
@@ -176,6 +176,34 @@ class users_o extends db
return false;
}
/**
* @throws Exception
*/
public function wantsSmsNotifications(): bool
{
self::requireSelected();
return (bool)$this->sms_notifications_enabled->value();
}
/**
* @throws Exception
*/
public function wantsEmailNotifications(): bool
{
self::requireSelected();
return (bool)$this->email_notifications_enabled->value();
}
/**
* @throws Exception
*/
public function getWashCertificateEmail(): string|null
{
self::requireSelected();
return $this->wash_certificate_email->value();
}
public function add(string $customer_number, mixed $password, int $role = 0): void
{
global $db;