veza/veza-docs/ORIGIN/ORIGIN_BUSINESS_LOGIC.md
okinrev b7955a680c P0: stabilisation backend/chat/stream + nouvelle base migrations v1
Backend Go:
- Remplacement complet des anciennes migrations par la base V1 alignée sur ORIGIN.
- Durcissement global du parsing JSON (BindAndValidateJSON + RespondWithAppError).
- Sécurisation de config.go, CORS, statuts de santé et monitoring.
- Implémentation des transactions P0 (RBAC, duplication de playlists, social toggles).
- Ajout d’un job worker structuré (emails, analytics, thumbnails) + tests associés.
- Nouvelle doc backend : AUDIT_CONFIG, BACKEND_CONFIG, AUTH_PASSWORD_RESET, JOB_WORKER_*.

Chat server (Rust):
- Refonte du pipeline JWT + sécurité, audit et rate limiting avancé.
- Implémentation complète du cycle de message (read receipts, delivered, edit/delete, typing).
- Nettoyage des panics, gestion d’erreurs robuste, logs structurés.
- Migrations chat alignées sur le schéma UUID et nouvelles features.

Stream server (Rust):
- Refonte du moteur de streaming (encoding pipeline + HLS) et des modules core.
- Transactions P0 pour les jobs et segments, garanties d’atomicité.
- Documentation détaillée de la pipeline (AUDIT_STREAM_*, DESIGN_STREAM_PIPELINE, TRANSACTIONS_P0_IMPLEMENTATION).

Documentation & audits:
- TRIAGE.md et AUDIT_STABILITY.md à jour avec l’état réel des 3 services.
- Cartographie complète des migrations et des transactions (DB_MIGRATIONS_*, DB_TRANSACTION_PLAN, AUDIT_DB_TRANSACTIONS, TRANSACTION_TESTS_PHASE3).
- Scripts de reset et de cleanup pour la lab DB et la V1.

Ce commit fige l’ensemble du travail de stabilisation P0 (UUID, backend, chat et stream) avant les phases suivantes (Coherence Guardian, WS hardening, etc.).
2025-12-06 11:14:38 +01:00

26 KiB

ORIGIN_BUSINESS_LOGIC.md

📋 RÉSUMÉ EXÉCUTIF

Ce document définit toutes les règles métier (business logic) de la plateforme Veza. Il couvre les prix, commissions, workflows utilisateurs, machines à états, règles de validation, calculs complexes, notifications, limites, quotas, et SLAs. Ces règles sont immuables et garantissent la cohérence des comportements métier pendant 24 mois.

🎯 OBJECTIFS

Objectif Principal

Centraliser et définir de manière exhaustive toutes les règles métier de la plateforme Veza pour garantir la cohérence, la traçabilité, et la maintenabilité pendant 24 mois.

Objectifs Secondaires

  • Standardiser les calculs financiers (prix, commissions, taxes)
  • Définir les workflows utilisateurs de bout en bout
  • Spécifier les transitions d'état valides
  • Documenter les règles de validation
  • Établir les limites et quotas par rôle

📖 TABLE DES MATIÈRES

  1. Pricing Models
  2. Commission Structure
  3. User Workflows
  4. State Machines
  5. Business Rules Engine
  6. Validation Rules
  7. Complex Calculations
  8. Notification Rules
  9. Limits & Quotas
  10. SLA Definitions

🔒 RÈGLES IMMUABLES

  1. Prix TOUJOURS en centimes (éviter erreurs d'arrondi)
  2. Commissions CALCULÉES avant taxes
  3. Remboursements MAX 30 jours après achat
  4. State transitions VALIDÉES (pas de transitions invalides)
  5. Limites APPLIQUÉES côté serveur (never trust client)
  6. Notifications ASYNCHRONES (via queue, pas bloquant)
  7. Calculs financiers AUDITÉS (log toutes les transactions)
  8. Quotas PAR RÔLE (user < creator < premium < admin)
  9. SLAs MESURABLES (métriques, alerting)
  10. Règles VERSIONÉES (changements documentés)

1. PRICING MODELS

1.1 Product Pricing

Fixed Price:

Product price: $29.99
No variation

Pay What You Want (PWYW):

Minimum price: $5.00 (set by seller)
Suggested price: $15.00
Buyer chooses: $10.00 - $100.00+

Tiered Licensing:

Basic License:   $29.99  (personal use)
Standard License: $49.99  (commercial use, 10k streams)
Premium License:  $99.99  (unlimited commercial use)
Exclusive License: $499.99 (buyer gets exclusive rights)

Subscription Plans:

Free:     $0/month
  - Upload limit: 5 tracks/month
  - Download: No
  - Analytics: Basic
  - Storage: 1 GB

Creator:  $9.99/month ($99.99/year, 17% savings)
  - Upload limit: Unlimited
  - Download: Yes
  - Analytics: Advanced
  - Storage: 50 GB
  - Sell products: Yes (15% commission)

Premium:  $19.99/month ($199.99/year, 17% savings)
  - All Creator features
  - Priority support
  - No ads
  - Storage: 200 GB
  - Sell products: Yes (10% commission)
  - Collaboration tools

1.2 Dynamic Pricing

Early Bird Discounts:

First 100 buyers: 20% off
Next 400 buyers:  10% off
After 500 buyers: Regular price

Bundle Pricing:

Single product:    $29.99
3-product bundle:  $79.99 (11% savings)
5-product bundle:  $119.99 (20% savings)

Volume Discounts (for API/enterprise):

0-1,000 requests:   $0.01/request
1,001-10,000:       $0.008/request
10,001-100,000:     $0.006/request
100,001+:           $0.004/request

1.3 Currency Support

Supported Currencies:

USD (default)
EUR
GBP
CAD
AUD

Exchange Rates:

Source: European Central Bank (ECB) API
Update frequency: Daily at 00:00 UTC
Cache: 24 hours
Fallback: Manual rates (updated weekly)

Conversion Formula:

Price_Target = Price_USD * Exchange_Rate
Rounded to 2 decimals (0.01 precision)

Example:
$29.99 USD * 0.92 EUR/USD = 27.59 EUR

2. COMMISSION STRUCTURE

2.1 Platform Commission

Marketplace Sales:

User:    N/A (cannot sell)
Creator: 15% commission
Premium: 10% commission
Admin:   N/A (no commission on own sales)

Example (Creator selling $100 product):
Product price:        $100.00
Platform commission:  -$15.00 (15%)
Payment processing:   -$3.20 (Stripe 2.9% + $0.30)
Seller receives:      $81.80

Subscription Revenue Share:

Streaming plays:
- Creator receives $0.004 per play (avg)
- Platform keeps remaining revenue from ads/subscriptions

Example (10,000 plays):
Creator revenue: 10,000 * $0.004 = $40.00

2.2 Payment Processing Fees

Stripe (default):

Card payments:    2.9% + $0.30
ACH (US):         0.8% (max $5.00)
SEPA (EU):        0.8% (max €5.00)
International:    +1.5% currency conversion

PayPal (alternative):

Domestic:         2.99% + $0.49
International:    4.49% + $0.49

Crypto (future):

Bitcoin:          1% + network fees
Ethereum:         1% + gas fees

2.3 Payout Schedule

Minimum Payout:

$50.00 minimum balance required

Payout Frequency:

Weekly:   Every Monday (for balances ≥ $50)
Manual:   Anytime (for balances ≥ $100)

Payout Methods:

Stripe Connect:   1-3 business days
PayPal:           Instant
Bank Transfer:    3-5 business days

2.4 Refund Policy

Timeframe:

Digital products: 14 days
Subscription:     Pro-rated to end of billing cycle
Services:         30 days (or as agreed)

Refund Amount:

Full refund:      100% (within 7 days, no downloads)
Partial refund:   50% (7-14 days, or after downloads)
No refund:        After 30 days

Commission on Refunds:

Platform commission: Refunded to buyer
Payment processing:  NOT refunded (non-recoverable)

Example (refund of $100 sale):
Buyer paid:              $100.00
Seller received:         $81.80
Refund to buyer:         $100.00
Platform loses:          $15.00 (commission)
Seller loses:            $18.20 (commission + processing fees)

3. USER WORKFLOWS

3.1 User Onboarding

Flow:

graph TD
    A[Visit Homepage] --> B{Has Account?}
    B -->|No| C[Click Sign Up]
    B -->|Yes| D[Click Log In]
    C --> E[Enter Email/Password]
    E --> F[Receive Verification Email]
    F --> G[Click Verification Link]
    G --> H[Email Verified]
    H --> I[Complete Profile]
    I --> J[Choose Role: Listener/Creator]
    J --> K{Creator?}
    K -->|Yes| L[Upload First Track]
    K -->|No| M[Browse Feed]
    L --> N[Onboarding Complete]
    M --> N
    D --> O[Enter Credentials]
    O --> P[Dashboard]

Steps:

  1. Registration (< 2 minutes)

    • Email, username, password
    • Captcha (after 3 failed attempts)
    • Terms acceptance
  2. Email Verification (< 5 minutes)

    • Send verification email
    • Link expires in 24 hours
    • Resend option (max 3 times)
  3. Profile Setup (< 5 minutes)

    • Display name, bio, avatar
    • Location (optional)
    • Social links (optional)
  4. Role Selection

    • Listener (default)
    • Creator (requires verification for monetization)
  5. First Interaction

    • Creator: Upload first track
    • Listener: Follow 3 suggested users

3.2 Track Upload Workflow

Flow:

1. Click "Upload Track"
2. Select audio file (drag & drop or browse)
3. File validation (format, size, duration)
4. Upload to S3 (resumable, chunked)
5. Extract metadata (ID3 tags)
6. Generate waveform (background job)
7. Fill metadata form:
   - Title, artist, genre
   - BPM, key (optional)
   - Description
   - Cover art
   - Visibility (public, unlisted, private)
   - Downloadable (yes/no)
8. Preview track
9. Publish
10. Track processing (transcode to multiple bitrates)
11. Track live (appears in feed)

Processing Time:

Upload:          ~1-5 min (depends on file size)
Metadata extract: ~5-10 sec
Waveform:        ~10-30 sec
Transcode:       ~1-3 min
Total:           ~2-9 min

3.3 Purchase Workflow

Flow:

1. Browse marketplace
2. Click product → View details
3. Listen to preview (30-60 sec)
4. Click "Add to Cart"
5. Continue shopping OR Checkout
6. Cart review:
   - Item list
   - Subtotal
   - Discount code (optional)
   - Tax calculation
   - Total
7. Click "Proceed to Checkout"
8. Select payment method:
   - Credit card (Stripe)
   - PayPal
   - (Future: Crypto)
9. Enter billing info
10. Review order
11. Click "Place Order"
12. Payment processing (Stripe/PayPal)
13. Payment successful:
    - Order confirmation email
    - Download links available
    - Invoice generated
14. Download files

Abandonment Recovery:

Cart abandoned for 1 hour:  Email reminder
Cart abandoned for 24 hours: Email with 10% discount
Cart abandoned for 7 days:   Email with 15% discount (final)

3.4 Subscription Workflow

Flow:

1. Click "Upgrade to Premium"
2. View plan comparison
3. Select plan (monthly/annual)
4. Enter payment info (saved for recurring)
5. Review subscription terms
6. Click "Subscribe"
7. Payment processed
8. Subscription active
9. Invoice sent monthly/annually
10. Auto-renewal (7 days before expiry)
11. Cancellation:
    - Access until end of billing period
    - No auto-renewal
    - Option to re-subscribe anytime

Trial Period:

Premium plan: 14-day free trial
- Full access
- No payment required upfront
- Reminder 3 days before trial ends
- Auto-convert to paid (if card on file)
- Cancel anytime during trial (no charge)

4. STATE MACHINES

4.1 Order State Machine

States:

pending     → Initial state after order created
paid        → Payment successful
processing  → Order being fulfilled (digital delivery)
completed   → Order fulfilled, files delivered
cancelled   → Order cancelled (before payment)
refunded    → Order refunded (after payment)
failed      → Payment failed

Transitions:

stateDiagram-v2
    [*] --> pending
    pending --> paid: Payment successful
    pending --> cancelled: User cancels
    pending --> failed: Payment failed
    paid --> processing: Start fulfillment
    processing --> completed: Delivery successful
    paid --> refunded: Refund requested (<14 days)
    completed --> refunded: Refund requested (<14 days)
    cancelled --> [*]
    failed --> [*]
    completed --> [*]
    refunded --> [*]

Business Rules:

- pending → paid: Stripe webhook confirms payment
- paid → processing: Triggered immediately (async job)
- processing → completed: Files delivered to buyer's library
- * → refunded: Only if within refund window (14 days)
- * → cancelled: Only if order not yet paid

4.2 Moderation State Machine

States:

submitted   → Content submitted by user
pending     → Awaiting moderation
approved    → Approved by moderator
rejected    → Rejected by moderator
flagged     → Flagged by users/auto-detection
banned      → Permanently banned

Transitions:

stateDiagram-v2
    [*] --> submitted
    submitted --> pending: Auto-check complete
    pending --> approved: Moderator approves
    pending --> rejected: Moderator rejects
    approved --> flagged: User reports
    flagged --> approved: False positive
    flagged --> rejected: Violates policy
    rejected --> banned: Repeat offender (3 strikes)
    banned --> [*]

Auto-Moderation Rules:

1. NSFW Detection (AI):
   - Explicit content → flagged
   - Hate speech → flagged
   - Violence → flagged

2. Spam Detection:
   - Identical title/description → flagged
   - Excessive links → flagged
   - Bot patterns → flagged

3. Copyright Detection:
   - Audio fingerprinting (ACRCloud)
   - Matches known tracks → flagged

If flagged → pending moderation
If auto-approved → approved (low risk content)

4.3 User Account State Machine

States:

registered      → Account created
verified        → Email verified
active          → Account active, can use platform
inactive        → Account inactive (user choice)
suspended       → Temporarily suspended (violation)
banned          → Permanently banned
deleted         → Account deleted (GDPR)

Transitions:

registered → verified: Email verification
verified → active: Profile completed
active → inactive: User deactivates
inactive → active: User reactivates
active → suspended: Policy violation (1-30 days)
suspended → active: Suspension period ends
suspended → banned: Multiple violations (3 strikes)
active → banned: Severe violation (illegal content)
* → deleted: User requests deletion (GDPR right)

5. BUSINESS RULES ENGINE

5.1 Track Publication Rules

Rule 1: Minimum Track Duration

IF track.duration < 30 seconds THEN
  REJECT with error "Track too short (min 30 seconds)"
END IF

Rule 2: Maximum Track Duration

IF track.duration > 3600 seconds (1 hour) THEN
  REJECT with error "Track too long (max 1 hour)"
END IF

Rule 3: File Size Limits

IF user.role == "user" AND file.size > 100MB THEN
  REJECT with error "File too large (max 100MB for free users)"
ELSE IF user.role IN ["creator", "premium"] AND file.size > 500MB THEN
  REJECT with error "File too large (max 500MB)"
END IF

Rule 4: Upload Limits

IF user.role == "user" AND user.tracks_this_month >= 5 THEN
  REJECT with error "Upload limit reached (5/month for free users)"
ELSE IF user.role == "creator" AND user.tracks_this_day >= 50 THEN
  REJECT with error "Upload limit reached (50/day for creators)"
END IF

5.2 Pricing Rules

Rule 1: Minimum Product Price

IF product.price < 1.00 THEN
  REJECT with error "Minimum price is $1.00"
END IF

Rule 2: Maximum Product Price

IF product.price > 10000.00 THEN
  REJECT with error "Maximum price is $10,000"
END IF

Rule 3: PWYW Minimum

IF product.pricing_model == "pwyw" AND product.minimum_price < 1.00 THEN
  REJECT with error "PWYW minimum must be at least $1.00"
END IF

5.3 Discount Rules

Rule 1: Discount Code Validity

IF discount_code.valid_from > NOW() THEN
  REJECT with error "Discount code not yet valid"
ELSE IF discount_code.valid_until < NOW() THEN
  REJECT with error "Discount code expired"
ELSE IF discount_code.usage_count >= discount_code.usage_limit THEN
  REJECT with error "Discount code usage limit reached"
END IF

Rule 2: Minimum Purchase Amount

IF discount_code.minimum_purchase_amount IS NOT NULL 
   AND cart.subtotal < discount_code.minimum_purchase_amount THEN
  REJECT with error "Minimum purchase amount not met"
END IF

Rule 3: Maximum Discount Amount

IF discount_code.discount_type == "percentage" THEN
  discount_amount = cart.subtotal * (discount_code.discount_value / 100)
  IF discount_code.maximum_discount_amount IS NOT NULL 
     AND discount_amount > discount_code.maximum_discount_amount THEN
    discount_amount = discount_code.maximum_discount_amount
  END IF
END IF

6. VALIDATION RULES

6.1 User Input Validation

Email:

Pattern: ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
Max length: 255 characters
Unique: Must not already exist (case-insensitive)

Username:

Pattern: ^[a-zA-Z0-9_]{3,30}$
Min length: 3 characters
Max length: 30 characters
Unique: Must not already exist (case-insensitive)
Reserved: admin, root, system, veza, api, www (blocked)

Password:

Min length: 12 characters
Max length: 128 characters
Must contain:
  - At least 1 uppercase letter
  - At least 1 lowercase letter
  - At least 1 digit
  - At least 1 special character (!@#$%^&*)
Cannot contain:
  - Email or username
  - Common passwords (check against Have I Been Pwned API)
  - Sequential characters (abc, 123)

Bio:

Max length: 500 characters
Allowed characters: Any UTF-8
Blocked patterns: Excessive links (max 3), hate speech (AI detection)

6.2 Track Metadata Validation

Title:

Min length: 1 character
Max length: 255 characters
Required: Yes

Artist:

Max length: 255 characters
Required: No (defaults to creator's name)

Genre:

Enum: electronic, house, techno, trance, dubstep, drum-and-bass, ...
Required: Yes

BPM:

Min: 60
Max: 200
Required: No

Duration:

Min: 30 seconds
Max: 3600 seconds (1 hour)
Required: Yes (auto-extracted from file)

6.3 Financial Validation

Product Price:

Min: $1.00
Max: $10,000.00
Precision: 2 decimals
Currency: USD, EUR, GBP, CAD, AUD

Discount Percentage:

Min: 1%
Max: 99%
Integer: Yes (no fractional percentages)

Discount Fixed Amount:

Min: $0.01
Max: $1,000.00
Precision: 2 decimals

7. COMPLEX CALCULATIONS

7.1 Order Total Calculation

Formula:

subtotal = SUM(item.price for item in cart.items)

discount_amount = 0
IF discount_code IS NOT NULL THEN
  IF discount_code.discount_type == "percentage" THEN
    discount_amount = subtotal * (discount_code.discount_value / 100)
    IF discount_code.maximum_discount_amount IS NOT NULL THEN
      discount_amount = MIN(discount_amount, discount_code.maximum_discount_amount)
    END IF
  ELSE IF discount_code.discount_type == "fixed_amount" THEN
    discount_amount = discount_code.discount_value
  END IF
END IF

taxable_amount = subtotal - discount_amount

tax_rate = get_tax_rate(user.country, user.state)
tax_amount = taxable_amount * tax_rate

total = subtotal - discount_amount + tax_amount

ROUND(total, 2)  // Round to 2 decimals

Example:

Item 1:           $29.99
Item 2:           $49.99
Subtotal:         $79.98

Discount (20%):   -$16.00
Taxable:          $63.98

Tax (10%):        +$6.40
Total:            $70.38

7.2 Seller Payout Calculation

Formula:

order_total = $100.00

platform_commission_rate = 0.15  // 15% for creators
platform_commission = order_total * platform_commission_rate
= $100.00 * 0.15 = $15.00

payment_processing_fee = (order_total * 0.029) + 0.30
= ($100.00 * 0.029) + $0.30 = $3.20

seller_payout = order_total - platform_commission - payment_processing_fee
= $100.00 - $15.00 - $3.20 = $81.80

Example:

Order total:              $100.00
Platform commission (15%): -$15.00
Payment processing (2.9% + $0.30): -$3.20
Seller receives:          $81.80

7.3 Streaming Royalty Calculation

Formula:

monthly_subscription_revenue = $100,000
total_plays_this_month = 10,000,000

per_play_rate = monthly_subscription_revenue / total_plays_this_month
= $100,000 / 10,000,000 = $0.01 per play

track_plays = 50,000
track_royalty = track_plays * per_play_rate
= 50,000 * $0.01 = $500.00

creator_share = 0.70  // 70% to creator, 30% platform
creator_payout = track_royalty * creator_share
= $500.00 * 0.70 = $350.00

Minimum Payout:

IF creator_balance >= $50.00 THEN
  process_payout(creator_id, creator_balance)
ELSE
  hold_until_minimum_reached()
END IF

7.4 Tax Calculation

US Sales Tax (varies by state):

state_tax_rates = {
  "CA": 0.0725,  // California: 7.25%
  "TX": 0.0625,  // Texas: 6.25%
  "NY": 0.04,    // New York: 4%
  "FL": 0.06,    // Florida: 6%
  // ... other states
}

tax_amount = subtotal * state_tax_rates[buyer.state]

EU VAT (value-added tax):

country_vat_rates = {
  "DE": 0.19,  // Germany: 19%
  "FR": 0.20,  // France: 20%
  "UK": 0.20,  // UK: 20%
  "ES": 0.21,  // Spain: 21%
  // ... other countries
}

IF buyer.has_valid_vat_number THEN
  // Reverse charge (B2B)
  vat_amount = 0
ELSE
  // Standard VAT (B2C)
  vat_amount = subtotal * country_vat_rates[buyer.country]
END IF

8. NOTIFICATION RULES

8.1 Email Notifications

Transactional Emails (always sent):

- Account verification
- Password reset
- Order confirmation
- Order shipped (physical goods)
- Refund processed
- Subscription activated
- Subscription expiring (7 days before)
- Payment failed

Marketing Emails (opt-in):

- New features announcement
- Promotional offers
- Product recommendations
- Weekly digest (new tracks from followed users)
- Monthly summary (stats, achievements)

Cadence Limits:

Transactional: No limit
Marketing:     Max 2/week (user can opt out)

8.2 Push Notifications

Real-time Notifications:

- New message received
- New follower
- Track liked
- Track commented
- Mention in comment/post
- Order placed (for sellers)
- Payout processed

Batched Notifications (hourly):

- Multiple likes (5+ likes → "Your track has 5 new likes")
- Multiple comments (3+ comments → "Your track has 3 new comments")

Quiet Hours:

Default: 22:00 - 08:00 (user's timezone)
User can configure in settings

8.3 In-App Notifications

Notification Types:

- Follow: "John Doe started following you"
- Like: "Jane Smith liked your track 'Summer Vibes'"
- Comment: "User123 commented on your track"
- Mention: "You were mentioned in a post"
- Order: "New order #12345 from BuyerName"
- System: "Your track 'Track Name' has been approved"

Notification Grouping:

IF same_type AND same_resource AND time_diff < 1 hour THEN
  group_notifications()
  // "John and 5 others liked your track"
END IF

Notification Expiry:

Mark as read: User clicks notification
Auto-expire:  30 days (unread notifications)
Delete:       90 days (all notifications)

9. LIMITS & QUOTAS

9.1 Upload Limits

Free User:

Tracks:      5/month
File size:   100 MB/file
Storage:     1 GB total
Playlist:    10 playlists

Creator:

Tracks:      Unlimited (50/day rate limit)
File size:   500 MB/file
Storage:     50 GB total
Playlist:    Unlimited
Products:    Unlimited

Premium:

Tracks:      Unlimited (100/day rate limit)
File size:   500 MB/file
Storage:     200 GB total
Playlist:    Unlimited
Products:    Unlimited
Collaboration: Yes

9.2 API Rate Limits

Public API (unauthenticated):

100 requests/hour per IP

Authenticated API:

Free:     1,000 requests/hour
Creator:  5,000 requests/hour
Premium:  10,000 requests/hour
Enterprise: Custom

WebSocket Connections:

Max connections per user: 5
Max rooms per user:       50
Max messages per minute:  60

9.3 Social Limits

Follows:

Free:     Follow up to 500 users
Creator:  Follow up to 2,000 users
Premium:  Follow up to 5,000 users

Messages:

Free:     50 DMs/day
Creator:  200 DMs/day
Premium:  Unlimited

Comments:

All users: 100 comments/day
Rate limit: 1 comment/second

10. SLA DEFINITIONS

10.1 Uptime SLA

Target: 99.95% uptime

Allowed downtime per month: 21.6 minutes
Allowed downtime per year:  4.38 hours

Credits (for Premium/Enterprise):

Uptime 99.95% - 99.99%:  No credit
Uptime 99.00% - 99.95%:  10% monthly fee credit
Uptime 95.00% - 99.00%:  25% monthly fee credit
Uptime < 95.00%:         50% monthly fee credit

Exclusions:

- Scheduled maintenance (announced 7 days in advance)
- Force majeure (natural disasters, wars, etc.)
- Third-party failures (AWS, Stripe, etc.)
- User-caused issues (DDoS from user's network)

10.2 Performance SLA

API Response Time:

p50 (median):  < 50ms
p95:           < 100ms
p99:           < 500ms

Page Load Time:

Time to First Byte (TTFB):  < 200ms
First Contentful Paint:     < 1.5s
Time to Interactive:        < 3.5s

Audio Streaming:

Buffering:          < 1 second initial
Rebuffering rate:   < 0.5%
Audio start time:   < 2 seconds

10.3 Support SLA

Response Time:

Critical (platform down):   < 15 minutes
High (feature broken):      < 2 hours
Medium (minor issue):       < 8 hours
Low (question/enhancement): < 24 hours

Resolution Time:

Critical:  < 4 hours
High:      < 24 hours
Medium:    < 3 days
Low:       < 7 days

Support Channels:

Free users:      Email, Help Center
Premium users:   Email, Chat, Priority support
Enterprise:      Phone, Dedicated account manager

10.4 Payout SLA

Processing Time:

Stripe Connect:   1-3 business days
PayPal:           Instant (< 1 hour)
Bank Transfer:    3-5 business days

Failure Handling:

IF payout_failed THEN
  retry_after_24_hours()
  IF retry_failed THEN
    notify_user_email()
    manual_review_by_finance_team()
  END IF
END IF

CHECKLIST DE VALIDATION

Pricing

  • All prices in centimes (avoid rounding errors)
  • Currency conversion rates updated daily
  • Commission structure documented
  • Refund policy defined

Workflows

  • All user workflows documented
  • State machines defined
  • Valid state transitions specified
  • Business rules engine implemented

Calculations

  • Financial calculations audited
  • Tax calculations compliant
  • Royalty calculations transparent
  • Rounding handled correctly

Limits & Quotas

  • Per-role limits enforced
  • Rate limiting implemented
  • Quota monitoring enabled
  • Graceful degradation

SLAs

  • Uptime targets defined
  • Performance targets measurable
  • Support SLAs documented
  • Monitoring & alerting configured

📊 MÉTRIQUES DE SUCCÈS

Business Metrics

  • Conversion Rate: > 3% (visitors → purchases)
  • Average Order Value: > $50
  • Customer Lifetime Value: > $500
  • Churn Rate: < 5%/month

Operational Metrics

  • Uptime: 99.95%
  • API Response Time p95: < 100ms
  • Support Response Time: < 2 hours (high priority)
  • Payout Success Rate: > 99%

🔄 HISTORIQUE DES VERSIONS

Version Date Changements
1.0.0 2025-11-02 Version initiale - Règles métier complètes

⚠️ AVERTISSEMENT

CES RÈGLES MÉTIER SONT IMMUABLES

Les règles métier définies ici sont VERROUILLÉES. Toute modification nécessite:

  1. RFC Business Logic Change avec impact analysis
  2. Approbation Product Owner + Legal (si implications légales)
  3. Migration plan pour données existantes
  4. Communication aux utilisateurs (si impact visible)

Les changements de règles financières nécessitent validation CFO.


Document créé par: Product Team + Business Analysts
Date de création: 2025-11-02
Prochaine révision: Trimestrielle
Propriétaire: Chief Product Officer

Statut: APPROUVÉ ET VERROUILLÉ