lifedebugger commited on
Commit
ae78a07
·
1 Parent(s): f2b94bf

Deploy files from GitHub repository

Browse files
Files changed (6) hide show
  1. docs/docs.go +652 -120
  2. docs/swagger.json +652 -120
  3. docs/swagger.yaml +390 -40
  4. swagger/docs/docs.go +652 -120
  5. swagger/docs/swagger.json +652 -120
  6. swagger/docs/swagger.yaml +390 -40
docs/docs.go CHANGED
@@ -1756,58 +1756,6 @@ const docTemplate = `{
1756
  }
1757
  }
1758
  },
1759
- "/api/v1/admin/authentication/{account_id}/assign": {
1760
- "put": {
1761
- "security": [
1762
- {
1763
- "BearerAuth": []
1764
- }
1765
- ],
1766
- "description": "Update the role of a user account",
1767
- "consumes": [
1768
- "application/json"
1769
- ],
1770
- "produces": [
1771
- "application/json"
1772
- ],
1773
- "tags": [
1774
- "Authentication"
1775
- ],
1776
- "summary": "Update User Role",
1777
- "parameters": [
1778
- {
1779
- "type": "string",
1780
- "description": "Account ID",
1781
- "name": "accountId",
1782
- "in": "path",
1783
- "required": true
1784
- },
1785
- {
1786
- "description": "Update User Role Request",
1787
- "name": "request",
1788
- "in": "body",
1789
- "required": true,
1790
- "schema": {
1791
- "$ref": "#/definitions/dto.UpdateUserRoleRequest"
1792
- }
1793
- }
1794
- ],
1795
- "responses": {
1796
- "200": {
1797
- "description": "OK",
1798
- "schema": {
1799
- "$ref": "#/definitions/dto.SuccessResponse-models_Account"
1800
- }
1801
- },
1802
- "400": {
1803
- "description": "Bad Request",
1804
- "schema": {
1805
- "$ref": "#/definitions/dto.ErrorResponse"
1806
- }
1807
- }
1808
- }
1809
- }
1810
- },
1811
  "/api/v1/admin/events": {
1812
  "get": {
1813
  "security": [
@@ -6096,6 +6044,88 @@ const docTemplate = `{
6096
  }
6097
  }
6098
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6099
  "/api/v1/super-admin/inject/probset": {
6100
  "post": {
6101
  "security": [
@@ -6236,6 +6266,84 @@ const docTemplate = `{
6236
  }
6237
  }
6238
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6239
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6240
  "post": {
6241
  "security": [
@@ -6345,14 +6453,14 @@ const docTemplate = `{
6345
  }
6346
  }
6347
  },
6348
- "/api/v1/super-admin/users": {
6349
  "get": {
6350
  "security": [
6351
  {
6352
  "BearerAuth": []
6353
  }
6354
  ],
6355
- "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6356
  "consumes": [
6357
  "application/json"
6358
  ],
@@ -6360,40 +6468,14 @@ const docTemplate = `{
6360
  "application/json"
6361
  ],
6362
  "tags": [
6363
- "Super Admin Users Management"
6364
- ],
6365
- "summary": "List All Users with Pagination",
6366
- "parameters": [
6367
- {
6368
- "type": "integer",
6369
- "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6370
- "name": "page",
6371
- "in": "query"
6372
- },
6373
- {
6374
- "type": "integer",
6375
- "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6376
- "name": "limit",
6377
- "in": "query"
6378
- },
6379
- {
6380
- "type": "string",
6381
- "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6382
- "name": "role",
6383
- "in": "query"
6384
- }
6385
  ],
 
6386
  "responses": {
6387
  "200": {
6388
  "description": "OK",
6389
  "schema": {
6390
- "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6391
- }
6392
- },
6393
- "400": {
6394
- "description": "Bad Request",
6395
- "schema": {
6396
- "$ref": "#/definitions/dto.ErrorResponse"
6397
  }
6398
  },
6399
  "401": {
@@ -6416,7 +6498,7 @@ const docTemplate = `{
6416
  "BearerAuth": []
6417
  }
6418
  ],
6419
- "description": "Create a new user account by providing user details",
6420
  "consumes": [
6421
  "application/json"
6422
  ],
@@ -6424,17 +6506,17 @@ const docTemplate = `{
6424
  "application/json"
6425
  ],
6426
  "tags": [
6427
- "Super Admin Users Management"
6428
  ],
6429
- "summary": "Create Single User",
6430
  "parameters": [
6431
  {
6432
- "description": "Create User Request",
6433
  "name": "request",
6434
  "in": "body",
6435
  "required": true,
6436
  "schema": {
6437
- "$ref": "#/definitions/dto.CreateUserRequest"
6438
  }
6439
  }
6440
  ],
@@ -6442,7 +6524,7 @@ const docTemplate = `{
6442
  "200": {
6443
  "description": "OK",
6444
  "schema": {
6445
- "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6446
  }
6447
  },
6448
  "400": {
@@ -6462,18 +6544,24 @@ const docTemplate = `{
6462
  "schema": {
6463
  "$ref": "#/definitions/dto.ErrorResponse"
6464
  }
 
 
 
 
 
 
6465
  }
6466
  }
6467
  }
6468
  },
6469
- "/api/v1/super-admin/users/bulk": {
6470
- "post": {
6471
  "security": [
6472
  {
6473
  "BearerAuth": []
6474
  }
6475
  ],
6476
- "description": "Create multiple user accounts at once",
6477
  "consumes": [
6478
  "application/json"
6479
  ],
@@ -6481,20 +6569,24 @@ const docTemplate = `{
6481
  "application/json"
6482
  ],
6483
  "tags": [
6484
- "Super Admin Users Management"
6485
  ],
6486
- "summary": "Bulk Create Users",
6487
  "parameters": [
6488
  {
6489
- "description": "Bulk Create User Requests",
6490
- "name": "requests",
 
 
 
 
 
 
 
6491
  "in": "body",
6492
  "required": true,
6493
  "schema": {
6494
- "type": "array",
6495
- "items": {
6496
- "$ref": "#/definitions/dto.CreateUserRequest"
6497
- }
6498
  }
6499
  }
6500
  ],
@@ -6502,7 +6594,7 @@ const docTemplate = `{
6502
  "200": {
6503
  "description": "OK",
6504
  "schema": {
6505
- "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6506
  }
6507
  },
6508
  "400": {
@@ -6524,16 +6616,14 @@ const docTemplate = `{
6524
  }
6525
  }
6526
  }
6527
- }
6528
- },
6529
- "/api/v1/super-admin/users/{id}": {
6530
- "put": {
6531
  "security": [
6532
  {
6533
  "BearerAuth": []
6534
  }
6535
  ],
6536
- "description": "Update user information by ID",
6537
  "consumes": [
6538
  "application/json"
6539
  ],
@@ -6541,13 +6631,249 @@ const docTemplate = `{
6541
  "application/json"
6542
  ],
6543
  "tags": [
6544
- "Super Admin Users Management"
6545
  ],
6546
- "summary": "Edit User",
6547
  "parameters": [
6548
  {
6549
  "type": "string",
6550
- "description": "User ID",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6551
  "name": "id",
6552
  "in": "path",
6553
  "required": true
@@ -7037,6 +7363,29 @@ const docTemplate = `{
7037
  }
7038
  }
7039
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7040
  "dto.AuthenticatedUser": {
7041
  "type": "object",
7042
  "properties": {
@@ -7386,6 +7735,29 @@ const docTemplate = `{
7386
  }
7387
  }
7388
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7389
  "dto.CreateUserRequest": {
7390
  "type": "object",
7391
  "required": [
@@ -7661,6 +8033,23 @@ const docTemplate = `{
7661
  }
7662
  }
7663
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7664
  "dto.ProblemSetInjectResponse": {
7665
  "type": "object",
7666
  "properties": {
@@ -7918,6 +8307,61 @@ const docTemplate = `{
7918
  }
7919
  }
7920
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7921
  "dto.SignInRequest": {
7922
  "type": "object",
7923
  "required": [
@@ -7998,6 +8442,22 @@ const docTemplate = `{
7998
  }
7999
  }
8000
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8001
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8002
  "type": "object",
8003
  "properties": {
@@ -8030,6 +8490,22 @@ const docTemplate = `{
8030
  }
8031
  }
8032
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8033
  "dto.SuccessResponse-array_dto_UserResponse": {
8034
  "type": "object",
8035
  "properties": {
@@ -8426,6 +8902,32 @@ const docTemplate = `{
8426
  }
8427
  }
8428
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8429
  "dto.SuccessResponse-dto_UserResponse": {
8430
  "type": "object",
8431
  "properties": {
@@ -8801,6 +9303,26 @@ const docTemplate = `{
8801
  }
8802
  }
8803
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8804
  "dto.UpdateUserRequest": {
8805
  "type": "object",
8806
  "properties": {
@@ -8818,17 +9340,6 @@ const docTemplate = `{
8818
  }
8819
  }
8820
  },
8821
- "dto.UpdateUserRoleRequest": {
8822
- "type": "object",
8823
- "required": [
8824
- "role"
8825
- ],
8826
- "properties": {
8827
- "role": {
8828
- "type": "string"
8829
- }
8830
- }
8831
- },
8832
  "dto.UserResponse": {
8833
  "type": "object",
8834
  "properties": {
@@ -9255,12 +9766,24 @@ const docTemplate = `{
9255
  "models.Account": {
9256
  "type": "object",
9257
  "properties": {
 
 
 
 
 
 
9258
  "created_at": {
9259
  "type": "string"
9260
  },
9261
  "email": {
9262
  "type": "string"
9263
  },
 
 
 
 
 
 
9264
  "full_name": {
9265
  "type": "string"
9266
  },
@@ -9276,6 +9799,15 @@ const docTemplate = `{
9276
  "role": {
9277
  "type": "string"
9278
  },
 
 
 
 
 
 
 
 
 
9279
  "username": {
9280
  "type": "string"
9281
  }
 
1756
  }
1757
  }
1758
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1759
  "/api/v1/admin/events": {
1760
  "get": {
1761
  "security": [
 
6044
  }
6045
  }
6046
  },
6047
+ "/api/v1/super-admin/accounts/{account_id}/role": {
6048
+ "put": {
6049
+ "security": [
6050
+ {
6051
+ "BearerAuth": []
6052
+ }
6053
+ ],
6054
+ "description": "Set the role and privileges of a user account. Supports system roles, named custom roles, or \"custom\" with explicit flags.",
6055
+ "consumes": [
6056
+ "application/json"
6057
+ ],
6058
+ "produces": [
6059
+ "application/json"
6060
+ ],
6061
+ "tags": [
6062
+ "Super Admin Accounts"
6063
+ ],
6064
+ "summary": "Set User Role",
6065
+ "parameters": [
6066
+ {
6067
+ "type": "string",
6068
+ "description": "Account ID",
6069
+ "name": "account_id",
6070
+ "in": "path",
6071
+ "required": true
6072
+ },
6073
+ {
6074
+ "description": "Set User Role Request",
6075
+ "name": "request",
6076
+ "in": "body",
6077
+ "required": true,
6078
+ "schema": {
6079
+ "$ref": "#/definitions/dto.SetUserRoleRequest"
6080
+ }
6081
+ }
6082
+ ],
6083
+ "responses": {
6084
+ "200": {
6085
+ "description": "OK",
6086
+ "schema": {
6087
+ "$ref": "#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData"
6088
+ }
6089
+ },
6090
+ "400": {
6091
+ "description": "Bad Request",
6092
+ "schema": {
6093
+ "$ref": "#/definitions/dto.ErrorResponse"
6094
+ }
6095
+ },
6096
+ "401": {
6097
+ "description": "Unauthorized",
6098
+ "schema": {
6099
+ "$ref": "#/definitions/dto.ErrorResponse"
6100
+ }
6101
+ },
6102
+ "403": {
6103
+ "description": "Forbidden",
6104
+ "schema": {
6105
+ "$ref": "#/definitions/dto.ErrorResponse"
6106
+ }
6107
+ },
6108
+ "404": {
6109
+ "description": "Not Found",
6110
+ "schema": {
6111
+ "$ref": "#/definitions/dto.ErrorResponse"
6112
+ }
6113
+ },
6114
+ "409": {
6115
+ "description": "Conflict",
6116
+ "schema": {
6117
+ "$ref": "#/definitions/dto.ErrorResponse"
6118
+ }
6119
+ },
6120
+ "422": {
6121
+ "description": "Unprocessable Entity",
6122
+ "schema": {
6123
+ "$ref": "#/definitions/dto.ErrorResponse"
6124
+ }
6125
+ }
6126
+ }
6127
+ }
6128
+ },
6129
  "/api/v1/super-admin/inject/probset": {
6130
  "post": {
6131
  "security": [
 
6266
  }
6267
  }
6268
  },
6269
+ "/api/v1/super-admin/logs": {
6270
+ "get": {
6271
+ "security": [
6272
+ {
6273
+ "BearerAuth": []
6274
+ }
6275
+ ],
6276
+ "description": "Get paginated audit logs with optional filters. Superadmin only.",
6277
+ "consumes": [
6278
+ "application/json"
6279
+ ],
6280
+ "produces": [
6281
+ "application/json"
6282
+ ],
6283
+ "tags": [
6284
+ "Super Admin Audit"
6285
+ ],
6286
+ "summary": "List Audit Logs",
6287
+ "parameters": [
6288
+ {
6289
+ "type": "integer",
6290
+ "description": "Page number (default 1)",
6291
+ "name": "page",
6292
+ "in": "query"
6293
+ },
6294
+ {
6295
+ "type": "integer",
6296
+ "description": "Items per page (default 10, max 50)",
6297
+ "name": "limit",
6298
+ "in": "query"
6299
+ },
6300
+ {
6301
+ "type": "string",
6302
+ "description": "Filter by action",
6303
+ "name": "action",
6304
+ "in": "query"
6305
+ },
6306
+ {
6307
+ "type": "string",
6308
+ "description": "Filter by actor account ID",
6309
+ "name": "actor_account_id",
6310
+ "in": "query"
6311
+ },
6312
+ {
6313
+ "type": "string",
6314
+ "description": "Start time (RFC3339)",
6315
+ "name": "from",
6316
+ "in": "query"
6317
+ },
6318
+ {
6319
+ "type": "string",
6320
+ "description": "End time (RFC3339)",
6321
+ "name": "to",
6322
+ "in": "query"
6323
+ }
6324
+ ],
6325
+ "responses": {
6326
+ "200": {
6327
+ "description": "OK",
6328
+ "schema": {
6329
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse"
6330
+ }
6331
+ },
6332
+ "401": {
6333
+ "description": "Unauthorized",
6334
+ "schema": {
6335
+ "$ref": "#/definitions/dto.ErrorResponse"
6336
+ }
6337
+ },
6338
+ "403": {
6339
+ "description": "Forbidden",
6340
+ "schema": {
6341
+ "$ref": "#/definitions/dto.ErrorResponse"
6342
+ }
6343
+ }
6344
+ }
6345
+ }
6346
+ },
6347
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6348
  "post": {
6349
  "security": [
 
6453
  }
6454
  }
6455
  },
6456
+ "/api/v1/super-admin/roles": {
6457
  "get": {
6458
  "security": [
6459
  {
6460
  "BearerAuth": []
6461
  }
6462
  ],
6463
+ "description": "Get all system and named custom roles with their privilege flags",
6464
  "consumes": [
6465
  "application/json"
6466
  ],
 
6468
  "application/json"
6469
  ],
6470
  "tags": [
6471
+ "Super Admin Roles"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6472
  ],
6473
+ "summary": "List All Roles",
6474
  "responses": {
6475
  "200": {
6476
  "description": "OK",
6477
  "schema": {
6478
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_RoleResponse"
 
 
 
 
 
 
6479
  }
6480
  },
6481
  "401": {
 
6498
  "BearerAuth": []
6499
  }
6500
  ],
6501
+ "description": "Create a new named custom role with privilege flags. Superadmin only.",
6502
  "consumes": [
6503
  "application/json"
6504
  ],
 
6506
  "application/json"
6507
  ],
6508
  "tags": [
6509
+ "Super Admin Roles"
6510
  ],
6511
+ "summary": "Create Named Role",
6512
  "parameters": [
6513
  {
6514
+ "description": "Create Role Request",
6515
  "name": "request",
6516
  "in": "body",
6517
  "required": true,
6518
  "schema": {
6519
+ "$ref": "#/definitions/dto.CreateRoleRequest"
6520
  }
6521
  }
6522
  ],
 
6524
  "200": {
6525
  "description": "OK",
6526
  "schema": {
6527
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6528
  }
6529
  },
6530
  "400": {
 
6544
  "schema": {
6545
  "$ref": "#/definitions/dto.ErrorResponse"
6546
  }
6547
+ },
6548
+ "409": {
6549
+ "description": "Conflict",
6550
+ "schema": {
6551
+ "$ref": "#/definitions/dto.ErrorResponse"
6552
+ }
6553
  }
6554
  }
6555
  }
6556
  },
6557
+ "/api/v1/super-admin/roles/{role_id}": {
6558
+ "put": {
6559
  "security": [
6560
  {
6561
  "BearerAuth": []
6562
  }
6563
  ],
6564
+ "description": "Update a named custom role's privilege flags. System roles are immutable.",
6565
  "consumes": [
6566
  "application/json"
6567
  ],
 
6569
  "application/json"
6570
  ],
6571
  "tags": [
6572
+ "Super Admin Roles"
6573
  ],
6574
+ "summary": "Update Named Role",
6575
  "parameters": [
6576
  {
6577
+ "type": "string",
6578
+ "description": "Role ID",
6579
+ "name": "role_id",
6580
+ "in": "path",
6581
+ "required": true
6582
+ },
6583
+ {
6584
+ "description": "Update Role Request",
6585
+ "name": "request",
6586
  "in": "body",
6587
  "required": true,
6588
  "schema": {
6589
+ "$ref": "#/definitions/dto.UpdateRoleRequest"
 
 
 
6590
  }
6591
  }
6592
  ],
 
6594
  "200": {
6595
  "description": "OK",
6596
  "schema": {
6597
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6598
  }
6599
  },
6600
  "400": {
 
6616
  }
6617
  }
6618
  }
6619
+ },
6620
+ "delete": {
 
 
6621
  "security": [
6622
  {
6623
  "BearerAuth": []
6624
  }
6625
  ],
6626
+ "description": "Delete a named custom role. System roles are immutable. Cannot delete if assigned to any account.",
6627
  "consumes": [
6628
  "application/json"
6629
  ],
 
6631
  "application/json"
6632
  ],
6633
  "tags": [
6634
+ "Super Admin Roles"
6635
  ],
6636
+ "summary": "Delete Named Role",
6637
  "parameters": [
6638
  {
6639
  "type": "string",
6640
+ "description": "Role ID",
6641
+ "name": "role_id",
6642
+ "in": "path",
6643
+ "required": true
6644
+ }
6645
+ ],
6646
+ "responses": {
6647
+ "200": {
6648
+ "description": "OK",
6649
+ "schema": {
6650
+ "$ref": "#/definitions/dto.SuccessResponse-any"
6651
+ }
6652
+ },
6653
+ "401": {
6654
+ "description": "Unauthorized",
6655
+ "schema": {
6656
+ "$ref": "#/definitions/dto.ErrorResponse"
6657
+ }
6658
+ },
6659
+ "403": {
6660
+ "description": "Forbidden",
6661
+ "schema": {
6662
+ "$ref": "#/definitions/dto.ErrorResponse"
6663
+ }
6664
+ },
6665
+ "409": {
6666
+ "description": "Conflict",
6667
+ "schema": {
6668
+ "$ref": "#/definitions/dto.ErrorResponse"
6669
+ }
6670
+ }
6671
+ }
6672
+ }
6673
+ },
6674
+ "/api/v1/super-admin/users": {
6675
+ "get": {
6676
+ "security": [
6677
+ {
6678
+ "BearerAuth": []
6679
+ }
6680
+ ],
6681
+ "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6682
+ "consumes": [
6683
+ "application/json"
6684
+ ],
6685
+ "produces": [
6686
+ "application/json"
6687
+ ],
6688
+ "tags": [
6689
+ "Super Admin Users Management"
6690
+ ],
6691
+ "summary": "List All Users with Pagination",
6692
+ "parameters": [
6693
+ {
6694
+ "type": "integer",
6695
+ "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6696
+ "name": "page",
6697
+ "in": "query"
6698
+ },
6699
+ {
6700
+ "type": "integer",
6701
+ "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6702
+ "name": "limit",
6703
+ "in": "query"
6704
+ },
6705
+ {
6706
+ "type": "string",
6707
+ "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6708
+ "name": "role",
6709
+ "in": "query"
6710
+ }
6711
+ ],
6712
+ "responses": {
6713
+ "200": {
6714
+ "description": "OK",
6715
+ "schema": {
6716
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6717
+ }
6718
+ },
6719
+ "400": {
6720
+ "description": "Bad Request",
6721
+ "schema": {
6722
+ "$ref": "#/definitions/dto.ErrorResponse"
6723
+ }
6724
+ },
6725
+ "401": {
6726
+ "description": "Unauthorized",
6727
+ "schema": {
6728
+ "$ref": "#/definitions/dto.ErrorResponse"
6729
+ }
6730
+ },
6731
+ "403": {
6732
+ "description": "Forbidden",
6733
+ "schema": {
6734
+ "$ref": "#/definitions/dto.ErrorResponse"
6735
+ }
6736
+ }
6737
+ }
6738
+ },
6739
+ "post": {
6740
+ "security": [
6741
+ {
6742
+ "BearerAuth": []
6743
+ }
6744
+ ],
6745
+ "description": "Create a new user account by providing user details",
6746
+ "consumes": [
6747
+ "application/json"
6748
+ ],
6749
+ "produces": [
6750
+ "application/json"
6751
+ ],
6752
+ "tags": [
6753
+ "Super Admin Users Management"
6754
+ ],
6755
+ "summary": "Create Single User",
6756
+ "parameters": [
6757
+ {
6758
+ "description": "Create User Request",
6759
+ "name": "request",
6760
+ "in": "body",
6761
+ "required": true,
6762
+ "schema": {
6763
+ "$ref": "#/definitions/dto.CreateUserRequest"
6764
+ }
6765
+ }
6766
+ ],
6767
+ "responses": {
6768
+ "200": {
6769
+ "description": "OK",
6770
+ "schema": {
6771
+ "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6772
+ }
6773
+ },
6774
+ "400": {
6775
+ "description": "Bad Request",
6776
+ "schema": {
6777
+ "$ref": "#/definitions/dto.ErrorResponse"
6778
+ }
6779
+ },
6780
+ "401": {
6781
+ "description": "Unauthorized",
6782
+ "schema": {
6783
+ "$ref": "#/definitions/dto.ErrorResponse"
6784
+ }
6785
+ },
6786
+ "403": {
6787
+ "description": "Forbidden",
6788
+ "schema": {
6789
+ "$ref": "#/definitions/dto.ErrorResponse"
6790
+ }
6791
+ }
6792
+ }
6793
+ }
6794
+ },
6795
+ "/api/v1/super-admin/users/bulk": {
6796
+ "post": {
6797
+ "security": [
6798
+ {
6799
+ "BearerAuth": []
6800
+ }
6801
+ ],
6802
+ "description": "Create multiple user accounts at once",
6803
+ "consumes": [
6804
+ "application/json"
6805
+ ],
6806
+ "produces": [
6807
+ "application/json"
6808
+ ],
6809
+ "tags": [
6810
+ "Super Admin Users Management"
6811
+ ],
6812
+ "summary": "Bulk Create Users",
6813
+ "parameters": [
6814
+ {
6815
+ "description": "Bulk Create User Requests",
6816
+ "name": "requests",
6817
+ "in": "body",
6818
+ "required": true,
6819
+ "schema": {
6820
+ "type": "array",
6821
+ "items": {
6822
+ "$ref": "#/definitions/dto.CreateUserRequest"
6823
+ }
6824
+ }
6825
+ }
6826
+ ],
6827
+ "responses": {
6828
+ "200": {
6829
+ "description": "OK",
6830
+ "schema": {
6831
+ "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6832
+ }
6833
+ },
6834
+ "400": {
6835
+ "description": "Bad Request",
6836
+ "schema": {
6837
+ "$ref": "#/definitions/dto.ErrorResponse"
6838
+ }
6839
+ },
6840
+ "401": {
6841
+ "description": "Unauthorized",
6842
+ "schema": {
6843
+ "$ref": "#/definitions/dto.ErrorResponse"
6844
+ }
6845
+ },
6846
+ "403": {
6847
+ "description": "Forbidden",
6848
+ "schema": {
6849
+ "$ref": "#/definitions/dto.ErrorResponse"
6850
+ }
6851
+ }
6852
+ }
6853
+ }
6854
+ },
6855
+ "/api/v1/super-admin/users/{id}": {
6856
+ "put": {
6857
+ "security": [
6858
+ {
6859
+ "BearerAuth": []
6860
+ }
6861
+ ],
6862
+ "description": "Update user information by ID",
6863
+ "consumes": [
6864
+ "application/json"
6865
+ ],
6866
+ "produces": [
6867
+ "application/json"
6868
+ ],
6869
+ "tags": [
6870
+ "Super Admin Users Management"
6871
+ ],
6872
+ "summary": "Edit User",
6873
+ "parameters": [
6874
+ {
6875
+ "type": "string",
6876
+ "description": "User ID",
6877
  "name": "id",
6878
  "in": "path",
6879
  "required": true
 
7363
  }
7364
  }
7365
  },
7366
+ "dto.AuditLogResponse": {
7367
+ "type": "object",
7368
+ "properties": {
7369
+ "action": {
7370
+ "type": "string"
7371
+ },
7372
+ "actor_account_id": {
7373
+ "type": "string"
7374
+ },
7375
+ "created_at": {
7376
+ "type": "string"
7377
+ },
7378
+ "detail": {
7379
+ "type": "string"
7380
+ },
7381
+ "id": {
7382
+ "type": "string"
7383
+ },
7384
+ "target_id": {
7385
+ "type": "string"
7386
+ }
7387
+ }
7388
+ },
7389
  "dto.AuthenticatedUser": {
7390
  "type": "object",
7391
  "properties": {
 
7735
  }
7736
  }
7737
  },
7738
+ "dto.CreateRoleRequest": {
7739
+ "type": "object",
7740
+ "required": [
7741
+ "name"
7742
+ ],
7743
+ "properties": {
7744
+ "academy_management": {
7745
+ "type": "boolean"
7746
+ },
7747
+ "content_management": {
7748
+ "type": "boolean"
7749
+ },
7750
+ "event_management": {
7751
+ "type": "boolean"
7752
+ },
7753
+ "exam_management": {
7754
+ "type": "boolean"
7755
+ },
7756
+ "name": {
7757
+ "type": "string"
7758
+ }
7759
+ }
7760
+ },
7761
  "dto.CreateUserRequest": {
7762
  "type": "object",
7763
  "required": [
 
8033
  }
8034
  }
8035
  },
8036
+ "dto.Privileges": {
8037
+ "type": "object",
8038
+ "properties": {
8039
+ "academy_management": {
8040
+ "type": "boolean"
8041
+ },
8042
+ "content_management": {
8043
+ "type": "boolean"
8044
+ },
8045
+ "event_management": {
8046
+ "type": "boolean"
8047
+ },
8048
+ "exam_management": {
8049
+ "type": "boolean"
8050
+ }
8051
+ }
8052
+ },
8053
  "dto.ProblemSetInjectResponse": {
8054
  "type": "object",
8055
  "properties": {
 
8307
  }
8308
  }
8309
  },
8310
+ "dto.RoleResponse": {
8311
+ "type": "object",
8312
+ "properties": {
8313
+ "academy_management": {
8314
+ "type": "boolean"
8315
+ },
8316
+ "content_management": {
8317
+ "type": "boolean"
8318
+ },
8319
+ "event_management": {
8320
+ "type": "boolean"
8321
+ },
8322
+ "exam_management": {
8323
+ "type": "boolean"
8324
+ },
8325
+ "id": {
8326
+ "type": "string"
8327
+ },
8328
+ "is_system": {
8329
+ "type": "boolean"
8330
+ },
8331
+ "name": {
8332
+ "type": "string"
8333
+ }
8334
+ }
8335
+ },
8336
+ "dto.SetUserRoleRequest": {
8337
+ "type": "object",
8338
+ "required": [
8339
+ "privileges",
8340
+ "role_name"
8341
+ ],
8342
+ "properties": {
8343
+ "privileges": {
8344
+ "$ref": "#/definitions/dto.Privileges"
8345
+ },
8346
+ "role_name": {
8347
+ "type": "string"
8348
+ }
8349
+ }
8350
+ },
8351
+ "dto.SetUserRoleResponseData": {
8352
+ "type": "object",
8353
+ "properties": {
8354
+ "account_id": {
8355
+ "type": "string"
8356
+ },
8357
+ "privileges": {
8358
+ "$ref": "#/definitions/dto.Privileges"
8359
+ },
8360
+ "role_name": {
8361
+ "type": "string"
8362
+ }
8363
+ }
8364
+ },
8365
  "dto.SignInRequest": {
8366
  "type": "object",
8367
  "required": [
 
8442
  }
8443
  }
8444
  },
8445
+ "dto.SuccessResponse-array_dto_AuditLogResponse": {
8446
+ "type": "object",
8447
+ "properties": {
8448
+ "data": {
8449
+ "type": "array",
8450
+ "items": {
8451
+ "$ref": "#/definitions/dto.AuditLogResponse"
8452
+ }
8453
+ },
8454
+ "message": {},
8455
+ "meta_data": {},
8456
+ "status": {
8457
+ "type": "string"
8458
+ }
8459
+ }
8460
+ },
8461
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8462
  "type": "object",
8463
  "properties": {
 
8490
  }
8491
  }
8492
  },
8493
+ "dto.SuccessResponse-array_dto_RoleResponse": {
8494
+ "type": "object",
8495
+ "properties": {
8496
+ "data": {
8497
+ "type": "array",
8498
+ "items": {
8499
+ "$ref": "#/definitions/dto.RoleResponse"
8500
+ }
8501
+ },
8502
+ "message": {},
8503
+ "meta_data": {},
8504
+ "status": {
8505
+ "type": "string"
8506
+ }
8507
+ }
8508
+ },
8509
  "dto.SuccessResponse-array_dto_UserResponse": {
8510
  "type": "object",
8511
  "properties": {
 
8902
  }
8903
  }
8904
  },
8905
+ "dto.SuccessResponse-dto_RoleResponse": {
8906
+ "type": "object",
8907
+ "properties": {
8908
+ "data": {
8909
+ "$ref": "#/definitions/dto.RoleResponse"
8910
+ },
8911
+ "message": {},
8912
+ "meta_data": {},
8913
+ "status": {
8914
+ "type": "string"
8915
+ }
8916
+ }
8917
+ },
8918
+ "dto.SuccessResponse-dto_SetUserRoleResponseData": {
8919
+ "type": "object",
8920
+ "properties": {
8921
+ "data": {
8922
+ "$ref": "#/definitions/dto.SetUserRoleResponseData"
8923
+ },
8924
+ "message": {},
8925
+ "meta_data": {},
8926
+ "status": {
8927
+ "type": "string"
8928
+ }
8929
+ }
8930
+ },
8931
  "dto.SuccessResponse-dto_UserResponse": {
8932
  "type": "object",
8933
  "properties": {
 
9303
  }
9304
  }
9305
  },
9306
+ "dto.UpdateRoleRequest": {
9307
+ "type": "object",
9308
+ "properties": {
9309
+ "academy_management": {
9310
+ "type": "boolean"
9311
+ },
9312
+ "content_management": {
9313
+ "type": "boolean"
9314
+ },
9315
+ "event_management": {
9316
+ "type": "boolean"
9317
+ },
9318
+ "exam_management": {
9319
+ "type": "boolean"
9320
+ },
9321
+ "name": {
9322
+ "type": "string"
9323
+ }
9324
+ }
9325
+ },
9326
  "dto.UpdateUserRequest": {
9327
  "type": "object",
9328
  "properties": {
 
9340
  }
9341
  }
9342
  },
 
 
 
 
 
 
 
 
 
 
 
9343
  "dto.UserResponse": {
9344
  "type": "object",
9345
  "properties": {
 
9766
  "models.Account": {
9767
  "type": "object",
9768
  "properties": {
9769
+ "academy_management": {
9770
+ "type": "boolean"
9771
+ },
9772
+ "content_management": {
9773
+ "type": "boolean"
9774
+ },
9775
  "created_at": {
9776
  "type": "string"
9777
  },
9778
  "email": {
9779
  "type": "string"
9780
  },
9781
+ "event_management": {
9782
+ "type": "boolean"
9783
+ },
9784
+ "exam_management": {
9785
+ "type": "boolean"
9786
+ },
9787
  "full_name": {
9788
  "type": "string"
9789
  },
 
9799
  "role": {
9800
  "type": "string"
9801
  },
9802
+ "role_id": {
9803
+ "type": "string"
9804
+ },
9805
+ "role_name": {
9806
+ "type": "string"
9807
+ },
9808
+ "token_version": {
9809
+ "type": "integer"
9810
+ },
9811
  "username": {
9812
  "type": "string"
9813
  }
docs/swagger.json CHANGED
@@ -1745,58 +1745,6 @@
1745
  }
1746
  }
1747
  },
1748
- "/api/v1/admin/authentication/{account_id}/assign": {
1749
- "put": {
1750
- "security": [
1751
- {
1752
- "BearerAuth": []
1753
- }
1754
- ],
1755
- "description": "Update the role of a user account",
1756
- "consumes": [
1757
- "application/json"
1758
- ],
1759
- "produces": [
1760
- "application/json"
1761
- ],
1762
- "tags": [
1763
- "Authentication"
1764
- ],
1765
- "summary": "Update User Role",
1766
- "parameters": [
1767
- {
1768
- "type": "string",
1769
- "description": "Account ID",
1770
- "name": "accountId",
1771
- "in": "path",
1772
- "required": true
1773
- },
1774
- {
1775
- "description": "Update User Role Request",
1776
- "name": "request",
1777
- "in": "body",
1778
- "required": true,
1779
- "schema": {
1780
- "$ref": "#/definitions/dto.UpdateUserRoleRequest"
1781
- }
1782
- }
1783
- ],
1784
- "responses": {
1785
- "200": {
1786
- "description": "OK",
1787
- "schema": {
1788
- "$ref": "#/definitions/dto.SuccessResponse-models_Account"
1789
- }
1790
- },
1791
- "400": {
1792
- "description": "Bad Request",
1793
- "schema": {
1794
- "$ref": "#/definitions/dto.ErrorResponse"
1795
- }
1796
- }
1797
- }
1798
- }
1799
- },
1800
  "/api/v1/admin/events": {
1801
  "get": {
1802
  "security": [
@@ -6085,6 +6033,88 @@
6085
  }
6086
  }
6087
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6088
  "/api/v1/super-admin/inject/probset": {
6089
  "post": {
6090
  "security": [
@@ -6225,6 +6255,84 @@
6225
  }
6226
  }
6227
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6228
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6229
  "post": {
6230
  "security": [
@@ -6334,14 +6442,14 @@
6334
  }
6335
  }
6336
  },
6337
- "/api/v1/super-admin/users": {
6338
  "get": {
6339
  "security": [
6340
  {
6341
  "BearerAuth": []
6342
  }
6343
  ],
6344
- "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6345
  "consumes": [
6346
  "application/json"
6347
  ],
@@ -6349,40 +6457,14 @@
6349
  "application/json"
6350
  ],
6351
  "tags": [
6352
- "Super Admin Users Management"
6353
- ],
6354
- "summary": "List All Users with Pagination",
6355
- "parameters": [
6356
- {
6357
- "type": "integer",
6358
- "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6359
- "name": "page",
6360
- "in": "query"
6361
- },
6362
- {
6363
- "type": "integer",
6364
- "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6365
- "name": "limit",
6366
- "in": "query"
6367
- },
6368
- {
6369
- "type": "string",
6370
- "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6371
- "name": "role",
6372
- "in": "query"
6373
- }
6374
  ],
 
6375
  "responses": {
6376
  "200": {
6377
  "description": "OK",
6378
  "schema": {
6379
- "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6380
- }
6381
- },
6382
- "400": {
6383
- "description": "Bad Request",
6384
- "schema": {
6385
- "$ref": "#/definitions/dto.ErrorResponse"
6386
  }
6387
  },
6388
  "401": {
@@ -6405,7 +6487,7 @@
6405
  "BearerAuth": []
6406
  }
6407
  ],
6408
- "description": "Create a new user account by providing user details",
6409
  "consumes": [
6410
  "application/json"
6411
  ],
@@ -6413,17 +6495,17 @@
6413
  "application/json"
6414
  ],
6415
  "tags": [
6416
- "Super Admin Users Management"
6417
  ],
6418
- "summary": "Create Single User",
6419
  "parameters": [
6420
  {
6421
- "description": "Create User Request",
6422
  "name": "request",
6423
  "in": "body",
6424
  "required": true,
6425
  "schema": {
6426
- "$ref": "#/definitions/dto.CreateUserRequest"
6427
  }
6428
  }
6429
  ],
@@ -6431,7 +6513,7 @@
6431
  "200": {
6432
  "description": "OK",
6433
  "schema": {
6434
- "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6435
  }
6436
  },
6437
  "400": {
@@ -6451,18 +6533,24 @@
6451
  "schema": {
6452
  "$ref": "#/definitions/dto.ErrorResponse"
6453
  }
 
 
 
 
 
 
6454
  }
6455
  }
6456
  }
6457
  },
6458
- "/api/v1/super-admin/users/bulk": {
6459
- "post": {
6460
  "security": [
6461
  {
6462
  "BearerAuth": []
6463
  }
6464
  ],
6465
- "description": "Create multiple user accounts at once",
6466
  "consumes": [
6467
  "application/json"
6468
  ],
@@ -6470,20 +6558,24 @@
6470
  "application/json"
6471
  ],
6472
  "tags": [
6473
- "Super Admin Users Management"
6474
  ],
6475
- "summary": "Bulk Create Users",
6476
  "parameters": [
6477
  {
6478
- "description": "Bulk Create User Requests",
6479
- "name": "requests",
 
 
 
 
 
 
 
6480
  "in": "body",
6481
  "required": true,
6482
  "schema": {
6483
- "type": "array",
6484
- "items": {
6485
- "$ref": "#/definitions/dto.CreateUserRequest"
6486
- }
6487
  }
6488
  }
6489
  ],
@@ -6491,7 +6583,7 @@
6491
  "200": {
6492
  "description": "OK",
6493
  "schema": {
6494
- "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6495
  }
6496
  },
6497
  "400": {
@@ -6513,16 +6605,14 @@
6513
  }
6514
  }
6515
  }
6516
- }
6517
- },
6518
- "/api/v1/super-admin/users/{id}": {
6519
- "put": {
6520
  "security": [
6521
  {
6522
  "BearerAuth": []
6523
  }
6524
  ],
6525
- "description": "Update user information by ID",
6526
  "consumes": [
6527
  "application/json"
6528
  ],
@@ -6530,13 +6620,249 @@
6530
  "application/json"
6531
  ],
6532
  "tags": [
6533
- "Super Admin Users Management"
6534
  ],
6535
- "summary": "Edit User",
6536
  "parameters": [
6537
  {
6538
  "type": "string",
6539
- "description": "User ID",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6540
  "name": "id",
6541
  "in": "path",
6542
  "required": true
@@ -7026,6 +7352,29 @@
7026
  }
7027
  }
7028
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7029
  "dto.AuthenticatedUser": {
7030
  "type": "object",
7031
  "properties": {
@@ -7375,6 +7724,29 @@
7375
  }
7376
  }
7377
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7378
  "dto.CreateUserRequest": {
7379
  "type": "object",
7380
  "required": [
@@ -7650,6 +8022,23 @@
7650
  }
7651
  }
7652
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7653
  "dto.ProblemSetInjectResponse": {
7654
  "type": "object",
7655
  "properties": {
@@ -7907,6 +8296,61 @@
7907
  }
7908
  }
7909
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7910
  "dto.SignInRequest": {
7911
  "type": "object",
7912
  "required": [
@@ -7987,6 +8431,22 @@
7987
  }
7988
  }
7989
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7990
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
7991
  "type": "object",
7992
  "properties": {
@@ -8019,6 +8479,22 @@
8019
  }
8020
  }
8021
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8022
  "dto.SuccessResponse-array_dto_UserResponse": {
8023
  "type": "object",
8024
  "properties": {
@@ -8415,6 +8891,32 @@
8415
  }
8416
  }
8417
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8418
  "dto.SuccessResponse-dto_UserResponse": {
8419
  "type": "object",
8420
  "properties": {
@@ -8790,6 +9292,26 @@
8790
  }
8791
  }
8792
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8793
  "dto.UpdateUserRequest": {
8794
  "type": "object",
8795
  "properties": {
@@ -8807,17 +9329,6 @@
8807
  }
8808
  }
8809
  },
8810
- "dto.UpdateUserRoleRequest": {
8811
- "type": "object",
8812
- "required": [
8813
- "role"
8814
- ],
8815
- "properties": {
8816
- "role": {
8817
- "type": "string"
8818
- }
8819
- }
8820
- },
8821
  "dto.UserResponse": {
8822
  "type": "object",
8823
  "properties": {
@@ -9244,12 +9755,24 @@
9244
  "models.Account": {
9245
  "type": "object",
9246
  "properties": {
 
 
 
 
 
 
9247
  "created_at": {
9248
  "type": "string"
9249
  },
9250
  "email": {
9251
  "type": "string"
9252
  },
 
 
 
 
 
 
9253
  "full_name": {
9254
  "type": "string"
9255
  },
@@ -9265,6 +9788,15 @@
9265
  "role": {
9266
  "type": "string"
9267
  },
 
 
 
 
 
 
 
 
 
9268
  "username": {
9269
  "type": "string"
9270
  }
 
1745
  }
1746
  }
1747
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1748
  "/api/v1/admin/events": {
1749
  "get": {
1750
  "security": [
 
6033
  }
6034
  }
6035
  },
6036
+ "/api/v1/super-admin/accounts/{account_id}/role": {
6037
+ "put": {
6038
+ "security": [
6039
+ {
6040
+ "BearerAuth": []
6041
+ }
6042
+ ],
6043
+ "description": "Set the role and privileges of a user account. Supports system roles, named custom roles, or \"custom\" with explicit flags.",
6044
+ "consumes": [
6045
+ "application/json"
6046
+ ],
6047
+ "produces": [
6048
+ "application/json"
6049
+ ],
6050
+ "tags": [
6051
+ "Super Admin Accounts"
6052
+ ],
6053
+ "summary": "Set User Role",
6054
+ "parameters": [
6055
+ {
6056
+ "type": "string",
6057
+ "description": "Account ID",
6058
+ "name": "account_id",
6059
+ "in": "path",
6060
+ "required": true
6061
+ },
6062
+ {
6063
+ "description": "Set User Role Request",
6064
+ "name": "request",
6065
+ "in": "body",
6066
+ "required": true,
6067
+ "schema": {
6068
+ "$ref": "#/definitions/dto.SetUserRoleRequest"
6069
+ }
6070
+ }
6071
+ ],
6072
+ "responses": {
6073
+ "200": {
6074
+ "description": "OK",
6075
+ "schema": {
6076
+ "$ref": "#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData"
6077
+ }
6078
+ },
6079
+ "400": {
6080
+ "description": "Bad Request",
6081
+ "schema": {
6082
+ "$ref": "#/definitions/dto.ErrorResponse"
6083
+ }
6084
+ },
6085
+ "401": {
6086
+ "description": "Unauthorized",
6087
+ "schema": {
6088
+ "$ref": "#/definitions/dto.ErrorResponse"
6089
+ }
6090
+ },
6091
+ "403": {
6092
+ "description": "Forbidden",
6093
+ "schema": {
6094
+ "$ref": "#/definitions/dto.ErrorResponse"
6095
+ }
6096
+ },
6097
+ "404": {
6098
+ "description": "Not Found",
6099
+ "schema": {
6100
+ "$ref": "#/definitions/dto.ErrorResponse"
6101
+ }
6102
+ },
6103
+ "409": {
6104
+ "description": "Conflict",
6105
+ "schema": {
6106
+ "$ref": "#/definitions/dto.ErrorResponse"
6107
+ }
6108
+ },
6109
+ "422": {
6110
+ "description": "Unprocessable Entity",
6111
+ "schema": {
6112
+ "$ref": "#/definitions/dto.ErrorResponse"
6113
+ }
6114
+ }
6115
+ }
6116
+ }
6117
+ },
6118
  "/api/v1/super-admin/inject/probset": {
6119
  "post": {
6120
  "security": [
 
6255
  }
6256
  }
6257
  },
6258
+ "/api/v1/super-admin/logs": {
6259
+ "get": {
6260
+ "security": [
6261
+ {
6262
+ "BearerAuth": []
6263
+ }
6264
+ ],
6265
+ "description": "Get paginated audit logs with optional filters. Superadmin only.",
6266
+ "consumes": [
6267
+ "application/json"
6268
+ ],
6269
+ "produces": [
6270
+ "application/json"
6271
+ ],
6272
+ "tags": [
6273
+ "Super Admin Audit"
6274
+ ],
6275
+ "summary": "List Audit Logs",
6276
+ "parameters": [
6277
+ {
6278
+ "type": "integer",
6279
+ "description": "Page number (default 1)",
6280
+ "name": "page",
6281
+ "in": "query"
6282
+ },
6283
+ {
6284
+ "type": "integer",
6285
+ "description": "Items per page (default 10, max 50)",
6286
+ "name": "limit",
6287
+ "in": "query"
6288
+ },
6289
+ {
6290
+ "type": "string",
6291
+ "description": "Filter by action",
6292
+ "name": "action",
6293
+ "in": "query"
6294
+ },
6295
+ {
6296
+ "type": "string",
6297
+ "description": "Filter by actor account ID",
6298
+ "name": "actor_account_id",
6299
+ "in": "query"
6300
+ },
6301
+ {
6302
+ "type": "string",
6303
+ "description": "Start time (RFC3339)",
6304
+ "name": "from",
6305
+ "in": "query"
6306
+ },
6307
+ {
6308
+ "type": "string",
6309
+ "description": "End time (RFC3339)",
6310
+ "name": "to",
6311
+ "in": "query"
6312
+ }
6313
+ ],
6314
+ "responses": {
6315
+ "200": {
6316
+ "description": "OK",
6317
+ "schema": {
6318
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse"
6319
+ }
6320
+ },
6321
+ "401": {
6322
+ "description": "Unauthorized",
6323
+ "schema": {
6324
+ "$ref": "#/definitions/dto.ErrorResponse"
6325
+ }
6326
+ },
6327
+ "403": {
6328
+ "description": "Forbidden",
6329
+ "schema": {
6330
+ "$ref": "#/definitions/dto.ErrorResponse"
6331
+ }
6332
+ }
6333
+ }
6334
+ }
6335
+ },
6336
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6337
  "post": {
6338
  "security": [
 
6442
  }
6443
  }
6444
  },
6445
+ "/api/v1/super-admin/roles": {
6446
  "get": {
6447
  "security": [
6448
  {
6449
  "BearerAuth": []
6450
  }
6451
  ],
6452
+ "description": "Get all system and named custom roles with their privilege flags",
6453
  "consumes": [
6454
  "application/json"
6455
  ],
 
6457
  "application/json"
6458
  ],
6459
  "tags": [
6460
+ "Super Admin Roles"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6461
  ],
6462
+ "summary": "List All Roles",
6463
  "responses": {
6464
  "200": {
6465
  "description": "OK",
6466
  "schema": {
6467
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_RoleResponse"
 
 
 
 
 
 
6468
  }
6469
  },
6470
  "401": {
 
6487
  "BearerAuth": []
6488
  }
6489
  ],
6490
+ "description": "Create a new named custom role with privilege flags. Superadmin only.",
6491
  "consumes": [
6492
  "application/json"
6493
  ],
 
6495
  "application/json"
6496
  ],
6497
  "tags": [
6498
+ "Super Admin Roles"
6499
  ],
6500
+ "summary": "Create Named Role",
6501
  "parameters": [
6502
  {
6503
+ "description": "Create Role Request",
6504
  "name": "request",
6505
  "in": "body",
6506
  "required": true,
6507
  "schema": {
6508
+ "$ref": "#/definitions/dto.CreateRoleRequest"
6509
  }
6510
  }
6511
  ],
 
6513
  "200": {
6514
  "description": "OK",
6515
  "schema": {
6516
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6517
  }
6518
  },
6519
  "400": {
 
6533
  "schema": {
6534
  "$ref": "#/definitions/dto.ErrorResponse"
6535
  }
6536
+ },
6537
+ "409": {
6538
+ "description": "Conflict",
6539
+ "schema": {
6540
+ "$ref": "#/definitions/dto.ErrorResponse"
6541
+ }
6542
  }
6543
  }
6544
  }
6545
  },
6546
+ "/api/v1/super-admin/roles/{role_id}": {
6547
+ "put": {
6548
  "security": [
6549
  {
6550
  "BearerAuth": []
6551
  }
6552
  ],
6553
+ "description": "Update a named custom role's privilege flags. System roles are immutable.",
6554
  "consumes": [
6555
  "application/json"
6556
  ],
 
6558
  "application/json"
6559
  ],
6560
  "tags": [
6561
+ "Super Admin Roles"
6562
  ],
6563
+ "summary": "Update Named Role",
6564
  "parameters": [
6565
  {
6566
+ "type": "string",
6567
+ "description": "Role ID",
6568
+ "name": "role_id",
6569
+ "in": "path",
6570
+ "required": true
6571
+ },
6572
+ {
6573
+ "description": "Update Role Request",
6574
+ "name": "request",
6575
  "in": "body",
6576
  "required": true,
6577
  "schema": {
6578
+ "$ref": "#/definitions/dto.UpdateRoleRequest"
 
 
 
6579
  }
6580
  }
6581
  ],
 
6583
  "200": {
6584
  "description": "OK",
6585
  "schema": {
6586
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6587
  }
6588
  },
6589
  "400": {
 
6605
  }
6606
  }
6607
  }
6608
+ },
6609
+ "delete": {
 
 
6610
  "security": [
6611
  {
6612
  "BearerAuth": []
6613
  }
6614
  ],
6615
+ "description": "Delete a named custom role. System roles are immutable. Cannot delete if assigned to any account.",
6616
  "consumes": [
6617
  "application/json"
6618
  ],
 
6620
  "application/json"
6621
  ],
6622
  "tags": [
6623
+ "Super Admin Roles"
6624
  ],
6625
+ "summary": "Delete Named Role",
6626
  "parameters": [
6627
  {
6628
  "type": "string",
6629
+ "description": "Role ID",
6630
+ "name": "role_id",
6631
+ "in": "path",
6632
+ "required": true
6633
+ }
6634
+ ],
6635
+ "responses": {
6636
+ "200": {
6637
+ "description": "OK",
6638
+ "schema": {
6639
+ "$ref": "#/definitions/dto.SuccessResponse-any"
6640
+ }
6641
+ },
6642
+ "401": {
6643
+ "description": "Unauthorized",
6644
+ "schema": {
6645
+ "$ref": "#/definitions/dto.ErrorResponse"
6646
+ }
6647
+ },
6648
+ "403": {
6649
+ "description": "Forbidden",
6650
+ "schema": {
6651
+ "$ref": "#/definitions/dto.ErrorResponse"
6652
+ }
6653
+ },
6654
+ "409": {
6655
+ "description": "Conflict",
6656
+ "schema": {
6657
+ "$ref": "#/definitions/dto.ErrorResponse"
6658
+ }
6659
+ }
6660
+ }
6661
+ }
6662
+ },
6663
+ "/api/v1/super-admin/users": {
6664
+ "get": {
6665
+ "security": [
6666
+ {
6667
+ "BearerAuth": []
6668
+ }
6669
+ ],
6670
+ "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6671
+ "consumes": [
6672
+ "application/json"
6673
+ ],
6674
+ "produces": [
6675
+ "application/json"
6676
+ ],
6677
+ "tags": [
6678
+ "Super Admin Users Management"
6679
+ ],
6680
+ "summary": "List All Users with Pagination",
6681
+ "parameters": [
6682
+ {
6683
+ "type": "integer",
6684
+ "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6685
+ "name": "page",
6686
+ "in": "query"
6687
+ },
6688
+ {
6689
+ "type": "integer",
6690
+ "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6691
+ "name": "limit",
6692
+ "in": "query"
6693
+ },
6694
+ {
6695
+ "type": "string",
6696
+ "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6697
+ "name": "role",
6698
+ "in": "query"
6699
+ }
6700
+ ],
6701
+ "responses": {
6702
+ "200": {
6703
+ "description": "OK",
6704
+ "schema": {
6705
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6706
+ }
6707
+ },
6708
+ "400": {
6709
+ "description": "Bad Request",
6710
+ "schema": {
6711
+ "$ref": "#/definitions/dto.ErrorResponse"
6712
+ }
6713
+ },
6714
+ "401": {
6715
+ "description": "Unauthorized",
6716
+ "schema": {
6717
+ "$ref": "#/definitions/dto.ErrorResponse"
6718
+ }
6719
+ },
6720
+ "403": {
6721
+ "description": "Forbidden",
6722
+ "schema": {
6723
+ "$ref": "#/definitions/dto.ErrorResponse"
6724
+ }
6725
+ }
6726
+ }
6727
+ },
6728
+ "post": {
6729
+ "security": [
6730
+ {
6731
+ "BearerAuth": []
6732
+ }
6733
+ ],
6734
+ "description": "Create a new user account by providing user details",
6735
+ "consumes": [
6736
+ "application/json"
6737
+ ],
6738
+ "produces": [
6739
+ "application/json"
6740
+ ],
6741
+ "tags": [
6742
+ "Super Admin Users Management"
6743
+ ],
6744
+ "summary": "Create Single User",
6745
+ "parameters": [
6746
+ {
6747
+ "description": "Create User Request",
6748
+ "name": "request",
6749
+ "in": "body",
6750
+ "required": true,
6751
+ "schema": {
6752
+ "$ref": "#/definitions/dto.CreateUserRequest"
6753
+ }
6754
+ }
6755
+ ],
6756
+ "responses": {
6757
+ "200": {
6758
+ "description": "OK",
6759
+ "schema": {
6760
+ "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6761
+ }
6762
+ },
6763
+ "400": {
6764
+ "description": "Bad Request",
6765
+ "schema": {
6766
+ "$ref": "#/definitions/dto.ErrorResponse"
6767
+ }
6768
+ },
6769
+ "401": {
6770
+ "description": "Unauthorized",
6771
+ "schema": {
6772
+ "$ref": "#/definitions/dto.ErrorResponse"
6773
+ }
6774
+ },
6775
+ "403": {
6776
+ "description": "Forbidden",
6777
+ "schema": {
6778
+ "$ref": "#/definitions/dto.ErrorResponse"
6779
+ }
6780
+ }
6781
+ }
6782
+ }
6783
+ },
6784
+ "/api/v1/super-admin/users/bulk": {
6785
+ "post": {
6786
+ "security": [
6787
+ {
6788
+ "BearerAuth": []
6789
+ }
6790
+ ],
6791
+ "description": "Create multiple user accounts at once",
6792
+ "consumes": [
6793
+ "application/json"
6794
+ ],
6795
+ "produces": [
6796
+ "application/json"
6797
+ ],
6798
+ "tags": [
6799
+ "Super Admin Users Management"
6800
+ ],
6801
+ "summary": "Bulk Create Users",
6802
+ "parameters": [
6803
+ {
6804
+ "description": "Bulk Create User Requests",
6805
+ "name": "requests",
6806
+ "in": "body",
6807
+ "required": true,
6808
+ "schema": {
6809
+ "type": "array",
6810
+ "items": {
6811
+ "$ref": "#/definitions/dto.CreateUserRequest"
6812
+ }
6813
+ }
6814
+ }
6815
+ ],
6816
+ "responses": {
6817
+ "200": {
6818
+ "description": "OK",
6819
+ "schema": {
6820
+ "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6821
+ }
6822
+ },
6823
+ "400": {
6824
+ "description": "Bad Request",
6825
+ "schema": {
6826
+ "$ref": "#/definitions/dto.ErrorResponse"
6827
+ }
6828
+ },
6829
+ "401": {
6830
+ "description": "Unauthorized",
6831
+ "schema": {
6832
+ "$ref": "#/definitions/dto.ErrorResponse"
6833
+ }
6834
+ },
6835
+ "403": {
6836
+ "description": "Forbidden",
6837
+ "schema": {
6838
+ "$ref": "#/definitions/dto.ErrorResponse"
6839
+ }
6840
+ }
6841
+ }
6842
+ }
6843
+ },
6844
+ "/api/v1/super-admin/users/{id}": {
6845
+ "put": {
6846
+ "security": [
6847
+ {
6848
+ "BearerAuth": []
6849
+ }
6850
+ ],
6851
+ "description": "Update user information by ID",
6852
+ "consumes": [
6853
+ "application/json"
6854
+ ],
6855
+ "produces": [
6856
+ "application/json"
6857
+ ],
6858
+ "tags": [
6859
+ "Super Admin Users Management"
6860
+ ],
6861
+ "summary": "Edit User",
6862
+ "parameters": [
6863
+ {
6864
+ "type": "string",
6865
+ "description": "User ID",
6866
  "name": "id",
6867
  "in": "path",
6868
  "required": true
 
7352
  }
7353
  }
7354
  },
7355
+ "dto.AuditLogResponse": {
7356
+ "type": "object",
7357
+ "properties": {
7358
+ "action": {
7359
+ "type": "string"
7360
+ },
7361
+ "actor_account_id": {
7362
+ "type": "string"
7363
+ },
7364
+ "created_at": {
7365
+ "type": "string"
7366
+ },
7367
+ "detail": {
7368
+ "type": "string"
7369
+ },
7370
+ "id": {
7371
+ "type": "string"
7372
+ },
7373
+ "target_id": {
7374
+ "type": "string"
7375
+ }
7376
+ }
7377
+ },
7378
  "dto.AuthenticatedUser": {
7379
  "type": "object",
7380
  "properties": {
 
7724
  }
7725
  }
7726
  },
7727
+ "dto.CreateRoleRequest": {
7728
+ "type": "object",
7729
+ "required": [
7730
+ "name"
7731
+ ],
7732
+ "properties": {
7733
+ "academy_management": {
7734
+ "type": "boolean"
7735
+ },
7736
+ "content_management": {
7737
+ "type": "boolean"
7738
+ },
7739
+ "event_management": {
7740
+ "type": "boolean"
7741
+ },
7742
+ "exam_management": {
7743
+ "type": "boolean"
7744
+ },
7745
+ "name": {
7746
+ "type": "string"
7747
+ }
7748
+ }
7749
+ },
7750
  "dto.CreateUserRequest": {
7751
  "type": "object",
7752
  "required": [
 
8022
  }
8023
  }
8024
  },
8025
+ "dto.Privileges": {
8026
+ "type": "object",
8027
+ "properties": {
8028
+ "academy_management": {
8029
+ "type": "boolean"
8030
+ },
8031
+ "content_management": {
8032
+ "type": "boolean"
8033
+ },
8034
+ "event_management": {
8035
+ "type": "boolean"
8036
+ },
8037
+ "exam_management": {
8038
+ "type": "boolean"
8039
+ }
8040
+ }
8041
+ },
8042
  "dto.ProblemSetInjectResponse": {
8043
  "type": "object",
8044
  "properties": {
 
8296
  }
8297
  }
8298
  },
8299
+ "dto.RoleResponse": {
8300
+ "type": "object",
8301
+ "properties": {
8302
+ "academy_management": {
8303
+ "type": "boolean"
8304
+ },
8305
+ "content_management": {
8306
+ "type": "boolean"
8307
+ },
8308
+ "event_management": {
8309
+ "type": "boolean"
8310
+ },
8311
+ "exam_management": {
8312
+ "type": "boolean"
8313
+ },
8314
+ "id": {
8315
+ "type": "string"
8316
+ },
8317
+ "is_system": {
8318
+ "type": "boolean"
8319
+ },
8320
+ "name": {
8321
+ "type": "string"
8322
+ }
8323
+ }
8324
+ },
8325
+ "dto.SetUserRoleRequest": {
8326
+ "type": "object",
8327
+ "required": [
8328
+ "privileges",
8329
+ "role_name"
8330
+ ],
8331
+ "properties": {
8332
+ "privileges": {
8333
+ "$ref": "#/definitions/dto.Privileges"
8334
+ },
8335
+ "role_name": {
8336
+ "type": "string"
8337
+ }
8338
+ }
8339
+ },
8340
+ "dto.SetUserRoleResponseData": {
8341
+ "type": "object",
8342
+ "properties": {
8343
+ "account_id": {
8344
+ "type": "string"
8345
+ },
8346
+ "privileges": {
8347
+ "$ref": "#/definitions/dto.Privileges"
8348
+ },
8349
+ "role_name": {
8350
+ "type": "string"
8351
+ }
8352
+ }
8353
+ },
8354
  "dto.SignInRequest": {
8355
  "type": "object",
8356
  "required": [
 
8431
  }
8432
  }
8433
  },
8434
+ "dto.SuccessResponse-array_dto_AuditLogResponse": {
8435
+ "type": "object",
8436
+ "properties": {
8437
+ "data": {
8438
+ "type": "array",
8439
+ "items": {
8440
+ "$ref": "#/definitions/dto.AuditLogResponse"
8441
+ }
8442
+ },
8443
+ "message": {},
8444
+ "meta_data": {},
8445
+ "status": {
8446
+ "type": "string"
8447
+ }
8448
+ }
8449
+ },
8450
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8451
  "type": "object",
8452
  "properties": {
 
8479
  }
8480
  }
8481
  },
8482
+ "dto.SuccessResponse-array_dto_RoleResponse": {
8483
+ "type": "object",
8484
+ "properties": {
8485
+ "data": {
8486
+ "type": "array",
8487
+ "items": {
8488
+ "$ref": "#/definitions/dto.RoleResponse"
8489
+ }
8490
+ },
8491
+ "message": {},
8492
+ "meta_data": {},
8493
+ "status": {
8494
+ "type": "string"
8495
+ }
8496
+ }
8497
+ },
8498
  "dto.SuccessResponse-array_dto_UserResponse": {
8499
  "type": "object",
8500
  "properties": {
 
8891
  }
8892
  }
8893
  },
8894
+ "dto.SuccessResponse-dto_RoleResponse": {
8895
+ "type": "object",
8896
+ "properties": {
8897
+ "data": {
8898
+ "$ref": "#/definitions/dto.RoleResponse"
8899
+ },
8900
+ "message": {},
8901
+ "meta_data": {},
8902
+ "status": {
8903
+ "type": "string"
8904
+ }
8905
+ }
8906
+ },
8907
+ "dto.SuccessResponse-dto_SetUserRoleResponseData": {
8908
+ "type": "object",
8909
+ "properties": {
8910
+ "data": {
8911
+ "$ref": "#/definitions/dto.SetUserRoleResponseData"
8912
+ },
8913
+ "message": {},
8914
+ "meta_data": {},
8915
+ "status": {
8916
+ "type": "string"
8917
+ }
8918
+ }
8919
+ },
8920
  "dto.SuccessResponse-dto_UserResponse": {
8921
  "type": "object",
8922
  "properties": {
 
9292
  }
9293
  }
9294
  },
9295
+ "dto.UpdateRoleRequest": {
9296
+ "type": "object",
9297
+ "properties": {
9298
+ "academy_management": {
9299
+ "type": "boolean"
9300
+ },
9301
+ "content_management": {
9302
+ "type": "boolean"
9303
+ },
9304
+ "event_management": {
9305
+ "type": "boolean"
9306
+ },
9307
+ "exam_management": {
9308
+ "type": "boolean"
9309
+ },
9310
+ "name": {
9311
+ "type": "string"
9312
+ }
9313
+ }
9314
+ },
9315
  "dto.UpdateUserRequest": {
9316
  "type": "object",
9317
  "properties": {
 
9329
  }
9330
  }
9331
  },
 
 
 
 
 
 
 
 
 
 
 
9332
  "dto.UserResponse": {
9333
  "type": "object",
9334
  "properties": {
 
9755
  "models.Account": {
9756
  "type": "object",
9757
  "properties": {
9758
+ "academy_management": {
9759
+ "type": "boolean"
9760
+ },
9761
+ "content_management": {
9762
+ "type": "boolean"
9763
+ },
9764
  "created_at": {
9765
  "type": "string"
9766
  },
9767
  "email": {
9768
  "type": "string"
9769
  },
9770
+ "event_management": {
9771
+ "type": "boolean"
9772
+ },
9773
+ "exam_management": {
9774
+ "type": "boolean"
9775
+ },
9776
  "full_name": {
9777
  "type": "string"
9778
  },
 
9788
  "role": {
9789
  "type": "string"
9790
  },
9791
+ "role_id": {
9792
+ "type": "string"
9793
+ },
9794
+ "role_name": {
9795
+ "type": "string"
9796
+ },
9797
+ "token_version": {
9798
+ "type": "integer"
9799
+ },
9800
  "username": {
9801
  "type": "string"
9802
  }
docs/swagger.yaml CHANGED
@@ -249,6 +249,21 @@ definitions:
249
  account_id:
250
  type: string
251
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  dto.AuthenticatedUser:
253
  properties:
254
  account:
@@ -480,6 +495,21 @@ definitions:
480
  - question
481
  - type
482
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  dto.CreateUserRequest:
484
  properties:
485
  email:
@@ -661,6 +691,17 @@ definitions:
661
  - option_name
662
  - option_values
663
  type: object
 
 
 
 
 
 
 
 
 
 
 
664
  dto.ProblemSetInjectResponse:
665
  properties:
666
  file:
@@ -828,6 +869,42 @@ definitions:
828
  required:
829
  - question_ids
830
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  dto.SignInRequest:
832
  properties:
833
  email_or_username:
@@ -883,6 +960,17 @@ definitions:
883
  status:
884
  type: string
885
  type: object
 
 
 
 
 
 
 
 
 
 
 
886
  dto.SuccessResponse-array_dto_EventScoreboardItem:
887
  properties:
888
  data:
@@ -905,6 +993,17 @@ definitions:
905
  status:
906
  type: string
907
  type: object
 
 
 
 
 
 
 
 
 
 
 
908
  dto.SuccessResponse-array_dto_UserResponse:
909
  properties:
910
  data:
@@ -1178,6 +1277,24 @@ definitions:
1178
  status:
1179
  type: string
1180
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181
  dto.SuccessResponse-dto_UserResponse:
1182
  properties:
1183
  data:
@@ -1431,6 +1548,19 @@ definitions:
1431
  required:
1432
  - final_score
1433
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
1434
  dto.UpdateUserRequest:
1435
  properties:
1436
  email:
@@ -1442,13 +1572,6 @@ definitions:
1442
  username:
1443
  type: string
1444
  type: object
1445
- dto.UpdateUserRoleRequest:
1446
- properties:
1447
- role:
1448
- type: string
1449
- required:
1450
- - role
1451
- type: object
1452
  dto.UserResponse:
1453
  properties:
1454
  created_at: {}
@@ -1729,10 +1852,18 @@ definitions:
1729
  type: object
1730
  models.Account:
1731
  properties:
 
 
 
 
1732
  created_at:
1733
  type: string
1734
  email:
1735
  type: string
 
 
 
 
1736
  full_name:
1737
  type: string
1738
  id:
@@ -1743,6 +1874,12 @@ definitions:
1743
  type: boolean
1744
  role:
1745
  type: string
 
 
 
 
 
 
1746
  username:
1747
  type: string
1748
  type: object
@@ -3204,39 +3341,6 @@ paths:
3204
  summary: 'Admin: List Academy Participants'
3205
  tags:
3206
  - Admin Academy
3207
- /api/v1/admin/authentication/{account_id}/assign:
3208
- put:
3209
- consumes:
3210
- - application/json
3211
- description: Update the role of a user account
3212
- parameters:
3213
- - description: Account ID
3214
- in: path
3215
- name: accountId
3216
- required: true
3217
- type: string
3218
- - description: Update User Role Request
3219
- in: body
3220
- name: request
3221
- required: true
3222
- schema:
3223
- $ref: '#/definitions/dto.UpdateUserRoleRequest'
3224
- produces:
3225
- - application/json
3226
- responses:
3227
- "200":
3228
- description: OK
3229
- schema:
3230
- $ref: '#/definitions/dto.SuccessResponse-models_Account'
3231
- "400":
3232
- description: Bad Request
3233
- schema:
3234
- $ref: '#/definitions/dto.ErrorResponse'
3235
- security:
3236
- - BearerAuth: []
3237
- summary: Update User Role
3238
- tags:
3239
- - Authentication
3240
  /api/v1/admin/events:
3241
  get:
3242
  consumes:
@@ -6039,6 +6143,60 @@ paths:
6039
  summary: Seed Provinces
6040
  tags:
6041
  - Region
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6042
  /api/v1/super-admin/inject/probset:
6043
  post:
6044
  consumes:
@@ -6130,6 +6288,56 @@ paths:
6130
  summary: 'Super Admin: Inject Zip to Storage'
6131
  tags:
6132
  - Super Admin Inject
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6133
  /api/v1/super-admin/repair/problemset/naming/migrate:
6134
  post:
6135
  consumes:
@@ -6201,6 +6409,148 @@ paths:
6201
  summary: 'Super Admin: Repair Question Storage Path'
6202
  tags:
6203
  - Super Admin Repair
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6204
  /api/v1/super-admin/users:
6205
  get:
6206
  consumes:
 
249
  account_id:
250
  type: string
251
  type: object
252
+ dto.AuditLogResponse:
253
+ properties:
254
+ action:
255
+ type: string
256
+ actor_account_id:
257
+ type: string
258
+ created_at:
259
+ type: string
260
+ detail:
261
+ type: string
262
+ id:
263
+ type: string
264
+ target_id:
265
+ type: string
266
+ type: object
267
  dto.AuthenticatedUser:
268
  properties:
269
  account:
 
495
  - question
496
  - type
497
  type: object
498
+ dto.CreateRoleRequest:
499
+ properties:
500
+ academy_management:
501
+ type: boolean
502
+ content_management:
503
+ type: boolean
504
+ event_management:
505
+ type: boolean
506
+ exam_management:
507
+ type: boolean
508
+ name:
509
+ type: string
510
+ required:
511
+ - name
512
+ type: object
513
  dto.CreateUserRequest:
514
  properties:
515
  email:
 
691
  - option_name
692
  - option_values
693
  type: object
694
+ dto.Privileges:
695
+ properties:
696
+ academy_management:
697
+ type: boolean
698
+ content_management:
699
+ type: boolean
700
+ event_management:
701
+ type: boolean
702
+ exam_management:
703
+ type: boolean
704
+ type: object
705
  dto.ProblemSetInjectResponse:
706
  properties:
707
  file:
 
869
  required:
870
  - question_ids
871
  type: object
872
+ dto.RoleResponse:
873
+ properties:
874
+ academy_management:
875
+ type: boolean
876
+ content_management:
877
+ type: boolean
878
+ event_management:
879
+ type: boolean
880
+ exam_management:
881
+ type: boolean
882
+ id:
883
+ type: string
884
+ is_system:
885
+ type: boolean
886
+ name:
887
+ type: string
888
+ type: object
889
+ dto.SetUserRoleRequest:
890
+ properties:
891
+ privileges:
892
+ $ref: '#/definitions/dto.Privileges'
893
+ role_name:
894
+ type: string
895
+ required:
896
+ - privileges
897
+ - role_name
898
+ type: object
899
+ dto.SetUserRoleResponseData:
900
+ properties:
901
+ account_id:
902
+ type: string
903
+ privileges:
904
+ $ref: '#/definitions/dto.Privileges'
905
+ role_name:
906
+ type: string
907
+ type: object
908
  dto.SignInRequest:
909
  properties:
910
  email_or_username:
 
960
  status:
961
  type: string
962
  type: object
963
+ dto.SuccessResponse-array_dto_AuditLogResponse:
964
+ properties:
965
+ data:
966
+ items:
967
+ $ref: '#/definitions/dto.AuditLogResponse'
968
+ type: array
969
+ message: {}
970
+ meta_data: {}
971
+ status:
972
+ type: string
973
+ type: object
974
  dto.SuccessResponse-array_dto_EventScoreboardItem:
975
  properties:
976
  data:
 
993
  status:
994
  type: string
995
  type: object
996
+ dto.SuccessResponse-array_dto_RoleResponse:
997
+ properties:
998
+ data:
999
+ items:
1000
+ $ref: '#/definitions/dto.RoleResponse'
1001
+ type: array
1002
+ message: {}
1003
+ meta_data: {}
1004
+ status:
1005
+ type: string
1006
+ type: object
1007
  dto.SuccessResponse-array_dto_UserResponse:
1008
  properties:
1009
  data:
 
1277
  status:
1278
  type: string
1279
  type: object
1280
+ dto.SuccessResponse-dto_RoleResponse:
1281
+ properties:
1282
+ data:
1283
+ $ref: '#/definitions/dto.RoleResponse'
1284
+ message: {}
1285
+ meta_data: {}
1286
+ status:
1287
+ type: string
1288
+ type: object
1289
+ dto.SuccessResponse-dto_SetUserRoleResponseData:
1290
+ properties:
1291
+ data:
1292
+ $ref: '#/definitions/dto.SetUserRoleResponseData'
1293
+ message: {}
1294
+ meta_data: {}
1295
+ status:
1296
+ type: string
1297
+ type: object
1298
  dto.SuccessResponse-dto_UserResponse:
1299
  properties:
1300
  data:
 
1548
  required:
1549
  - final_score
1550
  type: object
1551
+ dto.UpdateRoleRequest:
1552
+ properties:
1553
+ academy_management:
1554
+ type: boolean
1555
+ content_management:
1556
+ type: boolean
1557
+ event_management:
1558
+ type: boolean
1559
+ exam_management:
1560
+ type: boolean
1561
+ name:
1562
+ type: string
1563
+ type: object
1564
  dto.UpdateUserRequest:
1565
  properties:
1566
  email:
 
1572
  username:
1573
  type: string
1574
  type: object
 
 
 
 
 
 
 
1575
  dto.UserResponse:
1576
  properties:
1577
  created_at: {}
 
1852
  type: object
1853
  models.Account:
1854
  properties:
1855
+ academy_management:
1856
+ type: boolean
1857
+ content_management:
1858
+ type: boolean
1859
  created_at:
1860
  type: string
1861
  email:
1862
  type: string
1863
+ event_management:
1864
+ type: boolean
1865
+ exam_management:
1866
+ type: boolean
1867
  full_name:
1868
  type: string
1869
  id:
 
1874
  type: boolean
1875
  role:
1876
  type: string
1877
+ role_id:
1878
+ type: string
1879
+ role_name:
1880
+ type: string
1881
+ token_version:
1882
+ type: integer
1883
  username:
1884
  type: string
1885
  type: object
 
3341
  summary: 'Admin: List Academy Participants'
3342
  tags:
3343
  - Admin Academy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3344
  /api/v1/admin/events:
3345
  get:
3346
  consumes:
 
6143
  summary: Seed Provinces
6144
  tags:
6145
  - Region
6146
+ /api/v1/super-admin/accounts/{account_id}/role:
6147
+ put:
6148
+ consumes:
6149
+ - application/json
6150
+ description: Set the role and privileges of a user account. Supports system
6151
+ roles, named custom roles, or "custom" with explicit flags.
6152
+ parameters:
6153
+ - description: Account ID
6154
+ in: path
6155
+ name: account_id
6156
+ required: true
6157
+ type: string
6158
+ - description: Set User Role Request
6159
+ in: body
6160
+ name: request
6161
+ required: true
6162
+ schema:
6163
+ $ref: '#/definitions/dto.SetUserRoleRequest'
6164
+ produces:
6165
+ - application/json
6166
+ responses:
6167
+ "200":
6168
+ description: OK
6169
+ schema:
6170
+ $ref: '#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData'
6171
+ "400":
6172
+ description: Bad Request
6173
+ schema:
6174
+ $ref: '#/definitions/dto.ErrorResponse'
6175
+ "401":
6176
+ description: Unauthorized
6177
+ schema:
6178
+ $ref: '#/definitions/dto.ErrorResponse'
6179
+ "403":
6180
+ description: Forbidden
6181
+ schema:
6182
+ $ref: '#/definitions/dto.ErrorResponse'
6183
+ "404":
6184
+ description: Not Found
6185
+ schema:
6186
+ $ref: '#/definitions/dto.ErrorResponse'
6187
+ "409":
6188
+ description: Conflict
6189
+ schema:
6190
+ $ref: '#/definitions/dto.ErrorResponse'
6191
+ "422":
6192
+ description: Unprocessable Entity
6193
+ schema:
6194
+ $ref: '#/definitions/dto.ErrorResponse'
6195
+ security:
6196
+ - BearerAuth: []
6197
+ summary: Set User Role
6198
+ tags:
6199
+ - Super Admin Accounts
6200
  /api/v1/super-admin/inject/probset:
6201
  post:
6202
  consumes:
 
6288
  summary: 'Super Admin: Inject Zip to Storage'
6289
  tags:
6290
  - Super Admin Inject
6291
+ /api/v1/super-admin/logs:
6292
+ get:
6293
+ consumes:
6294
+ - application/json
6295
+ description: Get paginated audit logs with optional filters. Superadmin only.
6296
+ parameters:
6297
+ - description: Page number (default 1)
6298
+ in: query
6299
+ name: page
6300
+ type: integer
6301
+ - description: Items per page (default 10, max 50)
6302
+ in: query
6303
+ name: limit
6304
+ type: integer
6305
+ - description: Filter by action
6306
+ in: query
6307
+ name: action
6308
+ type: string
6309
+ - description: Filter by actor account ID
6310
+ in: query
6311
+ name: actor_account_id
6312
+ type: string
6313
+ - description: Start time (RFC3339)
6314
+ in: query
6315
+ name: from
6316
+ type: string
6317
+ - description: End time (RFC3339)
6318
+ in: query
6319
+ name: to
6320
+ type: string
6321
+ produces:
6322
+ - application/json
6323
+ responses:
6324
+ "200":
6325
+ description: OK
6326
+ schema:
6327
+ $ref: '#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse'
6328
+ "401":
6329
+ description: Unauthorized
6330
+ schema:
6331
+ $ref: '#/definitions/dto.ErrorResponse'
6332
+ "403":
6333
+ description: Forbidden
6334
+ schema:
6335
+ $ref: '#/definitions/dto.ErrorResponse'
6336
+ security:
6337
+ - BearerAuth: []
6338
+ summary: List Audit Logs
6339
+ tags:
6340
+ - Super Admin Audit
6341
  /api/v1/super-admin/repair/problemset/naming/migrate:
6342
  post:
6343
  consumes:
 
6409
  summary: 'Super Admin: Repair Question Storage Path'
6410
  tags:
6411
  - Super Admin Repair
6412
+ /api/v1/super-admin/roles:
6413
+ get:
6414
+ consumes:
6415
+ - application/json
6416
+ description: Get all system and named custom roles with their privilege flags
6417
+ produces:
6418
+ - application/json
6419
+ responses:
6420
+ "200":
6421
+ description: OK
6422
+ schema:
6423
+ $ref: '#/definitions/dto.SuccessResponse-array_dto_RoleResponse'
6424
+ "401":
6425
+ description: Unauthorized
6426
+ schema:
6427
+ $ref: '#/definitions/dto.ErrorResponse'
6428
+ "403":
6429
+ description: Forbidden
6430
+ schema:
6431
+ $ref: '#/definitions/dto.ErrorResponse'
6432
+ security:
6433
+ - BearerAuth: []
6434
+ summary: List All Roles
6435
+ tags:
6436
+ - Super Admin Roles
6437
+ post:
6438
+ consumes:
6439
+ - application/json
6440
+ description: Create a new named custom role with privilege flags. Superadmin
6441
+ only.
6442
+ parameters:
6443
+ - description: Create Role Request
6444
+ in: body
6445
+ name: request
6446
+ required: true
6447
+ schema:
6448
+ $ref: '#/definitions/dto.CreateRoleRequest'
6449
+ produces:
6450
+ - application/json
6451
+ responses:
6452
+ "200":
6453
+ description: OK
6454
+ schema:
6455
+ $ref: '#/definitions/dto.SuccessResponse-dto_RoleResponse'
6456
+ "400":
6457
+ description: Bad Request
6458
+ schema:
6459
+ $ref: '#/definitions/dto.ErrorResponse'
6460
+ "401":
6461
+ description: Unauthorized
6462
+ schema:
6463
+ $ref: '#/definitions/dto.ErrorResponse'
6464
+ "403":
6465
+ description: Forbidden
6466
+ schema:
6467
+ $ref: '#/definitions/dto.ErrorResponse'
6468
+ "409":
6469
+ description: Conflict
6470
+ schema:
6471
+ $ref: '#/definitions/dto.ErrorResponse'
6472
+ security:
6473
+ - BearerAuth: []
6474
+ summary: Create Named Role
6475
+ tags:
6476
+ - Super Admin Roles
6477
+ /api/v1/super-admin/roles/{role_id}:
6478
+ delete:
6479
+ consumes:
6480
+ - application/json
6481
+ description: Delete a named custom role. System roles are immutable. Cannot
6482
+ delete if assigned to any account.
6483
+ parameters:
6484
+ - description: Role ID
6485
+ in: path
6486
+ name: role_id
6487
+ required: true
6488
+ type: string
6489
+ produces:
6490
+ - application/json
6491
+ responses:
6492
+ "200":
6493
+ description: OK
6494
+ schema:
6495
+ $ref: '#/definitions/dto.SuccessResponse-any'
6496
+ "401":
6497
+ description: Unauthorized
6498
+ schema:
6499
+ $ref: '#/definitions/dto.ErrorResponse'
6500
+ "403":
6501
+ description: Forbidden
6502
+ schema:
6503
+ $ref: '#/definitions/dto.ErrorResponse'
6504
+ "409":
6505
+ description: Conflict
6506
+ schema:
6507
+ $ref: '#/definitions/dto.ErrorResponse'
6508
+ security:
6509
+ - BearerAuth: []
6510
+ summary: Delete Named Role
6511
+ tags:
6512
+ - Super Admin Roles
6513
+ put:
6514
+ consumes:
6515
+ - application/json
6516
+ description: Update a named custom role's privilege flags. System roles are
6517
+ immutable.
6518
+ parameters:
6519
+ - description: Role ID
6520
+ in: path
6521
+ name: role_id
6522
+ required: true
6523
+ type: string
6524
+ - description: Update Role Request
6525
+ in: body
6526
+ name: request
6527
+ required: true
6528
+ schema:
6529
+ $ref: '#/definitions/dto.UpdateRoleRequest'
6530
+ produces:
6531
+ - application/json
6532
+ responses:
6533
+ "200":
6534
+ description: OK
6535
+ schema:
6536
+ $ref: '#/definitions/dto.SuccessResponse-dto_RoleResponse'
6537
+ "400":
6538
+ description: Bad Request
6539
+ schema:
6540
+ $ref: '#/definitions/dto.ErrorResponse'
6541
+ "401":
6542
+ description: Unauthorized
6543
+ schema:
6544
+ $ref: '#/definitions/dto.ErrorResponse'
6545
+ "403":
6546
+ description: Forbidden
6547
+ schema:
6548
+ $ref: '#/definitions/dto.ErrorResponse'
6549
+ security:
6550
+ - BearerAuth: []
6551
+ summary: Update Named Role
6552
+ tags:
6553
+ - Super Admin Roles
6554
  /api/v1/super-admin/users:
6555
  get:
6556
  consumes:
swagger/docs/docs.go CHANGED
@@ -1763,58 +1763,6 @@ const docTemplate = `{
1763
  }
1764
  }
1765
  },
1766
- "/api/v1/admin/authentication/{account_id}/assign": {
1767
- "put": {
1768
- "security": [
1769
- {
1770
- "BearerAuth": []
1771
- }
1772
- ],
1773
- "description": "Update the role of a user account",
1774
- "consumes": [
1775
- "application/json"
1776
- ],
1777
- "produces": [
1778
- "application/json"
1779
- ],
1780
- "tags": [
1781
- "Authentication"
1782
- ],
1783
- "summary": "Update User Role",
1784
- "parameters": [
1785
- {
1786
- "type": "string",
1787
- "description": "Account ID",
1788
- "name": "accountId",
1789
- "in": "path",
1790
- "required": true
1791
- },
1792
- {
1793
- "description": "Update User Role Request",
1794
- "name": "request",
1795
- "in": "body",
1796
- "required": true,
1797
- "schema": {
1798
- "$ref": "#/definitions/dto.UpdateUserRoleRequest"
1799
- }
1800
- }
1801
- ],
1802
- "responses": {
1803
- "200": {
1804
- "description": "OK",
1805
- "schema": {
1806
- "$ref": "#/definitions/dto.SuccessResponse-models_Account"
1807
- }
1808
- },
1809
- "400": {
1810
- "description": "Bad Request",
1811
- "schema": {
1812
- "$ref": "#/definitions/dto.ErrorResponse"
1813
- }
1814
- }
1815
- }
1816
- }
1817
- },
1818
  "/api/v1/admin/events": {
1819
  "get": {
1820
  "security": [
@@ -6103,6 +6051,88 @@ const docTemplate = `{
6103
  }
6104
  }
6105
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6106
  "/api/v1/super-admin/inject/probset": {
6107
  "post": {
6108
  "security": [
@@ -6243,6 +6273,84 @@ const docTemplate = `{
6243
  }
6244
  }
6245
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6246
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6247
  "post": {
6248
  "security": [
@@ -6352,14 +6460,14 @@ const docTemplate = `{
6352
  }
6353
  }
6354
  },
6355
- "/api/v1/super-admin/users": {
6356
  "get": {
6357
  "security": [
6358
  {
6359
  "BearerAuth": []
6360
  }
6361
  ],
6362
- "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6363
  "consumes": [
6364
  "application/json"
6365
  ],
@@ -6367,40 +6475,14 @@ const docTemplate = `{
6367
  "application/json"
6368
  ],
6369
  "tags": [
6370
- "Super Admin Users Management"
6371
- ],
6372
- "summary": "List All Users with Pagination",
6373
- "parameters": [
6374
- {
6375
- "type": "integer",
6376
- "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6377
- "name": "page",
6378
- "in": "query"
6379
- },
6380
- {
6381
- "type": "integer",
6382
- "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6383
- "name": "limit",
6384
- "in": "query"
6385
- },
6386
- {
6387
- "type": "string",
6388
- "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6389
- "name": "role",
6390
- "in": "query"
6391
- }
6392
  ],
 
6393
  "responses": {
6394
  "200": {
6395
  "description": "OK",
6396
  "schema": {
6397
- "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6398
- }
6399
- },
6400
- "400": {
6401
- "description": "Bad Request",
6402
- "schema": {
6403
- "$ref": "#/definitions/dto.ErrorResponse"
6404
  }
6405
  },
6406
  "401": {
@@ -6423,7 +6505,7 @@ const docTemplate = `{
6423
  "BearerAuth": []
6424
  }
6425
  ],
6426
- "description": "Create a new user account by providing user details",
6427
  "consumes": [
6428
  "application/json"
6429
  ],
@@ -6431,17 +6513,17 @@ const docTemplate = `{
6431
  "application/json"
6432
  ],
6433
  "tags": [
6434
- "Super Admin Users Management"
6435
  ],
6436
- "summary": "Create Single User",
6437
  "parameters": [
6438
  {
6439
- "description": "Create User Request",
6440
  "name": "request",
6441
  "in": "body",
6442
  "required": true,
6443
  "schema": {
6444
- "$ref": "#/definitions/dto.CreateUserRequest"
6445
  }
6446
  }
6447
  ],
@@ -6449,7 +6531,7 @@ const docTemplate = `{
6449
  "200": {
6450
  "description": "OK",
6451
  "schema": {
6452
- "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6453
  }
6454
  },
6455
  "400": {
@@ -6469,18 +6551,24 @@ const docTemplate = `{
6469
  "schema": {
6470
  "$ref": "#/definitions/dto.ErrorResponse"
6471
  }
 
 
 
 
 
 
6472
  }
6473
  }
6474
  }
6475
  },
6476
- "/api/v1/super-admin/users/bulk": {
6477
- "post": {
6478
  "security": [
6479
  {
6480
  "BearerAuth": []
6481
  }
6482
  ],
6483
- "description": "Create multiple user accounts at once",
6484
  "consumes": [
6485
  "application/json"
6486
  ],
@@ -6488,20 +6576,24 @@ const docTemplate = `{
6488
  "application/json"
6489
  ],
6490
  "tags": [
6491
- "Super Admin Users Management"
6492
  ],
6493
- "summary": "Bulk Create Users",
6494
  "parameters": [
6495
  {
6496
- "description": "Bulk Create User Requests",
6497
- "name": "requests",
 
 
 
 
 
 
 
6498
  "in": "body",
6499
  "required": true,
6500
  "schema": {
6501
- "type": "array",
6502
- "items": {
6503
- "$ref": "#/definitions/dto.CreateUserRequest"
6504
- }
6505
  }
6506
  }
6507
  ],
@@ -6509,7 +6601,7 @@ const docTemplate = `{
6509
  "200": {
6510
  "description": "OK",
6511
  "schema": {
6512
- "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6513
  }
6514
  },
6515
  "400": {
@@ -6531,16 +6623,14 @@ const docTemplate = `{
6531
  }
6532
  }
6533
  }
6534
- }
6535
- },
6536
- "/api/v1/super-admin/users/{id}": {
6537
- "put": {
6538
  "security": [
6539
  {
6540
  "BearerAuth": []
6541
  }
6542
  ],
6543
- "description": "Update user information by ID",
6544
  "consumes": [
6545
  "application/json"
6546
  ],
@@ -6548,13 +6638,249 @@ const docTemplate = `{
6548
  "application/json"
6549
  ],
6550
  "tags": [
6551
- "Super Admin Users Management"
6552
  ],
6553
- "summary": "Edit User",
6554
  "parameters": [
6555
  {
6556
  "type": "string",
6557
- "description": "User ID",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6558
  "name": "id",
6559
  "in": "path",
6560
  "required": true
@@ -7044,6 +7370,29 @@ const docTemplate = `{
7044
  }
7045
  }
7046
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7047
  "dto.AuthenticatedUser": {
7048
  "type": "object",
7049
  "properties": {
@@ -7393,6 +7742,29 @@ const docTemplate = `{
7393
  }
7394
  }
7395
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7396
  "dto.CreateUserRequest": {
7397
  "type": "object",
7398
  "required": [
@@ -7668,6 +8040,23 @@ const docTemplate = `{
7668
  }
7669
  }
7670
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7671
  "dto.ProblemSetInjectResponse": {
7672
  "type": "object",
7673
  "properties": {
@@ -7925,6 +8314,61 @@ const docTemplate = `{
7925
  }
7926
  }
7927
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7928
  "dto.SignInRequest": {
7929
  "type": "object",
7930
  "required": [
@@ -8005,6 +8449,22 @@ const docTemplate = `{
8005
  }
8006
  }
8007
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8008
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8009
  "type": "object",
8010
  "properties": {
@@ -8037,6 +8497,22 @@ const docTemplate = `{
8037
  }
8038
  }
8039
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8040
  "dto.SuccessResponse-array_dto_UserResponse": {
8041
  "type": "object",
8042
  "properties": {
@@ -8433,6 +8909,32 @@ const docTemplate = `{
8433
  }
8434
  }
8435
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8436
  "dto.SuccessResponse-dto_UserResponse": {
8437
  "type": "object",
8438
  "properties": {
@@ -8808,6 +9310,26 @@ const docTemplate = `{
8808
  }
8809
  }
8810
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8811
  "dto.UpdateUserRequest": {
8812
  "type": "object",
8813
  "properties": {
@@ -8825,17 +9347,6 @@ const docTemplate = `{
8825
  }
8826
  }
8827
  },
8828
- "dto.UpdateUserRoleRequest": {
8829
- "type": "object",
8830
- "required": [
8831
- "role"
8832
- ],
8833
- "properties": {
8834
- "role": {
8835
- "type": "string"
8836
- }
8837
- }
8838
- },
8839
  "dto.UserResponse": {
8840
  "type": "object",
8841
  "properties": {
@@ -9262,12 +9773,24 @@ const docTemplate = `{
9262
  "models.Account": {
9263
  "type": "object",
9264
  "properties": {
 
 
 
 
 
 
9265
  "created_at": {
9266
  "type": "string"
9267
  },
9268
  "email": {
9269
  "type": "string"
9270
  },
 
 
 
 
 
 
9271
  "full_name": {
9272
  "type": "string"
9273
  },
@@ -9283,6 +9806,15 @@ const docTemplate = `{
9283
  "role": {
9284
  "type": "string"
9285
  },
 
 
 
 
 
 
 
 
 
9286
  "username": {
9287
  "type": "string"
9288
  }
 
1763
  }
1764
  }
1765
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1766
  "/api/v1/admin/events": {
1767
  "get": {
1768
  "security": [
 
6051
  }
6052
  }
6053
  },
6054
+ "/api/v1/super-admin/accounts/{account_id}/role": {
6055
+ "put": {
6056
+ "security": [
6057
+ {
6058
+ "BearerAuth": []
6059
+ }
6060
+ ],
6061
+ "description": "Set the role and privileges of a user account. Supports system roles, named custom roles, or \"custom\" with explicit flags.",
6062
+ "consumes": [
6063
+ "application/json"
6064
+ ],
6065
+ "produces": [
6066
+ "application/json"
6067
+ ],
6068
+ "tags": [
6069
+ "Super Admin Accounts"
6070
+ ],
6071
+ "summary": "Set User Role",
6072
+ "parameters": [
6073
+ {
6074
+ "type": "string",
6075
+ "description": "Account ID",
6076
+ "name": "account_id",
6077
+ "in": "path",
6078
+ "required": true
6079
+ },
6080
+ {
6081
+ "description": "Set User Role Request",
6082
+ "name": "request",
6083
+ "in": "body",
6084
+ "required": true,
6085
+ "schema": {
6086
+ "$ref": "#/definitions/dto.SetUserRoleRequest"
6087
+ }
6088
+ }
6089
+ ],
6090
+ "responses": {
6091
+ "200": {
6092
+ "description": "OK",
6093
+ "schema": {
6094
+ "$ref": "#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData"
6095
+ }
6096
+ },
6097
+ "400": {
6098
+ "description": "Bad Request",
6099
+ "schema": {
6100
+ "$ref": "#/definitions/dto.ErrorResponse"
6101
+ }
6102
+ },
6103
+ "401": {
6104
+ "description": "Unauthorized",
6105
+ "schema": {
6106
+ "$ref": "#/definitions/dto.ErrorResponse"
6107
+ }
6108
+ },
6109
+ "403": {
6110
+ "description": "Forbidden",
6111
+ "schema": {
6112
+ "$ref": "#/definitions/dto.ErrorResponse"
6113
+ }
6114
+ },
6115
+ "404": {
6116
+ "description": "Not Found",
6117
+ "schema": {
6118
+ "$ref": "#/definitions/dto.ErrorResponse"
6119
+ }
6120
+ },
6121
+ "409": {
6122
+ "description": "Conflict",
6123
+ "schema": {
6124
+ "$ref": "#/definitions/dto.ErrorResponse"
6125
+ }
6126
+ },
6127
+ "422": {
6128
+ "description": "Unprocessable Entity",
6129
+ "schema": {
6130
+ "$ref": "#/definitions/dto.ErrorResponse"
6131
+ }
6132
+ }
6133
+ }
6134
+ }
6135
+ },
6136
  "/api/v1/super-admin/inject/probset": {
6137
  "post": {
6138
  "security": [
 
6273
  }
6274
  }
6275
  },
6276
+ "/api/v1/super-admin/logs": {
6277
+ "get": {
6278
+ "security": [
6279
+ {
6280
+ "BearerAuth": []
6281
+ }
6282
+ ],
6283
+ "description": "Get paginated audit logs with optional filters. Superadmin only.",
6284
+ "consumes": [
6285
+ "application/json"
6286
+ ],
6287
+ "produces": [
6288
+ "application/json"
6289
+ ],
6290
+ "tags": [
6291
+ "Super Admin Audit"
6292
+ ],
6293
+ "summary": "List Audit Logs",
6294
+ "parameters": [
6295
+ {
6296
+ "type": "integer",
6297
+ "description": "Page number (default 1)",
6298
+ "name": "page",
6299
+ "in": "query"
6300
+ },
6301
+ {
6302
+ "type": "integer",
6303
+ "description": "Items per page (default 10, max 50)",
6304
+ "name": "limit",
6305
+ "in": "query"
6306
+ },
6307
+ {
6308
+ "type": "string",
6309
+ "description": "Filter by action",
6310
+ "name": "action",
6311
+ "in": "query"
6312
+ },
6313
+ {
6314
+ "type": "string",
6315
+ "description": "Filter by actor account ID",
6316
+ "name": "actor_account_id",
6317
+ "in": "query"
6318
+ },
6319
+ {
6320
+ "type": "string",
6321
+ "description": "Start time (RFC3339)",
6322
+ "name": "from",
6323
+ "in": "query"
6324
+ },
6325
+ {
6326
+ "type": "string",
6327
+ "description": "End time (RFC3339)",
6328
+ "name": "to",
6329
+ "in": "query"
6330
+ }
6331
+ ],
6332
+ "responses": {
6333
+ "200": {
6334
+ "description": "OK",
6335
+ "schema": {
6336
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse"
6337
+ }
6338
+ },
6339
+ "401": {
6340
+ "description": "Unauthorized",
6341
+ "schema": {
6342
+ "$ref": "#/definitions/dto.ErrorResponse"
6343
+ }
6344
+ },
6345
+ "403": {
6346
+ "description": "Forbidden",
6347
+ "schema": {
6348
+ "$ref": "#/definitions/dto.ErrorResponse"
6349
+ }
6350
+ }
6351
+ }
6352
+ }
6353
+ },
6354
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6355
  "post": {
6356
  "security": [
 
6460
  }
6461
  }
6462
  },
6463
+ "/api/v1/super-admin/roles": {
6464
  "get": {
6465
  "security": [
6466
  {
6467
  "BearerAuth": []
6468
  }
6469
  ],
6470
+ "description": "Get all system and named custom roles with their privilege flags",
6471
  "consumes": [
6472
  "application/json"
6473
  ],
 
6475
  "application/json"
6476
  ],
6477
  "tags": [
6478
+ "Super Admin Roles"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6479
  ],
6480
+ "summary": "List All Roles",
6481
  "responses": {
6482
  "200": {
6483
  "description": "OK",
6484
  "schema": {
6485
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_RoleResponse"
 
 
 
 
 
 
6486
  }
6487
  },
6488
  "401": {
 
6505
  "BearerAuth": []
6506
  }
6507
  ],
6508
+ "description": "Create a new named custom role with privilege flags. Superadmin only.",
6509
  "consumes": [
6510
  "application/json"
6511
  ],
 
6513
  "application/json"
6514
  ],
6515
  "tags": [
6516
+ "Super Admin Roles"
6517
  ],
6518
+ "summary": "Create Named Role",
6519
  "parameters": [
6520
  {
6521
+ "description": "Create Role Request",
6522
  "name": "request",
6523
  "in": "body",
6524
  "required": true,
6525
  "schema": {
6526
+ "$ref": "#/definitions/dto.CreateRoleRequest"
6527
  }
6528
  }
6529
  ],
 
6531
  "200": {
6532
  "description": "OK",
6533
  "schema": {
6534
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6535
  }
6536
  },
6537
  "400": {
 
6551
  "schema": {
6552
  "$ref": "#/definitions/dto.ErrorResponse"
6553
  }
6554
+ },
6555
+ "409": {
6556
+ "description": "Conflict",
6557
+ "schema": {
6558
+ "$ref": "#/definitions/dto.ErrorResponse"
6559
+ }
6560
  }
6561
  }
6562
  }
6563
  },
6564
+ "/api/v1/super-admin/roles/{role_id}": {
6565
+ "put": {
6566
  "security": [
6567
  {
6568
  "BearerAuth": []
6569
  }
6570
  ],
6571
+ "description": "Update a named custom role's privilege flags. System roles are immutable.",
6572
  "consumes": [
6573
  "application/json"
6574
  ],
 
6576
  "application/json"
6577
  ],
6578
  "tags": [
6579
+ "Super Admin Roles"
6580
  ],
6581
+ "summary": "Update Named Role",
6582
  "parameters": [
6583
  {
6584
+ "type": "string",
6585
+ "description": "Role ID",
6586
+ "name": "role_id",
6587
+ "in": "path",
6588
+ "required": true
6589
+ },
6590
+ {
6591
+ "description": "Update Role Request",
6592
+ "name": "request",
6593
  "in": "body",
6594
  "required": true,
6595
  "schema": {
6596
+ "$ref": "#/definitions/dto.UpdateRoleRequest"
 
 
 
6597
  }
6598
  }
6599
  ],
 
6601
  "200": {
6602
  "description": "OK",
6603
  "schema": {
6604
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6605
  }
6606
  },
6607
  "400": {
 
6623
  }
6624
  }
6625
  }
6626
+ },
6627
+ "delete": {
 
 
6628
  "security": [
6629
  {
6630
  "BearerAuth": []
6631
  }
6632
  ],
6633
+ "description": "Delete a named custom role. System roles are immutable. Cannot delete if assigned to any account.",
6634
  "consumes": [
6635
  "application/json"
6636
  ],
 
6638
  "application/json"
6639
  ],
6640
  "tags": [
6641
+ "Super Admin Roles"
6642
  ],
6643
+ "summary": "Delete Named Role",
6644
  "parameters": [
6645
  {
6646
  "type": "string",
6647
+ "description": "Role ID",
6648
+ "name": "role_id",
6649
+ "in": "path",
6650
+ "required": true
6651
+ }
6652
+ ],
6653
+ "responses": {
6654
+ "200": {
6655
+ "description": "OK",
6656
+ "schema": {
6657
+ "$ref": "#/definitions/dto.SuccessResponse-any"
6658
+ }
6659
+ },
6660
+ "401": {
6661
+ "description": "Unauthorized",
6662
+ "schema": {
6663
+ "$ref": "#/definitions/dto.ErrorResponse"
6664
+ }
6665
+ },
6666
+ "403": {
6667
+ "description": "Forbidden",
6668
+ "schema": {
6669
+ "$ref": "#/definitions/dto.ErrorResponse"
6670
+ }
6671
+ },
6672
+ "409": {
6673
+ "description": "Conflict",
6674
+ "schema": {
6675
+ "$ref": "#/definitions/dto.ErrorResponse"
6676
+ }
6677
+ }
6678
+ }
6679
+ }
6680
+ },
6681
+ "/api/v1/super-admin/users": {
6682
+ "get": {
6683
+ "security": [
6684
+ {
6685
+ "BearerAuth": []
6686
+ }
6687
+ ],
6688
+ "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6689
+ "consumes": [
6690
+ "application/json"
6691
+ ],
6692
+ "produces": [
6693
+ "application/json"
6694
+ ],
6695
+ "tags": [
6696
+ "Super Admin Users Management"
6697
+ ],
6698
+ "summary": "List All Users with Pagination",
6699
+ "parameters": [
6700
+ {
6701
+ "type": "integer",
6702
+ "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6703
+ "name": "page",
6704
+ "in": "query"
6705
+ },
6706
+ {
6707
+ "type": "integer",
6708
+ "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6709
+ "name": "limit",
6710
+ "in": "query"
6711
+ },
6712
+ {
6713
+ "type": "string",
6714
+ "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6715
+ "name": "role",
6716
+ "in": "query"
6717
+ }
6718
+ ],
6719
+ "responses": {
6720
+ "200": {
6721
+ "description": "OK",
6722
+ "schema": {
6723
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6724
+ }
6725
+ },
6726
+ "400": {
6727
+ "description": "Bad Request",
6728
+ "schema": {
6729
+ "$ref": "#/definitions/dto.ErrorResponse"
6730
+ }
6731
+ },
6732
+ "401": {
6733
+ "description": "Unauthorized",
6734
+ "schema": {
6735
+ "$ref": "#/definitions/dto.ErrorResponse"
6736
+ }
6737
+ },
6738
+ "403": {
6739
+ "description": "Forbidden",
6740
+ "schema": {
6741
+ "$ref": "#/definitions/dto.ErrorResponse"
6742
+ }
6743
+ }
6744
+ }
6745
+ },
6746
+ "post": {
6747
+ "security": [
6748
+ {
6749
+ "BearerAuth": []
6750
+ }
6751
+ ],
6752
+ "description": "Create a new user account by providing user details",
6753
+ "consumes": [
6754
+ "application/json"
6755
+ ],
6756
+ "produces": [
6757
+ "application/json"
6758
+ ],
6759
+ "tags": [
6760
+ "Super Admin Users Management"
6761
+ ],
6762
+ "summary": "Create Single User",
6763
+ "parameters": [
6764
+ {
6765
+ "description": "Create User Request",
6766
+ "name": "request",
6767
+ "in": "body",
6768
+ "required": true,
6769
+ "schema": {
6770
+ "$ref": "#/definitions/dto.CreateUserRequest"
6771
+ }
6772
+ }
6773
+ ],
6774
+ "responses": {
6775
+ "200": {
6776
+ "description": "OK",
6777
+ "schema": {
6778
+ "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6779
+ }
6780
+ },
6781
+ "400": {
6782
+ "description": "Bad Request",
6783
+ "schema": {
6784
+ "$ref": "#/definitions/dto.ErrorResponse"
6785
+ }
6786
+ },
6787
+ "401": {
6788
+ "description": "Unauthorized",
6789
+ "schema": {
6790
+ "$ref": "#/definitions/dto.ErrorResponse"
6791
+ }
6792
+ },
6793
+ "403": {
6794
+ "description": "Forbidden",
6795
+ "schema": {
6796
+ "$ref": "#/definitions/dto.ErrorResponse"
6797
+ }
6798
+ }
6799
+ }
6800
+ }
6801
+ },
6802
+ "/api/v1/super-admin/users/bulk": {
6803
+ "post": {
6804
+ "security": [
6805
+ {
6806
+ "BearerAuth": []
6807
+ }
6808
+ ],
6809
+ "description": "Create multiple user accounts at once",
6810
+ "consumes": [
6811
+ "application/json"
6812
+ ],
6813
+ "produces": [
6814
+ "application/json"
6815
+ ],
6816
+ "tags": [
6817
+ "Super Admin Users Management"
6818
+ ],
6819
+ "summary": "Bulk Create Users",
6820
+ "parameters": [
6821
+ {
6822
+ "description": "Bulk Create User Requests",
6823
+ "name": "requests",
6824
+ "in": "body",
6825
+ "required": true,
6826
+ "schema": {
6827
+ "type": "array",
6828
+ "items": {
6829
+ "$ref": "#/definitions/dto.CreateUserRequest"
6830
+ }
6831
+ }
6832
+ }
6833
+ ],
6834
+ "responses": {
6835
+ "200": {
6836
+ "description": "OK",
6837
+ "schema": {
6838
+ "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6839
+ }
6840
+ },
6841
+ "400": {
6842
+ "description": "Bad Request",
6843
+ "schema": {
6844
+ "$ref": "#/definitions/dto.ErrorResponse"
6845
+ }
6846
+ },
6847
+ "401": {
6848
+ "description": "Unauthorized",
6849
+ "schema": {
6850
+ "$ref": "#/definitions/dto.ErrorResponse"
6851
+ }
6852
+ },
6853
+ "403": {
6854
+ "description": "Forbidden",
6855
+ "schema": {
6856
+ "$ref": "#/definitions/dto.ErrorResponse"
6857
+ }
6858
+ }
6859
+ }
6860
+ }
6861
+ },
6862
+ "/api/v1/super-admin/users/{id}": {
6863
+ "put": {
6864
+ "security": [
6865
+ {
6866
+ "BearerAuth": []
6867
+ }
6868
+ ],
6869
+ "description": "Update user information by ID",
6870
+ "consumes": [
6871
+ "application/json"
6872
+ ],
6873
+ "produces": [
6874
+ "application/json"
6875
+ ],
6876
+ "tags": [
6877
+ "Super Admin Users Management"
6878
+ ],
6879
+ "summary": "Edit User",
6880
+ "parameters": [
6881
+ {
6882
+ "type": "string",
6883
+ "description": "User ID",
6884
  "name": "id",
6885
  "in": "path",
6886
  "required": true
 
7370
  }
7371
  }
7372
  },
7373
+ "dto.AuditLogResponse": {
7374
+ "type": "object",
7375
+ "properties": {
7376
+ "action": {
7377
+ "type": "string"
7378
+ },
7379
+ "actor_account_id": {
7380
+ "type": "string"
7381
+ },
7382
+ "created_at": {
7383
+ "type": "string"
7384
+ },
7385
+ "detail": {
7386
+ "type": "string"
7387
+ },
7388
+ "id": {
7389
+ "type": "string"
7390
+ },
7391
+ "target_id": {
7392
+ "type": "string"
7393
+ }
7394
+ }
7395
+ },
7396
  "dto.AuthenticatedUser": {
7397
  "type": "object",
7398
  "properties": {
 
7742
  }
7743
  }
7744
  },
7745
+ "dto.CreateRoleRequest": {
7746
+ "type": "object",
7747
+ "required": [
7748
+ "name"
7749
+ ],
7750
+ "properties": {
7751
+ "academy_management": {
7752
+ "type": "boolean"
7753
+ },
7754
+ "content_management": {
7755
+ "type": "boolean"
7756
+ },
7757
+ "event_management": {
7758
+ "type": "boolean"
7759
+ },
7760
+ "exam_management": {
7761
+ "type": "boolean"
7762
+ },
7763
+ "name": {
7764
+ "type": "string"
7765
+ }
7766
+ }
7767
+ },
7768
  "dto.CreateUserRequest": {
7769
  "type": "object",
7770
  "required": [
 
8040
  }
8041
  }
8042
  },
8043
+ "dto.Privileges": {
8044
+ "type": "object",
8045
+ "properties": {
8046
+ "academy_management": {
8047
+ "type": "boolean"
8048
+ },
8049
+ "content_management": {
8050
+ "type": "boolean"
8051
+ },
8052
+ "event_management": {
8053
+ "type": "boolean"
8054
+ },
8055
+ "exam_management": {
8056
+ "type": "boolean"
8057
+ }
8058
+ }
8059
+ },
8060
  "dto.ProblemSetInjectResponse": {
8061
  "type": "object",
8062
  "properties": {
 
8314
  }
8315
  }
8316
  },
8317
+ "dto.RoleResponse": {
8318
+ "type": "object",
8319
+ "properties": {
8320
+ "academy_management": {
8321
+ "type": "boolean"
8322
+ },
8323
+ "content_management": {
8324
+ "type": "boolean"
8325
+ },
8326
+ "event_management": {
8327
+ "type": "boolean"
8328
+ },
8329
+ "exam_management": {
8330
+ "type": "boolean"
8331
+ },
8332
+ "id": {
8333
+ "type": "string"
8334
+ },
8335
+ "is_system": {
8336
+ "type": "boolean"
8337
+ },
8338
+ "name": {
8339
+ "type": "string"
8340
+ }
8341
+ }
8342
+ },
8343
+ "dto.SetUserRoleRequest": {
8344
+ "type": "object",
8345
+ "required": [
8346
+ "privileges",
8347
+ "role_name"
8348
+ ],
8349
+ "properties": {
8350
+ "privileges": {
8351
+ "$ref": "#/definitions/dto.Privileges"
8352
+ },
8353
+ "role_name": {
8354
+ "type": "string"
8355
+ }
8356
+ }
8357
+ },
8358
+ "dto.SetUserRoleResponseData": {
8359
+ "type": "object",
8360
+ "properties": {
8361
+ "account_id": {
8362
+ "type": "string"
8363
+ },
8364
+ "privileges": {
8365
+ "$ref": "#/definitions/dto.Privileges"
8366
+ },
8367
+ "role_name": {
8368
+ "type": "string"
8369
+ }
8370
+ }
8371
+ },
8372
  "dto.SignInRequest": {
8373
  "type": "object",
8374
  "required": [
 
8449
  }
8450
  }
8451
  },
8452
+ "dto.SuccessResponse-array_dto_AuditLogResponse": {
8453
+ "type": "object",
8454
+ "properties": {
8455
+ "data": {
8456
+ "type": "array",
8457
+ "items": {
8458
+ "$ref": "#/definitions/dto.AuditLogResponse"
8459
+ }
8460
+ },
8461
+ "message": {},
8462
+ "meta_data": {},
8463
+ "status": {
8464
+ "type": "string"
8465
+ }
8466
+ }
8467
+ },
8468
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8469
  "type": "object",
8470
  "properties": {
 
8497
  }
8498
  }
8499
  },
8500
+ "dto.SuccessResponse-array_dto_RoleResponse": {
8501
+ "type": "object",
8502
+ "properties": {
8503
+ "data": {
8504
+ "type": "array",
8505
+ "items": {
8506
+ "$ref": "#/definitions/dto.RoleResponse"
8507
+ }
8508
+ },
8509
+ "message": {},
8510
+ "meta_data": {},
8511
+ "status": {
8512
+ "type": "string"
8513
+ }
8514
+ }
8515
+ },
8516
  "dto.SuccessResponse-array_dto_UserResponse": {
8517
  "type": "object",
8518
  "properties": {
 
8909
  }
8910
  }
8911
  },
8912
+ "dto.SuccessResponse-dto_RoleResponse": {
8913
+ "type": "object",
8914
+ "properties": {
8915
+ "data": {
8916
+ "$ref": "#/definitions/dto.RoleResponse"
8917
+ },
8918
+ "message": {},
8919
+ "meta_data": {},
8920
+ "status": {
8921
+ "type": "string"
8922
+ }
8923
+ }
8924
+ },
8925
+ "dto.SuccessResponse-dto_SetUserRoleResponseData": {
8926
+ "type": "object",
8927
+ "properties": {
8928
+ "data": {
8929
+ "$ref": "#/definitions/dto.SetUserRoleResponseData"
8930
+ },
8931
+ "message": {},
8932
+ "meta_data": {},
8933
+ "status": {
8934
+ "type": "string"
8935
+ }
8936
+ }
8937
+ },
8938
  "dto.SuccessResponse-dto_UserResponse": {
8939
  "type": "object",
8940
  "properties": {
 
9310
  }
9311
  }
9312
  },
9313
+ "dto.UpdateRoleRequest": {
9314
+ "type": "object",
9315
+ "properties": {
9316
+ "academy_management": {
9317
+ "type": "boolean"
9318
+ },
9319
+ "content_management": {
9320
+ "type": "boolean"
9321
+ },
9322
+ "event_management": {
9323
+ "type": "boolean"
9324
+ },
9325
+ "exam_management": {
9326
+ "type": "boolean"
9327
+ },
9328
+ "name": {
9329
+ "type": "string"
9330
+ }
9331
+ }
9332
+ },
9333
  "dto.UpdateUserRequest": {
9334
  "type": "object",
9335
  "properties": {
 
9347
  }
9348
  }
9349
  },
 
 
 
 
 
 
 
 
 
 
 
9350
  "dto.UserResponse": {
9351
  "type": "object",
9352
  "properties": {
 
9773
  "models.Account": {
9774
  "type": "object",
9775
  "properties": {
9776
+ "academy_management": {
9777
+ "type": "boolean"
9778
+ },
9779
+ "content_management": {
9780
+ "type": "boolean"
9781
+ },
9782
  "created_at": {
9783
  "type": "string"
9784
  },
9785
  "email": {
9786
  "type": "string"
9787
  },
9788
+ "event_management": {
9789
+ "type": "boolean"
9790
+ },
9791
+ "exam_management": {
9792
+ "type": "boolean"
9793
+ },
9794
  "full_name": {
9795
  "type": "string"
9796
  },
 
9806
  "role": {
9807
  "type": "string"
9808
  },
9809
+ "role_id": {
9810
+ "type": "string"
9811
+ },
9812
+ "role_name": {
9813
+ "type": "string"
9814
+ },
9815
+ "token_version": {
9816
+ "type": "integer"
9817
+ },
9818
  "username": {
9819
  "type": "string"
9820
  }
swagger/docs/swagger.json CHANGED
@@ -1760,58 +1760,6 @@
1760
  }
1761
  }
1762
  },
1763
- "/api/v1/admin/authentication/{account_id}/assign": {
1764
- "put": {
1765
- "security": [
1766
- {
1767
- "BearerAuth": []
1768
- }
1769
- ],
1770
- "description": "Update the role of a user account",
1771
- "consumes": [
1772
- "application/json"
1773
- ],
1774
- "produces": [
1775
- "application/json"
1776
- ],
1777
- "tags": [
1778
- "Authentication"
1779
- ],
1780
- "summary": "Update User Role",
1781
- "parameters": [
1782
- {
1783
- "type": "string",
1784
- "description": "Account ID",
1785
- "name": "accountId",
1786
- "in": "path",
1787
- "required": true
1788
- },
1789
- {
1790
- "description": "Update User Role Request",
1791
- "name": "request",
1792
- "in": "body",
1793
- "required": true,
1794
- "schema": {
1795
- "$ref": "#/definitions/dto.UpdateUserRoleRequest"
1796
- }
1797
- }
1798
- ],
1799
- "responses": {
1800
- "200": {
1801
- "description": "OK",
1802
- "schema": {
1803
- "$ref": "#/definitions/dto.SuccessResponse-models_Account"
1804
- }
1805
- },
1806
- "400": {
1807
- "description": "Bad Request",
1808
- "schema": {
1809
- "$ref": "#/definitions/dto.ErrorResponse"
1810
- }
1811
- }
1812
- }
1813
- }
1814
- },
1815
  "/api/v1/admin/events": {
1816
  "get": {
1817
  "security": [
@@ -6100,6 +6048,88 @@
6100
  }
6101
  }
6102
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6103
  "/api/v1/super-admin/inject/probset": {
6104
  "post": {
6105
  "security": [
@@ -6240,6 +6270,84 @@
6240
  }
6241
  }
6242
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6243
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6244
  "post": {
6245
  "security": [
@@ -6349,14 +6457,14 @@
6349
  }
6350
  }
6351
  },
6352
- "/api/v1/super-admin/users": {
6353
  "get": {
6354
  "security": [
6355
  {
6356
  "BearerAuth": []
6357
  }
6358
  ],
6359
- "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6360
  "consumes": [
6361
  "application/json"
6362
  ],
@@ -6364,40 +6472,14 @@
6364
  "application/json"
6365
  ],
6366
  "tags": [
6367
- "Super Admin Users Management"
6368
- ],
6369
- "summary": "List All Users with Pagination",
6370
- "parameters": [
6371
- {
6372
- "type": "integer",
6373
- "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6374
- "name": "page",
6375
- "in": "query"
6376
- },
6377
- {
6378
- "type": "integer",
6379
- "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6380
- "name": "limit",
6381
- "in": "query"
6382
- },
6383
- {
6384
- "type": "string",
6385
- "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6386
- "name": "role",
6387
- "in": "query"
6388
- }
6389
  ],
 
6390
  "responses": {
6391
  "200": {
6392
  "description": "OK",
6393
  "schema": {
6394
- "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6395
- }
6396
- },
6397
- "400": {
6398
- "description": "Bad Request",
6399
- "schema": {
6400
- "$ref": "#/definitions/dto.ErrorResponse"
6401
  }
6402
  },
6403
  "401": {
@@ -6420,7 +6502,7 @@
6420
  "BearerAuth": []
6421
  }
6422
  ],
6423
- "description": "Create a new user account by providing user details",
6424
  "consumes": [
6425
  "application/json"
6426
  ],
@@ -6428,17 +6510,17 @@
6428
  "application/json"
6429
  ],
6430
  "tags": [
6431
- "Super Admin Users Management"
6432
  ],
6433
- "summary": "Create Single User",
6434
  "parameters": [
6435
  {
6436
- "description": "Create User Request",
6437
  "name": "request",
6438
  "in": "body",
6439
  "required": true,
6440
  "schema": {
6441
- "$ref": "#/definitions/dto.CreateUserRequest"
6442
  }
6443
  }
6444
  ],
@@ -6446,7 +6528,7 @@
6446
  "200": {
6447
  "description": "OK",
6448
  "schema": {
6449
- "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6450
  }
6451
  },
6452
  "400": {
@@ -6466,18 +6548,24 @@
6466
  "schema": {
6467
  "$ref": "#/definitions/dto.ErrorResponse"
6468
  }
 
 
 
 
 
 
6469
  }
6470
  }
6471
  }
6472
  },
6473
- "/api/v1/super-admin/users/bulk": {
6474
- "post": {
6475
  "security": [
6476
  {
6477
  "BearerAuth": []
6478
  }
6479
  ],
6480
- "description": "Create multiple user accounts at once",
6481
  "consumes": [
6482
  "application/json"
6483
  ],
@@ -6485,20 +6573,24 @@
6485
  "application/json"
6486
  ],
6487
  "tags": [
6488
- "Super Admin Users Management"
6489
  ],
6490
- "summary": "Bulk Create Users",
6491
  "parameters": [
6492
  {
6493
- "description": "Bulk Create User Requests",
6494
- "name": "requests",
 
 
 
 
 
 
 
6495
  "in": "body",
6496
  "required": true,
6497
  "schema": {
6498
- "type": "array",
6499
- "items": {
6500
- "$ref": "#/definitions/dto.CreateUserRequest"
6501
- }
6502
  }
6503
  }
6504
  ],
@@ -6506,7 +6598,7 @@
6506
  "200": {
6507
  "description": "OK",
6508
  "schema": {
6509
- "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6510
  }
6511
  },
6512
  "400": {
@@ -6528,16 +6620,14 @@
6528
  }
6529
  }
6530
  }
6531
- }
6532
- },
6533
- "/api/v1/super-admin/users/{id}": {
6534
- "put": {
6535
  "security": [
6536
  {
6537
  "BearerAuth": []
6538
  }
6539
  ],
6540
- "description": "Update user information by ID",
6541
  "consumes": [
6542
  "application/json"
6543
  ],
@@ -6545,13 +6635,249 @@
6545
  "application/json"
6546
  ],
6547
  "tags": [
6548
- "Super Admin Users Management"
6549
  ],
6550
- "summary": "Edit User",
6551
  "parameters": [
6552
  {
6553
  "type": "string",
6554
- "description": "User ID",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6555
  "name": "id",
6556
  "in": "path",
6557
  "required": true
@@ -7041,6 +7367,29 @@
7041
  }
7042
  }
7043
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7044
  "dto.AuthenticatedUser": {
7045
  "type": "object",
7046
  "properties": {
@@ -7390,6 +7739,29 @@
7390
  }
7391
  }
7392
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7393
  "dto.CreateUserRequest": {
7394
  "type": "object",
7395
  "required": [
@@ -7665,6 +8037,23 @@
7665
  }
7666
  }
7667
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7668
  "dto.ProblemSetInjectResponse": {
7669
  "type": "object",
7670
  "properties": {
@@ -7922,6 +8311,61 @@
7922
  }
7923
  }
7924
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7925
  "dto.SignInRequest": {
7926
  "type": "object",
7927
  "required": [
@@ -8002,6 +8446,22 @@
8002
  }
8003
  }
8004
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8005
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8006
  "type": "object",
8007
  "properties": {
@@ -8034,6 +8494,22 @@
8034
  }
8035
  }
8036
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8037
  "dto.SuccessResponse-array_dto_UserResponse": {
8038
  "type": "object",
8039
  "properties": {
@@ -8430,6 +8906,32 @@
8430
  }
8431
  }
8432
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8433
  "dto.SuccessResponse-dto_UserResponse": {
8434
  "type": "object",
8435
  "properties": {
@@ -8805,6 +9307,26 @@
8805
  }
8806
  }
8807
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8808
  "dto.UpdateUserRequest": {
8809
  "type": "object",
8810
  "properties": {
@@ -8822,17 +9344,6 @@
8822
  }
8823
  }
8824
  },
8825
- "dto.UpdateUserRoleRequest": {
8826
- "type": "object",
8827
- "required": [
8828
- "role"
8829
- ],
8830
- "properties": {
8831
- "role": {
8832
- "type": "string"
8833
- }
8834
- }
8835
- },
8836
  "dto.UserResponse": {
8837
  "type": "object",
8838
  "properties": {
@@ -9259,12 +9770,24 @@
9259
  "models.Account": {
9260
  "type": "object",
9261
  "properties": {
 
 
 
 
 
 
9262
  "created_at": {
9263
  "type": "string"
9264
  },
9265
  "email": {
9266
  "type": "string"
9267
  },
 
 
 
 
 
 
9268
  "full_name": {
9269
  "type": "string"
9270
  },
@@ -9280,6 +9803,15 @@
9280
  "role": {
9281
  "type": "string"
9282
  },
 
 
 
 
 
 
 
 
 
9283
  "username": {
9284
  "type": "string"
9285
  }
 
1760
  }
1761
  }
1762
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1763
  "/api/v1/admin/events": {
1764
  "get": {
1765
  "security": [
 
6048
  }
6049
  }
6050
  },
6051
+ "/api/v1/super-admin/accounts/{account_id}/role": {
6052
+ "put": {
6053
+ "security": [
6054
+ {
6055
+ "BearerAuth": []
6056
+ }
6057
+ ],
6058
+ "description": "Set the role and privileges of a user account. Supports system roles, named custom roles, or \"custom\" with explicit flags.",
6059
+ "consumes": [
6060
+ "application/json"
6061
+ ],
6062
+ "produces": [
6063
+ "application/json"
6064
+ ],
6065
+ "tags": [
6066
+ "Super Admin Accounts"
6067
+ ],
6068
+ "summary": "Set User Role",
6069
+ "parameters": [
6070
+ {
6071
+ "type": "string",
6072
+ "description": "Account ID",
6073
+ "name": "account_id",
6074
+ "in": "path",
6075
+ "required": true
6076
+ },
6077
+ {
6078
+ "description": "Set User Role Request",
6079
+ "name": "request",
6080
+ "in": "body",
6081
+ "required": true,
6082
+ "schema": {
6083
+ "$ref": "#/definitions/dto.SetUserRoleRequest"
6084
+ }
6085
+ }
6086
+ ],
6087
+ "responses": {
6088
+ "200": {
6089
+ "description": "OK",
6090
+ "schema": {
6091
+ "$ref": "#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData"
6092
+ }
6093
+ },
6094
+ "400": {
6095
+ "description": "Bad Request",
6096
+ "schema": {
6097
+ "$ref": "#/definitions/dto.ErrorResponse"
6098
+ }
6099
+ },
6100
+ "401": {
6101
+ "description": "Unauthorized",
6102
+ "schema": {
6103
+ "$ref": "#/definitions/dto.ErrorResponse"
6104
+ }
6105
+ },
6106
+ "403": {
6107
+ "description": "Forbidden",
6108
+ "schema": {
6109
+ "$ref": "#/definitions/dto.ErrorResponse"
6110
+ }
6111
+ },
6112
+ "404": {
6113
+ "description": "Not Found",
6114
+ "schema": {
6115
+ "$ref": "#/definitions/dto.ErrorResponse"
6116
+ }
6117
+ },
6118
+ "409": {
6119
+ "description": "Conflict",
6120
+ "schema": {
6121
+ "$ref": "#/definitions/dto.ErrorResponse"
6122
+ }
6123
+ },
6124
+ "422": {
6125
+ "description": "Unprocessable Entity",
6126
+ "schema": {
6127
+ "$ref": "#/definitions/dto.ErrorResponse"
6128
+ }
6129
+ }
6130
+ }
6131
+ }
6132
+ },
6133
  "/api/v1/super-admin/inject/probset": {
6134
  "post": {
6135
  "security": [
 
6270
  }
6271
  }
6272
  },
6273
+ "/api/v1/super-admin/logs": {
6274
+ "get": {
6275
+ "security": [
6276
+ {
6277
+ "BearerAuth": []
6278
+ }
6279
+ ],
6280
+ "description": "Get paginated audit logs with optional filters. Superadmin only.",
6281
+ "consumes": [
6282
+ "application/json"
6283
+ ],
6284
+ "produces": [
6285
+ "application/json"
6286
+ ],
6287
+ "tags": [
6288
+ "Super Admin Audit"
6289
+ ],
6290
+ "summary": "List Audit Logs",
6291
+ "parameters": [
6292
+ {
6293
+ "type": "integer",
6294
+ "description": "Page number (default 1)",
6295
+ "name": "page",
6296
+ "in": "query"
6297
+ },
6298
+ {
6299
+ "type": "integer",
6300
+ "description": "Items per page (default 10, max 50)",
6301
+ "name": "limit",
6302
+ "in": "query"
6303
+ },
6304
+ {
6305
+ "type": "string",
6306
+ "description": "Filter by action",
6307
+ "name": "action",
6308
+ "in": "query"
6309
+ },
6310
+ {
6311
+ "type": "string",
6312
+ "description": "Filter by actor account ID",
6313
+ "name": "actor_account_id",
6314
+ "in": "query"
6315
+ },
6316
+ {
6317
+ "type": "string",
6318
+ "description": "Start time (RFC3339)",
6319
+ "name": "from",
6320
+ "in": "query"
6321
+ },
6322
+ {
6323
+ "type": "string",
6324
+ "description": "End time (RFC3339)",
6325
+ "name": "to",
6326
+ "in": "query"
6327
+ }
6328
+ ],
6329
+ "responses": {
6330
+ "200": {
6331
+ "description": "OK",
6332
+ "schema": {
6333
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse"
6334
+ }
6335
+ },
6336
+ "401": {
6337
+ "description": "Unauthorized",
6338
+ "schema": {
6339
+ "$ref": "#/definitions/dto.ErrorResponse"
6340
+ }
6341
+ },
6342
+ "403": {
6343
+ "description": "Forbidden",
6344
+ "schema": {
6345
+ "$ref": "#/definitions/dto.ErrorResponse"
6346
+ }
6347
+ }
6348
+ }
6349
+ }
6350
+ },
6351
  "/api/v1/super-admin/repair/problemset/naming/migrate": {
6352
  "post": {
6353
  "security": [
 
6457
  }
6458
  }
6459
  },
6460
+ "/api/v1/super-admin/roles": {
6461
  "get": {
6462
  "security": [
6463
  {
6464
  "BearerAuth": []
6465
  }
6466
  ],
6467
+ "description": "Get all system and named custom roles with their privilege flags",
6468
  "consumes": [
6469
  "application/json"
6470
  ],
 
6472
  "application/json"
6473
  ],
6474
  "tags": [
6475
+ "Super Admin Roles"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6476
  ],
6477
+ "summary": "List All Roles",
6478
  "responses": {
6479
  "200": {
6480
  "description": "OK",
6481
  "schema": {
6482
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_RoleResponse"
 
 
 
 
 
 
6483
  }
6484
  },
6485
  "401": {
 
6502
  "BearerAuth": []
6503
  }
6504
  ],
6505
+ "description": "Create a new named custom role with privilege flags. Superadmin only.",
6506
  "consumes": [
6507
  "application/json"
6508
  ],
 
6510
  "application/json"
6511
  ],
6512
  "tags": [
6513
+ "Super Admin Roles"
6514
  ],
6515
+ "summary": "Create Named Role",
6516
  "parameters": [
6517
  {
6518
+ "description": "Create Role Request",
6519
  "name": "request",
6520
  "in": "body",
6521
  "required": true,
6522
  "schema": {
6523
+ "$ref": "#/definitions/dto.CreateRoleRequest"
6524
  }
6525
  }
6526
  ],
 
6528
  "200": {
6529
  "description": "OK",
6530
  "schema": {
6531
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6532
  }
6533
  },
6534
  "400": {
 
6548
  "schema": {
6549
  "$ref": "#/definitions/dto.ErrorResponse"
6550
  }
6551
+ },
6552
+ "409": {
6553
+ "description": "Conflict",
6554
+ "schema": {
6555
+ "$ref": "#/definitions/dto.ErrorResponse"
6556
+ }
6557
  }
6558
  }
6559
  }
6560
  },
6561
+ "/api/v1/super-admin/roles/{role_id}": {
6562
+ "put": {
6563
  "security": [
6564
  {
6565
  "BearerAuth": []
6566
  }
6567
  ],
6568
+ "description": "Update a named custom role's privilege flags. System roles are immutable.",
6569
  "consumes": [
6570
  "application/json"
6571
  ],
 
6573
  "application/json"
6574
  ],
6575
  "tags": [
6576
+ "Super Admin Roles"
6577
  ],
6578
+ "summary": "Update Named Role",
6579
  "parameters": [
6580
  {
6581
+ "type": "string",
6582
+ "description": "Role ID",
6583
+ "name": "role_id",
6584
+ "in": "path",
6585
+ "required": true
6586
+ },
6587
+ {
6588
+ "description": "Update Role Request",
6589
+ "name": "request",
6590
  "in": "body",
6591
  "required": true,
6592
  "schema": {
6593
+ "$ref": "#/definitions/dto.UpdateRoleRequest"
 
 
 
6594
  }
6595
  }
6596
  ],
 
6598
  "200": {
6599
  "description": "OK",
6600
  "schema": {
6601
+ "$ref": "#/definitions/dto.SuccessResponse-dto_RoleResponse"
6602
  }
6603
  },
6604
  "400": {
 
6620
  }
6621
  }
6622
  }
6623
+ },
6624
+ "delete": {
 
 
6625
  "security": [
6626
  {
6627
  "BearerAuth": []
6628
  }
6629
  ],
6630
+ "description": "Delete a named custom role. System roles are immutable. Cannot delete if assigned to any account.",
6631
  "consumes": [
6632
  "application/json"
6633
  ],
 
6635
  "application/json"
6636
  ],
6637
  "tags": [
6638
+ "Super Admin Roles"
6639
  ],
6640
+ "summary": "Delete Named Role",
6641
  "parameters": [
6642
  {
6643
  "type": "string",
6644
+ "description": "Role ID",
6645
+ "name": "role_id",
6646
+ "in": "path",
6647
+ "required": true
6648
+ }
6649
+ ],
6650
+ "responses": {
6651
+ "200": {
6652
+ "description": "OK",
6653
+ "schema": {
6654
+ "$ref": "#/definitions/dto.SuccessResponse-any"
6655
+ }
6656
+ },
6657
+ "401": {
6658
+ "description": "Unauthorized",
6659
+ "schema": {
6660
+ "$ref": "#/definitions/dto.ErrorResponse"
6661
+ }
6662
+ },
6663
+ "403": {
6664
+ "description": "Forbidden",
6665
+ "schema": {
6666
+ "$ref": "#/definitions/dto.ErrorResponse"
6667
+ }
6668
+ },
6669
+ "409": {
6670
+ "description": "Conflict",
6671
+ "schema": {
6672
+ "$ref": "#/definitions/dto.ErrorResponse"
6673
+ }
6674
+ }
6675
+ }
6676
+ }
6677
+ },
6678
+ "/api/v1/super-admin/users": {
6679
+ "get": {
6680
+ "security": [
6681
+ {
6682
+ "BearerAuth": []
6683
+ }
6684
+ ],
6685
+ "description": "Retrieve a paginated list of all users with optional role filter. Supports pagination parameters (page, limit) and can filter by user role.",
6686
+ "consumes": [
6687
+ "application/json"
6688
+ ],
6689
+ "produces": [
6690
+ "application/json"
6691
+ ],
6692
+ "tags": [
6693
+ "Super Admin Users Management"
6694
+ ],
6695
+ "summary": "List All Users with Pagination",
6696
+ "parameters": [
6697
+ {
6698
+ "type": "integer",
6699
+ "description": "Page number for pagination. Minimum value is 1. Default is 1.",
6700
+ "name": "page",
6701
+ "in": "query"
6702
+ },
6703
+ {
6704
+ "type": "integer",
6705
+ "description": "Number of items per page. Minimum 1, Maximum 50. Default is 10.",
6706
+ "name": "limit",
6707
+ "in": "query"
6708
+ },
6709
+ {
6710
+ "type": "string",
6711
+ "description": "Filter users by role. Allowed values: user, admin, super_admin. Leave empty for no filter.",
6712
+ "name": "role",
6713
+ "in": "query"
6714
+ }
6715
+ ],
6716
+ "responses": {
6717
+ "200": {
6718
+ "description": "OK",
6719
+ "schema": {
6720
+ "$ref": "#/definitions/dto.SuccessResponse-array_dto_UserResponse"
6721
+ }
6722
+ },
6723
+ "400": {
6724
+ "description": "Bad Request",
6725
+ "schema": {
6726
+ "$ref": "#/definitions/dto.ErrorResponse"
6727
+ }
6728
+ },
6729
+ "401": {
6730
+ "description": "Unauthorized",
6731
+ "schema": {
6732
+ "$ref": "#/definitions/dto.ErrorResponse"
6733
+ }
6734
+ },
6735
+ "403": {
6736
+ "description": "Forbidden",
6737
+ "schema": {
6738
+ "$ref": "#/definitions/dto.ErrorResponse"
6739
+ }
6740
+ }
6741
+ }
6742
+ },
6743
+ "post": {
6744
+ "security": [
6745
+ {
6746
+ "BearerAuth": []
6747
+ }
6748
+ ],
6749
+ "description": "Create a new user account by providing user details",
6750
+ "consumes": [
6751
+ "application/json"
6752
+ ],
6753
+ "produces": [
6754
+ "application/json"
6755
+ ],
6756
+ "tags": [
6757
+ "Super Admin Users Management"
6758
+ ],
6759
+ "summary": "Create Single User",
6760
+ "parameters": [
6761
+ {
6762
+ "description": "Create User Request",
6763
+ "name": "request",
6764
+ "in": "body",
6765
+ "required": true,
6766
+ "schema": {
6767
+ "$ref": "#/definitions/dto.CreateUserRequest"
6768
+ }
6769
+ }
6770
+ ],
6771
+ "responses": {
6772
+ "200": {
6773
+ "description": "OK",
6774
+ "schema": {
6775
+ "$ref": "#/definitions/dto.SuccessResponse-dto_UserResponse"
6776
+ }
6777
+ },
6778
+ "400": {
6779
+ "description": "Bad Request",
6780
+ "schema": {
6781
+ "$ref": "#/definitions/dto.ErrorResponse"
6782
+ }
6783
+ },
6784
+ "401": {
6785
+ "description": "Unauthorized",
6786
+ "schema": {
6787
+ "$ref": "#/definitions/dto.ErrorResponse"
6788
+ }
6789
+ },
6790
+ "403": {
6791
+ "description": "Forbidden",
6792
+ "schema": {
6793
+ "$ref": "#/definitions/dto.ErrorResponse"
6794
+ }
6795
+ }
6796
+ }
6797
+ }
6798
+ },
6799
+ "/api/v1/super-admin/users/bulk": {
6800
+ "post": {
6801
+ "security": [
6802
+ {
6803
+ "BearerAuth": []
6804
+ }
6805
+ ],
6806
+ "description": "Create multiple user accounts at once",
6807
+ "consumes": [
6808
+ "application/json"
6809
+ ],
6810
+ "produces": [
6811
+ "application/json"
6812
+ ],
6813
+ "tags": [
6814
+ "Super Admin Users Management"
6815
+ ],
6816
+ "summary": "Bulk Create Users",
6817
+ "parameters": [
6818
+ {
6819
+ "description": "Bulk Create User Requests",
6820
+ "name": "requests",
6821
+ "in": "body",
6822
+ "required": true,
6823
+ "schema": {
6824
+ "type": "array",
6825
+ "items": {
6826
+ "$ref": "#/definitions/dto.CreateUserRequest"
6827
+ }
6828
+ }
6829
+ }
6830
+ ],
6831
+ "responses": {
6832
+ "200": {
6833
+ "description": "OK",
6834
+ "schema": {
6835
+ "$ref": "#/definitions/dto.SuccessResponse-dto_CreateUserRequest"
6836
+ }
6837
+ },
6838
+ "400": {
6839
+ "description": "Bad Request",
6840
+ "schema": {
6841
+ "$ref": "#/definitions/dto.ErrorResponse"
6842
+ }
6843
+ },
6844
+ "401": {
6845
+ "description": "Unauthorized",
6846
+ "schema": {
6847
+ "$ref": "#/definitions/dto.ErrorResponse"
6848
+ }
6849
+ },
6850
+ "403": {
6851
+ "description": "Forbidden",
6852
+ "schema": {
6853
+ "$ref": "#/definitions/dto.ErrorResponse"
6854
+ }
6855
+ }
6856
+ }
6857
+ }
6858
+ },
6859
+ "/api/v1/super-admin/users/{id}": {
6860
+ "put": {
6861
+ "security": [
6862
+ {
6863
+ "BearerAuth": []
6864
+ }
6865
+ ],
6866
+ "description": "Update user information by ID",
6867
+ "consumes": [
6868
+ "application/json"
6869
+ ],
6870
+ "produces": [
6871
+ "application/json"
6872
+ ],
6873
+ "tags": [
6874
+ "Super Admin Users Management"
6875
+ ],
6876
+ "summary": "Edit User",
6877
+ "parameters": [
6878
+ {
6879
+ "type": "string",
6880
+ "description": "User ID",
6881
  "name": "id",
6882
  "in": "path",
6883
  "required": true
 
7367
  }
7368
  }
7369
  },
7370
+ "dto.AuditLogResponse": {
7371
+ "type": "object",
7372
+ "properties": {
7373
+ "action": {
7374
+ "type": "string"
7375
+ },
7376
+ "actor_account_id": {
7377
+ "type": "string"
7378
+ },
7379
+ "created_at": {
7380
+ "type": "string"
7381
+ },
7382
+ "detail": {
7383
+ "type": "string"
7384
+ },
7385
+ "id": {
7386
+ "type": "string"
7387
+ },
7388
+ "target_id": {
7389
+ "type": "string"
7390
+ }
7391
+ }
7392
+ },
7393
  "dto.AuthenticatedUser": {
7394
  "type": "object",
7395
  "properties": {
 
7739
  }
7740
  }
7741
  },
7742
+ "dto.CreateRoleRequest": {
7743
+ "type": "object",
7744
+ "required": [
7745
+ "name"
7746
+ ],
7747
+ "properties": {
7748
+ "academy_management": {
7749
+ "type": "boolean"
7750
+ },
7751
+ "content_management": {
7752
+ "type": "boolean"
7753
+ },
7754
+ "event_management": {
7755
+ "type": "boolean"
7756
+ },
7757
+ "exam_management": {
7758
+ "type": "boolean"
7759
+ },
7760
+ "name": {
7761
+ "type": "string"
7762
+ }
7763
+ }
7764
+ },
7765
  "dto.CreateUserRequest": {
7766
  "type": "object",
7767
  "required": [
 
8037
  }
8038
  }
8039
  },
8040
+ "dto.Privileges": {
8041
+ "type": "object",
8042
+ "properties": {
8043
+ "academy_management": {
8044
+ "type": "boolean"
8045
+ },
8046
+ "content_management": {
8047
+ "type": "boolean"
8048
+ },
8049
+ "event_management": {
8050
+ "type": "boolean"
8051
+ },
8052
+ "exam_management": {
8053
+ "type": "boolean"
8054
+ }
8055
+ }
8056
+ },
8057
  "dto.ProblemSetInjectResponse": {
8058
  "type": "object",
8059
  "properties": {
 
8311
  }
8312
  }
8313
  },
8314
+ "dto.RoleResponse": {
8315
+ "type": "object",
8316
+ "properties": {
8317
+ "academy_management": {
8318
+ "type": "boolean"
8319
+ },
8320
+ "content_management": {
8321
+ "type": "boolean"
8322
+ },
8323
+ "event_management": {
8324
+ "type": "boolean"
8325
+ },
8326
+ "exam_management": {
8327
+ "type": "boolean"
8328
+ },
8329
+ "id": {
8330
+ "type": "string"
8331
+ },
8332
+ "is_system": {
8333
+ "type": "boolean"
8334
+ },
8335
+ "name": {
8336
+ "type": "string"
8337
+ }
8338
+ }
8339
+ },
8340
+ "dto.SetUserRoleRequest": {
8341
+ "type": "object",
8342
+ "required": [
8343
+ "privileges",
8344
+ "role_name"
8345
+ ],
8346
+ "properties": {
8347
+ "privileges": {
8348
+ "$ref": "#/definitions/dto.Privileges"
8349
+ },
8350
+ "role_name": {
8351
+ "type": "string"
8352
+ }
8353
+ }
8354
+ },
8355
+ "dto.SetUserRoleResponseData": {
8356
+ "type": "object",
8357
+ "properties": {
8358
+ "account_id": {
8359
+ "type": "string"
8360
+ },
8361
+ "privileges": {
8362
+ "$ref": "#/definitions/dto.Privileges"
8363
+ },
8364
+ "role_name": {
8365
+ "type": "string"
8366
+ }
8367
+ }
8368
+ },
8369
  "dto.SignInRequest": {
8370
  "type": "object",
8371
  "required": [
 
8446
  }
8447
  }
8448
  },
8449
+ "dto.SuccessResponse-array_dto_AuditLogResponse": {
8450
+ "type": "object",
8451
+ "properties": {
8452
+ "data": {
8453
+ "type": "array",
8454
+ "items": {
8455
+ "$ref": "#/definitions/dto.AuditLogResponse"
8456
+ }
8457
+ },
8458
+ "message": {},
8459
+ "meta_data": {},
8460
+ "status": {
8461
+ "type": "string"
8462
+ }
8463
+ }
8464
+ },
8465
  "dto.SuccessResponse-array_dto_EventScoreboardItem": {
8466
  "type": "object",
8467
  "properties": {
 
8494
  }
8495
  }
8496
  },
8497
+ "dto.SuccessResponse-array_dto_RoleResponse": {
8498
+ "type": "object",
8499
+ "properties": {
8500
+ "data": {
8501
+ "type": "array",
8502
+ "items": {
8503
+ "$ref": "#/definitions/dto.RoleResponse"
8504
+ }
8505
+ },
8506
+ "message": {},
8507
+ "meta_data": {},
8508
+ "status": {
8509
+ "type": "string"
8510
+ }
8511
+ }
8512
+ },
8513
  "dto.SuccessResponse-array_dto_UserResponse": {
8514
  "type": "object",
8515
  "properties": {
 
8906
  }
8907
  }
8908
  },
8909
+ "dto.SuccessResponse-dto_RoleResponse": {
8910
+ "type": "object",
8911
+ "properties": {
8912
+ "data": {
8913
+ "$ref": "#/definitions/dto.RoleResponse"
8914
+ },
8915
+ "message": {},
8916
+ "meta_data": {},
8917
+ "status": {
8918
+ "type": "string"
8919
+ }
8920
+ }
8921
+ },
8922
+ "dto.SuccessResponse-dto_SetUserRoleResponseData": {
8923
+ "type": "object",
8924
+ "properties": {
8925
+ "data": {
8926
+ "$ref": "#/definitions/dto.SetUserRoleResponseData"
8927
+ },
8928
+ "message": {},
8929
+ "meta_data": {},
8930
+ "status": {
8931
+ "type": "string"
8932
+ }
8933
+ }
8934
+ },
8935
  "dto.SuccessResponse-dto_UserResponse": {
8936
  "type": "object",
8937
  "properties": {
 
9307
  }
9308
  }
9309
  },
9310
+ "dto.UpdateRoleRequest": {
9311
+ "type": "object",
9312
+ "properties": {
9313
+ "academy_management": {
9314
+ "type": "boolean"
9315
+ },
9316
+ "content_management": {
9317
+ "type": "boolean"
9318
+ },
9319
+ "event_management": {
9320
+ "type": "boolean"
9321
+ },
9322
+ "exam_management": {
9323
+ "type": "boolean"
9324
+ },
9325
+ "name": {
9326
+ "type": "string"
9327
+ }
9328
+ }
9329
+ },
9330
  "dto.UpdateUserRequest": {
9331
  "type": "object",
9332
  "properties": {
 
9344
  }
9345
  }
9346
  },
 
 
 
 
 
 
 
 
 
 
 
9347
  "dto.UserResponse": {
9348
  "type": "object",
9349
  "properties": {
 
9770
  "models.Account": {
9771
  "type": "object",
9772
  "properties": {
9773
+ "academy_management": {
9774
+ "type": "boolean"
9775
+ },
9776
+ "content_management": {
9777
+ "type": "boolean"
9778
+ },
9779
  "created_at": {
9780
  "type": "string"
9781
  },
9782
  "email": {
9783
  "type": "string"
9784
  },
9785
+ "event_management": {
9786
+ "type": "boolean"
9787
+ },
9788
+ "exam_management": {
9789
+ "type": "boolean"
9790
+ },
9791
  "full_name": {
9792
  "type": "string"
9793
  },
 
9803
  "role": {
9804
  "type": "string"
9805
  },
9806
+ "role_id": {
9807
+ "type": "string"
9808
+ },
9809
+ "role_name": {
9810
+ "type": "string"
9811
+ },
9812
+ "token_version": {
9813
+ "type": "integer"
9814
+ },
9815
  "username": {
9816
  "type": "string"
9817
  }
swagger/docs/swagger.yaml CHANGED
@@ -250,6 +250,21 @@ definitions:
250
  account_id:
251
  type: string
252
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  dto.AuthenticatedUser:
254
  properties:
255
  account:
@@ -481,6 +496,21 @@ definitions:
481
  - question
482
  - type
483
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  dto.CreateUserRequest:
485
  properties:
486
  email:
@@ -662,6 +692,17 @@ definitions:
662
  - option_name
663
  - option_values
664
  type: object
 
 
 
 
 
 
 
 
 
 
 
665
  dto.ProblemSetInjectResponse:
666
  properties:
667
  file:
@@ -829,6 +870,42 @@ definitions:
829
  required:
830
  - question_ids
831
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
832
  dto.SignInRequest:
833
  properties:
834
  email_or_username:
@@ -884,6 +961,17 @@ definitions:
884
  status:
885
  type: string
886
  type: object
 
 
 
 
 
 
 
 
 
 
 
887
  dto.SuccessResponse-array_dto_EventScoreboardItem:
888
  properties:
889
  data:
@@ -906,6 +994,17 @@ definitions:
906
  status:
907
  type: string
908
  type: object
 
 
 
 
 
 
 
 
 
 
 
909
  dto.SuccessResponse-array_dto_UserResponse:
910
  properties:
911
  data:
@@ -1179,6 +1278,24 @@ definitions:
1179
  status:
1180
  type: string
1181
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1182
  dto.SuccessResponse-dto_UserResponse:
1183
  properties:
1184
  data:
@@ -1432,6 +1549,19 @@ definitions:
1432
  required:
1433
  - final_score
1434
  type: object
 
 
 
 
 
 
 
 
 
 
 
 
 
1435
  dto.UpdateUserRequest:
1436
  properties:
1437
  email:
@@ -1443,13 +1573,6 @@ definitions:
1443
  username:
1444
  type: string
1445
  type: object
1446
- dto.UpdateUserRoleRequest:
1447
- properties:
1448
- role:
1449
- type: string
1450
- required:
1451
- - role
1452
- type: object
1453
  dto.UserResponse:
1454
  properties:
1455
  created_at: {}
@@ -1730,10 +1853,18 @@ definitions:
1730
  type: object
1731
  models.Account:
1732
  properties:
 
 
 
 
1733
  created_at:
1734
  type: string
1735
  email:
1736
  type: string
 
 
 
 
1737
  full_name:
1738
  type: string
1739
  id:
@@ -1744,6 +1875,12 @@ definitions:
1744
  type: boolean
1745
  role:
1746
  type: string
 
 
 
 
 
 
1747
  username:
1748
  type: string
1749
  type: object
@@ -3214,39 +3351,6 @@ paths:
3214
  summary: 'Admin: List Academy Participants'
3215
  tags:
3216
  - Admin Academy
3217
- /api/v1/admin/authentication/{account_id}/assign:
3218
- put:
3219
- consumes:
3220
- - application/json
3221
- description: Update the role of a user account
3222
- parameters:
3223
- - description: Account ID
3224
- in: path
3225
- name: accountId
3226
- required: true
3227
- type: string
3228
- - description: Update User Role Request
3229
- in: body
3230
- name: request
3231
- required: true
3232
- schema:
3233
- $ref: '#/definitions/dto.UpdateUserRoleRequest'
3234
- produces:
3235
- - application/json
3236
- responses:
3237
- "200":
3238
- description: OK
3239
- schema:
3240
- $ref: '#/definitions/dto.SuccessResponse-models_Account'
3241
- "400":
3242
- description: Bad Request
3243
- schema:
3244
- $ref: '#/definitions/dto.ErrorResponse'
3245
- security:
3246
- - BearerAuth: []
3247
- summary: Update User Role
3248
- tags:
3249
- - Authentication
3250
  /api/v1/admin/events:
3251
  get:
3252
  consumes:
@@ -6049,6 +6153,60 @@ paths:
6049
  summary: Seed Provinces
6050
  tags:
6051
  - Region
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6052
  /api/v1/super-admin/inject/probset:
6053
  post:
6054
  consumes:
@@ -6140,6 +6298,56 @@ paths:
6140
  summary: 'Super Admin: Inject Zip to Storage'
6141
  tags:
6142
  - Super Admin Inject
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6143
  /api/v1/super-admin/repair/problemset/naming/migrate:
6144
  post:
6145
  consumes:
@@ -6211,6 +6419,148 @@ paths:
6211
  summary: 'Super Admin: Repair Question Storage Path'
6212
  tags:
6213
  - Super Admin Repair
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6214
  /api/v1/super-admin/users:
6215
  get:
6216
  consumes:
 
250
  account_id:
251
  type: string
252
  type: object
253
+ dto.AuditLogResponse:
254
+ properties:
255
+ action:
256
+ type: string
257
+ actor_account_id:
258
+ type: string
259
+ created_at:
260
+ type: string
261
+ detail:
262
+ type: string
263
+ id:
264
+ type: string
265
+ target_id:
266
+ type: string
267
+ type: object
268
  dto.AuthenticatedUser:
269
  properties:
270
  account:
 
496
  - question
497
  - type
498
  type: object
499
+ dto.CreateRoleRequest:
500
+ properties:
501
+ academy_management:
502
+ type: boolean
503
+ content_management:
504
+ type: boolean
505
+ event_management:
506
+ type: boolean
507
+ exam_management:
508
+ type: boolean
509
+ name:
510
+ type: string
511
+ required:
512
+ - name
513
+ type: object
514
  dto.CreateUserRequest:
515
  properties:
516
  email:
 
692
  - option_name
693
  - option_values
694
  type: object
695
+ dto.Privileges:
696
+ properties:
697
+ academy_management:
698
+ type: boolean
699
+ content_management:
700
+ type: boolean
701
+ event_management:
702
+ type: boolean
703
+ exam_management:
704
+ type: boolean
705
+ type: object
706
  dto.ProblemSetInjectResponse:
707
  properties:
708
  file:
 
870
  required:
871
  - question_ids
872
  type: object
873
+ dto.RoleResponse:
874
+ properties:
875
+ academy_management:
876
+ type: boolean
877
+ content_management:
878
+ type: boolean
879
+ event_management:
880
+ type: boolean
881
+ exam_management:
882
+ type: boolean
883
+ id:
884
+ type: string
885
+ is_system:
886
+ type: boolean
887
+ name:
888
+ type: string
889
+ type: object
890
+ dto.SetUserRoleRequest:
891
+ properties:
892
+ privileges:
893
+ $ref: '#/definitions/dto.Privileges'
894
+ role_name:
895
+ type: string
896
+ required:
897
+ - privileges
898
+ - role_name
899
+ type: object
900
+ dto.SetUserRoleResponseData:
901
+ properties:
902
+ account_id:
903
+ type: string
904
+ privileges:
905
+ $ref: '#/definitions/dto.Privileges'
906
+ role_name:
907
+ type: string
908
+ type: object
909
  dto.SignInRequest:
910
  properties:
911
  email_or_username:
 
961
  status:
962
  type: string
963
  type: object
964
+ dto.SuccessResponse-array_dto_AuditLogResponse:
965
+ properties:
966
+ data:
967
+ items:
968
+ $ref: '#/definitions/dto.AuditLogResponse'
969
+ type: array
970
+ message: {}
971
+ meta_data: {}
972
+ status:
973
+ type: string
974
+ type: object
975
  dto.SuccessResponse-array_dto_EventScoreboardItem:
976
  properties:
977
  data:
 
994
  status:
995
  type: string
996
  type: object
997
+ dto.SuccessResponse-array_dto_RoleResponse:
998
+ properties:
999
+ data:
1000
+ items:
1001
+ $ref: '#/definitions/dto.RoleResponse'
1002
+ type: array
1003
+ message: {}
1004
+ meta_data: {}
1005
+ status:
1006
+ type: string
1007
+ type: object
1008
  dto.SuccessResponse-array_dto_UserResponse:
1009
  properties:
1010
  data:
 
1278
  status:
1279
  type: string
1280
  type: object
1281
+ dto.SuccessResponse-dto_RoleResponse:
1282
+ properties:
1283
+ data:
1284
+ $ref: '#/definitions/dto.RoleResponse'
1285
+ message: {}
1286
+ meta_data: {}
1287
+ status:
1288
+ type: string
1289
+ type: object
1290
+ dto.SuccessResponse-dto_SetUserRoleResponseData:
1291
+ properties:
1292
+ data:
1293
+ $ref: '#/definitions/dto.SetUserRoleResponseData'
1294
+ message: {}
1295
+ meta_data: {}
1296
+ status:
1297
+ type: string
1298
+ type: object
1299
  dto.SuccessResponse-dto_UserResponse:
1300
  properties:
1301
  data:
 
1549
  required:
1550
  - final_score
1551
  type: object
1552
+ dto.UpdateRoleRequest:
1553
+ properties:
1554
+ academy_management:
1555
+ type: boolean
1556
+ content_management:
1557
+ type: boolean
1558
+ event_management:
1559
+ type: boolean
1560
+ exam_management:
1561
+ type: boolean
1562
+ name:
1563
+ type: string
1564
+ type: object
1565
  dto.UpdateUserRequest:
1566
  properties:
1567
  email:
 
1573
  username:
1574
  type: string
1575
  type: object
 
 
 
 
 
 
 
1576
  dto.UserResponse:
1577
  properties:
1578
  created_at: {}
 
1853
  type: object
1854
  models.Account:
1855
  properties:
1856
+ academy_management:
1857
+ type: boolean
1858
+ content_management:
1859
+ type: boolean
1860
  created_at:
1861
  type: string
1862
  email:
1863
  type: string
1864
+ event_management:
1865
+ type: boolean
1866
+ exam_management:
1867
+ type: boolean
1868
  full_name:
1869
  type: string
1870
  id:
 
1875
  type: boolean
1876
  role:
1877
  type: string
1878
+ role_id:
1879
+ type: string
1880
+ role_name:
1881
+ type: string
1882
+ token_version:
1883
+ type: integer
1884
  username:
1885
  type: string
1886
  type: object
 
3351
  summary: 'Admin: List Academy Participants'
3352
  tags:
3353
  - Admin Academy
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3354
  /api/v1/admin/events:
3355
  get:
3356
  consumes:
 
6153
  summary: Seed Provinces
6154
  tags:
6155
  - Region
6156
+ /api/v1/super-admin/accounts/{account_id}/role:
6157
+ put:
6158
+ consumes:
6159
+ - application/json
6160
+ description: Set the role and privileges of a user account. Supports system
6161
+ roles, named custom roles, or "custom" with explicit flags.
6162
+ parameters:
6163
+ - description: Account ID
6164
+ in: path
6165
+ name: account_id
6166
+ required: true
6167
+ type: string
6168
+ - description: Set User Role Request
6169
+ in: body
6170
+ name: request
6171
+ required: true
6172
+ schema:
6173
+ $ref: '#/definitions/dto.SetUserRoleRequest'
6174
+ produces:
6175
+ - application/json
6176
+ responses:
6177
+ "200":
6178
+ description: OK
6179
+ schema:
6180
+ $ref: '#/definitions/dto.SuccessResponse-dto_SetUserRoleResponseData'
6181
+ "400":
6182
+ description: Bad Request
6183
+ schema:
6184
+ $ref: '#/definitions/dto.ErrorResponse'
6185
+ "401":
6186
+ description: Unauthorized
6187
+ schema:
6188
+ $ref: '#/definitions/dto.ErrorResponse'
6189
+ "403":
6190
+ description: Forbidden
6191
+ schema:
6192
+ $ref: '#/definitions/dto.ErrorResponse'
6193
+ "404":
6194
+ description: Not Found
6195
+ schema:
6196
+ $ref: '#/definitions/dto.ErrorResponse'
6197
+ "409":
6198
+ description: Conflict
6199
+ schema:
6200
+ $ref: '#/definitions/dto.ErrorResponse'
6201
+ "422":
6202
+ description: Unprocessable Entity
6203
+ schema:
6204
+ $ref: '#/definitions/dto.ErrorResponse'
6205
+ security:
6206
+ - BearerAuth: []
6207
+ summary: Set User Role
6208
+ tags:
6209
+ - Super Admin Accounts
6210
  /api/v1/super-admin/inject/probset:
6211
  post:
6212
  consumes:
 
6298
  summary: 'Super Admin: Inject Zip to Storage'
6299
  tags:
6300
  - Super Admin Inject
6301
+ /api/v1/super-admin/logs:
6302
+ get:
6303
+ consumes:
6304
+ - application/json
6305
+ description: Get paginated audit logs with optional filters. Superadmin only.
6306
+ parameters:
6307
+ - description: Page number (default 1)
6308
+ in: query
6309
+ name: page
6310
+ type: integer
6311
+ - description: Items per page (default 10, max 50)
6312
+ in: query
6313
+ name: limit
6314
+ type: integer
6315
+ - description: Filter by action
6316
+ in: query
6317
+ name: action
6318
+ type: string
6319
+ - description: Filter by actor account ID
6320
+ in: query
6321
+ name: actor_account_id
6322
+ type: string
6323
+ - description: Start time (RFC3339)
6324
+ in: query
6325
+ name: from
6326
+ type: string
6327
+ - description: End time (RFC3339)
6328
+ in: query
6329
+ name: to
6330
+ type: string
6331
+ produces:
6332
+ - application/json
6333
+ responses:
6334
+ "200":
6335
+ description: OK
6336
+ schema:
6337
+ $ref: '#/definitions/dto.SuccessResponse-array_dto_AuditLogResponse'
6338
+ "401":
6339
+ description: Unauthorized
6340
+ schema:
6341
+ $ref: '#/definitions/dto.ErrorResponse'
6342
+ "403":
6343
+ description: Forbidden
6344
+ schema:
6345
+ $ref: '#/definitions/dto.ErrorResponse'
6346
+ security:
6347
+ - BearerAuth: []
6348
+ summary: List Audit Logs
6349
+ tags:
6350
+ - Super Admin Audit
6351
  /api/v1/super-admin/repair/problemset/naming/migrate:
6352
  post:
6353
  consumes:
 
6419
  summary: 'Super Admin: Repair Question Storage Path'
6420
  tags:
6421
  - Super Admin Repair
6422
+ /api/v1/super-admin/roles:
6423
+ get:
6424
+ consumes:
6425
+ - application/json
6426
+ description: Get all system and named custom roles with their privilege flags
6427
+ produces:
6428
+ - application/json
6429
+ responses:
6430
+ "200":
6431
+ description: OK
6432
+ schema:
6433
+ $ref: '#/definitions/dto.SuccessResponse-array_dto_RoleResponse'
6434
+ "401":
6435
+ description: Unauthorized
6436
+ schema:
6437
+ $ref: '#/definitions/dto.ErrorResponse'
6438
+ "403":
6439
+ description: Forbidden
6440
+ schema:
6441
+ $ref: '#/definitions/dto.ErrorResponse'
6442
+ security:
6443
+ - BearerAuth: []
6444
+ summary: List All Roles
6445
+ tags:
6446
+ - Super Admin Roles
6447
+ post:
6448
+ consumes:
6449
+ - application/json
6450
+ description: Create a new named custom role with privilege flags. Superadmin
6451
+ only.
6452
+ parameters:
6453
+ - description: Create Role Request
6454
+ in: body
6455
+ name: request
6456
+ required: true
6457
+ schema:
6458
+ $ref: '#/definitions/dto.CreateRoleRequest'
6459
+ produces:
6460
+ - application/json
6461
+ responses:
6462
+ "200":
6463
+ description: OK
6464
+ schema:
6465
+ $ref: '#/definitions/dto.SuccessResponse-dto_RoleResponse'
6466
+ "400":
6467
+ description: Bad Request
6468
+ schema:
6469
+ $ref: '#/definitions/dto.ErrorResponse'
6470
+ "401":
6471
+ description: Unauthorized
6472
+ schema:
6473
+ $ref: '#/definitions/dto.ErrorResponse'
6474
+ "403":
6475
+ description: Forbidden
6476
+ schema:
6477
+ $ref: '#/definitions/dto.ErrorResponse'
6478
+ "409":
6479
+ description: Conflict
6480
+ schema:
6481
+ $ref: '#/definitions/dto.ErrorResponse'
6482
+ security:
6483
+ - BearerAuth: []
6484
+ summary: Create Named Role
6485
+ tags:
6486
+ - Super Admin Roles
6487
+ /api/v1/super-admin/roles/{role_id}:
6488
+ delete:
6489
+ consumes:
6490
+ - application/json
6491
+ description: Delete a named custom role. System roles are immutable. Cannot
6492
+ delete if assigned to any account.
6493
+ parameters:
6494
+ - description: Role ID
6495
+ in: path
6496
+ name: role_id
6497
+ required: true
6498
+ type: string
6499
+ produces:
6500
+ - application/json
6501
+ responses:
6502
+ "200":
6503
+ description: OK
6504
+ schema:
6505
+ $ref: '#/definitions/dto.SuccessResponse-any'
6506
+ "401":
6507
+ description: Unauthorized
6508
+ schema:
6509
+ $ref: '#/definitions/dto.ErrorResponse'
6510
+ "403":
6511
+ description: Forbidden
6512
+ schema:
6513
+ $ref: '#/definitions/dto.ErrorResponse'
6514
+ "409":
6515
+ description: Conflict
6516
+ schema:
6517
+ $ref: '#/definitions/dto.ErrorResponse'
6518
+ security:
6519
+ - BearerAuth: []
6520
+ summary: Delete Named Role
6521
+ tags:
6522
+ - Super Admin Roles
6523
+ put:
6524
+ consumes:
6525
+ - application/json
6526
+ description: Update a named custom role's privilege flags. System roles are
6527
+ immutable.
6528
+ parameters:
6529
+ - description: Role ID
6530
+ in: path
6531
+ name: role_id
6532
+ required: true
6533
+ type: string
6534
+ - description: Update Role Request
6535
+ in: body
6536
+ name: request
6537
+ required: true
6538
+ schema:
6539
+ $ref: '#/definitions/dto.UpdateRoleRequest'
6540
+ produces:
6541
+ - application/json
6542
+ responses:
6543
+ "200":
6544
+ description: OK
6545
+ schema:
6546
+ $ref: '#/definitions/dto.SuccessResponse-dto_RoleResponse'
6547
+ "400":
6548
+ description: Bad Request
6549
+ schema:
6550
+ $ref: '#/definitions/dto.ErrorResponse'
6551
+ "401":
6552
+ description: Unauthorized
6553
+ schema:
6554
+ $ref: '#/definitions/dto.ErrorResponse'
6555
+ "403":
6556
+ description: Forbidden
6557
+ schema:
6558
+ $ref: '#/definitions/dto.ErrorResponse'
6559
+ security:
6560
+ - BearerAuth: []
6561
+ summary: Update Named Role
6562
+ tags:
6563
+ - Super Admin Roles
6564
  /api/v1/super-admin/users:
6565
  get:
6566
  consumes: