Files
tgex-frontend/lib/demo/mock-data.ts
2026-01-21 22:43:54 +03:00

813 lines
24 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ============================================================================
// Demo Mock Data
// ============================================================================
import type {
Workspace,
Project,
Channel,
Creative,
Placement,
PlacementChannel,
PurchasePlanChannel,
WorkspaceMember,
Permission,
SpendingAnalytics,
CreativeAnalyticsItem,
ChannelAnalyticsItem,
OverviewAnalytics,
PlacementAnalyticsItem,
} from "@/lib/types/api";
import { DEMO_WORKSPACE_ID, DEMO_USER } from "./constants";
// ============================================================================
// Workspace & User
// ============================================================================
export const demoWorkspace: Workspace = {
id: DEMO_WORKSPACE_ID,
name: "Демо Workspace",
};
export const demoMember: WorkspaceMember = {
id: "demo-member-0000-0000-000000000001",
user: {
id: DEMO_USER.id,
telegram_id: DEMO_USER.telegram_id,
username: DEMO_USER.username,
first_name: DEMO_USER.first_name,
last_name: DEMO_USER.last_name,
},
status: "active",
permissions: [{ key: "admin_full" }],
};
// ============================================================================
// Projects (Target Channels)
// ============================================================================
export const demoProjects: Project[] = [
{
id: "proj-0001-0000-0000-000000000001",
telegram_id: -1001234567001,
title: "Крипто Новости",
username: "crypto_news_demo",
status: "active",
subscribers_count: 125000,
purchase_invite_type_default: "public",
},
{
id: "proj-0002-0000-0000-000000000002",
telegram_id: -1001234567002,
title: "IT Вакансии",
username: "it_jobs_demo",
status: "active",
subscribers_count: 89000,
purchase_invite_type_default: "approval",
},
{
id: "proj-0003-0000-0000-000000000003",
telegram_id: -1001234567003,
title: "Стартапы и Бизнес",
username: "startups_demo",
status: "active",
subscribers_count: 67000,
purchase_invite_type_default: "public",
},
];
// ============================================================================
// Channels (External Channels for placements)
// ============================================================================
export const demoChannels: Channel[] = [
{
id: "chan-0001-0000-0000-000000000001",
telegram_id: -1002345678001,
title: "Технологии Будущего",
username: "tech_future",
description: "Новости о технологиях и инновациях",
subscribers_count: 125000,
},
{
id: "chan-0002-0000-0000-000000000002",
telegram_id: -1002345678002,
title: "Инвестиции Pro",
username: "invest_pro",
description: "Аналитика и инвестиционные идеи",
subscribers_count: 89000,
},
{
id: "chan-0003-0000-0000-000000000003",
telegram_id: -1002345678003,
title: "Программисты",
username: "programmers_hub",
description: "Сообщество разработчиков",
subscribers_count: 156000,
},
{
id: "chan-0004-0000-0000-000000000004",
telegram_id: -1002345678004,
title: "Маркетинг Pro",
username: "marketing_pro",
description: "Digital маркетинг и реклама",
subscribers_count: 67000,
},
{
id: "chan-0005-0000-0000-000000000005",
telegram_id: -1002345678005,
title: "Финансовая грамотность",
username: "finance_edu",
description: "Обучение финансам",
subscribers_count: 234000,
},
{
id: "chan-0006-0000-0000-000000000006",
telegram_id: -1002345678006,
title: "Startup Daily",
username: "startup_daily",
description: "Ежедневные новости стартапов",
subscribers_count: 45000,
},
];
// ============================================================================
// Creatives
// ============================================================================
export const demoCreatives: Creative[] = [
{
id: "crea-0001-0000-0000-000000000001",
name: "Крипто - Основной",
text: "🚀 Присоединяйтесь к лучшему крипто-каналу!\n\n💰 Ежедневные сигналы\n📊 Аналитика рынка\n🎯 Точные прогнозы\n\n{invite_link}",
status: "active",
placements_count: 12,
project_id: "proj-0001-0000-0000-000000000001",
project_channel_title: "Крипто Новости",
created_at: "2024-11-15T10:00:00Z",
},
{
id: "crea-0002-0000-0000-000000000002",
name: "Крипто - Агрессивный",
text: "⚡️ СРОЧНО! Секретный канал для избранных!\n\n🔥 Закрытая информация\n💎 Альткоины x100\n🚀 Успей до памп!\n\n{invite_link}",
status: "active",
placements_count: 5,
project_id: "proj-0001-0000-0000-000000000001",
project_channel_title: "Крипто Новости",
created_at: "2024-11-20T14:30:00Z",
},
{
id: "crea-0003-0000-0000-000000000003",
name: "IT Jobs - Основной",
text: "👨‍💻 Ищешь работу в IT?\n\n✅ Вакансии от топ-компаний\n✅ Удаленка и офис\n✅ Junior - Senior\n\nПодписывайся: {invite_link}",
status: "active",
placements_count: 8,
project_id: "proj-0002-0000-0000-000000000002",
project_channel_title: "IT Вакансии",
created_at: "2024-10-01T09:00:00Z",
},
{
id: "crea-0004-0000-0000-000000000004",
name: "Startups - Нетворкинг",
text: "🤝 Нетворкинг для стартаперов\n\n🎯 Найди кофаундера\n💡 Обменяйся идеями\n🚀 Развивай проект\n\n{invite_link}",
status: "active",
placements_count: 6,
project_id: "proj-0003-0000-0000-000000000003",
project_channel_title: "Стартапы и Бизнес",
created_at: "2024-12-01T16:00:00Z",
},
{
id: "crea-0005-0000-0000-000000000005",
name: "IT Jobs - Тестовый",
text: "🔥 Тестовый креатив для IT вакансий\n\n{invite_link}",
status: "archived",
placements_count: 2,
project_id: "proj-0002-0000-0000-000000000002",
project_channel_title: "IT Вакансии",
created_at: "2024-09-15T11:00:00Z",
},
];
// ============================================================================
// Purchase Plan Channels
// ============================================================================
export const demoPurchasePlanChannels: Record<string, PurchasePlanChannel[]> = {
"proj-0001-0000-0000-000000000001": [
{
id: "plan-0001-0000-0000-000000000001",
status: "completed",
planned_cost: 5500,
comment: "Основной канал",
channel: {
id: "chan-0001-0000-0000-000000000001",
telegram_id: -1002345678001,
title: "Технологии Будущего",
username: "tech_future",
},
},
{
id: "plan-0002-0000-0000-000000000002",
status: "completed",
planned_cost: 3500,
comment: null,
channel: {
id: "chan-0002-0000-0000-000000000002",
telegram_id: -1002345678002,
title: "Инвестиции Pro",
username: "invest_pro",
},
},
{
id: "plan-0003-0000-0000-000000000003",
status: "planned",
planned_cost: 4000,
comment: "На следующую неделю",
channel: {
id: "chan-0005-0000-0000-000000000005",
telegram_id: -1002345678005,
title: "Финансовая грамотность",
username: "finance_edu",
},
},
],
};
// ============================================================================
// Placements for Project (New Format)
// ============================================================================
export const demoPlacementChannels: PlacementChannel[] = [
{
id: "chan-0001-0000-0000-000000000001",
telegram_id: -1001234001001,
title: "Технологии Будущего",
username: "tech_future",
subscribers_count: 125000,
},
{
id: "chan-0002-0000-0000-000000000002",
telegram_id: -1001234001002,
title: "Инвестиции Pro",
username: "invest_pro",
subscribers_count: 89000,
},
{
id: "chan-0003-0000-0000-000000000003",
telegram_id: -1001234001003,
title: "Программисты",
username: "programmers",
subscribers_count: 230000,
},
{
id: "chan-0004-0000-0000-000000000004",
telegram_id: -1001234001004,
title: "Маркетинг Pro",
username: "marketing_pro",
subscribers_count: 67000,
},
];
export const demoPlacements: (Placement & { project_id: string })[] = [
{
id: "plac-0001-0000-0000-000000000001",
project_id: "proj-0001-0000-0000-000000000001",
status: "Оплачено",
creative_id: "crea-0001-0000-0000-000000000001",
comment: "crypto_jan",
invite_link: "https://t.me/+abc123",
invite_link_type: "public",
channel: demoPlacementChannels[0],
details: {
placement_at: "2024-12-20T12:00:00Z",
payment_at: "2024-12-19T10:00:00Z",
cost: { type: "fixed", value: 5500 },
cost_before_bargain: 6000,
placement_type: "self_promo",
format: "Стандарт",
comment: null,
creative_id: "crea-0001-0000-0000-000000000001",
},
placement_post: {
subscriptions_count: 156,
views_count: 8500,
created_at: "2024-12-20T12:00:00Z",
post: {
id: "post-0001-0000-0000-000000000001",
message_id: 12345,
text: "Привет! Отличные новости...",
url: "https://t.me/tech_future/12345",
deleted_from_channel_at: null,
created_at: "2024-12-20T12:00:00Z",
updated_at: "2024-12-20T12:00:00Z",
},
},
created_at: "2024-12-18T08:00:00Z",
},
{
id: "plac-0002-0000-0000-000000000002",
project_id: "proj-0001-0000-0000-000000000001",
status: "Согласование условий",
creative_id: "crea-0001-0000-0000-000000000001",
comment: "crypto_feb",
invite_link: "https://t.me/+def456",
invite_link_type: "approval",
channel: demoPlacementChannels[1],
details: {
placement_at: "2024-12-25T14:00:00Z",
payment_at: null,
cost: { type: "fixed", value: 3200 },
cost_before_bargain: 3500,
placement_type: "self_promo",
format: "Стандарт",
comment: null,
creative_id: "crea-0001-0000-0000-000000000001",
},
placement_post: null,
created_at: "2024-12-22T09:00:00Z",
},
{
id: "plac-0003-0000-0000-000000000003",
project_id: "proj-0001-0000-0000-000000000001",
status: "Оплачено",
creative_id: "crea-0001-0000-0000-000000000001",
comment: null,
invite_link: "https://t.me/+ghi789",
invite_link_type: "public",
channel: demoPlacementChannels[2],
details: {
placement_at: "2024-12-15T10:00:00Z",
payment_at: "2024-12-14T16:00:00Z",
cost: { type: "fixed", value: 4800 },
cost_before_bargain: 5000,
placement_type: "self_promo",
format: "Стандарт",
comment: null,
creative_id: "crea-0001-0000-0000-000000000001",
},
placement_post: {
subscriptions_count: 234,
views_count: 12000,
created_at: "2024-12-15T10:00:00Z",
post: {
id: "post-0002-0000-0000-000000000002",
message_id: 67890,
text: "Криптовалюты продолжают расти...",
url: "https://t.me/programmers/67890",
deleted_from_channel_at: null,
created_at: "2024-12-15T10:00:00Z",
updated_at: "2024-12-15T10:00:00Z",
},
},
created_at: "2024-12-12T11:00:00Z",
},
{
id: "plac-0004-0000-0000-000000000004",
project_id: "proj-0001-0000-0000-000000000001",
status: "Ждём ответа",
creative_id: "crea-0001-0000-0000-000000000001",
comment: null,
invite_link: "https://t.me/+jkl012",
invite_link_type: "public",
channel: demoPlacementChannels[3],
details: {
placement_at: "2024-12-28T09:00:00Z",
payment_at: null,
cost: { type: "fixed", value: 2500 },
cost_before_bargain: 2800,
placement_type: "self_promo",
format: "Стандарт",
comment: null,
creative_id: "crea-0001-0000-0000-000000000001",
},
placement_post: null,
created_at: "2024-12-24T14:00:00Z",
},
{
id: "plac-0005-0000-0000-000000000005",
project_id: "proj-0002-0000-0000-000000000002",
status: "Написать",
creative_id: "crea-0002-0000-0000-000000000002",
comment: "Новый оффер",
invite_link: null,
invite_link_type: "approval",
channel: demoPlacementChannels[0],
details: {
placement_at: null,
payment_at: null,
cost: { type: "fixed", value: 6000 },
cost_before_bargain: null,
placement_type: "self_promo",
format: "Спонсорский",
comment: null,
creative_id: "crea-0002-0000-0000-000000000002",
},
placement_post: null,
created_at: "2024-12-26T08:00:00Z",
},
{
id: "plac-0006-0000-0000-000000000006",
project_id: "proj-0002-0000-0000-000000000002",
status: "Отмена",
creative_id: "crea-0001-0000-0000-000000000001",
comment: "Неактуально",
invite_link: null,
invite_link_type: "public",
channel: demoPlacementChannels[1],
details: {
placement_at: null,
payment_at: null,
cost: null,
cost_before_bargain: null,
placement_type: null,
format: null,
comment: "Клиент отказался",
creative_id: null,
},
placement_post: null,
created_at: "2024-12-10T10:00:00Z",
},
];
// ============================================================================
// Analytics Data
// ============================================================================
export const demoSpendingAnalytics: SpendingAnalytics = {
total_cost: 24000,
total_subscriptions: 903,
total_views: 45500,
avg_cpf: 26.58,
avg_cpm: 527.47,
placements_count: 12,
chart_data: [
{
period: "2024-11",
cost: 1800,
subscriptions: 45,
views: 2100,
cpf: 40.0,
cpm: 857.14,
},
{
period: "2024-12-05",
cost: 6200,
subscriptions: 312,
views: 15600,
cpf: 19.87,
cpm: 397.44,
},
{
period: "2024-12-10",
cost: 2500,
subscriptions: 67,
views: 3100,
cpf: 37.31,
cpm: 806.45,
},
{
period: "2024-12-15",
cost: 4800,
subscriptions: 234,
views: 12000,
cpf: 20.51,
cpm: 400.0,
},
{
period: "2024-12-18",
cost: 3200,
subscriptions: 89,
views: 4200,
cpf: 35.96,
cpm: 761.9,
},
{
period: "2024-12-20",
cost: 5500,
subscriptions: 156,
views: 8500,
cpf: 35.26,
cpm: 647.06,
},
],
};
export const demoCreativeAnalytics: CreativeAnalyticsItem[] = [
{
id: "crea-0001-0000-0000-000000000001",
name: "Крипто - Основной",
placements_count: 12,
total_cost: 8700,
total_subscriptions: 245,
total_views: 12700,
avg_cpf: 35.51,
avg_cpm: 685.04,
},
{
id: "crea-0002-0000-0000-000000000002",
name: "Крипто - Агрессивный",
placements_count: 5,
total_cost: 6200,
total_subscriptions: 312,
total_views: 15600,
avg_cpf: 19.87,
avg_cpm: 397.44,
},
{
id: "crea-0003-0000-0000-000000000003",
name: "IT Jobs - Основной",
placements_count: 8,
total_cost: 4800,
total_subscriptions: 234,
total_views: 12000,
avg_cpf: 20.51,
avg_cpm: 400.0,
},
{
id: "crea-0004-0000-0000-000000000004",
name: "Startups - Нетворкинг",
placements_count: 6,
total_cost: 4300,
total_subscriptions: 112,
total_views: 5200,
avg_cpf: 38.39,
avg_cpm: 826.92,
},
];
export const demoChannelAnalytics: ChannelAnalyticsItem[] = [
{
channel_id: "chan-0001-0000-0000-000000000001",
channel_title: "Технологии Будущего",
channel_username: "tech_future",
placements_count: 3,
total_cost: 5500,
total_subscriptions: 156,
total_views: 8500,
avg_cps: 35.26,
avg_cpm: 647.06,
},
{
channel_id: "chan-0002-0000-0000-000000000002",
channel_title: "Инвестиции Pro",
channel_username: "invest_pro",
placements_count: 2,
total_cost: 3200,
total_subscriptions: 89,
total_views: 4200,
avg_cps: 35.96,
avg_cpm: 761.9,
},
{
channel_id: "chan-0003-0000-0000-000000000003",
channel_title: "Программисты",
channel_username: "programmers_hub",
placements_count: 4,
total_cost: 4800,
total_subscriptions: 234,
total_views: 12000,
avg_cps: 20.51,
avg_cpm: 400.0,
},
{
channel_id: "chan-0005-0000-0000-000000000005",
channel_title: "Финансовая грамотность",
channel_username: "finance_edu",
placements_count: 2,
total_cost: 6200,
total_subscriptions: 312,
total_views: 15600,
avg_cps: 19.87,
avg_cpm: 397.44,
},
{
channel_id: "chan-0004-0000-0000-000000000004",
channel_title: "Маркетинг Pro",
channel_username: "marketing_pro",
placements_count: 1,
total_cost: 2500,
total_subscriptions: 67,
total_views: 3100,
avg_cps: 37.31,
avg_cpm: 806.45,
},
{
channel_id: "chan-0006-0000-0000-000000000006",
channel_title: "Startup Daily",
channel_username: "startup_daily",
placements_count: 1,
total_cost: 1800,
total_subscriptions: 45,
total_views: 2100,
avg_cps: 40.0,
avg_cpm: 857.14,
},
];
// Placements Analytics (Projects Analytics)
export const demoPlacementAnalytics: PlacementAnalyticsItem[] = [
{
id: "plac-0001-0000-0000-000000000001",
project_id: "proj-0001-0000-0000-000000000001",
project_channel_title: "Крипто Новости",
placement_channel_id: "chan-0001-0000-0000-000000000001",
placement_channel_title: "Технологии Будущего",
creative_id: "crea-0001-0000-0000-000000000001",
creative_name: "Крипто - Основной",
placement_date: "2024-12-20T12:00:00Z",
cost: 5500,
subscriptions_count: 156,
views_count: 8500,
cpf: 35.26,
cpm: 647.06,
post_url: "https://t.me/tech_future/1001",
},
{
id: "plac-0002-0000-0000-000000000002",
project_id: "proj-0001-0000-0000-000000000001",
project_channel_title: "Крипто Новости",
placement_channel_id: "chan-0002-0000-0000-000000000002",
placement_channel_title: "Инвестиции Pro",
creative_id: "crea-0001-0000-0000-000000000001",
creative_name: "Крипто - Основной",
placement_date: "2024-12-18T14:00:00Z",
cost: 3200,
subscriptions_count: 89,
views_count: 4200,
cpf: 35.96,
cpm: 761.9,
post_url: "https://t.me/invest_pro/502",
},
{
id: "plac-0003-0000-0000-000000000003",
project_id: "proj-0001-0000-0000-000000000001",
project_channel_title: "Крипто Новости",
placement_channel_id: "chan-0003-0000-0000-000000000003",
placement_channel_title: "Программисты",
creative_id: "crea-0001-0000-0000-000000000001",
creative_name: "Крипто - Основной",
placement_date: "2024-12-15T10:00:00Z",
cost: 4800,
subscriptions_count: 234,
views_count: 12000,
cpf: 20.51,
cpm: 400.0,
post_url: "https://t.me/programmers_hub/2050",
},
{
id: "plac-0004-0000-0000-000000000004",
project_id: "proj-0002-0000-0000-000000000002",
project_channel_title: "IT Вакансии",
placement_channel_id: "chan-0004-0000-0000-000000000004",
placement_channel_title: "Маркетинг Pro",
creative_id: "crea-0002-0000-0000-000000000002",
creative_name: "Крипто - Агрессивный",
placement_date: "2024-12-10T16:00:00Z",
cost: 2500,
subscriptions_count: 67,
views_count: 3100,
cpf: 37.31,
cpm: 806.45,
post_url: "https://t.me/marketing_pro/803",
},
{
id: "plac-0005-0000-0000-000000000005",
project_id: "proj-0002-0000-0000-000000000002",
project_channel_title: "IT Вакансии",
placement_channel_id: "chan-0005-0000-0000-000000000005",
placement_channel_title: "Финансовая грамотность",
creative_id: "crea-0002-0000-0000-000000000002",
creative_name: "Крипто - Агрессивный",
placement_date: "2024-12-05T11:00:00Z",
cost: 6200,
subscriptions_count: 312,
views_count: 15600,
cpf: 19.87,
cpm: 397.44,
post_url: "https://t.me/finance_edu/1204",
},
];
export const demoOverviewAnalytics: OverviewAnalytics = {
total_cost: { value: 523400.5, delta_percent: 12.4 },
total_reach: { value: 380000, delta_percent: -8.1 },
placements_count: { value: 74, delta_percent: 5.7 },
subscriptions_count: { value: 14250, delta_percent: 18.2 },
avg_cpm: { value: 1376.06, delta_percent: 2.9 },
avg_cpf: { value: 36.74, delta_percent: -5.4 },
daily_stats: [
{ date: "2024-06-01", cost: 18450, subscriptions: 420, subscriptions_delta: -15, cpf: 43.93 },
{ date: "2024-06-02", cost: 21700, subscriptions: 505, subscriptions_delta: 85, cpf: 42.97 },
{ date: "2024-06-03", cost: 15800, subscriptions: 380, subscriptions_delta: -125, cpf: 41.58 },
{ date: "2024-06-04", cost: 26500, subscriptions: 640, subscriptions_delta: 260, cpf: 41.41 },
{ date: "2024-06-05", cost: 30200, subscriptions: 715, subscriptions_delta: 75, cpf: 42.24 },
{ date: "2024-06-06", cost: 18800, subscriptions: 455, subscriptions_delta: -260, cpf: 41.32 },
{ date: "2024-06-07", cost: 22400, subscriptions: 520, subscriptions_delta: 65, cpf: 43.08 },
],
top_channels_by_cpf: [
{
channel_id: "chan-0005-0000-0000-000000000005",
title: "Финансовая грамотность",
username: "finance_edu",
cpf: 18.7,
total_cost: 44200,
subscriptions: 2365,
},
{
channel_id: "chan-0003-0000-0000-000000000003",
title: "Программисты",
username: "programmers_hub",
cpf: 21.8,
total_cost: 38900,
subscriptions: 1785,
},
{
channel_id: "chan-0001-0000-0000-000000000001",
title: "Технологии Будущего",
username: "tech_future",
cpf: 23.4,
total_cost: 35500,
subscriptions: 1517,
},
{
channel_id: "chan-0002-0000-0000-000000000002",
title: "Инвестиции Pro",
username: "invest_pro",
cpf: 24.6,
total_cost: 33100,
subscriptions: 1346,
},
{
channel_id: "chan-0006-0000-0000-000000000006",
title: "Startup Daily",
username: "startup_daily",
cpf: 25.2,
total_cost: 28800,
subscriptions: 1143,
},
],
worst_channels_by_cpf: [
{
channel_id: "chan-0010-0000-0000-000000000010",
title: "Crypto Buzz",
username: "cryptobuzz",
cpf: 84.5,
total_cost: 9900,
subscriptions: 117,
},
{
channel_id: "chan-0009-0000-0000-000000000009",
title: "Ads Unlimited",
username: "ads_unlimited",
cpf: 72.3,
total_cost: 8200,
subscriptions: 113,
},
{
channel_id: "chan-0008-0000-0000-000000000008",
title: "News Mix",
username: "newsmix",
cpf: 66.2,
total_cost: 11400,
subscriptions: 172,
},
{
channel_id: "chan-0007-0000-0000-000000000007",
title: "Random Talks",
username: "randomtalks",
cpf: 61.9,
total_cost: 13400,
subscriptions: 216,
},
{
channel_id: "chan-0004-0000-0000-000000000004",
title: "Маркетинг Pro",
username: "marketing_pro",
cpf: 58.4,
total_cost: 12700,
subscriptions: 217,
},
],
project_spending: [
{
project_id: "proj-0001-0000-0000-000000000001",
project_title: "Крипто Новости",
project_username: "crypto_news_demo",
total_cost: 244000,
},
{
project_id: "proj-0002-0000-0000-000000000002",
project_title: "IT Вакансии",
project_username: "it_jobs_demo",
total_cost: 182400,
},
{
project_id: "proj-0003-0000-0000-000000000003",
project_title: "Стартапы и Бизнес",
project_username: "startups_demo",
total_cost: 96900,
},
],
};