8fad9c1bb6
Add a 'notification channels' card at the top of admin Settings with three master on/off checkboxes: web/in-app (new WebNotificationsEnabled, default true), SMS (existing SmsEnabled), and Web Push (existing PushEnabled). Removed the duplicate enable checkboxes from the SMS and Push sections so each binds once. NotificationService now gates the in-app + live SSE channel on WebNotificationsEnabled; push self-gates on PushEnabled. Migration defaults the new column to true so existing installs keep web notifications on. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
971 B
C#
32 lines
971 B
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace JobsMedical.Web.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class WebNotificationsToggle : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
// Default TRUE so existing installs keep the in-app/web channel ON after upgrade
|
|
// (matches AppSetting.WebNotificationsEnabled = true).
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "WebNotificationsEnabled",
|
|
table: "AppSettings",
|
|
type: "boolean",
|
|
nullable: false,
|
|
defaultValue: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "WebNotificationsEnabled",
|
|
table: "AppSettings");
|
|
}
|
|
}
|
|
}
|