Merged in jmathison/v2-upload-batch (pull request #224)

Implement v2 upload batch cleanup

* Implement v2 upload batch cleanup

* Merge remote-tracking branch 'origin/main' into jmathison/v2-upload-batch

* Address upload batch review feedback

* Raise batch worker coverage

* Fix batch cleanup review issues


Approved-by: Jay Brown
This commit is contained in:
Jacob Mathison
2026-05-08 21:42:46 +00:00
parent 7b820b18c2
commit a080ca59d8
35 changed files with 2587 additions and 108 deletions
@@ -368,6 +368,7 @@ s.cfg.GetQueueClient()
| `models.go` | Generated Go types from database schema |
| `client.sql.go` | Generated client query methods |
| `document.sql.go` | Generated document query methods |
| `batch.sql.go` | Generated batch, outcome, and folder cleanup query methods |
| etc. | One file per SQL source file |
**SQL Query Definition** (`internal/database/queries/client.sql`):
@@ -406,9 +407,13 @@ q.WithTx(tx)
**Examples**:
- `00000000000003_clients.up.sql` - Create clients table
- `00000000000109_create_folders_table.up.sql` - Add folders feature
- `00000000000124_batch_document_outcomes.up.sql` - Track per-file batch outcomes
- `00000000000132_batch_folder_candidates.up.sql` - Track batch folder cleanup candidates
**Migration Tool**: golang-migrate
Batch cleanup queries live in `internal/database/queries/batch.sql` with the rest of the batch upload workflow. Keep raw production SQL there so SQLC regenerates typed methods for readiness checks, rejected artifact detachment, cleanup completion, and safe candidate folder deletion.
---
### 9. Configuration Layer (`internal/serviceconfig/`)