Add plan usage warning buckets for emails#902
Conversation
77ea09a to
138c654
Compare
PR Review: Add plan usage warning buckets for emails🟡 Potential BugsEmail fires when usage drops between buckets The condition The test suite covers dropping below all buckets (to Fix — only send when advancing to a higher bucket: const previousThreshold = organisationPricingPlan.lastUsageWarningThreshold
if (currentBucket !== previousThreshold) {
organisationPricingPlan.lastUsageWarningThreshold = currentBucket
await em.flush()
if (currentBucket !== null && (previousThreshold === null || currentBucket > previousThreshold)) {
await queueEmail(...)
}
}🔵 Minorem.flush() before queueEmail() — missed email on queue failure If No issues found
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #902 +/- ##
========================================
Coverage 97.33% 97.33%
========================================
Files 405 405
Lines 6527 6537 +10
Branches 851 856 +5
========================================
+ Hits 6353 6363 +10
Misses 90 90
Partials 84 84 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.