test-SiLaju / docs /docs.go
RyZ
feature: adding notification feat
9591a68
// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "API Support",
"email": "support@dinacom.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/admin/auth/assign": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Assign worker role to a user (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Assign Worker Role",
"parameters": [
{
"description": "Assign Worker Role Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AssignWorkerRoleRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/report": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all reports with optional status filter and pagination",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get All Reports (Admin)",
"parameters": [
{
"type": "string",
"description": "Filter by status (pending, assigned, finish by worker, verified, complete)",
"name": "status",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Items per page",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PaginatedReportsResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/report/assign": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all workers with assigned reports",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get Assigned Workers",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.AssignedWorkerResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Admin assigns a worker to a report",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Assign Worker to Report",
"parameters": [
{
"description": "Assign Worker Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AssignWorkerRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/report/detail": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get complete report details by report ID",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get Full Report Detail (Admin)",
"parameters": [
{
"type": "string",
"description": "Report ID",
"name": "report_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.FullReportDetailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/report/verify": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Admin verifies a report with status 'Finish by Worker' to 'finished'",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Verify Report by Admin",
"parameters": [
{
"description": "Verify Report Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.VerifyReportRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/worker": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new worker account (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Create Worker",
"parameters": [
{
"description": "Create Worker Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.CreateWorkerRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkerResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/admin/worker/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get worker details by ID (Admin only)",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get Worker By ID",
"parameters": [
{
"type": "string",
"description": "Worker ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkerResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update worker details (Admin only)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Update Worker",
"parameters": [
{
"type": "string",
"description": "Worker ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Update Worker Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.UpdateWorkerRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.WorkerResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a worker (Admin only)",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Delete Worker",
"parameters": [
{
"type": "string",
"description": "Worker ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/admin/login": {
"post": {
"description": "Login for admins",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Login Admin",
"parameters": [
{
"description": "Login Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AuthResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/admin/users": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all users (Admin only)",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get All Users",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserResponse"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/admin/workers": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all workers (Admin only)",
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "Get All Workers",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserResponse"
}
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/google": {
"post": {
"description": "Authenticate with Google ID token and get JWT",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Google Authentication",
"parameters": [
{
"description": "Google Auth Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.GoogleAuthRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.GoogleAuthResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get current user's profile",
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Get Profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UserResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/user/login": {
"post": {
"description": "Login for users",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Login User",
"parameters": [
{
"description": "Login Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AuthResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/user/register": {
"post": {
"description": "Register a new user with email verification via OTP",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Register a new user",
"parameters": [
{
"description": "Register Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.RegisterRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/user/verify-otp": {
"post": {
"description": "Verify OTP to activate user account and get access token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Verify OTP",
"parameters": [
{
"description": "Verify OTP Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.VerifyOTPRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AuthResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/auth/worker/login": {
"post": {
"description": "Login for workers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "Login Worker",
"parameters": [
{
"description": "Login Request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AuthResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/get_report": {
"get": {
"description": "Get all completed reports with non-good destruct class",
"produces": [
"application/json"
],
"tags": [
"Report"
],
"summary": "Get Reports",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.ReportLocationResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/achievements": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all achievements with unlock status for the logged-in user",
"produces": [
"application/json"
],
"tags": [
"Achievements"
],
"summary": "Get All Achievements",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AchievementListResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/achievements/check": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Trigger achievement check and unlock any new achievements",
"produces": [
"application/json"
],
"tags": [
"Achievements"
],
"summary": "Check Achievements",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.NewAchievementResponse"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/achievements/unlocked": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get only unlocked achievements for the logged-in user",
"produces": [
"application/json"
],
"tags": [
"Achievements"
],
"summary": "Get Unlocked Achievements",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AchievementListResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/leaderboard": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get top users by XP (default limit 10)",
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Get Leaderboard",
"parameters": [
{
"type": "integer",
"description": "Limit (default 10)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.LeaderboardEntry"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/notifications": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get paginated notifications for authenticated user",
"produces": [
"application/json"
],
"tags": [
"Notification"
],
"summary": "Get User Notifications",
"parameters": [
{
"type": "integer",
"description": "Page number (default: 1)",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "Items per page (default: 20)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.NotificationListResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/notifications/read": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Mark a specific notification as read",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Notification"
],
"summary": "Mark Notification as Read",
"parameters": [
{
"description": "Notification ID",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.MarkNotificationReadRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/notifications/read-all": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Mark all notifications as read for authenticated user",
"produces": [
"application/json"
],
"tags": [
"Notification"
],
"summary": "Mark All Notifications as Read",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/notifications/unread-count": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get count of unread notifications",
"produces": [
"application/json"
],
"tags": [
"Notification"
],
"summary": "Get Unread Count",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "integer",
"format": "int64"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/rank": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get the logged-in user's rank, level, XP progress",
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Get User Rank",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UserRankResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/report": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Submit a new report with image and location data",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Report"
],
"summary": "Create Report",
"parameters": [
{
"type": "file",
"description": "Image file (JPG, PNG, JPEG, max 32MB)",
"name": "files",
"in": "formData",
"required": true
},
{
"type": "string",
"default": "{\"longitude\": 106.816666, \"latitude\": -6.200000, \"road_name\": \"Jalan Sudirman\", \"description\": \"Lubang besar di tengah jalan\"}",
"description": "JSON data",
"name": "json",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ReportResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/report/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all reports created by the logged-in user with pagination",
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Get User's Reports",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Items per page",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PaginatedReportsResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/user/report/stats": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get report statistics for the authenticated user",
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Get User Report Stats",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.UserReportStatsResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/worker/report": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Worker uploads after image and marks report as finished",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Worker"
],
"summary": "Finish Report by Worker",
"parameters": [
{
"type": "file",
"description": "After image file",
"name": "files",
"in": "formData",
"required": true
},
{
"type": "string",
"default": "{\"report_id\": \"uuid-here\"}",
"description": "JSON data",
"name": "json",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/worker/report/assign/detail": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get assigned report detail for worker",
"produces": [
"application/json"
],
"tags": [
"Worker"
],
"summary": "Get Report Detail",
"parameters": [
{
"type": "string",
"description": "Report ID",
"name": "report_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ReportDetailResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/worker/report/assign/image": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get before image URL for assigned report",
"produces": [
"application/json"
],
"tags": [
"Worker"
],
"summary": "Get Report Image",
"parameters": [
{
"type": "string",
"description": "Report ID",
"name": "report_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ReportImageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/worker/report/assign/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all reports assigned to the logged-in worker with pagination",
"produces": [
"application/json"
],
"tags": [
"Worker"
],
"summary": "Get Worker's Assigned Reports",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Items per page",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PaginatedReportsResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/api/worker/report/history/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get worker's completed reports with pagination and status filter",
"produces": [
"application/json"
],
"tags": [
"Worker"
],
"summary": "Get Worker's History",
"parameters": [
{
"type": "integer",
"default": 1,
"description": "Page number",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 10,
"description": "Items per page",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "True: finished, False: Finish by Worker",
"name": "verify_admin",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.PaginatedReportsResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"dto.AchievementListResponse": {
"type": "object",
"properties": {
"achievements": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.AchievementResponse"
}
},
"total_count": {
"type": "integer"
},
"unlocked_count": {
"type": "integer"
}
}
},
"dto.AchievementResponse": {
"type": "object",
"properties": {
"badge_url": {
"type": "string"
},
"category": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"unlocked": {
"type": "boolean"
},
"unlocked_at": {
"type": "string"
},
"xp_reward": {
"type": "integer"
}
}
},
"dto.AssignWorkerRequest": {
"type": "object",
"required": [
"report_id",
"worker_id"
],
"properties": {
"admin_notes": {
"type": "string"
},
"deadline": {
"type": "string"
},
"report_id": {
"type": "string"
},
"worker_id": {
"type": "string"
}
}
},
"dto.AssignWorkerRoleRequest": {
"type": "object",
"required": [
"worker_id"
],
"properties": {
"worker_id": {
"type": "string"
}
}
},
"dto.AssignedWorkerResponse": {
"type": "object",
"properties": {
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"road_name": {
"type": "string"
},
"status": {
"type": "string"
},
"worker_name": {
"type": "string"
}
}
},
"dto.AuthResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"dto.CreateWorkerRequest": {
"type": "object",
"required": [
"email",
"fullname",
"password",
"username"
],
"properties": {
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"password": {
"type": "string",
"minLength": 6
},
"username": {
"type": "string"
}
}
},
"dto.FullReportDetailResponse": {
"type": "object",
"properties": {
"admin_notes": {
"type": "string"
},
"after_image_url": {
"type": "string"
},
"before_image_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"deadline": {
"type": "string"
},
"description": {
"type": "string"
},
"destruct_class": {
"type": "string"
},
"id": {
"type": "string"
},
"latitude": {
"type": "number"
},
"location_score": {
"type": "number"
},
"longitude": {
"type": "number"
},
"road_name": {
"type": "string"
},
"status": {
"type": "string"
},
"total_score": {
"type": "number"
},
"user_id": {
"type": "string"
},
"worker_id": {
"type": "string"
}
}
},
"dto.GoogleAuthRequest": {
"type": "object",
"required": [
"idToken"
],
"properties": {
"idToken": {
"type": "string"
}
}
},
"dto.GoogleAuthResponse": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"user": {
"$ref": "#/definitions/dto.GoogleUserDetails"
}
}
},
"dto.GoogleUserDetails": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"isNewUser": {
"type": "boolean"
}
}
},
"dto.LeaderboardEntry": {
"type": "object",
"properties": {
"fullname": {
"type": "string"
},
"level": {
"type": "integer"
},
"rank": {
"type": "integer"
},
"rank_name": {
"type": "string"
},
"total_xp": {
"type": "integer"
},
"user_id": {
"type": "string"
}
}
},
"dto.LoginRequest": {
"type": "object",
"required": [
"email",
"password"
],
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
},
"dto.MarkNotificationReadRequest": {
"type": "object",
"required": [
"notification_id"
],
"properties": {
"notification_id": {
"type": "string"
}
}
},
"dto.NewAchievementResponse": {
"type": "object",
"properties": {
"achievement_id": {
"type": "string"
},
"badge_url": {
"type": "string"
},
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"xp_reward": {
"type": "integer"
}
}
},
"dto.NotificationListResponse": {
"type": "object",
"properties": {
"notifications": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.NotificationResponse"
}
},
"total": {
"type": "integer"
},
"unread_count": {
"type": "integer"
}
}
},
"dto.NotificationResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"data": {
"type": "string"
},
"id": {
"type": "string"
},
"is_read": {
"type": "boolean"
},
"message": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"dto.PaginatedReportsResponse": {
"type": "object",
"properties": {
"limit": {
"type": "integer"
},
"page": {
"type": "integer"
},
"reports": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.UserReportResponse"
}
},
"total_count": {
"type": "integer"
},
"total_pages": {
"type": "integer"
}
}
},
"dto.RegisterRequest": {
"type": "object",
"required": [
"email",
"fullname",
"password",
"username"
],
"properties": {
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"password": {
"type": "string",
"minLength": 6
},
"username": {
"type": "string"
}
}
},
"dto.ReportDetailResponse": {
"type": "object",
"properties": {
"admin_notes": {
"type": "string"
},
"before_image_url": {
"type": "string"
},
"deadline": {
"type": "string"
},
"destruct_class": {
"type": "string"
},
"road_name": {
"type": "string"
},
"total_score": {
"type": "number"
}
}
},
"dto.ReportImageResponse": {
"type": "object",
"properties": {
"before_image_url": {
"type": "string"
}
}
},
"dto.ReportLocationResponse": {
"type": "object",
"properties": {
"destruct_class": {
"type": "string"
},
"id": {
"type": "string"
},
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
},
"total_score": {
"type": "number"
}
}
},
"dto.ReportResponse": {
"type": "object",
"properties": {
"after_image_url": {
"type": "string"
},
"before_image_url": {
"type": "string"
},
"description": {
"type": "string"
},
"destruct_class": {
"type": "string"
},
"id": {
"type": "string"
},
"latitude": {
"type": "number"
},
"location_score": {
"type": "number"
},
"longitude": {
"type": "number"
},
"road_name": {
"type": "string"
},
"status": {
"type": "string"
},
"total_score": {
"type": "number"
},
"user_id": {
"type": "string"
}
}
},
"dto.UpdateWorkerRequest": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"dto.UserRankResponse": {
"type": "object",
"properties": {
"current_xp": {
"type": "integer"
},
"level": {
"type": "integer"
},
"next_level": {
"type": "integer"
},
"progress": {
"type": "number"
},
"rank": {
"type": "integer"
},
"rank_name": {
"type": "string"
},
"total_xp": {
"type": "integer"
},
"xp_to_next": {
"type": "integer"
}
}
},
"dto.UserReportResponse": {
"type": "object",
"properties": {
"admin_notes": {
"type": "string"
},
"after_image_url": {
"type": "string"
},
"before_image_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"deadline": {
"type": "string"
},
"description": {
"type": "string"
},
"destruct_class": {
"type": "string"
},
"id": {
"type": "string"
},
"latitude": {
"type": "number"
},
"location_score": {
"type": "number"
},
"longitude": {
"type": "number"
},
"road_name": {
"type": "string"
},
"status": {
"type": "string"
},
"total_score": {
"type": "number"
}
}
},
"dto.UserReportStatsResponse": {
"type": "object",
"properties": {
"in_progress": {
"type": "integer"
},
"total": {
"type": "integer"
},
"verified": {
"type": "integer"
}
}
},
"dto.UserResponse": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"id": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
},
"verified": {
"type": "boolean"
}
}
},
"dto.VerifyOTPRequest": {
"type": "object",
"required": [
"email",
"otp"
],
"properties": {
"email": {
"type": "string"
},
"otp": {
"type": "string"
}
}
},
"dto.VerifyReportRequest": {
"type": "object",
"required": [
"report_id"
],
"properties": {
"report_id": {
"type": "string"
}
}
},
"dto.WorkerResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"fullname": {
"type": "string"
},
"id": {
"type": "string"
},
"username": {
"type": "string"
},
"verified": {
"type": "boolean"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "Type \"Bearer\" followed by a space and JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Dinacom 11.0 Backend API",
Description: "Backend service for Dinacom 11.0 Hackathon",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}