Upload feature (a): BFF endpoints + category config + tests

- Domain/Documents: server-owned category config per wizard + authoritative
  type/size validation (DocumentRules).
- Data/DocumentStore: in-memory metadata store (no file bytes/PII) + audit log;
  user delete (owner-scoped, 409 once linked), admin delete (role seam via
  X-Admin header), link-on-submit, poll-by-localId status.
- Program.cs: GET /uploads/categories, POST /uploads (multipart, excluded from
  OpenAPI — hand-written on FE), GET /uploads/status, DELETE /uploads/{id},
  DELETE /admin/uploads/{id}. Submit links digital docs + records post-delivery.
- Contracts extended (DocumentRefDto on registratie/herregistratie submit);
  regenerated NSwag client + swagger.json (drift check stays green).
- Tests: 16 new (endpoints + DocumentRules); dotnet test 44/44.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-27 20:15:40 +02:00
parent a079d3259e
commit 0d37cc097a
9 changed files with 813 additions and 5 deletions

View File

@@ -282,6 +282,126 @@
}
}
}
},
"/api/v1/uploads/categories": {
"get": {
"tags": [
"BigRegister.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"parameters": [
{
"name": "wizardId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadCategoriesDto"
}
}
}
}
}
}
},
"/api/v1/uploads/status": {
"get": {
"tags": [
"BigRegister.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"parameters": [
{
"name": "localIds",
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UploadStatusDto"
}
}
}
}
}
}
},
"/api/v1/uploads/{documentId}": {
"delete": {
"tags": [
"BigRegister.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"parameters": [
{
"name": "documentId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"409": {
"description": "Conflict",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"404": {
"description": "Not Found"
}
}
}
},
"/api/v1/admin/uploads/{documentId}": {
"delete": {
"tags": [
"BigRegister.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"parameters": [
{
"name": "documentId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
}
}
}
},
"components": {
@@ -367,6 +487,62 @@
},
"additionalProperties": false
},
"DocumentCategoryDto": {
"type": "object",
"properties": {
"categoryId": {
"type": "string",
"nullable": true
},
"label": {
"type": "string",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"required": {
"type": "boolean"
},
"acceptedTypes": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true
},
"maxSizeMb": {
"type": "integer",
"format": "int32"
},
"multiple": {
"type": "boolean"
},
"allowPostDelivery": {
"type": "boolean"
}
},
"additionalProperties": false
},
"DocumentRefDto": {
"type": "object",
"properties": {
"categoryId": {
"type": "string",
"nullable": true
},
"channel": {
"type": "string",
"nullable": true
},
"documentId": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"DuoDiplomaDto": {
"type": "object",
"properties": {
@@ -435,6 +611,13 @@
"uren": {
"type": "integer",
"format": "int32"
},
"documents": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DocumentRefDto"
},
"nullable": true
}
},
"additionalProperties": false
@@ -557,6 +740,13 @@
"diplomaHerkomst": {
"type": "string",
"nullable": true
},
"documents": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DocumentRefDto"
},
"nullable": true
}
},
"additionalProperties": false
@@ -615,6 +805,50 @@
}
},
"additionalProperties": false
},
"UploadCategoriesDto": {
"type": "object",
"properties": {
"categories": {
"type": "array",
"items": {
"$ref": "#/components/schemas/DocumentCategoryDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"UploadStatusDto": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UploadStatusItemDto"
},
"nullable": true
}
},
"additionalProperties": false
},
"UploadStatusItemDto": {
"type": "object",
"properties": {
"localId": {
"type": "string",
"nullable": true
},
"status": {
"type": "string",
"nullable": true
},
"documentId": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
},