Testimony Workflow
This guide explains the complete testimony workflow from creation through completion, including all states, transitions, and available actions.
Overview
A testimony progresses through multiple states as clients and experts interact with it:
pending → offered → accepted → completed
↓ ↓
cancelled cancelledWorkflow Stages
1. Pending - Awaiting Offers
Initial State: When a client creates a testimony, it starts in the pending state.
What This Means:
- Testimony is visible to experts in the matching region
- No offers have been made yet
- Experts can view it in offerable testimonies
Who Can Do What:
- Experts → Create offers with price and timeline
- Client → Cancel testimony
Possible Transitions:
- →
offeredwhen first expert creates an offer - →
cancelledif client cancels
2. Offered - Receiving Expert Offers
Trigger: An expert creates an offer
What This Means:
- One or more experts have submitted offers
- Client can review and compare different offers
- Multiple experts can compete with different prices and timelines
Who Can Do What:
- Client → Initiate checkout for any offer
- Client → Cancel testimony
- Additional Experts → Create more offers
Possible Transitions:
- →
acceptedwhen client completes payment flow - →
cancelledif client cancels
Key Features:
- Multiple offers supported
- Competitive pricing possible
- Client chooses preferred expert
3. Accepted - Work in Progress
Trigger: Client completes the payment flow
The acceptance process involves three steps:
- Client provides billing/shipping address
- System creates Stripe checkout session
- Client receives checkout URL
Payment on Stripe
- Client completes payment on Stripe
- Stripe processes the transaction
- Commission is calculated
- Client confirms with Stripe session ID
- Testimony transitions to
acceptedstate - Expert is officially assigned
What This Means:
- Payment has been processed through Stripe
- Expert has been assigned to complete the work
acceptedOfferfield contains the chosen offer detailsexpertfield contains the assigned expert information- Commission will be transferred to the platform
Who Can Do What:
- Expert → Upload final document
Possible Transitions:
- →
completedwhen expert uploads the final document
Important Notes:
- Cannot be cancelled after payment (refund policies apply)
- Other offers are no longer relevant
- Only the assigned expert can complete the work
See Payment Integration Guide for detailed payment integration.
4. Completed - Work Delivered
Trigger: Expert uploads final testimony document
What This Means:
- Expert has uploaded the final PDF testimony
- Transaction is complete
- Client has access to the document
- Work appears in history for both parties
Who Can Do What:
- Client → Download testimony anytime
- Both → View in testimonies history
Possible Transitions:
- None (this is a final state)
5. Cancelled - No Longer Active
Trigger: Client or system cancels the testimony
What This Means:
- Testimony is no longer active
- No longer visible in active testimonies
- Cannot receive new offers or be accepted
cancellationReasonfield may contain the reason
Who Can Cancel:
- Client → From
pendingorofferedstates - System → In special edge cases
Cannot Be Cancelled:
- ❌ From
acceptedstate (payment already completed) - ❌ From
completedstate (work already finished)
Possible Transitions:
- None (this is a final state)
State Transition Reference
| Current State | Next State | Trigger | Actor |
|---|---|---|---|
pending | offered | Expert creates first offer | Expert |
pending | cancelled | Client cancels | Client |
offered | accepted | Payment completed | Client |
offered | cancelled | Client cancels | Client |
accepted | completed | Expert uploads document | Expert |
State Flow Diagram
┌─────────┐
│ pending │
└────┬────┘
│
┌──────────────┴──────────────┐
│ │
[first offer created] [client cancels]
│ │
↓ │
┌─────────┐ │
│ offered │ │
└────┬────┘ │
│ │
┌──────┴──────┐ │
│ │ │
[payment [client cancels] │
completed] │ │
│ └──────────────┬───────┘
│ │
↓ ↓
┌──────────┐ ┌───────────┐
│ accepted │ │ cancelled │
└────┬─────┘ └───────────┘
│ (final)
│
[expert uploads document]
│
↓
┌───────────┐
│ completed │
└───────────┘
(final)Common Scenarios
Happy Path
- Client creates testimony (
pending) - Expert creates offer (
offered) - Client completes payment (
accepted) - Expert uploads document (
completed) - Client downloads testimony
Early Cancellation
- Client creates testimony (
pending) - Client decides not to proceed
- Client cancels (
cancelled)
Multiple Offers
- Client creates testimony (
pending) - Expert A creates offer (
offered) - Expert B creates offer (still
offered) - Expert C creates offer (still
offered) - Client chooses Expert B's offer
- Client completes payment (
acceptedwith Expert B)
State Properties
Pending State
state:"pending"expert:nullacceptedOffer:null- Visible in offerable testimonies list
Offered State
state:"offered"expert:nullacceptedOffer:null- Has one or more associated offers
Accepted State
state:"accepted"expert: Assigned expert objectacceptedOffer: Chosen offer object- Payment completed
Completed State
state:"completed"expert: Assigned expert objectacceptedOffer: Chosen offer object- Document available for download
Cancelled State
state:"cancelled"cancellationReason: Optional reason string