You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(aspnetcore): serialize job status as string; record D20, mark PR 7
The /jobs/{id} status field serialized as the enum's numeric value, so clients
(and the async lifecycle test) couldn't read it as a name. Annotate the Status
DTO properties with JsonStringEnumConverter so the API emits "Queued"/"Running"/
"Completed" etc. — without touching the frozen ReportJobStatus enum in Abstractions.
Also folds in the docs that failed to land in the previous commit: ADR D20
(endpoints + artifact store + string status) and PR 7 checkmarks in plan.md.
All 58 solution tests green (8 API tests included).
Copy file name to clipboardExpand all lines: NeoReports-Decisoes.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,6 +183,7 @@ Removido da v1 vs. Cap. 16: `IRetryPolicy`, `IExceptionClassifier`, `IAuthProvid
183
183
| D12 | Map no builder |`Map` não é um passo que troca o tipo do builder; o mapeamento é expresso por `From(source, map)`, mantendo `ReportBuilder<TRow>` mono-genérico e compatível com `AddReport<TRow>(Action<...>)`|
184
184
| D18 | Empacotamento de jobs | Pacote base `NeoReports.Jobs` (worker compartilhado `ReportJobWorker` + `InMemoryJobStore` + `InMemoryJobScheduler` + `NoOpCheckpointStore` + DI) e `NeoReports.Jobs.Hangfire` estendendo-o. Evita um 3º pacote só p/ compartilhar o worker; o "InMemory" do plano mora no pacote base |
185
185
| D19 | Worker e cancelamento |`ReportJobWorker` é o núcleo único de ciclo de vida (running→completed/failed/cancelled), usado por ambos os schedulers. Restart idempotente (CA-16) vem do pipeline (temp por job + upload só no fim; cleanup do temp é best-effort e nunca altera o status). InMemory: cancela via `CancellationTokenSource` por job. Hangfire: `CancellationToken` injetado no invoker; `CancelAsync` deleta o job; mapa id↔hangfire-id em processo (single-server; cross-restart é pós-MVP, D2). Parâmetros viajam como JSON (`JobParameters`, datas em ISO-8601 round-trip) |
186
+
| D20 | Endpoints + artifact store |`MapNeoReports("/api")` (Minimal API). Download/sync precisam reter o arquivo além do temp do pipeline: `IReportArtifactStore` (+ `FileSystemArtifactStore`) no **Core** (concern de engine, não contrato de plugin → fora de `Abstractions`); o `ReportRunner` salva nele só se registrado (opt-in via DI). Sync = single-output (multi → 400, CA-10); multi-output no download vira zip. Status do job serializado como **string** (`JsonStringEnumConverter` nos DTOs, sem tocar o enum em `Abstractions`). Auth herda do host (`RequireAuthorization` opcional; sem auth chain) |
186
187
| — | Design | Já feito no Claude Design; exportar conforme handoff; UI pós-MVP |
<Message>System.InvalidOperationException : The requested operation requires an element of type 'String', but the target element has type 'Number'.</Message>
12
+
<StackTrace> at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
13
+
at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)
14
+
at NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Async_run_goes_queued_to_completed_and_downloads() in C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\EndpointsTests.cs:line 54
15
+
--- End of stack trace from previous location ---</StackTrace>
[xUnit.net 00:00:00.43] System.InvalidOperationException : The requested operation requires an element of type 'String', but the target element has type 'Number'.
83
+
[xUnit.net 00:00:00.43] Stack Trace:
84
+
[xUnit.net 00:00:00.43] at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
85
+
[xUnit.net 00:00:00.43] at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)
86
+
[xUnit.net 00:00:00.43] C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\EndpointsTests.cs(54,0): at NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Async_run_goes_queued_to_completed_and_downloads()
87
+
[xUnit.net 00:00:00.43] --- End of stack trace from previous location ---
-[x] Validação: sync rejeita multi-output (`400`); auth herda do host (`RequireAuthorization` opcional). Artifact store no Core; status como string — ver D20.
0 commit comments