-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-28531] Remove old proc and use new one #7110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
voommen-livefront
wants to merge
11
commits into
main
Choose a base branch
from
dirt/pm-28531/organization-report-metrics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+392
β44
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
18a2f5d
PM-28531 remove old proc and use new one
voommen-livefront 0505509
PM-28531 updated json property name
voommen-livefront dce39bf
PM-28531 used Pascal case for named placeholders and other sonarCube β¦
voommen-livefront 8a7e064
PM-28531 introduce caching and update methods
voommen-livefront 87b48cf
PM-28531 added a limit of 6 records per query
voommen-livefront fa587eb
PM-28531 added docs to the endpoint
voommen-livefront 39922e0
PM-28531 updated test and code to fix error
voommen-livefront d467a71
PM-28531 fix sonar qube recommendations
voommen-livefront 495cbf9
PM-28531 updated unit tests
voommen-livefront 8e8495d
PM-28531 update the file name - as per PR comments and formatting issues
voommen-livefront 2a4f451
PM-28531 updating formatting
voommen-livefront File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
src/Core/Dirt/Models/Data/OrganizationReportSummaryDataResponse.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,14 @@ | ||
| ο»Ώnamespace Bit.Core.Dirt.Models.Data; | ||
| ο»Ώusing System.Text.Json.Serialization; | ||
|
|
||
| namespace Bit.Core.Dirt.Models.Data; | ||
|
|
||
| public class OrganizationReportSummaryDataResponse | ||
| { | ||
| public string? SummaryData { get; set; } | ||
| public required Guid OrganizationId { get; set; } | ||
| [JsonPropertyName("encryptedData")] | ||
| public required string SummaryData { get; set; } | ||
| [JsonPropertyName("encryptionKey")] | ||
| public required string ContentEncryptionKey { get; set; } | ||
| [JsonPropertyName("date")] | ||
| public required DateTime RevisionDate { get; set; } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
src/Core/Dirt/Reports/ReportFeatures/ReportingServiceCollectionExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| ο»Ώnamespace Bit.Core.Utilities; | ||
|
|
||
| /// <summary> | ||
| /// Provides cache key generation helpers and cache name constants for organization reportβrelated entities. | ||
| /// </summary> | ||
| public static class OrganizationReportCacheConstants | ||
| { | ||
| /// <summary> | ||
| /// The cache name used for storing organization report data. | ||
| /// </summary> | ||
| public const string CacheName = "OrganizationReports"; | ||
|
|
||
| /// <summary> | ||
| /// Duration TimeSpan for caching organization report summary data. | ||
| /// Consider: Reports might be regenerated daily, so cache for shorter periods. | ||
| /// </summary> | ||
| public static readonly TimeSpan DurationForSummaryData = TimeSpan.FromHours(6); | ||
|
|
||
| /// <summary> | ||
| /// Builds a deterministic cache key for organization report summary data by date range. | ||
| /// </summary> | ||
| /// <param name="organizationId">The unique identifier of the organization.</param> | ||
| /// <param name="startDate">The start date of the date range.</param> | ||
| /// <param name="endDate">The end date of the date range.</param> | ||
| /// <returns> | ||
| /// A cache key for the organization report summary data. | ||
| /// </returns> | ||
| public static string BuildCacheKeyForSummaryDataByDateRange( | ||
| Guid organizationId, | ||
| DateTime startDate, | ||
| DateTime endDate) | ||
| => $"OrganizationReportSummaryData:{organizationId:N}:{startDate:yyyy-MM-dd}:{endDate:yyyy-MM-dd}"; | ||
|
|
||
| /// <summary> | ||
| /// Builds a cache tag for an organization's report data. | ||
| /// Used for bulk invalidation when organization reports are updated. | ||
| /// </summary> | ||
| /// <param name="organizationId">The unique identifier of the organization.</param> | ||
| /// <returns> | ||
| /// A cache tag for the organization's reports. | ||
| /// </returns> | ||
| public static string BuildCacheTagForOrganizationReports(Guid organizationId) | ||
| => $"OrganizationReports:{organizationId:N}"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
SummaryDataandRevisionDate(below) properties are required here, but both columns in the DB allow nulls. Not sure if it's an issue or not but I just wanted to point it out.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkincaid-bw you are right - the procedures are required - if there is no summary data, than this object is not relevant. And I tested it in the database