# 2. Registration & Program Enrollment

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

---

## 2. Registration & Program Enrollment

### 2.1 Affiliate Registration
**What it does:** Lets a new user register as an Affiliate. The registrant provides their name, email, phone, and a password, and the platform creates the affiliate account. The registration validates the inputs and prevents duplicate accounts. This is the entry point for becoming an Affiliate.

**Sub-features:**
- Register with name, email, phone, and password
- Input validation on all fields
- Duplicate account prevention
- Account creation on successful registration
- Registration confirmation
- Registration available on web and mobile
- Registration event logging (submitted, created)
- Audit logging of the affiliate registration

**Affiliate User Journey:**
1. A new user opens the registration screen.
2. The user provides their name, email, phone, and password.
3. The platform validates the inputs.
4. The platform prevents a duplicate account.
5. The affiliate account is created.
6. A registration confirmation is shown.
7. The user opens Profile → "Activity" and confirms the registration events are recorded.

**Rules & Edge Cases:**
- The registration requires name, email, phone, and password.
- The inputs are validated.
- A duplicate account is prevented.
- Registration events (submitted, created) are logged with the account and the timestamp.
- The affiliate registration is audit-logged with the account and the timestamp.

### 2.2 Email Verification
**What it does:** Verifies the Affiliate's email address after registration. The platform sends a verification link to the email, and the Affiliate clicks it to confirm ownership. The account is limited until the email is verified. The verification link is single-use and expires. This confirms the Affiliate's email is valid.

**Sub-features:**
- Verification link sent to the registered email
- Click the link to verify the email
- Account limited until verified
- Verification link is single-use
- Verification link expires
- Resend verification with a cooldown
- Verification available on web and mobile
- Verification event logging (sent, verified)
- Audit logging of the email verification

**Affiliate User Journey:**
1. After registration, a verification link is sent to the email.
2. The Affiliate clicks the link.
3. The email is verified.
4. The account is fully activated.
5. The verification link is single-use and expires.
6. The Affiliate can resend the verification with a cooldown.
7. The Affiliate opens Profile → "Activity" and confirms the verification events are recorded.

**Rules & Edge Cases:**
- The verification link is sent to the registered email.
- The account is limited until verified.
- The verification link is single-use and expires.
- A resend has a cooldown.
- Verification events (sent, verified) are logged with the account and the timestamp.
- The email verification is audit-logged with the account and the timestamp.

### 2.3 Affiliate Program Enrollment
**What it does:** Enrolls the Affiliate into the affiliate program after registration. The Affiliate reviews the program terms, provides any required details (payment info, tax details), and submits the enrollment. The enrollment is reviewed and, on approval, the Affiliate gains access to the referral tools. This formalizes the Affiliate's participation.

**Sub-features:**
- Review the affiliate program terms
- Provide required details (payment, tax)
- Submit the enrollment
- Enrollment review and approval
- Referral tools unlocked on approval
- Enrollment status (pending, approved, rejected)
- Enrollment available on web and mobile
- Enrollment event logging (submitted, approved)
- Audit logging of the affiliate program enrollment

**Affiliate User Journey:**
1. The Affiliate opens the program enrollment.
2. The Affiliate reviews the program terms.
3. The Affiliate provides the required details (payment, tax).
4. The Affiliate submits the enrollment.
5. The enrollment is reviewed and approved.
6. The referral tools are unlocked.
7. The Affiliate opens Profile → "Activity" and confirms the enrollment events are recorded.

**Rules & Edge Cases:**
- The enrollment requires the required details.
- The enrollment is reviewed and approved.
- The referral tools are unlocked on approval.
- Enrollment events (submitted, approved) are logged with the account and the timestamp.
- The affiliate program enrollment is audit-logged with the account and the timestamp.
