# 2. Discount Codes & Sharing

User Type: **Affiliate**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 2. Discount Codes & Sharing

### 2.1 Discount Code Creation
**What it does:** Lets the Affiliate create a discount code for their referrals, if permitted by their program tier. The Affiliate sets the discount value, the expiry, and the usage limit, and the platform generates the code. The code is tracked for usage and attributed to the Affiliate. This gives the Affiliate a powerful incentive tool for their audience.

**Sub-features:**
- Create a discount code (if permitted)
- Set the discount value
- Set the code expiry
- Set the usage limit
- Code generated and attributed to the Affiliate
- Code usage tracking
- Codes available on web and mobile
- Codes event logging (created, used)
- Audit logging of the discount code creation

**Affiliate User Journey:**
1. Affiliate opens the discount codes.
2. Affiliate creates a discount code (if permitted).
3. Affiliate sets the discount value.
4. Affiliate sets the code expiry.
5. Affiliate sets the usage limit.
6. The code is generated and attributed to the Affiliate.
7. Affiliate opens Profile → "Activity" and confirms the codes events are recorded.

**Rules & Edge Cases:**
- The code creation is permitted by the program tier.
- The code has a value, expiry, and usage limit.
- The code is attributed to the Affiliate.
- Codes events (created, used) are logged with the account and the timestamp.
- The discount code creation is audit-logged with the account and the timestamp.

### 2.2 Share Referral Link
**What it does:** Lets the Affiliate share their referral link directly from the platform: to a messaging app, email, or social channel, or by copying it. The platform provides share options and a copy button. The share is tracked. This makes it easy to spread the referral link.

**Sub-features:**
- Share the referral link to a messaging app
- Share the referral link to email
- Share the referral link to a social channel
- Copy the referral link
- Share options shown
- Share tracking
- Sharing available on web and mobile
- Sharing event logging (shared, copied)
- Audit logging of the share referral link

**Affiliate User Journey:**
1. Affiliate opens the share options.
2. The share options are shown.
3. Affiliate shares the referral link to a messaging app.
4. Affiliate shares the referral link to email.
5. Affiliate shares the referral link to a social channel.
6. Affiliate copies the referral link.
7. Affiliate opens Profile → "Activity" and confirms the sharing events are recorded.

**Rules & Edge Cases:**
- The share options include messaging, email, and social.
- The share is tracked.
- Sharing events (shared, copied) are logged with the account and the timestamp.
- The share referral link is audit-logged with the account and the timestamp.

### 2.3 Referral Tracking Links
**What it does:** Lets the Affiliate create tracked referral links for specific campaigns or channels, so they can see which source drives the most conversions. The Affiliate labels each tracked link and views its performance separately. This helps the Affiliate measure the effectiveness of each channel.

**Sub-features:**
- Create a tracked referral link
- Label the link by campaign or channel
- View the link's performance separately
- List of tracked links
- Delete a tracked link
- Tracked links available on web and mobile
- Tracked links event logging (created, deleted)
- Audit logging of the referral tracking links

**Affiliate User Journey:**
1. Affiliate opens the tracked links.
2. Affiliate creates a tracked referral link.
3. Affiliate labels the link by campaign or channel.
4. The link's performance is shown separately.
5. The tracked links are listed.
6. Affiliate deletes a tracked link.
7. Affiliate opens Profile → "Activity" and confirms the tracked links events are recorded.

**Rules & Edge Cases:**
- The tracked links are labeled by campaign or channel.
- The performance is shown per link.
- A tracked link can be deleted.
- Tracked links events (created, deleted) are logged with the account and the timestamp.
- The referral tracking links is audit-logged with the account and the timestamp.
