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: Revamp Referral Process #207

Merged
merged 6 commits into from
Mar 10, 2024
Merged

feat: Revamp Referral Process #207

merged 6 commits into from
Mar 10, 2024

Conversation

samhwang
Copy link
Collaborator

@samhwang samhwang commented Mar 7, 2024

Description

As already described in #205, at its current state, referrals are saved anonymously, which leads to a few issues. This referral aims to resolve that, but also added a few niceties.

  • Update the Referral model to link to an owner userId that links to a User
  • Update the /referral new command:
    • Update the response message to indicate who added the referral code
    • Add a dupe check logic to block a code if the user already added the code for said service
    • Make expiry_date an optional field. It will now default to 30 days from the added date.
  • Update the /referral random message to also include the display name or the userid of the adder. This will help the end-user knows who to give rep when they use the code.

Motivation and Context

Resolves #205
Resolves #177

How Has This Been Tested?

  • All existing and newly added unit tests passed
  • Tested on the Bot Test server

What's next?

This PR has to stay in draft for the time being so the admins can truncate the referrals table before this change can be migrated.

Screenshots (if appropriate):

  • Add new code
    Screenshot 2024-03-07 at 9 10 53 pm
  • Add new code with a defined expiry date
    Screenshot 2024-03-07 at 9 57 24 pm
  • Block adding service code if a code for said service already added by the user
    Screenshot 2024-03-07 at 8 37 24 pm

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@samhwang samhwang force-pushed the feat/referral-revamp branch 2 times, most recently from 4aa10cf to 7339625 Compare March 7, 2024 10:25
@samhwang samhwang force-pushed the feat/referral-revamp branch from 7339625 to 50d7592 Compare March 7, 2024 10:39
@samhwang samhwang marked this pull request as ready for review March 7, 2024 10:43
@samhwang samhwang force-pushed the feat/referral-revamp branch from 50d7592 to 78df81a Compare March 7, 2024 10:55
@samhwang samhwang merged commit f14d057 into master Mar 10, 2024
5 checks passed
@samhwang samhwang deleted the feat/referral-revamp branch March 10, 2024 12:01
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.

Revamp the current referral process Referral command doesn't check for existing link/code before saving
2 participants