F3.2 Android: enviar Acta explícita en Hallazgos
This commit is contained in:
+9
-3
@@ -22,6 +22,7 @@ import retrofit2.http.Multipart
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Part
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
import java.io.File
|
||||
import java.time.Instant
|
||||
|
||||
@@ -100,12 +101,15 @@ data class FieldFindingEvidenceListResponse(
|
||||
data class FieldFindingOptionsResponse(
|
||||
val act: FieldFindingAct,
|
||||
val capture: CaptureStatus = CaptureStatus(),
|
||||
val assetIncludedInAct: Boolean = true,
|
||||
val catalog: FieldFindingCatalog,
|
||||
val findings: List<FieldFindingItem> = emptyList(),
|
||||
val canAddAnother: Boolean = true,
|
||||
val actSelectionMode: String = "EXPLICIT",
|
||||
)
|
||||
|
||||
data class CreateFieldFindingRequest(
|
||||
val actId: String,
|
||||
val catalogItemId: String? = null,
|
||||
val customTitle: String? = null,
|
||||
val customLegalBasis: String? = null,
|
||||
@@ -119,6 +123,7 @@ data class FieldFindingCreateResponse(
|
||||
val capture: CaptureStatus = CaptureStatus(),
|
||||
val finding: FieldFindingItem,
|
||||
val canAddAnother: Boolean = true,
|
||||
val actSelectionMode: String = "EXPLICIT",
|
||||
)
|
||||
|
||||
private interface FieldFindingsApi {
|
||||
@@ -127,6 +132,7 @@ private interface FieldFindingsApi {
|
||||
@Header("Authorization") authorization: String,
|
||||
@Path("visitId") visitId: String,
|
||||
@Path("assetId") assetId: String,
|
||||
@Query("actId") actId: String,
|
||||
): FieldFindingOptionsResponse
|
||||
|
||||
@POST("inspection-visits/{visitId}/field-findings/{assetId}")
|
||||
@@ -166,7 +172,7 @@ private interface FieldFindingsApi {
|
||||
|
||||
/**
|
||||
* Cliente de campo para Hallazgos y sus evidencias append-only.
|
||||
* Comparte el almacén cifrado de sesión y nunca persiste la contraseña.
|
||||
* F3.2 exige que la APK identifique explícitamente el Acta activa.
|
||||
*/
|
||||
class FieldFindingsRepository(context: Context) {
|
||||
private val store = SecureSessionStore(context.applicationContext)
|
||||
@@ -179,9 +185,9 @@ class FieldFindingsRepository(context: Context) {
|
||||
.build()
|
||||
.create(FieldFindingsApi::class.java)
|
||||
|
||||
suspend fun options(visitId: String, assetId: String): FieldFindingOptionsResponse =
|
||||
suspend fun options(visitId: String, assetId: String, actId: String): FieldFindingOptionsResponse =
|
||||
authorized { session ->
|
||||
api.options("Bearer ${session.accessToken}", visitId, assetId)
|
||||
api.options("Bearer ${session.accessToken}", visitId, assetId, actId)
|
||||
}
|
||||
|
||||
suspend fun create(
|
||||
|
||||
Reference in New Issue
Block a user