Skip to content

Support multiple example files per template#59

Merged
Empreiteiro merged 1 commit intomainfrom
feature/template-multi-example-files
Mar 27, 2026
Merged

Support multiple example files per template#59
Empreiteiro merged 1 commit intomainfrom
feature/template-multi-example-files

Conversation

@Empreiteiro
Copy link
Copy Markdown
Owner

Summary

  • Allow uploading multiple example documents when creating a template
  • When multiple files are provided, AI processes all of them and compares differences to build a unified field set
  • Fields present in all documents are marked as required, fields in only some are marked optional
  • Template detail page shows list of example files with ability to add/remove individual files
  • New API endpoints: POST /api/templates/{id}/example-files and DELETE /api/templates/{id}/example-files/{index}
  • DB migration renames example_file (single path) to example_files (JSON array) with backward-compatible data conversion

Test plan

  • Create a template with a single file — verify field suggestion works as before
  • Create a template with 2+ different example documents — verify AI analyzes all and suggests unified fields
  • On template detail page, add more example files via drag-and-drop
  • Remove individual example files from the list
  • Click "Re-suggest Fields" with multiple files — verify multi-doc analysis runs
  • Verify existing templates with legacy single-file data still work after migration

🤖 Generated with Claude Code

… analysis

- Rename example_file column to example_files (JSON array of paths)
- Accept multiple files on template creation and via new add/remove endpoints
- Multi-document AI field suggestion compares all examples and unifies fields
- Fields present in all documents marked required, others optional
- Frontend: multi-file dropzone on new template page, file list on detail page
- Add alembic migration with data conversion for existing single-path values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Empreiteiro Empreiteiro merged commit 0fbc587 into main Mar 27, 2026
@Empreiteiro Empreiteiro deleted the feature/template-multi-example-files branch March 27, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant