Skip to content

Add bb document metadata update and filters #136

Description

@codeforester

Summary

Add a small read/write v2 document metadata workflow so imported generic documents can be classified and filtered without opening SQLite manually.

Scope

  • Add bb documents update DOCUMENT_ID for metadata fields already present on BB_DOCUMENT.
  • Support updating document type, jurisdiction code, tax year, and status.
  • Add filters to bb documents list for type, jurisdiction, tax year, and status.
  • Keep SQL behind DAO/service helpers rather than inline CLI command bodies.
  • Keep the slice parser-free, inference-free, and extracted-text-free.
  • Update README, changelog, and AI context.

Validation rules

  • jurisdiction_code is normalized to uppercase when supplied.
  • tax_year must be a four-digit year when supplied.
  • document_status must be one of the supported v2 statuses.
  • Missing document IDs fail clearly.
  • An update with no metadata options fails clearly.

Out of scope

  • Parser detection.
  • Observation/entity inference.
  • Extracted text storage.
  • JSON/CSV output changes.
  • Generic document inspect/report commands.

Acceptance criteria

  • bb documents update DOCUMENT_ID --type bank_statement --jurisdiction US --tax-year 2025 updates the document metadata.
  • bb documents list --type bank_statement --jurisdiction US --tax-year 2025 filters the document table.
  • bb documents show DOCUMENT_ID reflects updated metadata.
  • Existing bb documents import, list/show, and legacy commands continue working.
  • Validation passes.

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