[Demo] Add admin demo-mode toggle + generic website ingest source
CI/CD / CI · dotnet build (push) Failing after 1m40s
CI/CD / Deploy · hamkadr (push) Has been skipped

- AppSetting: DemoMode, WebsitesEnabled, WebsiteUrls
- Facility.IsDemo flag; SeedData split into SeedReferenceAsync (always)
  + SeedDemoAsync/ClearDemoAsync (idempotent, toggleable at runtime)
- WebsiteListingSource: scrape any admin-configured URL (og:title + content)
- Admin Settings: seed/clear demo card, demo-mode checkbox, website source
  fields; Program.cs seeds demo when DemoMode on (or in Development)
- EF migration DemoModeAndWebsites

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-04 13:43:07 +03:30
parent eae38373b9
commit 0c0449c2b9
11 changed files with 1341 additions and 149 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,62 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace JobsMedical.Web.Migrations
{
/// <inheritdoc />
public partial class DemoModeAndWebsites : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsDemo",
table: "Facilities",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "DemoMode",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "WebsiteUrls",
table: "AppSettings",
type: "character varying(4000)",
maxLength: 4000,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "WebsitesEnabled",
table: "AppSettings",
type: "boolean",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsDemo",
table: "Facilities");
migrationBuilder.DropColumn(
name: "DemoMode",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "WebsiteUrls",
table: "AppSettings");
migrationBuilder.DropColumn(
name: "WebsitesEnabled",
table: "AppSettings");
}
}
}
@@ -66,6 +66,9 @@ namespace JobsMedical.Web.Migrations
b.Property<bool>("BaleEnabled")
.HasColumnType("boolean");
b.Property<bool>("DemoMode")
.HasColumnType("boolean");
b.Property<string>("DivarCity")
.HasMaxLength(60)
.HasColumnType("character varying(60)");
@@ -133,6 +136,13 @@ namespace JobsMedical.Web.Migrations
.HasMaxLength(120)
.HasColumnType("character varying(120)");
b.Property<string>("WebsiteUrls")
.HasMaxLength(4000)
.HasColumnType("character varying(4000)");
b.Property<bool>("WebsitesEnabled")
.HasColumnType("boolean");
b.HasKey("Id");
b.ToTable("AppSettings");
@@ -297,6 +307,9 @@ namespace JobsMedical.Web.Migrations
b.Property<int?>("DistrictId")
.HasColumnType("integer");
b.Property<bool>("IsDemo")
.HasColumnType("boolean");
b.Property<bool>("IsVerified")
.HasColumnType("boolean");