feat: lock concurrent moderation decisions
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s

This commit is contained in:
ik
2026-09-13 09:26:18 +07:00
parent cbd854d933
commit 0abe1a2bb4
10 changed files with 147 additions and 31 deletions
+67 -5
View File
@@ -147,6 +147,10 @@
"title": "Moderation Status",
"type": "string"
},
"moderation_version": {
"title": "Moderation Version",
"type": "integer"
},
"player_name": {
"anyOf": [
{
@@ -194,7 +198,8 @@
"reported_at",
"moderation_status",
"comment",
"screenshot_url"
"screenshot_url",
"moderation_version"
],
"title": "AdminCatchReportOut",
"type": "object"
@@ -643,8 +648,27 @@
"title": "ExternalAliasSuggestionOut",
"type": "object"
},
"ExternalObservationAction": {
"properties": {
"expected_version": {
"minimum": 0.0,
"title": "Expected Version",
"type": "integer"
}
},
"required": [
"expected_version"
],
"title": "ExternalObservationAction",
"type": "object"
},
"ExternalObservationDecision": {
"properties": {
"expected_version": {
"minimum": 0.0,
"title": "Expected Version",
"type": "integer"
},
"reason": {
"maxLength": 1000,
"minLength": 1,
@@ -653,13 +677,19 @@
}
},
"required": [
"reason"
"reason",
"expected_version"
],
"title": "ExternalObservationDecision",
"type": "object"
},
"ExternalObservationMapping": {
"properties": {
"expected_version": {
"minimum": 0.0,
"title": "Expected Version",
"type": "integer"
},
"fish_slug": {
"title": "Fish Slug",
"type": "string"
@@ -683,7 +713,8 @@
},
"required": [
"fish_slug",
"waterbody_slug"
"waterbody_slug",
"expected_version"
],
"title": "ExternalObservationMapping",
"type": "object"
@@ -750,6 +781,10 @@
"title": "Missing Fields",
"type": "array"
},
"moderation_version": {
"title": "Moderation Version",
"type": "integer"
},
"published_at": {
"anyOf": [
{
@@ -906,7 +941,8 @@
"catch_report_id",
"review_note",
"missing_fields",
"source_payload"
"source_payload",
"moderation_version"
],
"title": "ExternalObservationOut",
"type": "object"
@@ -1189,6 +1225,11 @@
},
"ModerationUpdate": {
"properties": {
"expected_version": {
"minimum": 0.0,
"title": "Expected Version",
"type": "integer"
},
"reason": {
"anyOf": [
{
@@ -1207,7 +1248,8 @@
}
},
"required": [
"status"
"status",
"expected_version"
],
"title": "ModerationUpdate",
"type": "object"
@@ -1897,6 +1939,16 @@
"type": "string"
}
},
{
"in": "query",
"name": "expected_version",
"required": true,
"schema": {
"minimum": 0,
"title": "Expected Version",
"type": "integer"
}
},
{
"in": "header",
"name": "authorization",
@@ -2353,6 +2405,16 @@
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalObservationAction"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {