Skip to content

API Reference parrot_tools.hooba.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.hooba.models

View source

Pydantic models shared by the Hooba toolkit modules (FEAT-602 spec §2).

Class BankExpenseRow

One BBVA debit row.

Fields:

Field Type Default Description
row_index int
booking_date dt.date
value_date Optional[dt.date] None
concept str
movement Optional[str] None
amount Decimal
currency str 'EUR'
balance Optional[Decimal] None
observations Optional[str] None
row_id str

Class BbvaStatement

A parsed BBVA statement and its debit rows.

Fields:

Field Type Default Description
path str
digest str
sheet str
header_row int
rows list[BankExpenseRow]
skipped int
row_count int

Class ContactDraft

A supplier or customer contact to create (reused when one with the same TIN exists).

Fields:

Field Type Default Description
legal_name str
tin str
tin_type Literal['tin', 'vat-number', 'passport', 'other'] 'tin'
country_id str 'ES'
legal_type Literal['person', 'business'] 'business'
trade_name Optional[str] None
website Optional[str] None
notes Optional[str] None

Class ContactMatch

A fuzzy match between a free-text name and a Hooba contact.

Fields:

Field Type Default Description
contact_id int
legal_name str
score float

Class ContactReceipt

What Hooba returned for a created (or reused) contact.

Fields:

Field Type Default Description
id int
legal_name str
tin str
reused bool False

Class DeductibilityVerdict

Deductibility assessment for a bank transaction.

Fields:

Field Type Default Description
draft_id str
txn_id str
rule_id str
deductible_pct Decimal
vat_deductible_pct Decimal
capped_amount Optional[Decimal] None
legal_basis str
invoice_required bool
review_required bool
status Literal['draft', 'approved', 'rejected', 'registered'] 'draft'
evidence dict
hooba HoobaMapping

Class DraftReceipt

What Hooba returned for a created (or reused) draft.

Fields:

Field Type Default Description
kind Literal['invoice', 'purchase_invoice']
id int
state str
number Optional[str] None
url Optional[str] None
line_ids list[int]
correlation_key str
reused bool False

Class ExpenseDraftBatch

Results and reconciliation data for a BBVA expense-draft import.

Fields:

Field Type Default Description
statement_digest str
period str
dry_run bool
planned int
created list[DraftReceipt]
skipped list[dict]
reconciled bool
manifest_path str

Class HoobaLookupError

An invoice serie, tax, income tax, contact or document type could not be resolved.

Class HoobaMapping

Mapping from a deductibility rule to Hooba fields.

Fields:

Field Type Default Description
category str
tax_code str
subject_to_income_tax bool False
income_tax_code Optional[str] None
simplified bool True
accounting_account_code Optional[str] None

Class HoobaStateError

A created entity came back in a state other than draft.

Class InvoiceDraft

A sales invoice to create in draft state.

Fields:

Field Type Default Description
contact_id Optional[int] None
contact_query Optional[str] None
invoice_serie_code Optional[str] None
operation_date Optional[dt.date] None
reference Optional[str] None
notes Optional[str] None
simplified bool False
correlation_key Optional[str] None
lines list[InvoiceLineDraft]

Method InvoiceDraft.validate_contact_selector

Require exactly one contact selector.

validate_contact_selector() -> 'InvoiceDraft'

Returns: 'InvoiceDraft'

Class InvoiceLineDraft

One product line of a sales-invoice draft.

Fields:

Field Type Default Description
name str
price Decimal
quantity Decimal Decimal('1')
discount Decimal Decimal('0')
tax_code str 'IVA21'
income_tax_code Optional[str] None
notes Optional[str] None

Class PurchaseInvoiceDraft

A purchase invoice (gasto / compra) to create in draft state.

Fields:

Field Type Default Description
date dt.date
number Optional[str] None
currency_id str 'EUR'
simplified bool False
contact_id Optional[int] None
contact_query Optional[str] None
tax_included bool True
subject_to_income_tax bool False
notes Optional[str] None
correlation_key Optional[str] None
expected_charge Optional[Decimal] None
lines list[PurchaseInvoiceLineDraft]

Class PurchaseInvoiceLineDraft

One line of a purchase-invoice (expense) draft.

Fields:

Field Type Default Description
name str
price Decimal
quantity Decimal Decimal('1')
tax_code str 'IVA21'
income_tax_code Optional[str] None
accounting_account_code Optional[str] None
notes Optional[str] None

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally