BoQ Builder API Reference¶
BoQBuilder¶
BoQBuilder
¶
Programmatic builder for GAEB procurement documents.
Constructs a GAEBDocument from scratch with field validation,
Decimal convenience, auto OZ generation, phase-aware rules, and
version compatibility checks.
project
¶
Set project-level metadata (AwardInfo fields).
Common fields: no (project_no), name (project_name),
currency, client. All AwardInfo fields accepted as kwargs.
add_category
¶
Add a category to the implicit default lot (single-lot shortcut).
If no lots have been added, creates an implicit lot with rno="1".
build
¶
Assemble and return the GAEBDocument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strict
|
bool
|
If True, raise ValueError on phase/version incompatibilities instead of adding warnings. |
False
|
xsd_dir
|
str | None
|
If provided, validate the built XML against XSD schemas. |
None
|
Returns:
| Type | Description |
|---|---|
GAEBDocument
|
A fully constructed GAEBDocument. |
LotBuilder¶
LotBuilder
¶
Builder for a single lot, returned by BoQBuilder.add_lot().
CategoryBuilder¶
CategoryBuilder
¶
Builder for a single BoQ category (section), returned by LotBuilder.add_category().
add_item
¶
add_item(oz=None, short_text='', *, qty=None, unit=None, unit_price=None, total_price=None, item_type=NORMAL, **kwargs)
Add an item to this category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
oz
|
str | None
|
Ordinal number. If None, auto-generated from category rno + sequence. |
None
|
short_text
|
str
|
Short description text. |
''
|
qty
|
int | float | Decimal | None
|
Quantity (int/float/Decimal accepted, converted to Decimal). |
None
|
unit
|
str | None
|
Unit of measurement. |
None
|
unit_price
|
int | float | Decimal | None
|
Unit price (int/float/Decimal accepted). |
None
|
total_price
|
int | float | Decimal | None
|
Total price. If None and qty+unit_price are set, auto-computed. |
None
|
item_type
|
ItemType
|
Item type classification. |
NORMAL
|
**kwargs
|
Any
|
Any additional Item model field. |
{}
|
Returns:
| Type | Description |
|---|---|
ItemHandle
|
An ItemHandle for fluent post-construction (long text, attachments). |
add_subcategory
¶
Add a nested subcategory within this category.