Fix backend↔database mismatches found verifying against Fuchs_Database

Verified every [dbo].[...] object the backend calls against the SSDT project.
Two real mismatches fixed (both would fail at runtime):

- Banking search (bam/btl mode=s) called a non-existent
  [dbo].[fds__getBankingtransactions_list2] and dropped @tgtdate. The actual
  proc (and the legacy call) is [dbo].[fds__getBankingtransfers_list2]
  (@tgtdate,@mode,@search,@authuser) — corrected name + parameters.
- Widget generic branch called a phantom [dbo].[fds__getWidget] that never
  existed (legacy only had my/one; the dashboard only requests wdg/my, wdg/one).
  The default branch now returns 404 instead of hitting a missing proc.

(The 'fuchs__admin_logdebug' reference is only in a commented-out line.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 15:03:51 +02:00
parent 10ecdfa2e4
commit a00ec1da3b
2 changed files with 12 additions and 14 deletions
+7 -11
View File
@@ -97,19 +97,15 @@ public class FuchsWidgetService : IWidgetService
return await BuildWidgetResponse(userAccountId, dbSec, shortName, wdg);
}
// ── Generic widget by id ──────────────────────────────────────────────────
private async Task<IActionResult> HandleWidgetGeneric(string widgetId, string userAccountId,
// ── Unknown widget id ──────────────────────────────────────────────────────
// The dashboard only requests "my" and "one"; there is no generic widget
// source in the schema (the legacy code had no such procedure either).
private Task<IActionResult> HandleWidgetGeneric(string widgetId, string userAccountId,
DatabaseSecurity dbSec)
{
var pl = Params(userAccountId, SQL_VarChar("@widget", widgetId, dbNull_IfEmpty: true));
var dset = await getSQLDataSet_async(
"EXECUTE [dbo].[fds__getWidget] @widget, @authuser;",
Conn, pl, tablenames: new[] { "admin", "data" }, Security: dbSec);
return await JSONAsync(new
{
admin = dset.Table("admin").FirstRow.toObjectDictionary(),
data = dset.Tables("data").toArrayofObjectDictionaries()
});
_ = dbSec;
_logger.LogWarning("GetWidgetAsync: unknown widget id '{WidgetId}' requested by user={User}", widgetId, userAccountId);
return Task.FromResult<IActionResult>(new NotFoundResult());
}
// ── Widget renderer dispatcher ────────────────────────────────────────────