STATE-WP-0069 T04/T06: body metering and workplan-first state internals
Share LegacyWorkstreamIdBodyMixin across create schemas; meter POST /tasks/ and /decisions/ workstream_id bodies. State summary uses workplan flow; NextStep dual-writes workplan_* fields alongside legacy workstream_*.
This commit is contained in:
parent
6e5e150803
commit
388b330809
11 changed files with 157 additions and 36 deletions
|
|
@ -84,4 +84,28 @@ async def meter_legacy_body_field(
|
|||
)
|
||||
except Exception:
|
||||
await session.rollback()
|
||||
logger.warning("legacy-meter failed to record %s", interface_key, exc_info=True)
|
||||
logger.warning("legacy-meter failed to record %s", interface_key, exc_info=True)
|
||||
|
||||
|
||||
async def meter_legacy_body_from_model(
|
||||
body: object,
|
||||
*,
|
||||
session: AsyncSession,
|
||||
request: Request | None,
|
||||
response: Response | None,
|
||||
method: str,
|
||||
route: str,
|
||||
replacement_ref: str,
|
||||
field: str = "workstream_id",
|
||||
) -> None:
|
||||
if not getattr(body, "used_legacy_workstream_id", False):
|
||||
return
|
||||
await meter_legacy_body_field(
|
||||
session=session,
|
||||
request=request,
|
||||
response=response,
|
||||
method=method,
|
||||
route=route,
|
||||
replacement_ref=replacement_ref,
|
||||
field=field,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue