first commit
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
# User Activity API
|
||||
|
||||
#### Get All Users Activies
|
||||
|
||||
**Endpoint**
|
||||
|
||||
```
|
||||
POST: http://localhost:3070/api/activity
|
||||
```
|
||||
|
||||
**Respond**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "User activities retrieved successfully",
|
||||
"data": [
|
||||
{
|
||||
"id": 3,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_009270f9-e8ef-42d9-a3e4-5398c9466972",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": "Vendor Management",
|
||||
"activity_time": "2026-03-30T19:39:45.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:39:45.000Z",
|
||||
"updatedAt": "2026-03-30T19:39:45.000Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_95018101-b539-45a4-b9a6-4551cecda990",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": "Vendor Management",
|
||||
"activity_time": "2026-03-30T19:17:58.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:17:58.000Z",
|
||||
"updatedAt": "2026-03-30T19:17:58.000Z"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_c666b2cd-36fe-46db-aecd-18ec7677ccff",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": null,
|
||||
"activity_time": "2026-03-30T19:16:41.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:16:41.000Z",
|
||||
"updatedAt": "2026-03-30T19:16:41.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Get Activies by User ID
|
||||
|
||||
**Endpoint**
|
||||
|
||||
```
|
||||
POST: http://localhost:3070/api/activity/user/:userID
|
||||
```
|
||||
|
||||
Example: http://localhost:3070/api/activity/user/usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4
|
||||
|
||||
**Respond**
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "User activities retrieved successfully",
|
||||
"data": [
|
||||
{
|
||||
"id": 3,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_009270f9-e8ef-42d9-a3e4-5398c9466972",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": "Vendor Management",
|
||||
"activity_time": "2026-03-30T19:39:45.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:39:45.000Z",
|
||||
"updatedAt": "2026-03-30T19:39:45.000Z"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_95018101-b539-45a4-b9a6-4551cecda990",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": "Vendor Management",
|
||||
"activity_time": "2026-03-30T19:17:58.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:17:58.000Z",
|
||||
"updatedAt": "2026-03-30T19:17:58.000Z"
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"user_id": "usr_5ff8afec-5ddc-47d9-a63f-b43df0d8c3b4",
|
||||
"username": "Sathira",
|
||||
"activity_description": "Created vendor with ID: vnd_c666b2cd-36fe-46db-aecd-18ec7677ccff",
|
||||
"activity_type": "CREATE_VENDOR",
|
||||
"module": null,
|
||||
"activity_time": "2026-03-30T19:16:41.000Z",
|
||||
"activity_date": "2026-03-30",
|
||||
"createdAt": "2026-03-30T19:16:41.000Z",
|
||||
"updatedAt": "2026-03-30T19:16:41.000Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user