Add Fuchs_Database SSDT project (schema source of truth)

Adds the SQL Server Data Tools project for the fuchs_fds database — tables,
table types, functions and stored procedures that the backend calls (e.g.
fds__getInvoice, fds__merge_bankingtransactions, fds__tt__bankingtransactions,
fds__admin_getReportCatalog, fis_* auth). Build/model caches (bin, obj,
*.dbmdl, *.jfm, *.user) are git-ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 14:50:54 +02:00
parent 1376779224
commit 10ecdfa2e4
359 changed files with 22603 additions and 0 deletions
@@ -0,0 +1,49 @@
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE FUNCTION [dbo].[fis_getONEPersonWidgets]
(
@useraccount_id varchar(10)
)
RETURNS @RET TABLE
(
[short_name] [varchar](50) NOT NULL,
[account] [varchar](50) NOT NULL,
[type] [nvarchar](50) NOT NULL,
[name] [nvarchar](255) NOT NULL,
[description] [nvarchar](1000) NULL,
[sql] [nvarchar](2000) NULL,
[sql_admin_columns] [nvarchar](500) NULL,
[sql_datatypes] [nvarchar](255) NULL,
[url] [nvarchar](500) NULL,
[html] [nvarchar](max) NULL,
[visible_groups] [varchar](1000) NULL,
[visible] [tinyint] NOT NULL,
[auth_module] [varchar](50) NULL,
[rendering_options] [nvarchar](255) NULL,
[server_options] [nvarchar](2000) NULL,
[daycache] [bit] NOT NULL,
[personalized] [bit] NOT NULL,
[safemode] [bit] NOT NULL,
[variables] [varchar](1000) NULL,
[order] int
)
AS
BEGIN
--DECLARE @account varchar(50) = ''; -- kept in function for reuse purposes
INSERT INTO @RET
SELECT w.*
, ROW_NUMBER() OVER (ORDER BY s.[display_order], s.[DateCreated] DESC, w.[name]) as 'order'
FROM [dbo].[fis_widgets] as w JOIN [dbo].[fis_widget_subscriptions] as s ON w.[short_name] = s.[widget_name]
WHERE --(s.[account] = @account OR s.[account] = '*')
(s.[person_guid] = @useraccount_id OR s.[person_guid] = '*')
AND (ISNULL(w.[visible],0) = 0 OR ([dbo].[fis_getModuleAuth](ISNULL(w.[auth_module], 'fis_widgets'), @useraccount_id) >= w.[visible]))
--UNION
-- SELECT * FROM [dbo].[fis_getONEPersonWidgets_ownevents](@account, @person_guid)
RETURN
END