diff --git a/Applications/Pgan.PoracleWebNet.Api/Configuration/ServiceCollectionExtensions.cs b/Applications/Pgan.PoracleWebNet.Api/Configuration/ServiceCollectionExtensions.cs index 551a4d27..629aa75b 100644 --- a/Applications/Pgan.PoracleWebNet.Api/Configuration/ServiceCollectionExtensions.cs +++ b/Applications/Pgan.PoracleWebNet.Api/Configuration/ServiceCollectionExtensions.cs @@ -101,7 +101,7 @@ public static IServiceCollection AddPoracleServices(this IServiceCollection serv var scannerConnectionString = configuration.GetConnectionString("ScannerDb"); if (!string.IsNullOrEmpty(scannerConnectionString)) { - services.AddDbContext(options => + services.AddDbContext(options => options.UseMySQL(scannerConnectionString)); services.AddScoped(); } diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a687a3..df7654c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **Removed stale AutoMapper references from the docs site** ([#241](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/241)): AutoMapper was dropped in v2.6.0 ([#173](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/173)) in favour of manual mapping extensions, but four docs pages still described it as the live mapping layer — `architecture/backend.md` even carried a `.ForAllMembers(opts => opts.Condition(...))` snippet that exists nowhere in the codebase. The mapping sections in `architecture/overview.md` and `architecture/backend.md` now describe `AlarmMappingExtensions` (`To*()` / `ApplyUpdate()`) and `EntityMappingExtensions` (`ToModel()` / `ToEntity()` / `ApplyTo()`), with a real `ApplyUpdate` snippet showing the explicit null-skip guards; the `Core.Mappings/` line in the solution tree, the test-coverage bullet in `development/testing.md`, and a passing mention in `architecture/poracleng-proxy.md` are corrected to match. The last piece of AutoMapper residue outside the docs goes with it: the mapping test file was still named `PoracleMappingProfileTests.cs` while the class inside it had been renamed to `MappingExtensionTests`, so the file is renamed to match. No behaviour change. +- **Renamed `ScannerDbContext` to `ScannerContext`** ([#240](https://github.com/PGAN-Dev/PoracleWeb.NET/issues/240)): the scanner DB context was the only one of the three `DbContext` subclasses carrying a `Db` in its name, out of step with its siblings `PoracleContext` and `PoracleWebContext`. Renamed the class, its file, the `DbContextOptions<>` type argument, the `ScannerService` constructor parameter and field, and the `AddDbContext<>` registration, plus the two doc mentions. Purely cosmetic — no functional change: `IScannerService` is untouched, the optional `ConnectionStrings:ScannerDb` key is unchanged, no EF migrations are involved (the scanner DB is read-only and never migrated by PoracleWeb), and there is no wire-contract or config impact for self-hosters. - **Localized the external SSO / OIDC strings** across all bundled locales. The SSO login feature added 30 i18n keys to English only, so every non-English locale fell back to English for the "Sign in with {provider}" button, the signed-out panel, the OIDC error messages, and the admin Authentication / External SSO settings group. These are now translated into Danish, German, Spanish, French, Italian, Dutch, Polish, Portuguese (PT & BR), and Swedish. Translation-only — no code or behavior change. - **Admin Server Settings page UX overhaul.** Adds a live **search/filter** (sticky bar, match highlighting, `/` or Ctrl/Cmd+K to focus), a **sticky save + discard bar** so saving is always reachable on the long page, **sign-in providers grouped under Authentication** (Telegram/Discord moved up), and **collapsible sections** (persisted) with per-section "unsaved" chips and state summaries (e.g. "7 of 9 enabled"). Headline fix: the alarm-type/feature toggles were a confusing **double negative** ("Disable X", ON = feature off) mixed with positive `enable_*` toggles; they are now **uniformly positive** (ON = enabled, labels are the feature name, descriptions are "Let users …"). The stored `disable_*` keys are **unchanged** — a presentation-only inversion — so backend feature-gating is unaffected. New UX i18n keys and the reframed positive labels/descriptions are translated across all 11 locales. diff --git a/CLAUDE.md b/CLAUDE.md index 20bb5806..2ea86cf7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,7 +45,7 @@ Pgan.PoracleWebNet.slnx | | WebhookDelegateEntity, QuickPickDefinitionEntity, | | QuickPickAppliedStateEntity), | | Configurations/ (EF Core entity type configurations) -| +-- Data.Scanner/ ScannerDbContext for optional scanner DB +| +-- Data.Scanner/ ScannerContext for optional scanner DB | +-- Applications/ | +-- Web.Api/ ASP.NET Core host diff --git a/Core/Pgan.PoracleWebNet.Core.Services/ScannerService.cs b/Core/Pgan.PoracleWebNet.Core.Services/ScannerService.cs index d27905ee..4b085788 100644 --- a/Core/Pgan.PoracleWebNet.Core.Services/ScannerService.cs +++ b/Core/Pgan.PoracleWebNet.Core.Services/ScannerService.cs @@ -6,9 +6,9 @@ namespace Pgan.PoracleWebNet.Core.Services; -public partial class ScannerService(ScannerDbContext context, ILogger logger) : IScannerService +public partial class ScannerService(ScannerContext context, ILogger logger) : IScannerService { - private readonly ScannerDbContext _context = context; + private readonly ScannerContext _context = context; private readonly ILogger _logger = logger; private const int MaxResultRows = 5000; diff --git a/Data/Pgan.PoracleWebNet.Data.Scanner/ScannerDbContext.cs b/Data/Pgan.PoracleWebNet.Data.Scanner/ScannerContext.cs similarity index 83% rename from Data/Pgan.PoracleWebNet.Data.Scanner/ScannerDbContext.cs rename to Data/Pgan.PoracleWebNet.Data.Scanner/ScannerContext.cs index fa1f4da5..20085814 100644 --- a/Data/Pgan.PoracleWebNet.Data.Scanner/ScannerDbContext.cs +++ b/Data/Pgan.PoracleWebNet.Data.Scanner/ScannerContext.cs @@ -3,7 +3,7 @@ namespace Pgan.PoracleWebNet.Data.Scanner; -public class ScannerDbContext(DbContextOptions options) : DbContext(options) +public class ScannerContext(DbContextOptions options) : DbContext(options) { public DbSet Pokestops => this.Set(); public DbSet Gyms => this.Set(); diff --git a/docs/architecture/database.md b/docs/architecture/database.md index bc65c87b..34826d18 100644 --- a/docs/architecture/database.md +++ b/docs/architecture/database.md @@ -58,7 +58,7 @@ A separate EF Core context for **application-owned data**. !!! info "MariaDB compatibility" `MySql.EntityFrameworkCore`'s `MigrateAsync()` uses `GET_LOCK(-1)` which returns NULL on MariaDB. The `MariaDbHistoryRepository` class overrides the lock to use `GET_LOCK(3600)` instead. This is registered via `ReplaceService()` on `PoracleWebContext`. -### ScannerDbContext (optional) +### ScannerContext (optional) Connects to a Golbat scanner database for nest, Pokemon, and gym data.