Skip to content

Commit d62129d

Browse files
authored
feat: recruiter paddle tests (#3395)
1 parent afa471d commit d62129d

3 files changed

Lines changed: 481 additions & 0 deletions

File tree

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import type {
2+
SubscriptionCreatedEvent,
3+
SubscriptionCanceledEvent,
4+
TransactionCompletedEvent,
5+
} from '@paddle/paddle-node-sdk';
6+
7+
export const recruiterSubscriptionCreated = {
8+
eventId: 'evt_01jrec123subscription001',
9+
notificationId: 'ntf_01jrec123subscription001',
10+
eventType: 'subscription.created',
11+
occurredAt: '2025-04-15T14:49:12.287686Z',
12+
data: {
13+
id: 'sub_01jrec123subscription001',
14+
status: 'active',
15+
customerId: 'ctm_01jqy42s56qwrj14pfmaeav2f2',
16+
customData: {
17+
user_id: 'recruiter-user-1',
18+
opportunity_id: '550e8400-e29b-41d4-a716-446655440003',
19+
},
20+
items: [
21+
{
22+
price: {
23+
id: 'pri_recruiter_monthly',
24+
productId: 'pro_recruiter',
25+
description: 'Recruiter Monthly',
26+
type: 'standard',
27+
name: 'Recruiter Monthly',
28+
billingCycle: {
29+
interval: 'month',
30+
frequency: 1,
31+
},
32+
unitPrice: { amount: '9900', currencyCode: 'USD' },
33+
customData: {
34+
batch_size: 100,
35+
reminders: true,
36+
show_slack: true,
37+
},
38+
},
39+
quantity: 1,
40+
status: 'active',
41+
},
42+
],
43+
billingCycle: {
44+
interval: 'month',
45+
frequency: 1,
46+
},
47+
startedAt: '2025-04-15T14:49:12.070563Z',
48+
createdAt: '2025-04-15T14:49:12.070563411Z',
49+
updatedAt: '2025-04-15T14:49:12.070563411Z',
50+
},
51+
} as unknown as SubscriptionCreatedEvent;
52+
53+
export const recruiterSubscriptionCanceled = {
54+
eventId: 'evt_01jrec123subscription002',
55+
notificationId: 'ntf_01jrec123subscription002',
56+
eventType: 'subscription.canceled',
57+
occurredAt: '2025-04-15T15:00:00.000000Z',
58+
data: {
59+
id: 'sub_01jrec123subscription001',
60+
status: 'canceled',
61+
customerId: 'ctm_01jqy42s56qwrj14pfmaeav2f2',
62+
customData: {
63+
user_id: 'recruiter-user-1',
64+
opportunity_id: '550e8400-e29b-41d4-a716-446655440003',
65+
},
66+
items: [
67+
{
68+
price: {
69+
id: 'pri_recruiter_monthly',
70+
productId: 'pro_recruiter',
71+
description: 'Recruiter Monthly',
72+
type: 'standard',
73+
name: 'Recruiter Monthly',
74+
billingCycle: {
75+
interval: 'month',
76+
frequency: 1,
77+
},
78+
unitPrice: { amount: '9900', currencyCode: 'USD' },
79+
customData: {
80+
batch_size: 100,
81+
reminders: true,
82+
show_slack: true,
83+
},
84+
},
85+
quantity: 1,
86+
status: 'canceled',
87+
},
88+
],
89+
billingCycle: {
90+
interval: 'month',
91+
frequency: 1,
92+
},
93+
canceledAt: '2025-04-15T15:00:00.000000Z',
94+
createdAt: '2025-04-15T14:49:12.070563411Z',
95+
updatedAt: '2025-04-15T15:00:00.000000Z',
96+
},
97+
} as unknown as SubscriptionCanceledEvent;
98+
99+
export const recruiterTransactionCompleted = {
100+
eventId: 'evt_01jrec123transaction001',
101+
notificationId: 'ntf_01jrec123transaction001',
102+
eventType: 'transaction.completed',
103+
occurredAt: '2025-04-15T14:50:00.000000Z',
104+
data: {
105+
id: 'txn_01jrec123transaction001',
106+
status: 'completed',
107+
customerId: 'ctm_01jqy42s56qwrj14pfmaeav2f2',
108+
subscriptionId: 'sub_01jrec123subscription001',
109+
customData: {
110+
user_id: 'recruiter-user-1',
111+
opportunity_id: '550e8400-e29b-41d4-a716-446655440003',
112+
},
113+
items: [
114+
{
115+
price: {
116+
id: 'pri_recruiter_monthly',
117+
productId: 'pro_recruiter',
118+
description: 'Recruiter Monthly',
119+
type: 'standard',
120+
name: 'Recruiter Monthly',
121+
unitPrice: { amount: '9900', currencyCode: 'USD' },
122+
},
123+
quantity: 1,
124+
},
125+
],
126+
payments: [
127+
{
128+
paymentAttemptId: '526c8c63-0d03-4bbb-85d4-1afeb1f5efed',
129+
status: 'captured',
130+
},
131+
],
132+
origin: 'subscription_charge',
133+
currencyCode: 'USD',
134+
details: {
135+
totals: {
136+
total: '9900',
137+
},
138+
},
139+
createdAt: '2025-04-15T14:49:12.070563Z',
140+
updatedAt: '2025-04-15T14:50:00.000000Z',
141+
},
142+
} as unknown as TransactionCompletedEvent;

0 commit comments

Comments
 (0)