'cancellations_hotspots', 'label' => 'Cancellation hotspot products', 'description' => '', 'source' => 'table', 'table' => '{prefix}aieo_dmm_product_behavior_metrics', 'base_where' => 'total_orders >= 10', 'registry_id' => 'cancellations.cancellation_hotspots_10_orders', 'scope' => 'both', 'version' => '1', 'per_page' => 25, 'row_key' => 'product_id', 'default_sort' => array( 'total_cancellations', 'desc' ), 'empty_state' => 'No products yet meet the 10-order threshold. A cancellation rate over fewer orders than that is noise rather than a signal.', 'filter_bar' => array( 'first' => array( 'top_reason_slug', 'last_cancelled_at', 'cancellation_rate' ) ), 'columns' => array( array( 'key' => 'product_id', 'label' => 'Product', 'type' => 'object', 'sortable' => true, 'filter' => 'number', 'format' => array( 'show_id' => true ), ), array( 'key' => 'total_orders', 'label' => 'Orders', 'type' => 'integer', 'width' => '90px', 'sortable' => true, 'filter' => 'number_range', 'aggregate' => 'SUM', ), array( 'key' => 'total_cancellations', 'label' => 'Cancellations', 'type' => 'integer', 'width' => '120px', 'sortable' => true, 'filter' => 'number_range', 'aggregate' => 'SUM', ), array( 'key' => 'cancellation_rate', 'label' => 'Cancellation rate', 'type' => 'percent', 'width' => '90px', 'sortable' => true, 'filter' => 'number_range', 'format' => array( 'of' => 'ratio', 'precision' => 2 ), 'bands' => array( array( 'min' => 0.15, 'tone' => 'danger' ), array( 'min' => 0.10, 'max' => 0.1499, 'tone' => 'warning' ), ), ), array( 'key' => 'top_reason_slug', 'label' => 'Top reason', 'type' => 'code', 'width' => '160px', 'sortable' => true, 'filter' => 'select', 'empty' => '', ), array( 'key' => 'last_cancelled_at', 'label' => 'Last cancelled', 'type' => 'datetime', 'width' => '150px', 'nowrap' => true, 'tone' => 'secondary', 'sortable' => true, 'filter' => 'date_range', 'empty' => '', 'format' => array( 'tz' => 'utc' ), ), array( 'key' => 'total_refund_lines', 'label' => 'Refund lines', 'type' => 'integer', 'width' => '110px', 'sortable' => true, 'aggregate' => 'SUM', 'hidden' => true, ), array( 'key' => 'refund_rate', 'label' => 'Refund rate', 'type' => 'percent', 'width' => '110px', 'sortable' => true, 'format' => array( 'of' => 'ratio', 'precision' => 2 ), 'hidden' => true, ), array( 'key' => 'computed_at', 'label' => 'Computed', 'type' => 'datetime', 'width' => '150px', 'nowrap' => true, 'tone' => 'secondary', 'sortable' => true, 'format' => array( 'tz' => 'utc' ), 'hidden' => true, ), ), ), array( 'id' => 'cancellations_risk_users', 'label' => 'Users at cancellation risk', 'description' => '', 'source' => 'table', 'table' => '{prefix}aieo_dmm_user_behavior_metrics', 'base_where' => 'risk_band >= 1', 'registry_id' => 'cancellations.high_risk_users_risk_band_1', 'scope' => 'both', 'version' => '1', 'per_page' => 25, 'row_key' => 'user_id', 'default_sort' => array( 'risk_band', 'desc' ), 'empty_state' => 'No customers are currently in the elevated or high band. The bands are recomputed from rate and recency, so this fills and empties on its own.', 'filter_bar' => array( 'first' => array( 'risk_band', 'top_reason_slug', 'last_cancelled_at' ) ), 'capabilities' => array( 'export' => 'aieo_report_export', ), 'columns' => array( array( 'key' => 'user_id', 'label' => 'Customer', 'type' => 'user', 'sortable' => true, 'filter' => 'number', 'format' => array( 'email' => true ), ), array( 'key' => 'total_orders', 'label' => 'Orders', 'type' => 'integer', 'width' => '90px', 'sortable' => true, 'filter' => 'number_range', 'aggregate' => 'SUM', ), array( 'key' => 'total_cancellations', 'label' => 'Cancellations', 'type' => 'integer', 'width' => '120px', 'sortable' => true, 'filter' => 'number_range', 'aggregate' => 'SUM', ), array( 'key' => 'cancellation_rate', 'label' => 'Cancellation rate', 'type' => 'percent', 'width' => '90px', 'sortable' => true, 'filter' => 'number_range', 'format' => array( 'of' => 'ratio', 'precision' => 2 ), ), array( 'key' => 'risk_band', 'label' => 'Band', 'type' => 'badge', 'width' => '110px', 'sortable' => true, 'filter' => 'select', 'format' => array( 'labels' => array( '0' => 'normal', '1' => 'elevated', '2' => 'high', ), 'map' => array( '0' => 'muted', '1' => 'warning', '2' => 'danger', ), ), ), array( 'key' => 'top_reason_slug', 'label' => 'Top reason', 'type' => 'code', 'width' => '160px', 'sortable' => true, 'filter' => 'select', 'empty' => '', ), array( 'key' => 'last_cancelled_at', 'label' => 'Last cancelled', 'type' => 'datetime', 'width' => '150px', 'nowrap' => true, 'tone' => 'secondary', 'sortable' => true, 'filter' => 'date_range', 'empty' => '', 'format' => array( 'tz' => 'utc' ), ), array( 'key' => 'computed_at', 'label' => 'Computed', 'type' => 'datetime', 'width' => '150px', 'nowrap' => true, 'tone' => 'secondary', 'sortable' => true, 'format' => array( 'tz' => 'utc' ), 'hidden' => true, ), ), ), );