feat: update analytics

This commit is contained in:
ivannoskov
2026-02-03 18:55:09 +03:00
parent d87d6e2568
commit e27a171c63
8 changed files with 1529 additions and 461 deletions

View File

@@ -448,30 +448,65 @@ export interface ViewsHistoryQueryParams extends PaginationParams {
export type DateGrouping = "day" | "week" | "month" | "DAY" | "WEEK" | "MONTH";
// Placements Analytics (Projects Analytics)
// Placements Analytics (detailed view with all fields)
export interface PlacementAnalyticsItem {
id: string; // UUID
project_id: string; // UUID
project_channel_title: string;
placement_channel_id: string; // UUID
placement_channel_title: string;
creative_id: string; // UUID
creative_name: string;
placement_date: string; // ISO 8601
cost: number;
id: string;
project_id: string;
project_title: string;
channel_id: string;
channel_title: string;
creative_id: string | null;
creative_name: string | null;
cost: number | null;
cost_type: CostType;
cost_before_bargain: number | null;
payment_at: string | null;
placement_type: PlacementType | null;
comment: string | null;
format: string | null;
invite_link_type: InviteLinkType | null;
placement_date: string | null;
subscriptions_count: number;
views_count: number;
cpf: number;
cpm: number;
post_url?: string | null;
views_count: number | null;
cpf: number | null;
cpm: number | null;
time_on_top: number | null;
time_in_feed: number | null;
invite_link: string | null;
invite_link_created_at: string | null;
post_url: string | null;
post_deleted_at: string | null;
conversion_24h: number | null;
conversion_48h: number | null;
conversion_total: number | null;
unsubscriptions_count: number;
unsub_percent: number | null;
total_active: number;
}
export interface PlacementsAnalyticsQueryParams extends PaginationParams {
project_id?: string;
placement_channel_id?: string;
creative_id?: string;
date_from?: string;
date_to?: string;
project_ids?: string;
status_list?: string;
placement_channel_ids?: string;
creative_ids?: string;
cost_types?: string;
placement_types?: string;
invite_link_types?: string;
cost_min?: number;
cost_max?: number;
views_min?: number;
views_max?: number;
subscriptions_min?: number;
subscriptions_max?: number;
cpm_min?: number;
cpm_max?: number;
channel_title_contains?: string;
creative_name_contains?: string;
comment_contains?: string;
placement_date_from?: string;
placement_date_to?: string;
sort_by?: string;
sort_direction?: "asc" | "desc";
}
// Creatives Analytics (matches actual API response)
@@ -615,6 +650,50 @@ export interface OverviewAnalyticsQueryParams {
date_to?: string;
}
// Placements Detail Analytics
export interface PlacementAnalyticsDetail {
id: string;
project_id: string;
project_title: string;
channel_id: string;
channel_title: string;
creative_id: string | null;
creative_name: string | null;
cost: number | null;
cost_type: CostType;
cost_before_bargain: number | null;
payment_at: string | null;
placement_type: PlacementType | null;
comment: string | null;
format: string | null;
invite_link_type: InviteLinkType | null;
placement_date: string | null;
subscriptions_count: number;
views_count: number | null;
cpf: number | null;
cpm: number | null;
time_on_top: number | null;
time_in_feed: number | null;
invite_link: string | null;
invite_link_created_at: string | null;
post_url: string | null;
post_deleted_at: string | null;
conversion_24h: number | null;
conversion_48h: number | null;
conversion_total: number | null;
unsubscriptions_count: number;
unsub_percent: number | null;
total_active: number;
}
export interface PlacementsDetailAnalyticsQueryParams extends PaginationParams {
project_id?: string;
channel_id?: string;
status?: string;
sort_by?: string;
sort_direction?: "asc" | "desc";
}
// ----------------------------------------------------------------------------
// Common Types
// ----------------------------------------------------------------------------