Skip to content

Comments

[Edicion] Se agregan propiedades para reflejar correctamente el estado devuelvo por el SAT#7

Open
mtnadb wants to merge 2 commits intoFiscalAPI:mainfrom
mtnadb:feature/complete-sat-status-model
Open

[Edicion] Se agregan propiedades para reflejar correctamente el estado devuelvo por el SAT#7
mtnadb wants to merge 2 commits intoFiscalAPI:mainfrom
mtnadb:feature/complete-sat-status-model

Conversation

@mtnadb
Copy link

@mtnadb mtnadb commented Feb 17, 2026

Actualmente la verificación de un Request ID regresa un 5000(Estatus de la solicitud) y no el estatus del procesamiento de la misma petición. (Ver imagen)

En la imagen adjunta, se consultó un Request ID de una fecha donde no se generaron CFDIs (emitidos-cancelados, por ejemplo), por lo cual el código correcto es 5004 (Information not found) y al armar el VerifyResponse asigna el codStatus (5000) en lugar del valor real (5004).

Se proponen nuevas propiedades para reflejar el estatus de la acción, sin afectar las propiedades que se usan actualmente para este fin, para asegurar compatibilidad con legacy.

image

Summary by CodeRabbit

  • New Features
    • Verification responses now include additional SAT download status details, providing enhanced visibility into the verification process.

…o de la petición de verificación, ya que actualmente regresa un 5000(Estatus de la solicitud) y no el estatus del procesamiento de la misma petición.
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

The changes extend the VerifyResponse model with two new properties to capture additional SAT download status information (SatStatusDownload and SatStatusCodeDownload), and update the VerifyResponseService to extract and map these status fields from the SAT verification response envelope.

Changes

Cohort / File(s) Summary
SAT Download Status Tracking
Verify/Models/VerifyResponse.cs, Verify/VerifyResponseService.cs
Added two new properties (SatStatusDownload and SatStatusCodeDownload) to capture SAT download status. Updated service to extract CodigoEstadoSolicitud from the response envelope, derive the corresponding status, and map the results to the new response properties. Existing status calculation logic remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A Status to Download

New properties hop into the fold,
SAT status stories waiting to be told,
Extract and map with enum care,
Download states now tracked with flair! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding new properties to correctly reflect the SAT status returned in the verification response, addressing the issue where wrong status codes were being reported.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Verify/VerifyResponseService.cs`:
- Around line 108-109: The SatStatusCodeDownload assignment currently uses
satStatus.ToEnumCode(), which can lose unmapped/unknown SAT codes; instead set
SatStatusCodeDownload to the raw codSatStatus (with a fallback to ToEnumCode()
only if codSatStatus is null/empty) so the property preserves the original
CodigoEstadoSolicitud; update the object initializer where SatStatusDownload and
SatStatusCodeDownload are set to use codSatStatus ?? satStatus.ToEnumCode() (or
equivalent null/empty check) and keep SatStatusDownload = satStatus as-is.

Comment on lines +108 to +109
SatStatusDownload = satStatus,
SatStatusCodeDownload = satStatus.ToEnumCode(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Preserve raw CodigoEstadoSolicitud in SatStatusCodeDownload.
Using satStatus.ToEnumCode() can drop unmapped/unknown codes and doesn’t reflect the raw SAT attribute. Consider storing codSatStatus (with a fallback) to match the property’s intent.

🔧 Suggested fix
-                SatStatusCodeDownload = satStatus.ToEnumCode(),
+                SatStatusCodeDownload = string.IsNullOrWhiteSpace(codSatStatus)
+                    ? satStatus.ToEnumCode()
+                    : codSatStatus,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
SatStatusDownload = satStatus,
SatStatusCodeDownload = satStatus.ToEnumCode(),
SatStatusCodeDownload = string.IsNullOrWhiteSpace(codSatStatus)
? satStatus.ToEnumCode()
: codSatStatus,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Verify/VerifyResponseService.cs` around lines 108 - 109, The
SatStatusCodeDownload assignment currently uses satStatus.ToEnumCode(), which
can lose unmapped/unknown SAT codes; instead set SatStatusCodeDownload to the
raw codSatStatus (with a fallback to ToEnumCode() only if codSatStatus is
null/empty) so the property preserves the original CodigoEstadoSolicitud; update
the object initializer where SatStatusDownload and SatStatusCodeDownload are set
to use codSatStatus ?? satStatus.ToEnumCode() (or equivalent null/empty check)
and keep SatStatusDownload = satStatus as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant