fix
This commit is contained in:
@@ -0,0 +1,185 @@
|
||||
// --- ENUMS ---
|
||||
export type BusinessStage =
|
||||
| "JUST_STARTING"
|
||||
| "LESS_THAN_ONE_YEAR"
|
||||
| "ONE_TO_THREE_YEARS"
|
||||
| "MORE_THAN_THREE_YEARS";
|
||||
export type ClientTarget = "PRIVATE_CLIENTS" | "BUSINESS" | "MIXED";
|
||||
export type OfferType = "SERVICES" | "GOODS" | "SUBSCRIPTION";
|
||||
export type AverageCheck = "LOW" | "MEDIUM" | "HIGH";
|
||||
export type CustomerBehavior =
|
||||
| "BUY_QUICKLY"
|
||||
| "COMPARE_OPTIONS"
|
||||
| "REQUEST_PROPOSAL"
|
||||
| "CHECK_REVIEWS"
|
||||
| "NEED_CONSULTATION";
|
||||
export type GeoScope = "SINGLE_CITY" | "MULTI_CITY" | "FULL_COUNTRY" | "ONLINE";
|
||||
export type PurchaseFrequency =
|
||||
| "ONCE"
|
||||
| "MULTIPLE_PER_YEAR"
|
||||
| "REGULARLY";
|
||||
export type VisualFactor =
|
||||
| "VISUALS_IMPORTANT"
|
||||
| "PARTIALLY"
|
||||
| "EXPLANATION_IMPORTANT";
|
||||
export type DecisionPriority =
|
||||
| "PRICE"
|
||||
| "QUALITY"
|
||||
| "SPEED"
|
||||
| "TRUST"
|
||||
| "SERVICE";
|
||||
export type DiscoveryMethod =
|
||||
| "SEARCH_WEB"
|
||||
| "RECOMMENDATIONS"
|
||||
| "PRICE_SELECTION"
|
||||
| "REVIEWS"
|
||||
| "CONVENIENCE";
|
||||
export type PriceFeedback =
|
||||
| "LOWER_THAN_EXPECTED"
|
||||
| "AS_EXPECTED"
|
||||
| "HIGHER_THAN_EXPECTED"
|
||||
| "NOT_DISCUSSED";
|
||||
export type SmmStatus = "NONE" | "DORMANT" | "IRREGULAR" | "ACTIVE";
|
||||
export type LeadVolume = "NONE" | "SOMETIMES" | "REGULARLY";
|
||||
export type ResponseHandler = "MYSELF" | "EMPLOYEE" | "DELAYED";
|
||||
export type BusinessConstraint =
|
||||
| "NONE"
|
||||
| "SEASONALITY"
|
||||
| "SMALL_TEAM"
|
||||
| "LIMITED_BUDGET"
|
||||
| "LONG_DEAL_CYCLE";
|
||||
|
||||
// --- MAPPINGS ДЛЯ UI ---
|
||||
export const BusinessStageLabels: Record<BusinessStage, string> = {
|
||||
JUST_STARTING: "Только запускаемся",
|
||||
LESS_THAN_ONE_YEAR: "Работаем до 1 года",
|
||||
ONE_TO_THREE_YEARS: "Работаем 1–3 года",
|
||||
MORE_THAN_THREE_YEARS: "Работаем более 3 лет"
|
||||
};
|
||||
|
||||
export const ClientTargetLabels: Record<ClientTarget, string> = {
|
||||
PRIVATE_CLIENTS: "Работаем с конечными клиентами (B2C)",
|
||||
BUSINESS: "Работаем с бизнесом (B2B)",
|
||||
MIXED: "Смешанная модель (B2B + B2C)"
|
||||
};
|
||||
|
||||
export const OfferTypeLabels: Record<OfferType, string> = {
|
||||
SERVICES: "Услуги",
|
||||
GOODS: "Товары",
|
||||
SUBSCRIPTION: "Подписка / доступ"
|
||||
};
|
||||
|
||||
export const AverageCheckLabels: Record<AverageCheck, string> = {
|
||||
LOW: "Низкий чек",
|
||||
MEDIUM: "Средний чек",
|
||||
HIGH: "Высокий чек"
|
||||
};
|
||||
|
||||
export const CustomerBehaviorLabels: Record<CustomerBehavior, string> = {
|
||||
BUY_QUICKLY: "Покупают быстро, без долгих раздумий",
|
||||
COMPARE_OPTIONS: "Сравнивают варианты и предложения",
|
||||
REQUEST_PROPOSAL: "Запрашивают индивидуальное коммерческое предложение",
|
||||
CHECK_REVIEWS: "Внимательно читают отзывы и рейтинги",
|
||||
NEED_CONSULTATION: "Нуждаются в консультации перед покупкой"
|
||||
};
|
||||
|
||||
export const GeoScopeLabels: Record<GeoScope, string> = {
|
||||
SINGLE_CITY: "Один город",
|
||||
MULTI_CITY: "Несколько городов",
|
||||
FULL_COUNTRY: "Вся страна",
|
||||
ONLINE: "Онлайн по всему миру"
|
||||
};
|
||||
|
||||
export const PurchaseFrequencyLabels: Record<PurchaseFrequency, string> = {
|
||||
ONCE: "Одна покупка",
|
||||
MULTIPLE_PER_YEAR: "Несколько раз в год",
|
||||
REGULARLY: "Регулярно (ежемесячно / чаще)"
|
||||
};
|
||||
|
||||
export const VisualFactorLabels: Record<VisualFactor, string> = {
|
||||
VISUALS_IMPORTANT: "Визуал критически важен (эстетика, фото, видео)",
|
||||
PARTIALLY: "Важно, но не критично",
|
||||
EXPLANATION_IMPORTANT:
|
||||
"Тексты и экспертность важнее визуала для доверия"
|
||||
};
|
||||
|
||||
export const DecisionPriorityLabels: Record<DecisionPriority, string> = {
|
||||
PRICE: "Цена",
|
||||
QUALITY: "Качество",
|
||||
SPEED: "Скорость",
|
||||
TRUST: "Доверие к бренду",
|
||||
SERVICE: "Сервис и сопровождение"
|
||||
};
|
||||
|
||||
export const DiscoveryMethodLabels: Record<DiscoveryMethod, string> = {
|
||||
SEARCH_WEB: "Ищут в поиске и сравнивают",
|
||||
RECOMMENDATIONS: "Приходят по рекомендациям / сарафанке",
|
||||
PRICE_SELECTION: "Выбирают по цене / акциям",
|
||||
REVIEWS: "Ориентируются на отзывы и рейтинги",
|
||||
CONVENIENCE: "Выбирают по удобству (сайт, UX, доставка)"
|
||||
};
|
||||
|
||||
export const PriceFeedbackLabels: Record<PriceFeedback, string> = {
|
||||
LOWER_THAN_EXPECTED: "Часто говорят, что «дёшево / ниже ожиданий»",
|
||||
AS_EXPECTED: "Цена воспринимается как ожидаемая",
|
||||
HIGHER_THAN_EXPECTED: "Считают, что «дорого / выше ожиданий»",
|
||||
NOT_DISCUSSED: "Цену обычно подробно не обсуждают"
|
||||
};
|
||||
|
||||
export const SmmStatusLabels: Record<SmmStatus, string> = {
|
||||
NONE: "Соцсетей нет",
|
||||
DORMANT: "Есть, но почти не ведём",
|
||||
IRREGULAR: "Ведём нерегулярно",
|
||||
ACTIVE: "Активно ведём и развиваем"
|
||||
};
|
||||
|
||||
export const LeadVolumeLabels: Record<LeadVolume, string> = {
|
||||
NONE: "Заявок практически нет",
|
||||
SOMETIMES: "Иногда приходят заявки",
|
||||
REGULARLY: "Заявки приходят регулярно"
|
||||
};
|
||||
|
||||
export const ResponseHandlerLabels: Record<ResponseHandler, string> = {
|
||||
MYSELF: "Отвечает лично основатель / владелец",
|
||||
EMPLOYEE: "Есть выделенный сотрудник",
|
||||
DELAYED: "Отвечаем не сразу, с задержками"
|
||||
};
|
||||
|
||||
export const BusinessConstraintLabels: Record<BusinessConstraint, string> = {
|
||||
NONE: "Серьезных ограничений нет",
|
||||
SEASONALITY: "Ярко выраженная сезонность",
|
||||
SMALL_TEAM: "Маленькая команда",
|
||||
LIMITED_BUDGET: "Ограниченный маркетинговый бюджет",
|
||||
LONG_DEAL_CYCLE: "Длинный цикл сделки"
|
||||
};
|
||||
|
||||
// --- MAIN REQUEST INTERFACE ---
|
||||
export interface MarketingAnalysisV3Request {
|
||||
businessNiche: string;
|
||||
productName: string;
|
||||
goal: string;
|
||||
businessStage: BusinessStage;
|
||||
clientTarget: ClientTarget;
|
||||
offerType: OfferType;
|
||||
averageCheck: AverageCheck;
|
||||
customerBehaviors: CustomerBehavior[]; // min 1, max 2
|
||||
geoScope: GeoScope;
|
||||
mainCity?: string;
|
||||
presenceCities?: string[]; // max 5
|
||||
promotionCities: string[]; // max 5
|
||||
productDescription: string;
|
||||
purchaseFrequency: PurchaseFrequency;
|
||||
visualFactor: VisualFactor;
|
||||
decisionPriorities: DecisionPriority[]; // min 1, max 2
|
||||
discoveryMethods: DiscoveryMethod[]; // min 1, max 2
|
||||
priceFeedback: PriceFeedback;
|
||||
smmStatus: SmmStatus;
|
||||
leadVolume: LeadVolume;
|
||||
responseHandler: ResponseHandler;
|
||||
constraints?: BusinessConstraint[];
|
||||
userSocialLinks?: string[]; // max 5
|
||||
knownCompetitorLinks?: string[]; // max 5
|
||||
detailLevel: string;
|
||||
analysisType: string[]; // ['РЫНОК', 'КОНКУРЕНТЫ', 'ЦА', 'КАНАЛЫ']
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
export interface MarketingAnalysisV3Result {
|
||||
"0_executive_summary": ExecutiveSummary;
|
||||
"1_market_landscape": MarketLandscape;
|
||||
"2_geo_structure": GeoStructure;
|
||||
"3_competitor_map": CompetitorProfile[];
|
||||
"4_content_profile": ContentProfile;
|
||||
"5_competition_intensity": CompetitionIntensity;
|
||||
"6_reputation_analysis": ReputationAnalysis;
|
||||
"7_behavioral_pattern": BehavioralPattern;
|
||||
"8_search_demand": SearchDemand;
|
||||
"9_user_positioning": UserPositioning;
|
||||
"10_structured_conclusions": string[];
|
||||
"11_smm_strategy_rationale": string;
|
||||
}
|
||||
|
||||
export interface ExecutiveSummary {
|
||||
businessStage: string;
|
||||
geography: string;
|
||||
activeCompetitors: number;
|
||||
competitionLevel: string;
|
||||
averageNicheEr: string;
|
||||
averageRating: number;
|
||||
demandTrend: string;
|
||||
keyFigures: string[];
|
||||
}
|
||||
|
||||
export interface TimeSeriesPoint {
|
||||
period: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface MarketLandscape {
|
||||
activePlayersByPlatform: Record<string, number>;
|
||||
cityDistribution: Record<string, number>;
|
||||
demandDynamics: TimeSeriesPoint[];
|
||||
nicheReputationLevel: number;
|
||||
}
|
||||
|
||||
export interface CityMetrics {
|
||||
city: string;
|
||||
activePlayers: number;
|
||||
avgEr: number;
|
||||
avgRating: number;
|
||||
avgPostsPerMonth: number;
|
||||
}
|
||||
|
||||
export interface GeoStructure {
|
||||
cityComparison: CityMetrics[];
|
||||
densityIndex: number;
|
||||
}
|
||||
|
||||
export interface CompetitorProfile {
|
||||
name: string;
|
||||
platform: string;
|
||||
followers: number;
|
||||
postsPerMonth: number;
|
||||
er: number;
|
||||
rating: number;
|
||||
reviews: number;
|
||||
strengths: string[];
|
||||
weaknesses: string[];
|
||||
}
|
||||
|
||||
export interface ContentProfile {
|
||||
demoContentPercent: number;
|
||||
expertContentPercent: number;
|
||||
salesContentPercent: number;
|
||||
reviewsContentPercent: number;
|
||||
engagementContentPercent: number;
|
||||
videoShare: number;
|
||||
avgTextLength: string;
|
||||
ctaFrequency: string;
|
||||
}
|
||||
|
||||
export interface CompetitionIntensity {
|
||||
ciiIndex: number;
|
||||
intensityLabel: string;
|
||||
contributingFactors: string[];
|
||||
}
|
||||
|
||||
export interface ReputationAnalysis {
|
||||
avgNicheRating: number;
|
||||
medianReviews: number;
|
||||
starDistribution: Record<string, number>;
|
||||
highTrustBusinessShare: number;
|
||||
avgOwnerResponseSpeed: string;
|
||||
}
|
||||
|
||||
export interface BehavioralPattern {
|
||||
promoFrequency: string;
|
||||
bookingFrequency: string;
|
||||
dmRequestFrequency: string;
|
||||
priceVisibility: string;
|
||||
avgCycleDuration: string;
|
||||
commonCta: string[];
|
||||
}
|
||||
|
||||
export interface SearchDemand {
|
||||
avgFrequency: string;
|
||||
seasonality: TimeSeriesPoint[];
|
||||
peakPeriods: string[];
|
||||
relatedQueries: string[];
|
||||
}
|
||||
|
||||
export interface RadarMetrics {
|
||||
activity: number;
|
||||
engagement: number;
|
||||
video: number;
|
||||
reputation: number;
|
||||
frequency: number;
|
||||
}
|
||||
|
||||
export interface UserPositioning {
|
||||
radarChart: RadarMetrics;
|
||||
status: string;
|
||||
gaps: string[];
|
||||
}
|
||||
|
||||
export type MarketingAnalysisStatus =
|
||||
| "QUEUED"
|
||||
| "PROCESSING"
|
||||
| "COMPLETED"
|
||||
| "FAILED";
|
||||
|
||||
export interface MarketingAnalysisV3Document {
|
||||
id: string;
|
||||
userId: string;
|
||||
status: MarketingAnalysisStatus;
|
||||
requestData: unknown;
|
||||
resultData?: MarketingAnalysisV3Result;
|
||||
errorMessage?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user