feat: global ui & functional update
This commit is contained in:
112
lib/types/api.ts
112
lib/types/api.ts
@@ -42,10 +42,12 @@ export interface PaginationParams {
|
||||
export interface Workspace {
|
||||
id: string; // UUID
|
||||
name: string;
|
||||
avatar_url?: string | null;
|
||||
}
|
||||
|
||||
export interface WorkspaceCreateRequest {
|
||||
name: string;
|
||||
avatar_file?: File | null;
|
||||
}
|
||||
|
||||
export interface WorkspaceUpdateRequest {
|
||||
@@ -215,7 +217,18 @@ export interface CreativesQueryParams extends PaginationParams {
|
||||
// Placements
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
export type PlacementStatus = "active" | "archived";
|
||||
export type PlacementStatus =
|
||||
| "Без статуса"
|
||||
| "Написать"
|
||||
| "Ждём ответа"
|
||||
| "Согласование условий"
|
||||
| "Оплатить"
|
||||
| "Оплачено"
|
||||
| "Отмена"
|
||||
| "Не подходит цена"
|
||||
| "Неактуально"
|
||||
| "Не отвечает";
|
||||
|
||||
export type InviteLinkType = "public" | "approval";
|
||||
export type PostViewsAvailability =
|
||||
| "unknown"
|
||||
@@ -223,26 +236,79 @@ export type PostViewsAvailability =
|
||||
| "unavailable"
|
||||
| "manual";
|
||||
|
||||
export interface Placement {
|
||||
id: string; // UUID
|
||||
project_id: string;
|
||||
project_channel_title: string;
|
||||
placement_channel_id: string;
|
||||
placement_channel_title: string;
|
||||
creative_id: string;
|
||||
creative_name: string;
|
||||
placement_date: string; // ISO 8601
|
||||
cost: number | null;
|
||||
export interface PlacementChannel {
|
||||
id: string;
|
||||
telegram_id: number;
|
||||
title: string;
|
||||
username: string | null;
|
||||
subscribers_count?: number;
|
||||
}
|
||||
|
||||
export interface PlacementCostInfo {
|
||||
type: "fixed" | "cpm";
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface PlacementDetails {
|
||||
placement_at: string | null; // ISO 8601
|
||||
payment_at: string | null; // ISO 8601
|
||||
cost: PlacementCostInfo | null;
|
||||
cost_before_bargain: number | null;
|
||||
placement_type: string | null;
|
||||
format: string | null;
|
||||
comment: string | null;
|
||||
ad_post_url: string | null;
|
||||
invite_link_type: InviteLinkType;
|
||||
invite_link: string;
|
||||
status: PlacementStatus;
|
||||
creative_id: string | null;
|
||||
}
|
||||
|
||||
export interface PlacementPost {
|
||||
subscriptions_count: number;
|
||||
views_count?: number | null;
|
||||
views_availability?: PostViewsAvailability;
|
||||
last_views_fetch_at?: string | null;
|
||||
views_count: number | null;
|
||||
created_at: string;
|
||||
post: {
|
||||
id: string;
|
||||
message_id: number;
|
||||
text: string;
|
||||
url: string | null;
|
||||
deleted_from_channel_at: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface Placement {
|
||||
id: string;
|
||||
status: PlacementStatus;
|
||||
creative_id: string | null;
|
||||
comment: string | null;
|
||||
invite_link: string | null;
|
||||
invite_link_type: InviteLinkType;
|
||||
channel: PlacementChannel;
|
||||
details: PlacementDetails | null;
|
||||
placement_post: PlacementPost | null;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface PlacementWithStats extends Placement {
|
||||
cpf: number | null;
|
||||
cpm: number | null;
|
||||
}
|
||||
|
||||
export interface PlacementsGroupedByChannel {
|
||||
channel: PlacementChannel;
|
||||
placements: PlacementWithStats[];
|
||||
total_cost: number;
|
||||
total_subscriptions: number;
|
||||
total_views: number;
|
||||
}
|
||||
|
||||
export interface ProjectPlacementsSummary {
|
||||
total_placements: number;
|
||||
total_channels: number;
|
||||
total_cost: number;
|
||||
total_subscriptions: number;
|
||||
total_views: number;
|
||||
avg_cpf: number | null;
|
||||
avg_cpm: number | null;
|
||||
}
|
||||
|
||||
export interface PlacementCreateRequest {
|
||||
@@ -306,6 +372,15 @@ export interface PlacementAnalyticsItem {
|
||||
views_count: number;
|
||||
cpf: number;
|
||||
cpm: number;
|
||||
post_url?: string | null;
|
||||
}
|
||||
|
||||
export interface PlacementsAnalyticsQueryParams extends PaginationParams {
|
||||
project_id?: string;
|
||||
placement_channel_id?: string;
|
||||
creative_id?: string;
|
||||
date_from?: string;
|
||||
date_to?: string;
|
||||
}
|
||||
|
||||
// Creatives Analytics (matches actual API response)
|
||||
@@ -350,6 +425,7 @@ export interface SpendingAnalytics {
|
||||
total_views: number;
|
||||
avg_cpf: number | null;
|
||||
avg_cpm: number | null;
|
||||
placements_count: number;
|
||||
}
|
||||
|
||||
export interface AnalyticsQueryParams extends PaginationParams {
|
||||
|
||||
Reference in New Issue
Block a user