[PM-34146] Add stored procedures for accepted users#7392
[PM-34146] Add stored procedures for accepted users#7392
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR adds a new Code Review DetailsNo findings. The implementation correctly follows established repository patterns, maintains dual-ORM parity, and includes comprehensive test coverage. |
| /// WARNING: do not use this to enforce policies against a user! It returns raw data and does not take into account | ||
| /// various business rules. Use <see cref="IPolicyRequirementQuery"/> instead. | ||
| /// </remarks> | ||
| Task<Policy?> GetByOrganizationIdTypeAsync(Guid organizationId, PolicyType type); |
There was a problem hiding this comment.
@eliykat Not related to this ticket, but should we consider adding more context to this name, or do we feel that we can safely assume that it implies it’s only for confirmed users?
There was a problem hiding this comment.
I always like being explicit. You could add more context via xmldoc or changing its name to mention Confirmed, provided the blast radius isn't too large for this PR.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7392 +/- ##
==========================================
+ Coverage 62.58% 62.59% +0.01%
==========================================
Files 2060 2061 +1
Lines 91184 91248 +64
Branches 8114 8119 +5
==========================================
+ Hits 57069 57120 +51
- Misses 32144 32154 +10
- Partials 1971 1974 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
New Issues (113)Checkmarx found the following issues in this Pull Request
Fixed Issues (8)Great job! The following issues were fixed in this Pull Request
|
|
| Items = phase1.Items.Select(i => new SubscriptionSchedulePhaseItemOptions | ||
| { | ||
| Price = i.PriceId, Quantity = i.Quantity | ||
| Price = i.PriceId, |
There was a problem hiding this comment.
This broke the linter pipeline earlier. It’s not related to my change, but I’m happy to keep it to keep things moving unless the billing team wants to merge their own fix into main.
cc: @bitwarden/team-billing-dev
There was a problem hiding this comment.
Nope that's perfectly fine. Thanks for the fix!
|
I'm looking into Checkmarx. I feel like it's a false positive since I'm using an established pattern. |
|
Talked to Matt Andreko about Checkmarx, and this is a false positive. We’re looking into moving to a new system in the near future. |
| @@ -0,0 +1,18 @@ | |||
| CREATE PROCEDURE [dbo].[Policy_ReadByUserIdWithConfirmedAndAccepted] | |||
There was a problem hiding this comment.
We want to avoid using And in proc names (see note: "Do not use And between parameter names in procedure names"):
https://contributing.bitwarden.com/contributing/code-style/sql/#common-examples
| @@ -0,0 +1,25 @@ | |||
| IF OBJECT_ID('[dbo].[Policy_ReadByUserIdWithConfirmedAndAccepted]') IS NOT NULL | |||
There was a problem hiding this comment.
This should use CREATE OR ALTER instead of DROP/CREATE
https://contributing.bitwarden.com/contributing/code-style/sql/#creating-or-modifying-a-function-or-stored-procedure






🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-34146
📔 Objective
📸 Screenshots
Migration was successful.
