forked from SOE305-project/soe305-project-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick-test.http
More file actions
91 lines (75 loc) · 1.96 KB
/
quick-test.http
File metadata and controls
91 lines (75 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
### Quick API Tests for Notification Backend
### You can use these with VS Code REST Client extension or similar tools
@baseUrl = http://localhost:3000
@userId = test-user-001
### Health Check
GET {{baseUrl}}/health
### Send User Signup Notification (Email + SMS)
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}",
"event": "user_signup",
"payload": {
"userName": "Test User",
"loginUrl": "https://yourapp.com/login"
}
}
### Send Password Reset Notification
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}",
"event": "password_reset",
"payload": {
"userName": "Test User",
"resetLink": "https://yourapp.com/reset?token=xyz789",
"expiryTime": "30 minutes"
}
}
### Send Booking Confirmation Notification
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}",
"event": "booking_confirmation",
"payload": {
"userName": "Test User",
"hostelName": "Elite Hostel",
"roomNumber": "A-101",
"bookingDate": "2026-02-17",
"checkInDate": "2026-03-01",
"amount": "₦50,000"
}
}
### Send Payment Success Notification
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}",
"event": "payment_success",
"payload": {
"userName": "Test User",
"amount": "₦50,000",
"transactionId": "TXN123456789",
"paymentDate": "2026-02-17"
}
}
### Get User Notifications
GET {{baseUrl}}/api/notifications/{{userId}}
### Get User Notifications with Pagination
GET {{baseUrl}}/api/notifications/{{userId}}?limit=10&offset=0
### Test with Invalid Event (Should Fail)
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}",
"event": "invalid_event",
"payload": {}
}
### Test with Missing Fields (Should Fail)
POST {{baseUrl}}/api/notifications/send
Content-Type: application/json
{
"userId": "{{userId}}"
}