V3 S5 : graphe documentaire + doublons + collections
Backend : resource_links + scan_session_id (000021), réconciliation déterministe (same_scan outbox, doublons SHA-256 à l'upload + backfill, same_issuer/référence via faits effectifs, verdicts préservés, élagage auto), GET /files/:id/relations + verdict (owner-only), GET /duplicates (groupes + gain récupérable). Tests service + handlers + migrations. Mobile (Room v22) : links + collections, scanSessionId dans les creates de scan, LinksRepository (sync + verdicts REST), « Voir aussi » dans la fiche (verdict infirmer/re-confirmer), écran Doublons (garder le plus récent), collections locales (sauver/rejouer/supprimer). FR/EN. Contrat docs/api-v1.md (/relations, pas /links — pris par le partage), V3.md (S5 livré, version_of non matérialisé).
This commit is contained in:
@@ -127,6 +127,7 @@ func (r *Resources) CorrectFacts(resourceID string, params []FactParam) error {
|
||||
}
|
||||
|
||||
type factNeedingExtract struct {
|
||||
UserID string
|
||||
ResourceID string
|
||||
Text string
|
||||
}
|
||||
@@ -135,8 +136,8 @@ type factNeedingExtract struct {
|
||||
// origin='auto' facts (boot backfill, S2). Live rows only.
|
||||
func (r *Resources) ListNeedingExtract(limit int) ([]factNeedingExtract, error) {
|
||||
rows, err := r.DB.Query(
|
||||
`SELECT resource_id, ocr_text FROM resources
|
||||
WHERE type = 'file' AND deleted_at IS NULL
|
||||
`SELECT user_id, resource_id, ocr_text FROM resources
|
||||
WHERE type = 'file' AND deleted_at IS NULL AND user_id IS NOT NULL
|
||||
AND ocr_text IS NOT NULL AND ocr_text <> ''
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM resource_facts
|
||||
@@ -152,7 +153,7 @@ func (r *Resources) ListNeedingExtract(limit int) ([]factNeedingExtract, error)
|
||||
var out []factNeedingExtract
|
||||
for rows.Next() {
|
||||
var row factNeedingExtract
|
||||
if err := rows.Scan(&row.ResourceID, &row.Text); err != nil {
|
||||
if err := rows.Scan(&row.UserID, &row.ResourceID, &row.Text); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, row)
|
||||
|
||||
Reference in New Issue
Block a user