Skip to content

Commit 0e75abb

Browse files
committed
docs: add LOCAL_TESTING.md for SQL operations in local development
1 parent 97c9cb0 commit 0e75abb

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

docs/LOCAL_TESTING.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Local Testing Operations
2+
3+
Common SQL queries and operations for local development and testing.
4+
5+
## Opportunity & Recruiter Testing
6+
7+
### Fake Payment for an Opportunity
8+
9+
Payment status for opportunities is tracked on the **Organization** level via the `recruiterSubscriptionFlags` column. To simulate a paid subscription:
10+
11+
**If you know your organization ID:**
12+
13+
```sql
14+
UPDATE organization
15+
SET "recruiterSubscriptionFlags" = jsonb_build_object(
16+
'status', 'active',
17+
'provider', 'paddle',
18+
'subscriptionId', 'fake_sub_123',
19+
'createdAt', now(),
20+
'updatedAt', now(),
21+
'items', jsonb_build_array(
22+
jsonb_build_object('priceId', 'pri_fake_123', 'quantity', 5)
23+
)
24+
)
25+
WHERE id = 'YOUR_ORGANIZATION_ID';
26+
```
27+
28+
**If you know your opportunity ID:**
29+
30+
```sql
31+
UPDATE organization
32+
SET "recruiterSubscriptionFlags" = jsonb_build_object(
33+
'status', 'active',
34+
'provider', 'paddle',
35+
'subscriptionId', 'fake_sub_123',
36+
'createdAt', now(),
37+
'updatedAt', now(),
38+
'items', jsonb_build_array(
39+
jsonb_build_object('priceId', 'pri_fake_123', 'quantity', 5)
40+
)
41+
)
42+
WHERE id = (SELECT "organizationId" FROM opportunity WHERE id = 'YOUR_OPPORTUNITY_ID');
43+
```
44+
45+
**Key fields:**
46+
47+
| Field | Description |
48+
|-------|-------------|
49+
| `status` | Must be `'active'` for payment validation to pass |
50+
| `provider` | Use `'paddle'` |
51+
| `items[].quantity` | Number of opportunity "seats" available |
52+
53+
**To reset/remove fake payment:**
54+
55+
```sql
56+
UPDATE organization
57+
SET "recruiterSubscriptionFlags" = '{}'
58+
WHERE id = 'YOUR_ORGANIZATION_ID';
59+
```
60+

0 commit comments

Comments
 (0)