MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / shouldSendAlert

Method shouldSendAlert

api/pkg/services/billing_service.go:223–241  ·  view source on GitHub ↗
(user *entities.User, usage *entities.BillingUsage)

Source from the content-addressed store, hash-verified

221}
222
223func (service *BillingService) shouldSendAlert(user *entities.User, usage *entities.BillingUsage) bool {
224 if user.IsOnFreePlan() && (usage.TotalMessages() == 160 || usage.TotalMessages() == 180 || usage.TotalMessages() == 190) {
225 return true
226 }
227
228 if user.IsOnProPlan() && (usage.TotalMessages() == 4000 || usage.TotalMessages() == 4500 || usage.TotalMessages() == 4750) {
229 return true
230 }
231
232 if user.IsOnUltraPlan() && (usage.TotalMessages() == 8000 || usage.TotalMessages() == 9000 || usage.TotalMessages() == 9500) {
233 return true
234 }
235
236 if user.IsOn20kPlan() && (usage.TotalMessages() == 16000 || usage.TotalMessages() == 18000 || usage.TotalMessages() == 19000) {
237 return true
238 }
239
240 return false
241}

Callers 1

sendUsageAlertMethod · 0.95

Calls 5

IsOnFreePlanMethod · 0.80
TotalMessagesMethod · 0.80
IsOnProPlanMethod · 0.80
IsOnUltraPlanMethod · 0.80
IsOn20kPlanMethod · 0.80

Tested by

no test coverage detected