Monthly Quota Enforcement Fix

Job ID: 39945872

Budget: $10 – $30 USD

My Flask-based app already sends emails through SMTP and text messages through a small Python gateway script, with user data currently living in a Flask-managed store. I need you to make sure each user’s monthly quota—combined email + SMS count—is tracked accurately and that sending stops once the limit is hit.

Scope (keep it lean and focused):
• Review the existing quota logic and database schema.
• Patch or add code so every send request checks the current month’s usage before dispatching.
• Provide a quick unit test or script that proves the enforcement works (allowed when under limit, blocked when over).

Please stick to Python 3.x, Flask, and any lightweight helper library you need. A short code diff or annotated snippet plus the test file is enough; no large refactor.