Skip to content
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

[PM-15807]Move subscription to 'canceled' 7 days after unpaid #5208

Conversation

cyprain-okeke
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-15807

📔 Objective

7 days after a subscription moves to an unpaid status, we cancel the subscription.

we void any associated invoices

CS needs some way to override this behavior. Could be as simple as their current workflow, which is to mark the org as enabled.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@cyprain-okeke cyprain-okeke requested a review from a team as a code owner January 2, 2025 09:36
Copy link
Contributor

github-actions bot commented Jan 2, 2025

Logo
Checkmarx One – Scan Summary & Details351ee151-f200-4458-99f8-ad30fcbcf970

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Billing/Controllers/RecoveryController.cs: 38
MEDIUM CSRF /src/Billing/Controllers/StripeController.cs: 164
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 845
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 470
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 256
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 256
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 256
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
LOW Log_Forging /src/Api/Auth/Controllers/EmergencyAccessController.cs: 159

Status = "open",
Subscription = subscriptionId
};
var invoices = await stripeFacade.ListInvoices(options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cyprain-okeke The default pagination size is 10. This means you can only cancel 10 unpaid subscriptions per week if I'm understanding it correctly. If I misunderstood, feel free to dismiss my comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I added some changes for when is more than default

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 68 lines in your changes missing coverage. Please review.

Project coverage is 43.65%. Comparing base (ff84628) to head (b581a5f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Billing/Jobs/SubscriptionCancellationJob.cs 0.00% 36 Missing ⚠️
...ices/Implementations/SubscriptionUpdatedHandler.cs 0.00% 26 Missing ⚠️
src/Billing/Startup.cs 0.00% 5 Missing ⚠️
src/Billing/Jobs/JobsHostedService.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5208      +/-   ##
==========================================
- Coverage   43.69%   43.65%   -0.05%     
==========================================
  Files        1469     1470       +1     
  Lines       67898    67965      +67     
  Branches     6156     6164       +8     
==========================================
  Hits        29670    29670              
- Misses      36934    37001      +67     
  Partials     1294     1294              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cyprain-okeke cyprain-okeke changed the title [PM-15807]Move subscription to 'canceled' 7 days after 'unpaid' [PM-15807]Move subscription to 'canceled' 7 days after unpaid Jan 6, 2025
@cyprain-okeke cyprain-okeke deleted the pm-15807-Move-subscription-to-canceled-7-days-after-unpai' branch January 6, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants