mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Filters that match no properties refuse the run 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e9b39df322
commit
e9eb068be9
1 changed files with 10 additions and 0 deletions
|
|
@ -83,6 +83,16 @@ async def trigger_run(
|
|||
properties: list[FilteredProperty] = resolve_filtered_property_ids(
|
||||
session, body.portfolio_id, body.filters
|
||||
)
|
||||
if not properties:
|
||||
# A task with zero sub_tasks could never roll up to complete; the
|
||||
# app's preview shows the same zero from the same rule (ADR-0056).
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail=(
|
||||
f"The filters resolve to no properties in portfolio "
|
||||
f"{body.portfolio_id} — nothing to distribute."
|
||||
),
|
||||
)
|
||||
batches = pack_postcode_batches(properties)
|
||||
|
||||
# Pre-create one sub_task per (scenario, batch) message under the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue