// config/platform-limits.ts
import { Platform } from '../enum/platform.enum';
import { AccountTier } from '../enum/account-tier.enum';
import { PostLength } from '../enum/post-length.enum';

export interface LengthRange {
    min: number;
    max: number;
    sweet: number; // target tối ưu cho engagement
}

/**
 * Hard limits theo platform + tier (characters)
 */
export const PLATFORM_LIMITS: Record<Platform, Record<AccountTier, number>> = {
    [Platform.X]: {
        [AccountTier.FREE]: 280,
        [AccountTier.PREMIUM]: 25000,
        [AccountTier.PREMIUM_PLUS]: 25000,
        [AccountTier.VERIFIED_ORG]: 25000,
    },
    [Platform.FACEBOOK]: {
        [AccountTier.FREE]: 63206,
        [AccountTier.PREMIUM]: 63206,
        [AccountTier.PREMIUM_PLUS]: 63206,
        [AccountTier.VERIFIED_ORG]: 63206,
    },
};

/**
 * Sweet spot ranges theo PostLength.
 * Dựa trên data engagement thực tế của X 2025-2026.
 */
export const LENGTH_RANGES: Record<PostLength, LengthRange> = {
    [PostLength.SHORT]:    { min: 180,  max: 280,   sweet: 210  },
    [PostLength.MEDIUM]:   { min: 200,  max: 500,   sweet: 320  },
    [PostLength.LONG]:     { min: 400,  max: 1200,  sweet: 600 },
    [PostLength.EXTENDED]: { min: 1500, max: 3000,  sweet: 2200 },
    [PostLength.ARTICLE]:  { min: 3000, max: 8000,  sweet: 5000 },
};
