[Edicion] Se agregan propiedades para reflejar correctamente el estado devuelvo por el SAT#7
Conversation
…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.
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
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.
| SatStatusDownload = satStatus, | ||
| SatStatusCodeDownload = satStatus.ToEnumCode(), |
There was a problem hiding this comment.
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.
| 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.
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.
Summary by CodeRabbit