Skip to content
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: coupon code for bounty creation fee #4237

Merged
merged 6 commits into from
Jun 12, 2019

Conversation

thelostone-mc
Copy link
Member

@thelostone-mc thelostone-mc commented Apr 20, 2019

Description
  • added Coupon model
  • admin can create coupon with expiry date and share bounty
    creation URL
  • bounty creation will load updated fee if coupon hasn't expired
  • bounty metadata is updated to keep track if bounty used a coupon
  • updated web3 not defined error message
  • refactored css
How it would work
  1. admin created new coupon in admin with the following information
    • coupon code
    • fee % (should be between 0 to 100)
    • expiry date
  2. Upon creation the admin will be able to view the URL they can share AS SHOWN HERE which will be something like http://gitcoin.co/funding/new?coupon=FREE-50
  3. Once funder receives the URL the new fee will be applied.
  4. For reporting purpose bounties which have been funded with a coupon will have that information
    in the bounty on admin AS SHOWN HERE

DEMO: https://embed.vidyard.com/share/rzwbLjVvVHbeVuzCbdVUuD?

Fixes: #4497

- added Coupon model
- admin can create coupon with expiry date and share bounty
  creation URL
- bounty creation will load updated fee if coupon hasn't expired
- bounty metadata is updated to keep track if bounty used a coupon
- updated web3 not defined error message
- refactored css

Fixes: gitcoinco#4497
@thelostone-mc thelostone-mc changed the title feat: add fee discount bounty/new feat: coupon code for bounty creation fee Jun 1, 2019
@thelostone-mc thelostone-mc requested review from alexvotofuture, frankchen07 and a team June 1, 2019 13:20
@thelostone-mc thelostone-mc marked this pull request as ready for review June 1, 2019 13:29
@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #4237 into master will increase coverage by 0.06%.
The diff coverage is 43.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4237      +/-   ##
==========================================
+ Coverage   30.12%   30.19%   +0.06%     
==========================================
  Files         210      209       -1     
  Lines       16911    16917       +6     
  Branches     2284     2282       -2     
==========================================
+ Hits         5095     5108      +13     
+ Misses      11619    11612       -7     
  Partials      197      197
Impacted Files Coverage Δ
app/dashboard/views.py 14.2% <0%> (-0.08%) ⬇️
app/dashboard/helpers.py 13.99% <0%> (-0.19%) ⬇️
app/dashboard/admin.py 65.92% <58.33%> (-0.75%) ⬇️
app/dashboard/models.py 56.78% <87.5%> (+0.15%) ⬆️
app/retail/views.py 28.84% <0%> (-0.29%) ⬇️
...p/dashboard/management/commands/sync_es_profile.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b17efb5...6458ad0. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #4237 into master will decrease coverage by 0.01%.
The diff coverage is 43.75%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4237      +/-   ##
=========================================
- Coverage   30.11%   30.1%   -0.02%     
=========================================
  Files         210     210              
  Lines       16919   16950      +31     
  Branches     2286    2290       +4     
=========================================
+ Hits         5095    5102       +7     
- Misses      11626   11650      +24     
  Partials      198     198
Impacted Files Coverage Δ
app/dashboard/views.py 14.2% <0%> (-0.08%) ⬇️
app/dashboard/helpers.py 13.99% <0%> (-0.19%) ⬇️
app/dashboard/admin.py 65.92% <58.33%> (-0.75%) ⬇️
app/dashboard/models.py 56.78% <87.5%> (+0.15%) ⬆️
app/dashboard/embed.py 28.16% <0%> (-3.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2ece5b...8201dc1. Read the comment docs.

@frankchen07
Copy link
Contributor

qq - for expired coupons, the functionality looks solid (becaue the coupon is expired they have to pay full price), but it doesn’t actually let the user know “hey the coupon is expired” (like a red text box) do you think this is necessary? like a “if now() > coupon expiration date, and they’re using the link, so a box that says the coupon is expired”

octavioamu
octavioamu previously approved these changes Jun 3, 2019
Copy link
Contributor

@octavioamu octavioamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing


class Coupon(SuperModel):
code = models.CharField(unique=True, max_length=10)
fee_percentage = models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(100)])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@thelostone-mc thelostone-mc merged commit 631717d into gitcoinco:master Jun 12, 2019
@thelostone-mc thelostone-mc deleted the coupon branch July 4, 2019 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fee Discount Codes
4 participants