09a5cb69a7
CI / build-and-push (push) Successful in 42s
Replaces the simplified single-subscriber market with a full competitive simulation: shared TAM with softmax market shares across 4 segments, multi-tier consumer subscriptions (Free/Plus/Pro/Team) and API tiers (Free/PAYG/Scale/Enterprise), enterprise sales pipeline (Lead→Qualification→POC→Negotiation→Active→Renewal) with SLA tracking, developer ecosystem flywheel, technology obsolescence pressure, seasonal demand cycles, and two new product lines (Code Assistant, AI Agents Platform). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
803 B
TypeScript
26 lines
803 B
TypeScript
import type { SeasonalPhase } from '@ai-tycoon/shared';
|
|
import { SEASONAL_CYCLE_TICKS, SEASONAL_MULTIPLIERS } from '@ai-tycoon/shared';
|
|
|
|
export interface SeasonalResult {
|
|
phase: SeasonalPhase;
|
|
multipliers: { consumer: number; api: number; enterprise: number };
|
|
}
|
|
|
|
const PHASES: SeasonalPhase[] = ['q1', 'q2', 'q3', 'q4'];
|
|
|
|
export function computeSeasonal(tickCount: number): SeasonalResult {
|
|
const positionInCycle = tickCount % SEASONAL_CYCLE_TICKS;
|
|
const quarterLength = SEASONAL_CYCLE_TICKS / 4;
|
|
const phaseIndex = Math.min(3, Math.floor(positionInCycle / quarterLength));
|
|
const phase = PHASES[phaseIndex];
|
|
const raw = SEASONAL_MULTIPLIERS[phase];
|
|
return {
|
|
phase,
|
|
multipliers: {
|
|
consumer: raw.consumer,
|
|
api: raw.api,
|
|
enterprise: raw.enterprise,
|
|
},
|
|
};
|
|
}
|