Skip to content

Add generic bb document import MVP #132

Description

@codeforester

Summary

Add the first document-first v2 workflow: importing an explicit file through bb documents import without bank-specific parsing or inference.

Scope

  • Add a bb documents import --file FILE command.
  • Add --dry-run planning that reports hash, size, media type, and canonical object key without writing database rows or copying files.
  • On real import, hash the file, create or reuse a BB_DOCUMENT row, copy the source file into financial/canonical, and create a BB_DOCUMENT_OBJECT row.
  • Keep canonical objects addressed by SHA-256 object keys, not source filenames.
  • Make duplicate imports idempotent by file hash/object key.
  • Keep parser detection, inference, views, and document inbox processing out of scope.

Acceptance criteria

  • uv run bb documents import --dry-run --file sample.pdf reports a plan and makes no changes.
  • uv run bb documents import --file sample.pdf records the document and copies a canonical object.
  • Re-importing the same file is safe and reports the existing document/object rather than creating duplicates.
  • bb status and existing legacy commands continue to work.
  • Validation passes.

Follows #130.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or product improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions