Skip to content

Commit

Permalink
Merge branch 'RELEASE/v1.1.0.14' into 'master'
Browse files Browse the repository at this point in the history
Release/v1.1.0.14

See merge request ACVTS/GenVals/gen-val!565
  • Loading branch information
Kritner committed Dec 1, 2020
2 parents 53e8ef9 + f685ada commit 69d9efa
Show file tree
Hide file tree
Showing 463 changed files with 313,044 additions and 302,917 deletions.
14 changes: 14 additions & 0 deletions DB/ACVP_DB/ACVP_DB.refactorlog
Original file line number Diff line number Diff line change
Expand Up @@ -882,4 +882,18 @@
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="LabVectorSetAllotmentPurchaseItemId" />
</Operation>
<Operation Name="Rename Refactor" Key="960b39fa-d875-4e1e-a5e3-dccbfa40e02c" ChangeDateTime="10/26/2020 16:00:22">
<Property Name="ElementName" Value="[dbo].[LabVectorSetAllotmentUsage].[Id]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[LabVectorSetAllotmentUsage]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="LabVectorSetAllotmentUsageId" />
</Operation>
<Operation Name="Rename Refactor" Key="00b15ff2-750a-4731-8020-0b3c68f12860" ChangeDateTime="10/26/2020 16:03:44">
<Property Name="ElementName" Value="[dbo].[LabVectorSetAllotmentUsage].[UseDate]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[LabVectorSetAllotmentUsage]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="UsageDate" />
</Operation>
</Operations>
11 changes: 10 additions & 1 deletion DB/ACVP_DB/ACVP_DB.sqlproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
<Build Include="dbo\Tables\Algorithms.sql" />
<Build Include="dbo\Tables\AlgorithmPropertyTypes.sql" />
<Build Include="dbo\Tables\AlgorithmProperties.sql" />
<Build Include="dbo\Stored Procedures\RecursivelyCreateCapability.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmsGet.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmIDByNameAndModeGet.sql" />
<Build Include="dbo\Stored Procedures\PropertiesGet.sql" />
Expand Down Expand Up @@ -324,6 +323,16 @@
<Build Include="dbo\Stored Procedures\ValidationsGetByOE.sql" />
<Build Include="dbo\Stored Procedures\LabsGet.sql" />
<Build Include="dbo\Stored Procedures\ACVPUsersGetByLab.sql" />
<Build Include="dbo\Stored Procedures\LabVectorSetAllotmentUsageInsert.sql" />
<Build Include="dbo\Tables\LabVectorSetAllotmentUsage.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmGet.sql" />
<Build Include="dbo\Stored Procedures\PropertiesForAlgorithmGet.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmPropertyStringValueDisplayMappingsGet.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmUpdate.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmPropertyUpdate.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmPropertyStringValueDisplayMappingUpdate.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmPropertyStringValueDisplayMappingInsert.sql" />
<Build Include="dbo\Stored Procedures\AlgorithmPropertyStringValueDisplayMappingDelete.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="ACVP_DB.refactorlog" />
Expand Down
19 changes: 19 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/AlgorithmGet.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[AlgorithmGet]

@AlgorithmId bigint

AS

SET NOCOUNT ON

SELECT AlgorithmId
,[Name]
,Mode
,Revision
,DisplayName
,Alias
,Historical
,DisplayOnCSRC
,SupportedByACVP
FROM dbo.Algorithms
WHERE AlgorithmId = @AlgorithmId
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE PROCEDURE [dbo].[AlgorithmPropertyStringValueDisplayMappingDelete]

@AlgorithmPropertyStringValueDisplayMappingId bigint

AS

SET NOCOUNT ON

DELETE
FROM dbo.AlgorithmPropertyStringValueDisplayMapping
WHERE AlgorithmPropertyStringValueDisplayMappingId = @AlgorithmPropertyStringValueDisplayMappingId
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE PROCEDURE [dbo].[AlgorithmPropertyStringValueDisplayMappingInsert]

@AlgorithmPropertyId bigint
,@StringValue nvarchar(512)
,@DisplayValue nvarchar(512)

AS

SET NOCOUNT ON

INSERT INTO dbo.AlgorithmPropertyStringValueDisplayMapping (
AlgorithmPropertyId
,StringValue
,DisplayValue
)
VALUES (
@AlgorithmPropertyId
,@StringValue
,@DisplayValue
)

SELECT CAST(SCOPE_IDENTITY() AS bigint) AS AlgorithmPropertyStringValueDisplayMappingId
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE PROCEDURE [dbo].[AlgorithmPropertyStringValueDisplayMappingUpdate]

@AlgorithmPropertyStringValueDisplayMappingId bigint
,@StringValue nvarchar(512)
,@DisplayValue nvarchar(512)

AS

SET NOCOUNT ON

UPDATE dbo.AlgorithmPropertyStringValueDisplayMapping
SET StringValue = @StringValue
,DisplayValue = @DisplayValue
WHERE AlgorithmPropertyStringValueDisplayMappingId = @AlgorithmPropertyStringValueDisplayMappingId
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE PROCEDURE [dbo].[AlgorithmPropertyStringValueDisplayMappingsGet]

@AlgorithmPropertyId bigint

AS

SET NOCOUNT ON

SELECT AlgorithmPropertyStringValueDisplayMappingId
,StringValue
,DisplayValue
FROM dbo.AlgorithmPropertyStringValueDisplayMapping
WHERE AlgorithmPropertyId = @AlgorithmPropertyId
28 changes: 28 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/AlgorithmPropertyUpdate.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
CREATE PROCEDURE [dbo].[AlgorithmPropertyUpdate]

@AlgorithmPropertyId bigint
,@PropertyName nvarchar(128)
,@ParentAlgorithmPropertyId bigint
,@DefaultValue nvarchar(128)
,@Historical bit
,@DisplayName nvarchar(128)
,@InCertificate bit
,@OrderIndex int
,@IsRequired bit
,@UnitsLabel nvarchar(128)

AS

SET NOCOUNT ON

UPDATE dbo.AlgorithmProperties
SET PropertyName = @PropertyName
,ParentAlgorithmPropertyId = @ParentAlgorithmPropertyId
,DefaultValue = @DefaultValue
,Historical = @Historical
,DisplayName = @DisplayName
,InCertificate = @InCertificate
,OrderIndex = @OrderIndex
,IsRequired = @IsRequired
,UnitsLabel = @UnitsLabel
WHERE AlgorithmPropertyId = @AlgorithmPropertyId
24 changes: 24 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/AlgorithmUpdate.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CREATE PROCEDURE [dbo].[AlgorithmUpdate]

@AlgorithmId bigint
,@Name nvarchar(128)
,@Mode nvarchar(128)
,@Revision nvarchar(32)
,@DisplayName nvarchar(128)
,@Historical bit
,@DisplayOnCSRC bit
,@SupportedByACVP bit

AS

SET NOCOUNT ON

UPDATE dbo.Algorithms
SET [Name] = @Name
,Mode = @Mode
,Revision = @Revision
,DisplayName = @DisplayName
,Historical = @Historical
,DisplayOnCSRC = @DisplayOnCSRC
,SupportedByACVP = @SupportedByACVP
WHERE AlgorithmId = @AlgorithmId
2 changes: 2 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/AlgorithmsGet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ SELECT AlgorithmId
,DisplayName
,Alias
,Historical
,DisplayOnCSRC
,SupportedByACVP
FROM dbo.Algorithms
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE PROCEDURE [dbo].[LabVectorSetAllotmentUsageInsert]

@LabVectorSetAllotmentId int
,@LabVectorSetRequestId int
,@VectorSetCount int

AS

SET NOCOUNT ON

INSERT INTO LabVectorSetAllotmentUsage (LabVectorSetAllotmentId, LabVectorSetRequestId, VectorSetCount, UsageDate)
VALUES (@LabVectorSetAllotmentId, @LabVectorSetRequestId, @VectorSetCount, CURRENT_TIMESTAMP)
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ VALUES (
,CURRENT_TIMESTAMP
,@VectorSetCount
,@TestSessionId
)
)

SELECT CAST(SCOPE_IDENTITY() AS int) AS LabVectorSetRequestId
22 changes: 22 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/PropertiesForAlgorithmGet.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE PROCEDURE [dbo].[PropertiesForAlgorithmGet]

@AlgorithmId bigint

AS

SET NOCOUNT ON

SELECT AlgorithmPropertyId
,AlgorithmId
,PropertyName
,ParentAlgorithmPropertyId
,AlgorithmPropertyTypeId
,DefaultValue
,Historical
,DisplayName
,InCertificate
,OrderIndex
,IsRequired
,UnitsLabel
FROM dbo.AlgorithmProperties
WHERE AlgorithmId = @AlgorithmId
50 changes: 0 additions & 50 deletions DB/ACVP_DB/dbo/Stored Procedures/RecursivelyCreateCapability.sql

This file was deleted.

6 changes: 6 additions & 0 deletions DB/ACVP_DB/dbo/Stored Procedures/TestSessionsGet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@TestSessionId BIGINT = NULL,
@TestSessionStatusId TINYINT = NULL,
@VectorSetId BIGINT = NULL,
@UserId BIGINT = NULL,
@LabId INT = NULL,
@TotalRecords BIGINT OUTPUT

AS
Expand All @@ -16,12 +18,16 @@ FROM dbo.TestSessions ts
WHERE (@TestSessionStatusId IS NULL OR ts.TestSessionStatusId = @TestSessionStatusId)
AND (@TestSessionId IS NULL OR ts.TestSessionId = @TestSessionId)
AND (@VectorSetId IS NULL OR EXISTS (SELECT 1 FROM dbo.VectorSets vs WHERE vs.TestSessionId = ts.TestSessionId AND vs.VectorSetId = @VectorSetId))
AND (@UserId IS NULL OR ts.ACVPUserId = @UserId)
AND (@LabId IS NULL OR EXISTS (SELECT 1 FROM dbo.ACVPUsers WHERE ACVPUserId = ts.ACVPUserId AND LabId = @LabId))

SELECT TestSessionId, CreatedOn AS Created, TestSessionStatusId as [Status]
FROM dbo.TestSessions ts
WHERE (@TestSessionStatusId IS NULL OR ts.TestSessionStatusId = @TestSessionStatusId)
AND (@TestSessionId IS NULL OR ts.TestSessionId = @TestSessionId)
AND (@VectorSetId IS NULL OR EXISTS (SELECT 1 FROM dbo.VectorSets vs WHERE vs.TestSessionId = ts.TestSessionId AND vs.VectorSetId = @VectorSetId))
AND (@UserId IS NULL OR ts.ACVPUserId = @UserId)
AND (@LabId IS NULL OR EXISTS (SELECT 1 FROM dbo.ACVPUsers WHERE ACVPUserId = ts.ACVPUserId AND LabId = @LabId))
ORDER BY TestSessionId DESC
OFFSET (@Page - 1) * @PageSize ROWS
FETCH NEXT @PageSize ROWS ONLY
Expand Down
11 changes: 11 additions & 0 deletions DB/ACVP_DB/dbo/Tables/LabVectorSetAllotmentUsage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE [dbo].[LabVectorSetAllotmentUsage]
(
[LabVectorSetAllotmentUsageId] INT IDENTITY(1,1) NOT NULL,
[LabVectorSetAllotmentId] INT NOT NULL,
[LabVectorSetRequestId] INT NOT NULL,
[VectorSetCount] INT NOT NULL,
[UsageDate] DATETIME2 NOT NULL,
CONSTRAINT [PK_LabVectorSetAllotmentUsage] PRIMARY KEY CLUSTERED ([LabVectorSetAllotmentUsageId] ASC),
CONSTRAINT [FK_LabVectorSetAllotmentUsage_LabVectorSetAllotments] FOREIGN KEY ([LabVectorSetAllotmentId]) REFERENCES [dbo].[LabVectorSetAllotments]([LabVectorSetAllotmentId]),
CONSTRAINT [FK_LabVectorSetAllotmentUsage_LabVectorSetRequests] FOREIGN KEY ([LabVectorSetRequestId]) REFERENCES [dbo].[LabVectorSetRequests]([LabVectorSetRequestId])
)
1 change: 1 addition & 0 deletions DB/ACVP_DB/lcavp/Stored Procedures/ImplementationIDGet.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ AS
INNER JOIN
dbo.Validations V ON V.ValidationSourceId = S.ValidationSourceId
AND V.ValidationNumber = @ValidationNumber
AND S.Prefix = @Algorithm


Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ DECLARE @algorithmProperties TABLE (
[OrderIndex] [int] NULL,
[IsRequired] [bit] NULL,
[UnitsLabel] [nvarchar](128) NULL,
[StringValue] [nvarchar](512),
[DisplayValue] [nvarchar](512),
[HasDisplayMappings] [bit] NULL,
[NewAlgorithmPropertyId] [bigint],
[NewParentAlgorithmPropertyId] [bigint]
)
Expand All @@ -79,9 +78,7 @@ INSERT INTO @algorithmProperties (
[InCertificate],
[OrderIndex],
[IsRequired],
[UnitsLabel],
[StringValue],
[DisplayValue]
[UnitsLabel]
)
SELECT
ap.[AlgorithmPropertyId],
Expand All @@ -95,14 +92,16 @@ SELECT
[InCertificate],
[OrderIndex],
[IsRequired],
[UnitsLabel],
[StringValue],
[DisplayValue]
[UnitsLabel]
FROM AlgorithmProperties ap
LEFT JOIN AlgorithmPropertyStringValueDisplayMapping aps ON ap.AlgorithmPropertyId = aps.AlgorithmPropertyId
WHERE ap.AlgorithmId = @algorithmId
ORDER BY AlgorithmPropertyId, ParentAlgorithmPropertyId

UPDATE ap
SET HasDisplayMappings = 1
FROM @algorithmProperties ap
INNER JOIN AlgorithmPropertyStringValueDisplayMapping aps ON ap.AlgorithmPropertyId = aps.AlgorithmPropertyId

-- Creating a table to keep track of the mapping on the destination database
INSERT INTO @algorithmCreationScript
SELECT 'DECLARE @mapping TABLE (rowId INT, oldPropertyId BIGINT, oldParentPropertyId BIGINT, newPropertyId BIGINT)'
Expand Down Expand Up @@ -174,13 +173,14 @@ WHILE (@rowIterator <= @rowCount)
SELECT 1
FROM @algorithmProperties ap
WHERE RowId = @rowIterator
AND ap.StringValue IS NOT NULL
AND HasDisplayMappings = 1
)
BEGIN
INSERT INTO @algorithmCreationScript
SELECT 'INSERT INTO AlgorithmPropertyStringValueDisplayMapping (StringValue, DisplayValue)
SELECT ' + CONVERT(NVARCHAR(512), [StringValue]) + ', ' + CONVERT(NVARCHAR(512), [DisplayValue])
SELECT 'INSERT INTO AlgorithmPropertyStringValueDisplayMapping (AlgorithmPropertyid, StringValue, DisplayValue)
SELECT @newPropertyId, ''' + CONVERT(NVARCHAR(512), [StringValue]) + ''', ''' + CONVERT(NVARCHAR(512), [DisplayValue]) + ''''
FROM @algorithmProperties ap
INNER JOIN AlgorithmPropertyStringValueDisplayMapping aps ON ap.AlgorithmPropertyId = aps.AlgorithmPropertyId
WHERE ap.RowId = @rowIterator
END

Expand Down
Loading

0 comments on commit 69d9efa

Please sign in to comment.