- Corrige la comparación del hash del report para detectar cambios y comentarios nuevos.

- Elimina la generación de documentos artificiales para comentarios.
- Añade los estados Nueva denuncia, Actualización ciudadano, Actividad OAAF y Actualizada.
- Incorpora circuitos específicos de comunicación SAJ y SDI.
- Registra correctamente el tipo de última subida en el histórico.
- Añade confirmación al asignar una denuncia a un grupo distinto al del usuario.
- Mejora etiquetas, mensajes de ayuda e instrucciones de la aplicación.
- Añade la persistencia técnica necesaria para identificar el origen de cada actualización.
This commit is contained in:
2026-07-29 14:47:35 +02:00
parent 6f9392f3d0
commit 8dedafdc07
23 changed files with 404 additions and 71 deletions

View File

@@ -102,6 +102,7 @@ public sealed class InboxTrackingService : IInboxTrackingService
DownloadedByAnotherUser = meta?.DownloadedByAnotherUser ?? false,
LastDownloadedByUsername = meta?.LastDownloadedByUsername,
LastDownloadedAt = meta?.LastDownloadedAtUtc?.ToString("O", CultureInfo.InvariantCulture),
LastGestionaUploadAt = meta?.LastGestionaUploadAtUtc?.ToString("O", CultureInfo.InvariantCulture),
AlreadyImported = meta?.AlreadyImported ?? false,
AlreadyInGestiona = meta?.AlreadyInGestiona ?? false,
OwnerUsername = meta?.OwnerUsername,
@@ -535,6 +536,15 @@ public sealed class InboxTrackingService : IInboxTrackingService
owner.username AS owner_username,
ir.imported_to_store_at_utc,
COALESCE(c.is_in_gestiona, 0) AS already_in_gestiona,
COALESCE(
(
SELECT MAX(history.uploaded_at_utc)
FROM gestiona_upload_history history
WHERE history.external_report_id =
COALESCE(ir.imported_complaint_report_id, ir.progressive_id)
),
c.gestiona_uploaded_at_utc
) AS last_gestiona_upload_at_utc,
CASE WHEN uir.last_downloaded_at_utc IS NULL THEN 0 ELSE 1 END AS downloaded_by_current_user,
CASE WHEN ir.owner_user_id = @userId THEN 1 ELSE 0 END AS owned_by_current_user,
CASE
@@ -599,6 +609,7 @@ public sealed class InboxTrackingService : IInboxTrackingService
DownloadedByAnotherUser = downloadedByAnotherUser,
LastDownloadedByUsername = lastDownloadedByUsername,
LastDownloadedAtUtc = GetDateTimeOffset(reader, "last_downloaded_at_utc"),
LastGestionaUploadAtUtc = GetDateTimeOffset(reader, "last_gestiona_upload_at_utc"),
AlreadyImported = !reader.IsDBNull(reader.GetOrdinal("imported_to_store_at_utc")),
AlreadyInGestiona = reader.GetInt32(reader.GetOrdinal("already_in_gestiona")) == 1,
OwnerUsername = ownerUsername,
@@ -748,6 +759,7 @@ public sealed class InboxTrackingService : IInboxTrackingService
public bool DownloadedByAnotherUser { get; init; }
public string? LastDownloadedByUsername { get; init; }
public DateTimeOffset? LastDownloadedAtUtc { get; init; }
public DateTimeOffset? LastGestionaUploadAtUtc { get; init; }
public bool AlreadyImported { get; init; }
public bool AlreadyInGestiona { get; init; }
public string? OwnerUsername { get; init; }