feat(backend): Add applicationFormTemplate, add isTemplate flag, refactoring

This commit is contained in:
2025-03-08 17:35:09 +01:00
parent 40e295937d
commit 59a8c5d900
12 changed files with 262 additions and 10 deletions

View File

@@ -124,6 +124,119 @@ paths:
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
/application-form-templates:
get:
summary: Get all ApplicationFormTemplates
operationId: getAllApplicationFormTemplates
tags:
- application-form-template
responses:
"200":
description: Paged list of application form templates
content:
application/json:
schema:
$ref: "#/components/schemas/PagedApplicationFormDto"
"500":
description: Internal server error
post:
summary: Create a new ApplicationFormTemplate
operationId: createApplicationFormTemplate
tags:
- application-form-template
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateApplicationFormDto"
responses:
"201":
description: Successfully created application form template
content:
application/json:
schema:
$ref: "#/components/schemas/ApplicationFormDto"
"400":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/BadRequest"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
/application-form-templates/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
get:
summary: Get a specific ApplicationFormTemplate
operationId: getApplicationFormTemplateById
tags:
- application-form-template
responses:
"200":
description: Get application form template by ID
content:
application/json:
schema:
$ref: "#/components/schemas/ApplicationFormDto"
"400":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/BadRequest"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
put:
summary: Updates a ApplicationFormTemplate
operationId: updateApplicationFormTemplate
tags:
- application-form-template
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ApplicationFormDto"
responses:
"200":
description: Successfully updated application form template
content:
application/json:
schema:
$ref: "#/components/schemas/ApplicationFormDto"
"400":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/BadRequest"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
delete:
summary: Delete a ApplicationFormTemplate
operationId: deleteApplicationFormTemplate
tags:
- application-form-template
responses:
"204":
description: Application Form Template successfully deleted
"400":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/BadRequest"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
"503":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServiceUnavailable"
/users:
get:
summary: Get all users
@@ -563,6 +676,7 @@ components:
required:
- id
- formElements
- isTemplate
- createdAt
- modifiedAt
properties:
@@ -573,6 +687,8 @@ components:
type: array
items:
$ref: "#/components/schemas/FormElementDto"
isTemplate:
type: boolean
createdAt:
type: string
format: date-time
@@ -583,12 +699,16 @@ components:
CreateApplicationFormDto:
required:
- formElements
- isTemplate
type: object
properties:
formElements:
type: array
items:
$ref: "#/components/schemas/CreateFormElementDto"
isTemplate:
type: boolean
default: false
PagedApplicationFormDto:
type: object