first commit

This commit is contained in:
Isuru Bimsara
2026-08-14 22:46:02 +05:30
commit 81d0e65686
132 changed files with 24398 additions and 0 deletions
+137
View File
@@ -0,0 +1,137 @@
# Notification API
## Create New Notification
**Endpoint**
```
POST: http://localhost:3070/api/notification
```
**Request Body**
```json
{
"notificationHeadline": "System Maintenance",
"notificationDescription": "The system will be unavailable from 10 PM to 12 AM.",
"notificationType": "ANNOUNCEMENT"
}
```
**Respond**
```json
{
"success": true,
"message": "Notification created successfully",
"notification": {
"notification_id": "notif_1782553200000",
"notificationHeadline": "System Maintenance",
"notificationDescription": "The system will be unavailable from 10 PM to 12 AM.",
"notificationType": "ANNOUNCEMENT",
"dateCreated": "2026-06-27T05:30:00.000Z",
"isActive": true,
"updatedAt": "2026-06-27T05:30:00.000Z",
"createdAt": "2026-06-27T05:30:00.000Z"
}
}
```
## Get Announcements
**Endpoint**
```
GET: http://localhost:3070/api/notification/announcements
```
**Respond**
```json
{
"success": true,
"announcements": [
{
"notification_id": "notif_1782553200000",
"notificationHeadline": "System Maintenance",
"notificationDescription": "The system will be unavailable from 10 PM to 12 AM.",
"notificationType": "ANNOUNCEMENT",
"isActive": true,
"dateCreated": "2026-06-27T05:30:00.000Z",
"createdAt": "2026-06-27T05:30:00.000Z",
"updatedAt": "2026-06-27T05:30:00.000Z"
}
]
}
```
---
## Get User Notifications
**Endpoint**
```
GET: http://localhost:3070/api/notification/user/:userId
```
Example:
```
GET: http://localhost:3070/api/notification/user/usr_12345
```
**Respond**
```json
{
"success": true,
"notifications": [
{
"id": "userNotif_001",
"user_id": "usr_12345",
"notification_id": "notif_1782553200000",
"isRead": false,
"createdAt": "2026-06-27T05:30:00.000Z",
"updatedAt": "2026-06-27T05:30:00.000Z",
"notification": {
"notification_id": "notif_1782553200000",
"notificationHeadline": "System Maintenance",
"notificationDescription": "The system will be unavailable from 10 PM to 12 AM.",
"notificationType": "ANNOUNCEMENT",
"isActive": true
}
}
]
}
```
---
## Mark Notification As Read
**Endpoint**
```
PATCH: http://localhost:3070/api/notification/user/:userId/notification/:notificationId/read
```
Example:
```
PATCH: http://localhost:3070/api/notification/user/usr_12345/notification/notif_1782553200000/read
```
**Respond**
```json
{
"success": true,
"message": "Notification marked as read"
}
```