fix(subscriptions): subscriptions_by_plan и ending_paid_subscriptions

Refs EventHub/EventHubFrontAdmin#28

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-13 17:35:52 +03:00
parent 190cca7e6b
commit 72f973bbd1
@@ -198,8 +198,31 @@ const SubscriptionListPage: React.FC = () => {
</Card> </Card>
</Col> </Col>
))} ))}
{Object.entries(stats.subscriptions_by_plan || {}).map(([plan, count]) => (
<Col xs={12} sm={6} md={4} key={`plan-${plan}`}>
<Card>
<Statistic title={`План: ${plan}`} value={count} />
</Card>
</Col>
))}
</Row> </Row>
)} )}
{stats?.ending_paid_subscriptions && stats.ending_paid_subscriptions.length > 0 && (
<Card title="Заканчивающиеся платные подписки" style={{ marginBottom: 16 }}>
<Table
size="small"
pagination={false}
rowKey="id"
dataSource={stats.ending_paid_subscriptions}
columns={[
{ title: 'ID', dataIndex: 'id', key: 'id' },
{ title: 'Пользователь', dataIndex: 'user_id', key: 'user_id' },
{ title: 'План', dataIndex: 'plan', key: 'plan' },
{ title: 'Истекает', dataIndex: 'expires_at', key: 'expires_at' },
]}
/>
</Card>
)}
<Space style={{ marginBottom: 16 }}> <Space style={{ marginBottom: 16 }}>
<Select <Select
allowClear allowClear