feat(backend): add pricing coverage, unpriced seats, and explain endpoints

add backend endpoints for pricing coverage analysis and unpriced seat inspection

add explain endpoint to make effective pricing decisions traceable
improve pricing diagnostics for admin and editor workflows
This commit is contained in:
greebo
2026-03-19 20:10:14 +03:00
parent aab5a51654
commit 2af5e49b8c
4 changed files with 270 additions and 3 deletions

View File

@@ -0,0 +1,52 @@
from pydantic import BaseModel
class PricingExplainMatchedRule(BaseModel):
matched_rule_level: str
matched_target_ref: str
pricing_category_id: str
amount: str
currency: str
class PricingExplainResponse(BaseModel):
scheme_id: str
scheme_version_id: str
seat_id: str | None
element_id: str | None
sector_id: str | None
group_id: str | None
row_label: str | None
seat_number: str | None
has_price: bool
reason_code: str
reason_message: str
matched_rule: PricingExplainMatchedRule | None
class UnpricedSeatItem(BaseModel):
seat_record_id: str
seat_id: str | None
element_id: str | None
sector_id: str | None
group_id: str | None
row_label: str | None
seat_number: str | None
reason_code: str
reason_message: str
class UnpricedSeatsResponse(BaseModel):
scheme_id: str
scheme_version_id: str
total: int
items: list[UnpricedSeatItem]
class PricingCoverageSummaryResponse(BaseModel):
scheme_id: str
scheme_version_id: str
total_seats: int
priced_seats: int
unpriced_seats: int
coverage_percent: float