Skip to content

Commit 2ef25b4

Browse files
committed
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).
1 parent dc9db0d commit 2ef25b4

4 files changed

Lines changed: 107 additions & 6 deletions

File tree

NeoReports-Decisoes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Removido da v1 vs. Cap. 16: `IRetryPolicy`, `IExceptionClassifier`, `IAuthProvid
183183
| 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<...>)` |
184184
| 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 |
185185
| 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) |
186187
|| Design | Já feito no Claude Design; exportar conforme handoff; UI pós-MVP |
187188

188189
---

_apt/api.trx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<TestRun id="48030c2e-c96e-4b6e-a580-29fe5e370f61" name="Dev@VM-DEV-NEW 2026-05-31 08:34:38" runUser="VM-DEV-NEW\Dev" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
3+
<Times creation="2026-05-31T08:34:38.6699916-03:00" queuing="2026-05-31T08:34:38.6699918-03:00" start="2026-05-31T08:34:37.6713912-03:00" finish="2026-05-31T08:34:38.6824702-03:00" />
4+
<TestSettings name="default" id="fd3a3716-d1f1-4501-81f7-43d56b2e72ba">
5+
<Deployment runDeploymentRoot="Dev_VM-DEV-NEW_2026-05-31_08_34_38" />
6+
</TestSettings>
7+
<Results>
8+
<UnitTestResult executionId="465f93e4-ca27-48ad-b44f-b3d435c75550" testId="bf8016ff-650b-bc1f-c0e3-b96cea5914db" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Async_run_goes_queued_to_completed_and_downloads" computerName="VM-DEV-NEW" duration="00:00:00.0420966" startTime="2026-05-31T08:34:38.4837092-03:00" endTime="2026-05-31T08:34:38.5382202-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="465f93e4-ca27-48ad-b44f-b3d435c75550">
9+
<Output>
10+
<ErrorInfo>
11+
<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)&#xD;
13+
at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)&#xD;
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&#xD;
15+
--- End of stack trace from previous location ---</StackTrace>
16+
</ErrorInfo>
17+
</Output>
18+
</UnitTestResult>
19+
<UnitTestResult executionId="562b86cc-d53f-4b86-8c08-4590af17adf0" testId="27f3a6f6-2b75-402a-6483-ebe4dbb59421" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Cancel_unknown_job_returns_404" computerName="VM-DEV-NEW" duration="00:00:00.0208160" startTime="2026-05-31T08:34:38.3662400-03:00" endTime="2026-05-31T08:34:38.3849867-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="562b86cc-d53f-4b86-8c08-4590af17adf0" />
20+
<UnitTestResult executionId="be324cba-14d5-4312-8f96-32aeb47feaa7" testId="beb2c331-390a-ede7-25b1-33b7dfde5354" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Sync_run_rejects_multi_output_with_400" computerName="VM-DEV-NEW" duration="00:00:00.1322158" startTime="2026-05-31T08:34:38.2239870-03:00" endTime="2026-05-31T08:34:38.3614265-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="be324cba-14d5-4312-8f96-32aeb47feaa7" />
21+
<UnitTestResult executionId="541de949-fdbf-41b0-a393-5920bd8e1636" testId="2f5884fd-bc75-a279-b5aa-70453165d312" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.List_reports_returns_registered_report" computerName="VM-DEV-NEW" duration="00:00:00.0206851" startTime="2026-05-31T08:34:38.4433707-03:00" endTime="2026-05-31T08:34:38.4655798-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="541de949-fdbf-41b0-a393-5920bd8e1636" />
22+
<UnitTestResult executionId="08583d20-196b-4e30-826d-bd5b6bede315" testId="34fe808e-94ca-c2b9-a642-a00161ca8030" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Run_unknown_report_returns_404" computerName="VM-DEV-NEW" duration="00:00:00.0150551" startTime="2026-05-31T08:34:38.5529081-03:00" endTime="2026-05-31T08:34:38.5705321-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="08583d20-196b-4e30-826d-bd5b6bede315" />
23+
<UnitTestResult executionId="ac5df2be-4f58-43b1-a801-a0bfc76269a3" testId="b6fd5f51-5e8d-9ad7-f9c0-23d0eb386522" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Download_before_completion_returns_conflict_or_notfound" computerName="VM-DEV-NEW" duration="00:00:00.0163462" startTime="2026-05-31T08:34:38.4659649-03:00" endTime="2026-05-31T08:34:38.4833120-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="ac5df2be-4f58-43b1-a801-a0bfc76269a3" />
24+
<UnitTestResult executionId="86b06188-2d3b-4f4c-bc87-b2926d01c4ab" testId="a1e6527f-0ed9-3add-1447-b22065751e50" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Sync_run_streams_single_output_with_content_disposition" computerName="VM-DEV-NEW" duration="00:00:00.0576620" startTime="2026-05-31T08:34:38.3858806-03:00" endTime="2026-05-31T08:34:38.4432241-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="86b06188-2d3b-4f4c-bc87-b2926d01c4ab" />
25+
<UnitTestResult executionId="a11d8c9d-ada7-4666-8de2-98f0334f8c02" testId="c0505855-e030-09a3-94cb-902d0aa1fcf2" testName="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Get_unknown_job_returns_404" computerName="VM-DEV-NEW" duration="00:00:00.0131319" startTime="2026-05-31T08:34:38.5434449-03:00" endTime="2026-05-31T08:34:38.5525209-03:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="a11d8c9d-ada7-4666-8de2-98f0334f8c02" />
26+
</Results>
27+
<TestDefinitions>
28+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Sync_run_streams_single_output_with_content_disposition" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="a1e6527f-0ed9-3add-1447-b22065751e50">
29+
<Execution id="86b06188-2d3b-4f4c-bc87-b2926d01c4ab" />
30+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Sync_run_streams_single_output_with_content_disposition" />
31+
</UnitTest>
32+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Get_unknown_job_returns_404" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="c0505855-e030-09a3-94cb-902d0aa1fcf2">
33+
<Execution id="a11d8c9d-ada7-4666-8de2-98f0334f8c02" />
34+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Get_unknown_job_returns_404" />
35+
</UnitTest>
36+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Async_run_goes_queued_to_completed_and_downloads" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="bf8016ff-650b-bc1f-c0e3-b96cea5914db">
37+
<Execution id="465f93e4-ca27-48ad-b44f-b3d435c75550" />
38+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Async_run_goes_queued_to_completed_and_downloads" />
39+
</UnitTest>
40+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Sync_run_rejects_multi_output_with_400" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="beb2c331-390a-ede7-25b1-33b7dfde5354">
41+
<Execution id="be324cba-14d5-4312-8f96-32aeb47feaa7" />
42+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Sync_run_rejects_multi_output_with_400" />
43+
</UnitTest>
44+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Cancel_unknown_job_returns_404" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="27f3a6f6-2b75-402a-6483-ebe4dbb59421">
45+
<Execution id="562b86cc-d53f-4b86-8c08-4590af17adf0" />
46+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Cancel_unknown_job_returns_404" />
47+
</UnitTest>
48+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Download_before_completion_returns_conflict_or_notfound" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="b6fd5f51-5e8d-9ad7-f9c0-23d0eb386522">
49+
<Execution id="ac5df2be-4f58-43b1-a801-a0bfc76269a3" />
50+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Download_before_completion_returns_conflict_or_notfound" />
51+
</UnitTest>
52+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Run_unknown_report_returns_404" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="34fe808e-94ca-c2b9-a642-a00161ca8030">
53+
<Execution id="08583d20-196b-4e30-826d-bd5b6bede315" />
54+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="Run_unknown_report_returns_404" />
55+
</UnitTest>
56+
<UnitTest name="NeoReports.AspNetCore.IntegrationTests.EndpointsTests.List_reports_returns_registered_report" storage="c:\repos\thiagoluga\neoreports\tests\neoreports.aspnetcore.integrationtests\bin\release\net8.0\neoreports.aspnetcore.integrationtests.dll" id="2f5884fd-bc75-a279-b5aa-70453165d312">
57+
<Execution id="541de949-fdbf-41b0-a393-5920bd8e1636" />
58+
<TestMethod codeBase="C:\repos\thiagoluga\NeoReports\tests\NeoReports.AspNetCore.IntegrationTests\bin\Release\net8.0\NeoReports.AspNetCore.IntegrationTests.dll" adapterTypeName="executor://xunit/VsTestRunner3/netcore/" className="NeoReports.AspNetCore.IntegrationTests.EndpointsTests" name="List_reports_returns_registered_report" />
59+
</UnitTest>
60+
</TestDefinitions>
61+
<TestEntries>
62+
<TestEntry testId="bf8016ff-650b-bc1f-c0e3-b96cea5914db" executionId="465f93e4-ca27-48ad-b44f-b3d435c75550" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
63+
<TestEntry testId="27f3a6f6-2b75-402a-6483-ebe4dbb59421" executionId="562b86cc-d53f-4b86-8c08-4590af17adf0" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
64+
<TestEntry testId="beb2c331-390a-ede7-25b1-33b7dfde5354" executionId="be324cba-14d5-4312-8f96-32aeb47feaa7" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
65+
<TestEntry testId="2f5884fd-bc75-a279-b5aa-70453165d312" executionId="541de949-fdbf-41b0-a393-5920bd8e1636" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
66+
<TestEntry testId="34fe808e-94ca-c2b9-a642-a00161ca8030" executionId="08583d20-196b-4e30-826d-bd5b6bede315" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
67+
<TestEntry testId="b6fd5f51-5e8d-9ad7-f9c0-23d0eb386522" executionId="ac5df2be-4f58-43b1-a801-a0bfc76269a3" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
68+
<TestEntry testId="a1e6527f-0ed9-3add-1447-b22065751e50" executionId="86b06188-2d3b-4f4c-bc87-b2926d01c4ab" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
69+
<TestEntry testId="c0505855-e030-09a3-94cb-902d0aa1fcf2" executionId="a11d8c9d-ada7-4666-8de2-98f0334f8c02" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
70+
</TestEntries>
71+
<TestLists>
72+
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
73+
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
74+
</TestLists>
75+
<ResultSummary outcome="Failed">
76+
<Counters total="8" executed="8" passed="7" failed="1" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
77+
<Output>
78+
<StdOut>[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.5+1b188a7b0a (64-bit .NET 8.0.27)&#xD;
79+
[xUnit.net 00:00:00.05] Discovering: NeoReports.AspNetCore.IntegrationTests&#xD;
80+
[xUnit.net 00:00:00.09] Discovered: NeoReports.AspNetCore.IntegrationTests&#xD;
81+
[xUnit.net 00:00:00.10] Starting: NeoReports.AspNetCore.IntegrationTests&#xD;
82+
[xUnit.net 00:00:00.43] System.InvalidOperationException : The requested operation requires an element of type 'String', but the target element has type 'Number'.&#xD;
83+
[xUnit.net 00:00:00.43] Stack Trace:&#xD;
84+
[xUnit.net 00:00:00.43] at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)&#xD;
85+
[xUnit.net 00:00:00.43] at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)&#xD;
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()&#xD;
87+
[xUnit.net 00:00:00.43] --- End of stack trace from previous location ---&#xD;
88+
[xUnit.net 00:00:00.47] Finished: NeoReports.AspNetCore.IntegrationTests&#xD;
89+
</StdOut>
90+
</Output>
91+
<RunInfos>
92+
<RunInfo computerName="VM-DEV-NEW" outcome="Error" timestamp="2026-05-31T08:34:38.5420800-03:00">
93+
<Text>[xUnit.net 00:00:00.43] NeoReports.AspNetCore.IntegrationTests.EndpointsTests.Async_run_goes_queued_to_completed_and_downloads [FAIL]</Text>
94+
</RunInfo>
95+
</RunInfos>
96+
</ResultSummary>
97+
</TestRun>

plan.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ PRs pequenos e independentes, em ordem. Cada um fecha com testes verdes e fecha
5353
- **Depende de:** PR 2.
5454

5555
## PR 7 — Integrations.AspNetCore: endpoints de disparo
56-
- [ ] `MapNeoReports("/api")`: `run` (async/sync), `GET /reports`, `GET /jobs/{id}`, `cancel`, `download`.
57-
- [ ] Validação: sync rejeita multi-output (`400`); auth herda do host.
58-
- [ ] Sample `03-async-job-hangfire`.
59-
- **Aceite:** CA-9, CA-10. **MVP demonstrável.**
56+
- [x] `MapNeoReports("/api")` (Minimal API): `run` (async 202+jobId / `?mode=sync` stream), `GET /reports`, `GET /jobs/{id}`, `POST /jobs/{id}/cancel`, `GET /jobs/{id}/download` (multi-output → zip).
57+
- [x] Validação: sync rejeita multi-output (`400`); auth herda do host (`RequireAuthorization` opcional). Artifact store no Core; status como string — ver D20.
58+
- [x] Sample `03-async-job-hangfire` (Hangfire single-server, storage in-memory).
59+
- **Aceite:** CA-9, CA-10. **MVP demonstrável.** ✅ 8 testes de integração via TestServer.
6060
- **Depende de:** PR 6, PR 4.
6161

6262
## PR 8 — Polimento de release OSS

src/Integrations/NeoReports.AspNetCore/Contracts.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Text.Json.Serialization;
12
using NeoReports.Abstractions;
23

34
namespace NeoReports.AspNetCore;
@@ -9,7 +10,9 @@ public sealed record RunReportRequest(IReadOnlyDictionary<string, object?>? Para
910
/// <summary>Response returned when a report is triggered asynchronously.</summary>
1011
/// <param name="JobId">Identifier of the queued job.</param>
1112
/// <param name="Status">Initial job status (typically <c>Queued</c>).</param>
12-
public sealed record RunAcceptedResponse(string JobId, ReportJobStatus Status);
13+
public sealed record RunAcceptedResponse(
14+
string JobId,
15+
[property: JsonConverter(typeof(JsonStringEnumConverter))] ReportJobStatus Status);
1316

1417
/// <summary>Summary of a registered report.</summary>
1518
/// <param name="Name">The report name.</param>
@@ -29,7 +32,7 @@ public sealed record ReportSummary(string Name, int OutputCount, IReadOnlyList<s
2932
public sealed record JobView(
3033
string Id,
3134
string ReportName,
32-
ReportJobStatus Status,
35+
[property: JsonConverter(typeof(JsonStringEnumConverter))] ReportJobStatus Status,
3336
DateTimeOffset CreatedAt,
3437
DateTimeOffset? StartedAt,
3538
DateTimeOffset? CompletedAt,

0 commit comments

Comments
 (0)