Update plugins/sangmata.js
Browse files- plugins/sangmata.js +28 -9
plugins/sangmata.js
CHANGED
@@ -8,9 +8,9 @@ const SangmataRoutes = express.Router();
|
|
8 |
* @swagger
|
9 |
* /api/v2/sangmata/tracker:
|
10 |
* post:
|
11 |
-
* summary:
|
12 |
* tags: [Sangmata]
|
13 |
-
* description:
|
14 |
* security:
|
15 |
* - apiKeyAuth: []
|
16 |
* requestBody:
|
@@ -22,14 +22,16 @@ const SangmataRoutes = express.Router();
|
|
22 |
* properties:
|
23 |
* user_id:
|
24 |
* type: integer
|
25 |
-
* description:
|
|
|
26 |
* username:
|
27 |
* type: string
|
28 |
-
* description:
|
|
|
29 |
* first_name:
|
30 |
* type: string
|
31 |
-
* description: first name.
|
32 |
-
*
|
33 |
* parameters:
|
34 |
* - in: header
|
35 |
* name: x-api-key
|
@@ -39,17 +41,34 @@ const SangmataRoutes = express.Router();
|
|
39 |
* type: string
|
40 |
* responses:
|
41 |
* 200:
|
42 |
-
* description:
|
43 |
* content:
|
44 |
* application/json:
|
45 |
* schema:
|
46 |
* type: object
|
47 |
* properties:
|
|
|
|
|
|
|
48 |
* message:
|
49 |
* type: string
|
50 |
-
* example: User data updated successfully
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
* 400:
|
52 |
-
* description:
|
53 |
* 500:
|
54 |
* description: Internal server error.
|
55 |
*/
|
|
|
8 |
* @swagger
|
9 |
* /api/v2/sangmata/tracker:
|
10 |
* post:
|
11 |
+
* summary: Track and update a user's first name history
|
12 |
* tags: [Sangmata]
|
13 |
+
* description: Updates or creates a record tracking a user's first name changes.
|
14 |
* security:
|
15 |
* - apiKeyAuth: []
|
16 |
* requestBody:
|
|
|
22 |
* properties:
|
23 |
* user_id:
|
24 |
* type: integer
|
25 |
+
* description: Unique Telegram user ID.
|
26 |
+
* example: 123456789
|
27 |
* username:
|
28 |
* type: string
|
29 |
+
* description: User's latest Telegram username.
|
30 |
+
* example: "new_user"
|
31 |
* first_name:
|
32 |
* type: string
|
33 |
+
* description: New first name to be added to history.
|
34 |
+
* example: "John"
|
35 |
* parameters:
|
36 |
* - in: header
|
37 |
* name: x-api-key
|
|
|
41 |
* type: string
|
42 |
* responses:
|
43 |
* 200:
|
44 |
+
* description: User data updated successfully.
|
45 |
* content:
|
46 |
* application/json:
|
47 |
* schema:
|
48 |
* type: object
|
49 |
* properties:
|
50 |
+
* success:
|
51 |
+
* type: boolean
|
52 |
+
* example: true
|
53 |
* message:
|
54 |
* type: string
|
55 |
+
* example: "User data updated successfully"
|
56 |
+
* user:
|
57 |
+
* type: object
|
58 |
+
* properties:
|
59 |
+
* user_id:
|
60 |
+
* type: integer
|
61 |
+
* example: 123456789
|
62 |
+
* username:
|
63 |
+
* type: string
|
64 |
+
* example: "new_user"
|
65 |
+
* first_name:
|
66 |
+
* type: array
|
67 |
+
* items:
|
68 |
+
* type: string
|
69 |
+
* example: ["John", "Johnny", "Jonathan"]
|
70 |
* 400:
|
71 |
+
* description: Missing required parameters or invalid data.
|
72 |
* 500:
|
73 |
* description: Internal server error.
|
74 |
*/
|