Transition matrix: how the families' purchases moved between single lessons and trainings across a pivot date or a tariff change
POST/api/admin/statistics/products/transitions/search
Two windows of window_days each, [pivot − N, pivot) and [pivot, pivot + N). Each family with a purchase in either window is profiled per window as none, single_only, training_only or mixed, and counted in the cell of its (before, after) pair with what it bought on each side. Only complete days count: when the after-window reaches today both windows are shortened to the same effective length and truncated is true; a pivot today or later is a 400. compare_previous_year adds the same matrix one year earlier (same effective length), to tell the school-year seasonality from the effect of the pivot. Narrowed by competence school, a family is profiled on the purchases made in that competence only (lesson_order.competence_school_id), so a school sees what was bought from it. Accepts pivot_date or price_change_id, window_days, compare_previous_year and competence_school; date range and product_type are a 400.
Request
Responses
- 200
- 400
- 401
- 403
- 500
Ok
Invalid or unsupported parameters, a cancelled price change, or a pivot not before today
Unauthorized
Forbidden
Internal server error