10ecdfa2e4
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>
30 lines
1.0 KiB
Transact-SQL
30 lines
1.0 KiB
Transact-SQL
-- =============================================
|
|
-- Author: Dr. Stefan Ott
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[fis_widgets_setCache]
|
|
@account varchar(50)
|
|
,@short_name varchar(50)
|
|
,@login_guid varchar(36)
|
|
,@data nvarchar(max)
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
|
|
DECLARE @IsCacheable bit, @Personalized bit;
|
|
SELECT @IsCacheable = [daycache], @personalized = [personalized]
|
|
FROM [dbo].[fis_widgets]
|
|
WHERE ([account] = @account OR [account] = '*') AND [short_name] = @short_name;
|
|
|
|
DELETE FROM [dbo].[fis_widgets_cache]
|
|
WHERE [date] <> CAST(GETUTCDATE() as date)
|
|
OR ([account] = @account AND [short_name] = @short_name AND @Personalized = 0)
|
|
OR ([account] = @account AND [short_name] = @short_name AND @Personalized = 1 AND [person_guid] = @login_guid);
|
|
|
|
IF @IsCacheable = 1
|
|
BEGIN
|
|
INSERT INTO [dbo].[fis_widgets_cache]
|
|
VALUES( @account, @short_name, @login_guid, CAST(GETUTCDATE() as date), @data );
|
|
END
|
|
END |