From 21b87fbf6815be2f4916c4cf3221a9127b8757b7 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sat, 12 Apr 2025 22:51:16 +0200 Subject: [PATCH] Add appeal endpoints and schema definitions Introduce new API endpoints for handling Minecraft and Discord appeals, as well as updating appeal email addresses. Define detailed schemas for request and response payloads, supporting streamlined appeal processing across all platforms. --- open_api/src/main/resources/api.yml | 6 + .../resources/schemas/forms/appeal/appeal.yml | 162 ++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 open_api/src/main/resources/schemas/forms/appeal/appeal.yml diff --git a/open_api/src/main/resources/api.yml b/open_api/src/main/resources/api.yml index bb23678..c4a5bd1 100644 --- a/open_api/src/main/resources/api.yml +++ b/open_api/src/main/resources/api.yml @@ -24,3 +24,9 @@ paths: $ref: './schemas/bans/bans.yml#/getHistoryForUuid' /history/total: $ref: './schemas/bans/bans.yml#/getTotalPunishments' + /appeal/update-mail: + $ref: './schemas/forms/appeal/appeal.yml#/UpdateMail' + /appeal/minecraft-appeal: + $ref: './schemas/forms/appeal/appeal.yml#/MinecraftAppeal' + /appeal/discord-appeal: + $ref: './schemas/forms/appeal/appeal.yml#/DiscordAppeal' diff --git a/open_api/src/main/resources/schemas/forms/appeal/appeal.yml b/open_api/src/main/resources/schemas/forms/appeal/appeal.yml new file mode 100644 index 0000000..5f8b048 --- /dev/null +++ b/open_api/src/main/resources/schemas/forms/appeal/appeal.yml @@ -0,0 +1,162 @@ +# TODO save appeal +# TODO load appeal into page for viewing +# TODO give option to reload appeal if user didnt finish it (or verify it) based on cookies +# TODO on validation send mail to us +# TODO if they dont validate their email add a button to change it, this should change the mail in the appeal as well + +UpdateMail: + post: + tags: + - appeals + summary: Update a mail for an appeal + description: Update a mail for an appeal that was made earlier + operationId: updateMail + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMail' + responses: + '200': + description: Email updated + content: + application/json: + schema: + $ref: '#/components/schemas/AppealResponse' + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '../../generic/errors.yml#/components/schemas/ApiError' +MinecraftAppeal: + post: + tags: + - appeals + summary: Submit a Minecraft appeal + description: Submit an appeal for a Minecraft punishment + operationId: submitMinecraftAppeal + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MinecraftAppeal' + responses: + '201': + description: Appeal created please verify email + content: + application/json: + schema: + $ref: '#/components/schemas/AppealResponse' + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '../../generic/errors.yml#/components/schemas/ApiError' +DiscordAppeal: + post: + tags: + - appeals + summary: Submit a Discord appeal + description: Submit an appeal for a Discord punishment + operationId: submitDiscordAppeal + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DiscordAppeal' + responses: + '201': + description: Appeal created please verify email + content: + application/json: + schema: + $ref: '#/components/schemas/MinecraftAppeal' + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '../../generic/errors.yml#/components/schemas/ApiError' + +components: + schemas: + MinecraftAppeal: + type: object + description: Schema for Minecraft ban/punishment appeals + required: + - username + - email + - punishmentId + - appeal + properties: + username: + type: string + description: Minecraft username of the appealing player + uuid: + type: string + format: uuid + description: Minecraft player's unique identifier + email: + type: string + description: Contact email address of the appealing player + punishmentId: + type: integer + description: Unique identifier of the punishment being appealed + appeal: + type: string + description: Appeal text explaining why the punishment should be reconsidered + DiscordAppeal: + type: object + description: Schema for Discord ban/punishment appeals + required: + - username + - userId + - email + - punishmentId + - appeal + properties: + username: + type: string + description: Discord username of the appealing user + userId: + type: integer + format: int64 + description: Discord user ID of the appealing user + email: + type: string + description: Contact email address of the appealing user + punishmentId: + type: integer + description: Unique identifier of the punishment being appealed + appeal: + type: string + description: Appeal text explaining why the punishment should be reconsidered + AppealResponse: + type: object + required: + - id + - message + properties: + id: + type: string + description: Unique identifier for the submitted appeal for referring to it later + message: + type: string + description: Confirmation message + UpdateMail: + type: object + required: + - id + - mail + properties: + id: + type: string + description: Unique identifier of the appeal you wish to update + mail: + type: string + description: The new mail address to use