Module project, commit, submission
All checks were successful
Build and Release / release (push) Successful in 1m15s

This commit is contained in:
2026-04-26 16:31:03 +07:00
parent ac90236022
commit 6918a100fc
60 changed files with 5957 additions and 1020 deletions

View File

@@ -1622,6 +1622,459 @@ const docTemplate = `{
}
}
},
"/projects/{id}/change-owner": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Transfer project ownership to an existing member. Only the current owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Transfer project ownership",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "New Owner Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangeOwnerDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/commits": {
"get": {
"description": "Retrieve all commits for a specific project",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Get project commits",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new commit and update project's latest commit ID. Only owner/editor allowed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Create a new commit",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Commit Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateCommitDto"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/commits/restore": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update project's latest commit ID to an older commit. Only owner/editor allowed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Restore project to a commit",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Restore Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.RestoreCommitDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Invite a user to the project with a specific role (EDITOR or VIEWER). Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Add a member to project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Member Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.AddProjectMemberDto"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members/{userId}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Change a member's role in the project. Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Update member role",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Member User ID",
"name": "userId",
"in": "path",
"required": true
},
{
"description": "Role Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProjectMemberDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Remove a user from the project. Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Remove a member from project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Member User ID",
"name": "userId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/raster-tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
@@ -1783,6 +2236,317 @@ const docTemplate = `{
}
}
},
"/submissions": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of submissions with filters",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Search submissions",
"parameters": [
{
"type": "string",
"name": "created_from",
"in": "query"
},
{
"type": "string",
"name": "created_to",
"in": "query"
},
{
"maximum": 100,
"minimum": 1,
"type": "integer",
"name": "limit",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"name": "order",
"in": "query"
},
{
"minimum": 1,
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "string",
"name": "project_id",
"in": "query"
},
{
"type": "string",
"name": "reviewed_by",
"in": "query"
},
{
"maxLength": 200,
"minLength": 2,
"type": "string",
"name": "search",
"in": "query"
},
{
"enum": [
"id",
"created_at",
"reviewed_at",
"status"
],
"type": "string",
"name": "sort",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"name": "statuses",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"name": "user_ids",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Submit a new submission for a project commit",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Create submission",
"parameters": [
{
"description": "Submission data",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateSubmissionDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/submissions/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information of a submission",
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Get submission by ID",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a submission by ID",
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Delete submission",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/submissions/{id}/status": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Approve or reject a submission",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Update submission status",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Status update data",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateSubmissionStatusDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
@@ -2653,6 +3417,36 @@ const docTemplate = `{
}
},
"definitions": {
"history-api_internal_dtos_request.AddProjectMemberDto": {
"type": "object",
"required": [
"role",
"user_id"
],
"properties": {
"role": {
"type": "string",
"enum": [
"EDITOR",
"VIEWER"
]
},
"user_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.ChangeOwnerDto": {
"type": "object",
"required": [
"new_owner_id"
],
"properties": {
"new_owner_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.ChangePasswordDto": {
"type": "object",
"required": [
@@ -2686,6 +3480,25 @@ const docTemplate = `{
}
}
},
"history-api_internal_dtos_request.CreateCommitDto": {
"type": "object",
"required": [
"edit_summary",
"snapshot_json"
],
"properties": {
"edit_summary": {
"type": "string",
"maxLength": 500
},
"snapshot_json": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"history-api_internal_dtos_request.CreateProjectDto": {
"type": "object",
"required": [
@@ -2709,6 +3522,24 @@ const docTemplate = `{
}
}
},
"history-api_internal_dtos_request.CreateSubmissionDto": {
"type": "object",
"required": [
"commit_id",
"project_id"
],
"properties": {
"commit_id": {
"type": "string"
},
"content": {
"type": "string"
},
"project_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.CreateTokenDto": {
"type": "object",
"required": [
@@ -2810,6 +3641,17 @@ const docTemplate = `{
}
}
},
"history-api_internal_dtos_request.RestoreCommitDto": {
"type": "object",
"required": [
"commit_id"
],
"properties": {
"commit_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.SignInDto": {
"type": "object",
"required": [
@@ -2915,6 +3757,37 @@ const docTemplate = `{
}
}
},
"history-api_internal_dtos_request.UpdateProjectMemberDto": {
"type": "object",
"required": [
"role"
],
"properties": {
"role": {
"type": "string",
"enum": [
"EDITOR",
"VIEWER"
]
}
}
},
"history-api_internal_dtos_request.UpdateSubmissionStatusDto": {
"type": "object",
"required": [
"review_note",
"status"
],
"properties": {
"review_note": {
"type": "string",
"minLength": 10
},
"status": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.UpdateVerificationStatusDto": {
"type": "object",
"required": [

View File

@@ -1615,6 +1615,459 @@
}
}
},
"/projects/{id}/change-owner": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Transfer project ownership to an existing member. Only the current owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Transfer project ownership",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "New Owner Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.ChangeOwnerDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/commits": {
"get": {
"description": "Retrieve all commits for a specific project",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Get project commits",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new commit and update project's latest commit ID. Only owner/editor allowed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Create a new commit",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Commit Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateCommitDto"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/commits/restore": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update project's latest commit ID to an older commit. Only owner/editor allowed.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Commits"
],
"summary": "Restore project to a commit",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Restore Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.RestoreCommitDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Invite a user to the project with a specific role (EDITOR or VIEWER). Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Add a member to project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Member Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.AddProjectMemberDto"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/projects/{id}/members/{userId}": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Change a member's role in the project. Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Update member role",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Member User ID",
"name": "userId",
"in": "path",
"required": true
},
{
"description": "Role Data",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateProjectMemberDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Remove a user from the project. Only project owner can do this.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Projects"
],
"summary": "Remove a member from project",
"parameters": [
{
"type": "string",
"description": "Project ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Member User ID",
"name": "userId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/raster-tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
@@ -1776,6 +2229,317 @@
}
}
},
"/submissions": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of submissions with filters",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Search submissions",
"parameters": [
{
"type": "string",
"name": "created_from",
"in": "query"
},
{
"type": "string",
"name": "created_to",
"in": "query"
},
{
"maximum": 100,
"minimum": 1,
"type": "integer",
"name": "limit",
"in": "query"
},
{
"enum": [
"asc",
"desc"
],
"type": "string",
"name": "order",
"in": "query"
},
{
"minimum": 1,
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "string",
"name": "project_id",
"in": "query"
},
{
"type": "string",
"name": "reviewed_by",
"in": "query"
},
{
"maxLength": 200,
"minLength": 2,
"type": "string",
"name": "search",
"in": "query"
},
{
"enum": [
"id",
"created_at",
"reviewed_at",
"status"
],
"type": "string",
"name": "sort",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"name": "statuses",
"in": "query"
},
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv",
"name": "user_ids",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Submit a new submission for a project commit",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Create submission",
"parameters": [
{
"description": "Submission data",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.CreateSubmissionDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/submissions/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information of a submission",
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Get submission by ID",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a submission by ID",
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Delete submission",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/submissions/{id}/status": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Approve or reject a submission",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Submission"
],
"summary": "Update submission status",
"parameters": [
{
"type": "string",
"description": "Submission ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Status update data",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_request.UpdateSubmissionStatusDto"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/history-api_internal_dtos_response.CommonResponse"
}
}
}
}
},
"/tiles/metadata": {
"get": {
"description": "Retrieve map metadata",
@@ -2646,6 +3410,36 @@
}
},
"definitions": {
"history-api_internal_dtos_request.AddProjectMemberDto": {
"type": "object",
"required": [
"role",
"user_id"
],
"properties": {
"role": {
"type": "string",
"enum": [
"EDITOR",
"VIEWER"
]
},
"user_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.ChangeOwnerDto": {
"type": "object",
"required": [
"new_owner_id"
],
"properties": {
"new_owner_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.ChangePasswordDto": {
"type": "object",
"required": [
@@ -2679,6 +3473,25 @@
}
}
},
"history-api_internal_dtos_request.CreateCommitDto": {
"type": "object",
"required": [
"edit_summary",
"snapshot_json"
],
"properties": {
"edit_summary": {
"type": "string",
"maxLength": 500
},
"snapshot_json": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"history-api_internal_dtos_request.CreateProjectDto": {
"type": "object",
"required": [
@@ -2702,6 +3515,24 @@
}
}
},
"history-api_internal_dtos_request.CreateSubmissionDto": {
"type": "object",
"required": [
"commit_id",
"project_id"
],
"properties": {
"commit_id": {
"type": "string"
},
"content": {
"type": "string"
},
"project_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.CreateTokenDto": {
"type": "object",
"required": [
@@ -2803,6 +3634,17 @@
}
}
},
"history-api_internal_dtos_request.RestoreCommitDto": {
"type": "object",
"required": [
"commit_id"
],
"properties": {
"commit_id": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.SignInDto": {
"type": "object",
"required": [
@@ -2908,6 +3750,37 @@
}
}
},
"history-api_internal_dtos_request.UpdateProjectMemberDto": {
"type": "object",
"required": [
"role"
],
"properties": {
"role": {
"type": "string",
"enum": [
"EDITOR",
"VIEWER"
]
}
}
},
"history-api_internal_dtos_request.UpdateSubmissionStatusDto": {
"type": "object",
"required": [
"review_note",
"status"
],
"properties": {
"review_note": {
"type": "string",
"minLength": 10
},
"status": {
"type": "string"
}
}
},
"history-api_internal_dtos_request.UpdateVerificationStatusDto": {
"type": "object",
"required": [

View File

@@ -1,5 +1,25 @@
basePath: /
definitions:
history-api_internal_dtos_request.AddProjectMemberDto:
properties:
role:
enum:
- EDITOR
- VIEWER
type: string
user_id:
type: string
required:
- role
- user_id
type: object
history-api_internal_dtos_request.ChangeOwnerDto:
properties:
new_owner_id:
type: string
required:
- new_owner_id
type: object
history-api_internal_dtos_request.ChangePasswordDto:
properties:
new_password:
@@ -23,6 +43,19 @@ definitions:
required:
- role_ids
type: object
history-api_internal_dtos_request.CreateCommitDto:
properties:
edit_summary:
maxLength: 500
type: string
snapshot_json:
items:
type: integer
type: array
required:
- edit_summary
- snapshot_json
type: object
history-api_internal_dtos_request.CreateProjectDto:
properties:
description:
@@ -39,6 +72,18 @@ definitions:
required:
- title
type: object
history-api_internal_dtos_request.CreateSubmissionDto:
properties:
commit_id:
type: string
content:
type: string
project_id:
type: string
required:
- commit_id
- project_id
type: object
history-api_internal_dtos_request.CreateTokenDto:
properties:
email:
@@ -108,6 +153,13 @@ definitions:
required:
- token_id
type: object
history-api_internal_dtos_request.RestoreCommitDto:
properties:
commit_id:
type: string
required:
- commit_id
type: object
history-api_internal_dtos_request.SignInDto:
properties:
email:
@@ -185,6 +237,27 @@ definitions:
maxLength: 255
type: string
type: object
history-api_internal_dtos_request.UpdateProjectMemberDto:
properties:
role:
enum:
- EDITOR
- VIEWER
type: string
required:
- role
type: object
history-api_internal_dtos_request.UpdateSubmissionStatusDto:
properties:
review_note:
minLength: 10
type: string
status:
type: string
required:
- review_note
- status
type: object
history-api_internal_dtos_request.UpdateVerificationStatusDto:
properties:
review_note:
@@ -1314,6 +1387,304 @@ paths:
summary: Update a project
tags:
- Projects
/projects/{id}/change-owner:
put:
consumes:
- application/json
description: Transfer project ownership to an existing member. Only the current
owner can do this.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: New Owner Data
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.ChangeOwnerDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Transfer project ownership
tags:
- Projects
/projects/{id}/commits:
get:
consumes:
- application/json
description: Retrieve all commits for a specific project
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
summary: Get project commits
tags:
- Commits
post:
consumes:
- application/json
description: Create a new commit and update project's latest commit ID. Only
owner/editor allowed.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Commit Data
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.CreateCommitDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Create a new commit
tags:
- Commits
/projects/{id}/commits/restore:
post:
consumes:
- application/json
description: Update project's latest commit ID to an older commit. Only owner/editor
allowed.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Restore Data
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.RestoreCommitDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Restore project to a commit
tags:
- Commits
/projects/{id}/members:
post:
consumes:
- application/json
description: Invite a user to the project with a specific role (EDITOR or VIEWER).
Only project owner can do this.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Member Data
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.AddProjectMemberDto'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"409":
description: Conflict
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Add a member to project
tags:
- Projects
/projects/{id}/members/{userId}:
delete:
consumes:
- application/json
description: Remove a user from the project. Only project owner can do this.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Member User ID
in: path
name: userId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Remove a member from project
tags:
- Projects
put:
consumes:
- application/json
description: Change a member's role in the project. Only project owner can do
this.
parameters:
- description: Project ID
in: path
name: id
required: true
type: string
- description: Member User ID
in: path
name: userId
required: true
type: string
- description: Role Data
in: body
name: request
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.UpdateProjectMemberDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Update member role
tags:
- Projects
/raster-tiles/{z}/{x}/{y}:
get:
description: Fetch vector or raster map tile data by Z, X, Y coordinates
@@ -1418,6 +1789,205 @@ paths:
summary: Get role by ID
tags:
- Roles
/submissions:
get:
consumes:
- application/json
description: Get a list of submissions with filters
parameters:
- in: query
name: created_from
type: string
- in: query
name: created_to
type: string
- in: query
maximum: 100
minimum: 1
name: limit
type: integer
- enum:
- asc
- desc
in: query
name: order
type: string
- in: query
minimum: 1
name: page
type: integer
- in: query
name: project_id
type: string
- in: query
name: reviewed_by
type: string
- in: query
maxLength: 200
minLength: 2
name: search
type: string
- enum:
- id
- created_at
- reviewed_at
- status
in: query
name: sort
type: string
- collectionFormat: csv
in: query
items:
type: string
name: statuses
type: array
- collectionFormat: csv
in: query
items:
type: string
name: user_ids
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Search submissions
tags:
- Submission
post:
consumes:
- application/json
description: Submit a new submission for a project commit
parameters:
- description: Submission data
in: body
name: body
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.CreateSubmissionDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Create submission
tags:
- Submission
/submissions/{id}:
delete:
description: Delete a submission by ID
parameters:
- description: Submission ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Delete submission
tags:
- Submission
get:
description: Get detailed information of a submission
parameters:
- description: Submission ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Get submission by ID
tags:
- Submission
/submissions/{id}/status:
patch:
consumes:
- application/json
description: Approve or reject a submission
parameters:
- description: Submission ID
in: path
name: id
required: true
type: string
- description: Status update data
in: body
name: body
required: true
schema:
$ref: '#/definitions/history-api_internal_dtos_request.UpdateSubmissionStatusDto'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/history-api_internal_dtos_response.CommonResponse'
security:
- BearerAuth: []
summary: Update submission status
tags:
- Submission
/tiles/{z}/{x}/{y}:
get:
description: Fetch vector or raster map tile data by Z, X, Y coordinates