-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add discount payment types #1390
Conversation
7746aa9
to
e76317c
Compare
migrations.AddField( | ||
model_name='discount', | ||
name='payment_type', | ||
field=models.CharField(choices=[('B2C', 'Marketing'), ('B2B', 'Sales'), ('FA', 'Financial Assistance'), ('CS', 'Customer Support')], max_length=3, null=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to confirm this list. Please don't merge until I've signed off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdpinch Do you have an update on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add one more: "staff"
How should we handle updating existing coupons? |
I am not really sure about that. I have created a data migration for financial assistance discounts. I am not sure about all the other types of discounts. Maybe if have some kind of a pattern then we can create a data migration for other discounts as well. For now, I have kept the new field nullable. So, It will be null for all the discounts apart from the ones that are related to financial assistance. Do you have any information about any pattern that we used for the discounts that we can use and write a data migration? |
great.
Good idea. That's fine.
@jkachel may have some suggestions for some of the coupons he created. To be clear, it's not necessary that we backfill all of them. I just want to update the easy ones. |
We've only had to do a few runs of these so it shouldn't be too bad to do. The patterns I've been using are:
The |
Yeah, I will be updating a couple of commands, The work is in progress for that.
What should be the type for these discounts?
What should be the type for these course discounts? |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1390 +/- ##
==========================================
- Coverage 83.22% 83.19% -0.03%
==========================================
Files 309 309
Lines 13135 13148 +13
Branches 935 936 +1
==========================================
+ Hits 10932 10939 +7
- Misses 1936 1940 +4
- Partials 267 269 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Hey @pdpinch & @jkachel,
Also, I am not sure about these 2 discounts. What should be the payment_type for these 2 types of discounts?
|
After some thought, I think both of these are B2C. I did find out the purpose for the last group of codes I mentioned. They're for the lottery - https://odl.zendesk.com/agent/tickets/145641 is the Zendesk ticket for that (which you'll probably not be able to get into, just including for completeness) and this is it in HQ: https://github.com/mitodl/hq/issues/558. The relevant info from the ticket is:
In addition, I also found a couple more groups that will need backfilling:
|
@jkachel There are also some discount codes starting with |
@pdpinch What do you suggest about these? |
|
ffda830
to
0fd5e11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good - staff dashboard looked OK, management command is good, workflow is fine on the frontend. Approving conditionally because of two things:
- waiting on resolution for
MM-prepaid
codes from @pdpinch (my thought is to leave them blank because we're never going to do anything like that again probably, or at least not without it being a whole thing that gets tracked like a project) - can you update the docs for
generate_discount_code
indocs/source/commands
? It needs the new flag added.
Other than those two things, LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkachel Could you please verify if this is a legit issue? It seems like a migrations issue to me. Not sure if you tried to change something there. Everything is working fine for me. I am getting the emails. I have also tried to reapply all the migrations as well. |
After some checking I have no idea. The local copy I use most of the time has issues (even with a fresh database and the migrations applied), but I tested it on a separate system and it works OK there. So, this does seem like a local-to-me issue or maybe at worst a macOS issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I think we should make a new category for these, "legacy" |
…-support for legacy discount command
44126b5
to
23f0b3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Pre-Flight checklist
What are the relevant tickets?
Closes #1074
What's this PR do?
payment_type
in the discounts model.for_flexible_pricing
withpayment_type
.generate_discount_code
management command to add a new argument.How should this be manually tested?
There are a few things that we need to test.
/admin/ecommerce/discount/
.for_flexible_pricing=True
thenpayment_type=financial-assistance
CS-
thenpayment_type=customer-support
JPAL-
thenpayment_type=staff
MITALUM15-
,14750x-
,14740x-
,1473x-
,14310x-
,JPAL102x-
orCYB2022-
thenpayment_type=marketing
CYBER2022
thenpayment_type=marketing
/admin/ecommerce/discount/
.