Contactbeheer: berichten, schakelaar en tweelaagse poort voor het formulier

Beheerroutes zonder /admin-segment op contact-messages (lijst met spam apart en ongelezen-teller zonder spam, detail, status, verwijderen, opnieuw versturen met eigen limiet) en contact-settings voor de CMS-schakelaar, allemaal AdminOnly. Het formulier is alleen open als de hostvlag EN de CMS-schakelaar (standaard uit) aan staan; de hostvlag wordt eerst gecontroleerd zodat de database niet wordt aangeraakt. Bij uitgeschakelde host antwoorden de beheerroutes 404. OpenAPI-document bijgewerkt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 13:07:28 +01:00
co-authored by Claude Sonnet 5.5
parent f8d45eef54
commit e53b318c31
23 changed files with 2704 additions and 10 deletions
+535
View File
@@ -101,6 +101,153 @@
],
"type": "object"
},
"ContactMessageDetail": {
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"mailAttempts": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
},
"mailError": {
"type": [
"null",
"string"
]
},
"mailStatus": {
"type": "string"
},
"message": {
"type": "string"
},
"name": {
"type": "string"
},
"receivedAt": {
"format": "date-time",
"type": "string"
},
"retentionUntil": {
"format": "date-time",
"type": "string"
},
"status": {
"type": "string"
},
"subject": {
"type": "string"
}
},
"required": [
"id",
"receivedAt",
"name",
"email",
"subject",
"message",
"status",
"mailStatus",
"mailAttempts",
"mailError",
"retentionUntil"
],
"type": "object"
},
"ContactMessageList": {
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/ContactMessageListItem"
},
"type": "array"
},
"page": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
},
"pageSize": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
},
"totalCount": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
},
"unreadCount": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
}
},
"required": [
"items",
"page",
"pageSize",
"totalCount",
"unreadCount"
],
"type": "object"
},
"ContactMessageListItem": {
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"mailStatus": {
"type": "string"
},
"name": {
"type": "string"
},
"receivedAt": {
"format": "date-time",
"type": "string"
},
"status": {
"type": "string"
},
"subject": {
"type": "string"
}
},
"required": [
"id",
"receivedAt",
"name",
"email",
"subject",
"status",
"mailStatus"
],
"type": "object"
},
"ContactMessageRequest": {
"properties": {
"captchaToken": {
@@ -143,6 +290,45 @@
],
"type": "object"
},
"ContactResendResult": {
"properties": {
"mailAttempts": {
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
},
"mailStatus": {
"type": "string"
},
"mailed": {
"type": "boolean"
}
},
"required": [
"mailStatus",
"mailAttempts",
"mailed"
],
"type": "object"
},
"ContactSettingsDto": {
"properties": {
"enabled": {
"type": "boolean"
},
"hostEnabled": {
"type": "boolean"
}
},
"required": [
"enabled",
"hostEnabled"
],
"type": "object"
},
"ContactTokenResponse": {
"properties": {
"captcha": {
@@ -424,6 +610,34 @@
],
"type": "object"
},
"UpdateContactMessageStatusRequest": {
"properties": {
"status": {
"type": [
"null",
"string"
]
}
},
"required": [
"status"
],
"type": "object"
},
"UpdateContactSettingsRequest": {
"properties": {
"enabled": {
"type": [
"null",
"boolean"
]
}
},
"required": [
"enabled"
],
"type": "object"
},
"UpdateOfferingRequest": {
"properties": {
"categoryId": {
@@ -1194,6 +1408,68 @@
}
},
"/api/v1/contact-messages": {
"get": {
"parameters": [
{
"in": "query",
"name": "status",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "page",
"schema": {
"default": 1,
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
}
},
{
"in": "query",
"name": "pageSize",
"schema": {
"default": 25,
"format": "int32",
"pattern": "^-?(?:0|[1-9]\\d*)$",
"type": [
"integer",
"string"
]
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactMessageList"
}
}
},
"description": "OK"
},
"400": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
},
"description": "Bad Request"
}
},
"tags": [
"ContactMessagesAdmin"
]
},
"post": {
"parameters": [
{
@@ -1271,6 +1547,259 @@
]
}
},
"/api/v1/contact-messages/{id}": {
"delete": {
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"404": {
"description": "Not Found"
}
},
"tags": [
"ContactMessagesAdmin"
]
},
"get": {
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactMessageDetail"
}
}
},
"description": "OK"
},
"404": {
"description": "Not Found"
}
},
"tags": [
"ContactMessagesAdmin"
]
},
"patch": {
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/*+json": {
"schema": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/UpdateContactMessageStatusRequest"
}
]
}
},
"application/json": {
"schema": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/UpdateContactMessageStatusRequest"
}
]
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactMessageDetail"
}
}
},
"description": "OK"
},
"400": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
},
"description": "Bad Request"
},
"404": {
"description": "Not Found"
}
},
"tags": [
"ContactMessagesAdmin"
]
}
},
"/api/v1/contact-messages/{id}/resend": {
"post": {
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactResendResult"
}
}
},
"description": "OK"
},
"404": {
"description": "Not Found"
},
"409": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
},
"description": "Conflict"
},
"429": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
},
"description": "Too Many Requests"
}
},
"tags": [
"ContactMessagesAdmin"
]
}
},
"/api/v1/contact-settings": {
"get": {
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactSettingsDto"
}
}
},
"description": "OK"
}
},
"tags": [
"ContactSettings"
]
},
"put": {
"requestBody": {
"content": {
"application/*+json": {
"schema": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/UpdateContactSettingsRequest"
}
]
}
},
"application/json": {
"schema": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "#/components/schemas/UpdateContactSettingsRequest"
}
]
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ContactSettingsDto"
}
}
},
"description": "OK"
},
"400": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
},
"description": "Bad Request"
}
},
"tags": [
"ContactSettings"
]
}
},
"/api/v1/offerings": {
"get": {
"responses": {
@@ -1542,9 +2071,15 @@
{
"name": "Master"
},
{
"name": "ContactMessagesAdmin"
},
{
"name": "ContactMessages"
},
{
"name": "ContactSettings"
},
{
"name": "Auth"
},