1
0
mirror of https://github.com/bitwarden/server synced 2026-01-06 02:23:51 +00:00

Organization report tables, repos, services, and endpoints (#6158)

* PM-23754 initial commit

* pm-23754 fixing controller tests

* pm-23754 adding commands and queries

* pm-23754 adding endpoints, command/queries, repositories, and sql migrations

* pm-23754 add new sql scripts

* PM-23754 adding sql scripts

* pm-23754

* PM-23754 fixing migration script

* PM-23754 fixing migration script again

* PM-23754 fixing migration script validation

* PM-23754 fixing db validation script issue

* PM-23754 fixing endpoint and db validation

* PM-23754 fixing unit tests

* PM-23754 fixing implementation based on comments and tests

* PM-23754 updating logging statements

* PM-23754 making changes based on PR comments.

* updating migration scripts

* removing old migration files

* update code based testing for whole data object for OrganizationReport and add a stored procedure.

* updating services, unit tests, repository tests

* fixing unit tests

* fixing migration script

* fixing migration script again

* fixing migration script

* another fix

* fixing sql file, updating controller to account for different orgIds in the url and body.

* updating error message in controllers without a body

* making a change to the command

* Refactor ReportsController by removing organization reports

The IDropOrganizationReportCommand is no longer needed

* will code based on PR comments.

* fixing unit test

* fixing migration script based on last changes.

* adding another check in endpoint and adding unit tests

* fixing route parameter.

* PM-23754 updating data fields to return just the column

* PM-23754 fixing repository method signatures

* PM-23754 making change to orgId parameter through out code to align with api naming

---------

Co-authored-by: Tom <144813356+ttalty@users.noreply.github.com>
This commit is contained in:
Graham Walker
2025-09-08 15:06:13 -05:00
committed by GitHub
parent cb0d5a5ba6
commit 226f274a72
79 changed files with 24744 additions and 1047 deletions

View File

@@ -1,26 +1,35 @@
CREATE PROCEDURE [dbo].[OrganizationReport_Create]
@Id UNIQUEIDENTIFIER OUTPUT,
@OrganizationId UNIQUEIDENTIFIER,
@Date DATETIME2(7),
@ReportData NVARCHAR(MAX),
@CreationDate DATETIME2(7),
@ContentEncryptionKey VARCHAR(MAX)
@Id UNIQUEIDENTIFIER OUTPUT,
@OrganizationId UNIQUEIDENTIFIER,
@ReportData NVARCHAR(MAX),
@CreationDate DATETIME2(7),
@ContentEncryptionKey VARCHAR(MAX),
@SummaryData NVARCHAR(MAX),
@ApplicationData NVARCHAR(MAX),
@RevisionDate DATETIME2(7)
AS
SET NOCOUNT ON;
BEGIN
SET NOCOUNT ON;
INSERT INTO [dbo].[OrganizationReport](
[Id],
[OrganizationId],
[Date],
[ReportData],
[CreationDate],
[ContentEncryptionKey]
)
VALUES (
@Id,
@OrganizationId,
@Date,
@ReportData,
@CreationDate,
@ContentEncryptionKey
INSERT INTO [dbo].[OrganizationReport](
[Id],
[OrganizationId],
[ReportData],
[CreationDate],
[ContentEncryptionKey],
[SummaryData],
[ApplicationData],
[RevisionDate]
)
VALUES (
@Id,
@OrganizationId,
@ReportData,
@CreationDate,
@ContentEncryptionKey,
@SummaryData,
@ApplicationData,
@RevisionDate
);
END