-- REMOVE LAYER
--DECLARE @LayerId UNIQUEIDENTIFIER;
--SET @LayerId = '92ee1732-3900-4a8e-bb78-9bdc00332dd3';
--DELETE FROM [diunabi-morska].[dbo].[Records] WHERE [LayerId] = (SELECT @LayerId);
--DELETE FROM [diunabi-morska].[dbo].[Layers] WHERE [Id] = (SELECT @LayerId);


-- ADD IMPORT LAYER
--DECLARE @LayerId UNIQUEIDENTIFIER;
--SET @LayerId = 'a2883b74-be6d-4491-93cc-3681d65ba1bf';
--
--INSERT INTO [diunabi-morska].[dbo].[Layers] 
--([Id], [Number], [Source], [Name], [CreatedAt], [ModifiedAt], [IsDeleted], 
--[CreatedById], [ModifiedById], [Type])
--VALUES ((SELECT @LayerId),794, 'Manual', 'L794-A-IW_M7-2024/03-202402292014',
--GETDATE(), GETDATE(), 0, '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 2);
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'StartDate', '2024.02.29',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'EndDate', '2024.04.05',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'GoogleSheet',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'SheetTabName', 'Marzec_2024',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'SheetId', '1epk7AdNNvTyN4TKIIOqan-h5A8HYGbRVM_OS-Ns-Qlg', 
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'DataRange', 'D4:BS5',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'ImportName', 'D3',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'ImportMonth', 'F3',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'ImportYear', 'E3',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'CheckSum', 'G3',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Type', 'ImportWorker',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'IsEnabled', 'True',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--ADD PROCESS LAYERS
-- T3-SingleSource
--DECLARE @LayerId UNIQUEIDENTIFIER;
--SET @LayerId = 'ab6d7105-f593-4a0b-a601-5ff9efbdd557';
--
--INSERT INTO [diunabi-morska].[dbo].[Layers] 
--([Id], [Number], [Source], [Name], [CreatedAt], [ModifiedAt], [IsDeleted], 
--[CreatedById], [ModifiedById], [Type])
--VALUES ((SELECT @LayerId), 798, 'Manual', 'L798-A-PW_FK-2024/03-202402292021',
--GETDATE(), GETDATE(), 0, '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 2);
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'FK',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'SourceLayer', 'L791-A-IW_FK-2024/03-202402292008',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Type', 'ProcessWorker',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'ProcessType', 'T3-SingleSource',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'IsEnabled', 'True',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Year', '2024',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Month', '03',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--

-- T3-MultiSourceSummary
--DECLARE @LayerId UNIQUEIDENTIFIER;
--SET @LayerId = 'd8be7a0c-b2fe-4ce4-8d77-13f89ea5045a';
--
--INSERT INTO [diunabi-morska].[dbo].[Layers] 
--([Id], [Number], [Source], [Name], [CreatedAt], [ModifiedAt], [IsDeleted], 
--[CreatedById], [ModifiedById], [Type])
--VALUES ((SELECT @LayerId), 799, 'Manual', 'L799-A-PW_AA-2024/03-202402292024',
--GETDATE(), GETDATE(), 0, '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 2);
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'K5',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'M7',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'PU',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Source', 'FK',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Type', 'ProcessWorker',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'ProcessType', 'T3-MultiSourceSummary',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'IsEnabled', 'True',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Year', '2024',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--
--INSERT INTO [diunabi-morska].[dbo].[Records] 
--([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
--VALUES ((SELECT NEWID()), 'Month', '03',
--GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
--

-- T3-MultiSourceCopySelectedCodes

DECLARE @LayerId UNIQUEIDENTIFIER;
SET @LayerId = '76a86f96-5d3b-41aa-96fe-ae5c647a060c';

INSERT INTO [diunabi-morska].[dbo].[Layers] 
([Id], [Number], [Source], [Name], [CreatedAt], [ModifiedAt], [IsDeleted], 
[CreatedById], [ModifiedById], [Type])
VALUES ((SELECT @LayerId), 800, 'Manual', 'L800-A-PW_AB-2024/03-202402292027',
GETDATE(), GETDATE(), 0, '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 2);

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Source', 'K5',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Source', 'M7',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Source', 'PU',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Source', 'FK',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Type', 'ProcessWorker',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'ProcessType', 'T3-MultiSourceCopySelectedCodes',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'IsEnabled', 'True',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Year', '2024',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Month', '03',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));

INSERT INTO [diunabi-morska].[dbo].[Records] 
([Id], [Code], [Desc1], [CreatedAt], [ModifiedAt], [CreatedById], [ModifiedById], [IsDeleted], [LayerId])
VALUES ((SELECT NEWID()), 'Codes', '5000-5003;5005;5081-5095;6000-6003;6005;6081-6095;7000-7003;7005;7081-7095;8000-8003;8005;8081-8095',
GETDATE(), GETDATE(), '117be4f0-b5d1-41a1-a962-39dc30cce368', '117be4f0-b5d1-41a1-a962-39dc30cce368', 0, (SELECT @LayerId));
