-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33433 from dimagi/jc/remove-free-50-sms
Migration to remove free 50 sms
- Loading branch information
Showing
5 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
corehq/apps/accounting/bootstrap/config/remove_free_50_sms_sep_2023.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from decimal import Decimal | ||
|
||
from corehq.apps.accounting.models import FeatureType, SoftwarePlanEdition | ||
|
||
BOOTSTRAP_CONFIG = { | ||
(SoftwarePlanEdition.STANDARD, False, False): { | ||
'role': 'standard_plan_v1', | ||
'product_rate_monthly_fee': Decimal('300.00'), | ||
'feature_rates': { | ||
FeatureType.USER: dict(monthly_limit=125, per_excess_fee=Decimal('2.00')), | ||
FeatureType.SMS: dict(monthly_limit=0), | ||
}, | ||
}, | ||
(SoftwarePlanEdition.PRO, False, False): { | ||
'role': 'pro_plan_v1', | ||
'product_rate_monthly_fee': Decimal('600.00'), | ||
'feature_rates': { | ||
FeatureType.USER: dict(monthly_limit=250, per_excess_fee=Decimal('2.00')), | ||
FeatureType.SMS: dict(monthly_limit=0), | ||
}, | ||
}, | ||
(SoftwarePlanEdition.ADVANCED, False, False): { | ||
'role': 'advanced_plan_v0', | ||
'product_rate_monthly_fee': Decimal('1200.00'), | ||
'feature_rates': { | ||
FeatureType.USER: dict(monthly_limit=500, per_excess_fee=Decimal('2.00')), | ||
FeatureType.SMS: dict(monthly_limit=0), | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
corehq/apps/accounting/migrations/0085_remove_free_50_sms.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.db import migrations | ||
|
||
from corehq.apps.accounting.bootstrap.config.remove_free_50_sms_sep_2023 import ( | ||
BOOTSTRAP_CONFIG, | ||
) | ||
from corehq.apps.accounting.bootstrap.utils import ensure_plans | ||
|
||
|
||
def _bootstrap_new_standard_pricing(apps, schema_editor): | ||
ensure_plans(BOOTSTRAP_CONFIG, verbose=True, apps=apps) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accounting', '0084_copy_cases_priv'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(_bootstrap_new_standard_pricing), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters