Skip to content

Commit

Permalink
feat(backfill_payment_types: Add more backfill)
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali145 committed Feb 3, 2023
1 parent 74df67f commit ffda830
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ecommerce/migrations/0032_backfill_payment_types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Generated by Django 3.2.15 on 2023-02-02 09:12

from django.db import migrations
from django.db.models import Q

from ecommerce.constants import (
PAYMENT_TYPE_CUSTOMER_SUPPORT,
PAYMENT_TYPE_FINANCIAL_ASSISTANCE,
PAYMENT_TYPE_MARKETING,
PAYMENT_TYPE_STAFF,
)

Expand All @@ -27,6 +29,18 @@ def backfill_payment_types(apps, schema_editor):
payment_type=PAYMENT_TYPE_STAFF
)

# marketing discount codes start with `MITALUM15-`
discount.objects.filter(
Q(discount_code__startswith="MITALUM15-")
| Q(discount_code__startswith="14750x-")
| Q(discount_code__startswith="14740x-")
| Q(discount_code__startswith="1473x-")
| Q(discount_code__startswith="14310x-")
| Q(discount_code__startswith="JPAL102x-")
| Q(discount_code__startswith="CYB2022-")
| Q(discount_code="CYBER2022")
).update(payment_type=PAYMENT_TYPE_MARKETING)


class Migration(migrations.Migration):

Expand Down

0 comments on commit ffda830

Please sign in to comment.