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>
60 lines
1.6 KiB
Transact-SQL
60 lines
1.6 KiB
Transact-SQL
|
|
|
|
|
|
-- =============================================
|
|
-- Author: <Author,,Name>
|
|
-- Create date: <Create Date, ,>
|
|
-- Description: <Description, ,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[fis_admin_createUserAccount]
|
|
@name nvarchar(100)
|
|
,@firstname nvarchar(100)
|
|
,@title varchar(50)
|
|
,@gender varchar(1)
|
|
,@email varchar(255)
|
|
,@mobile varchar(50)
|
|
,@password nvarchar(20)
|
|
,@enc_key uniqueidentifier
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON;
|
|
|
|
DECLARE @utcnow datetime = GETUTCDATE();
|
|
|
|
INSERT INTO [dbo].[fis_useraccounts]
|
|
([useraccount_id]
|
|
,[name_enc]
|
|
,[firstname_enc]
|
|
,[title_enc]
|
|
,[gender_enc]
|
|
,[email_enc]
|
|
,[mobile_enc]
|
|
,[password_enc]
|
|
,[UserDisabled]
|
|
,[DateDisabled]
|
|
,[UserCreated]
|
|
,[DateCreated]
|
|
,[UserModified]
|
|
,[DateModified]
|
|
,[UserDeleted]
|
|
,[DateDeleted])
|
|
OUTPUT inserted.[useraccount_id]
|
|
VALUES
|
|
([dbo].[fis_fn_useraccount_id] ()
|
|
,ENCRYPTBYKEY(@enc_key, @name)
|
|
,ENCRYPTBYKEY(@enc_key, @firstname)
|
|
,ENCRYPTBYKEY(@enc_key, @title)
|
|
,ENCRYPTBYKEY(@enc_key, @gender)
|
|
,ENCRYPTBYKEY(@enc_key, @email)
|
|
,ENCRYPTBYKEY(@enc_key, @mobile)
|
|
,CASE WHEN @password is null then ENCRYPTBYKEY(@enc_key, CAST([dbo].[ocms_fn_generatePassword] (8, 0, 1, 1) AS nvarchar(20))) ELSE ENCRYPTBYKEY(@enc_key, @password) END
|
|
,NULL --[UserDisabled]
|
|
,NULL --[DateDisabled]
|
|
,'sa'
|
|
,@utcnow
|
|
,'sa'
|
|
,@utcnow
|
|
,NULL
|
|
,NULL);
|
|
|
|
END |