Payment & Reward Flow
This document describes how points and referee rewards are handled in Peppercheck.
1. Prerequisites
-
Task Lifecycle — Point lock occurs at task creation, settlement at judgement confirmation.
-
Subscription — Subscriptions grant monthly points.
|
Implementation Status
Currently implemented:
Planned / Not yet implemented:
|
2. Overview
-
Tasker purchases subscriptions, which grant monthly points.
-
Tasker locks points when creating tasks (requesting reviews); points are settled on judgement confirmation.
-
Referee completes reviews and earns rewards (tracked internally; Stripe Connect payouts planned).
| UX copy shows "Tasker pays Referee directly", but legally Peppercheck collects payments first and pays Referees as contractors (marketplace model). |
4. Point Lock / Settle Mechanism
Points follow a two-phase model to ensure funds are reserved but not consumed until the review process completes.
4.1. Phases
-
Lock — When a Task is opened, points are locked in the Tasker’s wallet via
lock_points(). Thelockedcolumn onpoint_walletsincreases; the walletbalanceis unchanged. Available balance =balance - locked. -
Settle — When a Judgement is confirmed (or evidence times out), locked points are consumed via
consume_points(). Bothbalanceandlockeddecrease. -
Unlock (failure path) — If a matching fails, locked points are returned via
unlock_points(). Thelockedcolumn decreases; balance remains unchanged.
4.2. Database Functions
| Function | Description |
|---|---|
|
Lock points in the wallet. Raises exception if available ( |
|
Release locked points back to available. Raises exception if locked amount is insufficient. |
|
Settle: deduct from both |
5. Reward System (Internal)
Referee rewards are currently tracked internally. Stripe Connect payouts are planned but not yet implemented.
5.1. reward_wallets Table
| Column | Type | Description |
|---|---|---|
|
uuid (PK, FK → auth.users) |
Referee user ID |
|
integer |
Current reward balance (≥ 0) |
|
timestamptz |
Timestamps |
5.2. reward_ledger Table
| Column | Type | Description |
|---|---|---|
|
uuid (PK) |
Ledger entry ID |
|
uuid (FK → auth.users) |
Referee user ID |
|
integer |
Reward amount |
|
reward_reason (enum) |
Reason for the entry |
|
text |
Optional description |
|
uuid |
Related entity ID (e.g. judgement ID) |
|
timestamptz |
Timestamp |
6. Stripe Connect (Planned)
When implemented, Peppercheck will use Stripe Connect to pay Referees:
-
Account Type: Express or Custom accounts
-
Charge Model: Separate Charges & Transfers
-
Reward Transfer: Per completed review, from Platform to Referee Stripe balance
-
Payouts: Monthly automatic payout from Referee Stripe balance to bank account