|
| 1 | +export const benchmarkEndpoints = [ |
| 2 | + { |
| 3 | + name: "health-check", |
| 4 | + method: "GET", |
| 5 | + path: "/health", |
| 6 | + expectedStatus: 200, |
| 7 | + scenario: "Public health probe used by uptime checks and deployment smoke tests." |
| 8 | + }, |
| 9 | + { |
| 10 | + name: "auth-register-client", |
| 11 | + method: "POST", |
| 12 | + path: "/api/auth/register", |
| 13 | + expectedStatus: 201, |
| 14 | + scenario: "Client creates a new account before posting freelance work.", |
| 15 | + json: ({ nextId }) => ({ |
| 16 | + email: `benchmark.client.${nextId()}@example.com`, |
| 17 | + password: "benchmark-pass-123", |
| 18 | + role: "client" |
| 19 | + }) |
| 20 | + }, |
| 21 | + { |
| 22 | + name: "auth-login-client", |
| 23 | + method: "POST", |
| 24 | + path: "/api/auth/login", |
| 25 | + expectedStatus: 200, |
| 26 | + scenario: "Existing client signs in with email and password.", |
| 27 | + json: () => ({ |
| 28 | + email: "benchmark.client@example.com", |
| 29 | + password: "benchmark-pass-123" |
| 30 | + }) |
| 31 | + }, |
| 32 | + { |
| 33 | + name: "auth-oauth-callback", |
| 34 | + method: "GET", |
| 35 | + path: "/api/auth/oauth/github/callback", |
| 36 | + expectedStatus: 200, |
| 37 | + scenario: "OAuth provider callback reaches the API callback endpoint." |
| 38 | + }, |
| 39 | + { |
| 40 | + name: "auth-refresh-token", |
| 41 | + method: "POST", |
| 42 | + path: "/api/auth/refresh", |
| 43 | + expectedStatus: 200, |
| 44 | + scenario: "Authenticated session requests a refreshed access token." |
| 45 | + }, |
| 46 | + { |
| 47 | + name: "users-list", |
| 48 | + method: "GET", |
| 49 | + path: "/api/users", |
| 50 | + expectedStatus: 200, |
| 51 | + scenario: "Directory view loads users for marketplace discovery." |
| 52 | + }, |
| 53 | + { |
| 54 | + name: "users-create-freelancer", |
| 55 | + method: "POST", |
| 56 | + path: "/api/users", |
| 57 | + expectedStatus: 201, |
| 58 | + scenario: "Freelancer profile is created with portfolio metadata.", |
| 59 | + json: ({ nextId }) => ({ |
| 60 | + email: `benchmark.freelancer.${nextId()}@example.com`, |
| 61 | + name: "Benchmark Freelancer", |
| 62 | + role: "freelancer", |
| 63 | + skills: ["node.js", "api performance", "sql"], |
| 64 | + hourlyRate: 85 |
| 65 | + }) |
| 66 | + }, |
| 67 | + { |
| 68 | + name: "jobs-list", |
| 69 | + method: "GET", |
| 70 | + path: "/api/jobs", |
| 71 | + expectedStatus: 200, |
| 72 | + scenario: "Marketplace job list is loaded by a freelancer browsing work." |
| 73 | + }, |
| 74 | + { |
| 75 | + name: "jobs-create", |
| 76 | + method: "POST", |
| 77 | + path: "/api/jobs", |
| 78 | + expectedStatus: 201, |
| 79 | + scenario: "Client posts a realistic API performance optimisation job.", |
| 80 | + json: ({ nextId }) => ({ |
| 81 | + title: `Benchmark API optimisation ${nextId()}`, |
| 82 | + description: "Audit API latency, add dashboard metrics, and reduce p95 response time for high-traffic endpoints.", |
| 83 | + budgetMin: 750, |
| 84 | + budgetMax: 2500, |
| 85 | + categoryId: "cat_api_engineering", |
| 86 | + skills: ["node.js", "express", "benchmarking", "observability"] |
| 87 | + }) |
| 88 | + }, |
| 89 | + { |
| 90 | + name: "proposals-list", |
| 91 | + method: "GET", |
| 92 | + path: "/api/proposals", |
| 93 | + expectedStatus: 200, |
| 94 | + scenario: "Client reviews proposals submitted for open work." |
| 95 | + }, |
| 96 | + { |
| 97 | + name: "proposals-create", |
| 98 | + method: "POST", |
| 99 | + path: "/api/proposals", |
| 100 | + expectedStatus: 201, |
| 101 | + scenario: "Freelancer submits a detailed proposal against a job.", |
| 102 | + json: ({ nextId }) => ({ |
| 103 | + jobId: `job_benchmark_${nextId()}`, |
| 104 | + freelancerId: "usr_benchmark_freelancer", |
| 105 | + coverLetter: "I will profile the critical API routes, publish reproducible results, and tune the slowest handlers.", |
| 106 | + bidAmount: 1200, |
| 107 | + deliveryDays: 5 |
| 108 | + }) |
| 109 | + }, |
| 110 | + { |
| 111 | + name: "payments-create", |
| 112 | + method: "POST", |
| 113 | + path: "/api/payments", |
| 114 | + expectedStatus: 201, |
| 115 | + scenario: "Client opens an escrow-style payment intent for accepted work.", |
| 116 | + json: ({ nextId }) => ({ |
| 117 | + proposalId: `prp_benchmark_${nextId()}`, |
| 118 | + amount: 1200, |
| 119 | + currency: "usd", |
| 120 | + customerId: "cus_benchmark_client" |
| 121 | + }) |
| 122 | + }, |
| 123 | + { |
| 124 | + name: "reviews-list", |
| 125 | + method: "GET", |
| 126 | + path: "/api/reviews", |
| 127 | + expectedStatus: 200, |
| 128 | + scenario: "Public profile loads completed-work reviews." |
| 129 | + }, |
| 130 | + { |
| 131 | + name: "reviews-create", |
| 132 | + method: "POST", |
| 133 | + path: "/api/reviews", |
| 134 | + expectedStatus: 201, |
| 135 | + scenario: "Client leaves a post-project review for a freelancer.", |
| 136 | + json: ({ nextId }) => ({ |
| 137 | + contractId: `ctr_benchmark_${nextId()}`, |
| 138 | + reviewerId: "usr_benchmark_client", |
| 139 | + revieweeId: "usr_benchmark_freelancer", |
| 140 | + rating: 5, |
| 141 | + comment: "Delivered the benchmark report quickly with clear latency improvements." |
| 142 | + }) |
| 143 | + }, |
| 144 | + { |
| 145 | + name: "messages-list", |
| 146 | + method: "GET", |
| 147 | + path: "/api/messages", |
| 148 | + expectedStatus: 200, |
| 149 | + scenario: "Conversation pane fetches project messages." |
| 150 | + }, |
| 151 | + { |
| 152 | + name: "messages-create", |
| 153 | + method: "POST", |
| 154 | + path: "/api/messages", |
| 155 | + expectedStatus: 201, |
| 156 | + scenario: "Client sends project clarification to a freelancer.", |
| 157 | + json: ({ nextId }) => ({ |
| 158 | + threadId: `thr_benchmark_${nextId()}`, |
| 159 | + senderId: "usr_benchmark_client", |
| 160 | + recipientId: "usr_benchmark_freelancer", |
| 161 | + body: "Please include p50, p95, p99, sustained RPS, peak RPS, error rate, and TTFB in the report." |
| 162 | + }) |
| 163 | + }, |
| 164 | + { |
| 165 | + name: "notifications-list", |
| 166 | + method: "GET", |
| 167 | + path: "/api/notifications", |
| 168 | + expectedStatus: 200, |
| 169 | + scenario: "User notification drawer loads recent events." |
| 170 | + }, |
| 171 | + { |
| 172 | + name: "notifications-create", |
| 173 | + method: "POST", |
| 174 | + path: "/api/notifications", |
| 175 | + expectedStatus: 201, |
| 176 | + scenario: "System creates a notification for a new proposal.", |
| 177 | + json: ({ nextId }) => ({ |
| 178 | + userId: "usr_benchmark_client", |
| 179 | + type: "proposal_received", |
| 180 | + title: "New benchmark proposal received", |
| 181 | + body: `Proposal ${nextId()} includes latency and throughput reporting.` |
| 182 | + }) |
| 183 | + }, |
| 184 | + { |
| 185 | + name: "uploads-create", |
| 186 | + method: "POST", |
| 187 | + path: "/api/uploads", |
| 188 | + expectedStatus: 201, |
| 189 | + scenario: "Freelancer uploads a small project artefact.", |
| 190 | + multipart: ({ nextId }) => ({ |
| 191 | + files: [ |
| 192 | + { |
| 193 | + field: "file", |
| 194 | + filename: `benchmark-report-${nextId()}.txt`, |
| 195 | + type: "text/plain", |
| 196 | + content: "Synthetic benchmark upload payload for API coverage.\n" |
| 197 | + } |
| 198 | + ] |
| 199 | + }) |
| 200 | + }, |
| 201 | + { |
| 202 | + name: "search-global", |
| 203 | + method: "GET", |
| 204 | + path: "/api/search?q=api%20benchmark", |
| 205 | + expectedStatus: 200, |
| 206 | + scenario: "Global search looks for API benchmark related marketplace data." |
| 207 | + }, |
| 208 | + { |
| 209 | + name: "admin-metrics", |
| 210 | + method: "GET", |
| 211 | + path: "/api/admin/metrics", |
| 212 | + expectedStatus: 200, |
| 213 | + auth: "admin", |
| 214 | + scenario: "Admin user loads platform metrics with a dedicated benchmark token." |
| 215 | + } |
| 216 | +]; |
0 commit comments