export function apiEnvelope(data: T) { return { code: 200, message: "success", success: true, data, }; } export const e2eUser = { id: "user_e2e", username: "E2E User", email: "e2e@example.com", platform: "web", intimacy: 42, dolBalance: 0, relationshipStage: "close_friend", currentMood: "happy", preferredLanguage: "en", createdAt: "2026-06-25T00:00:00.000Z", lastMessageAt: "", avatarUrl: "", loginProvider: "guest", isGuest: true, isVip: false, voiceMinutesRemaining: 0, }; export const e2eEmailUser = { ...e2eUser, id: "user_e2e_email", username: "E2E Email User", email: "chanwillian0@gmail.com", isGuest: false, }; export const guestLoginResponse = { token: "e2e-guest-token", deviceId: "e2e-device-id", userId: e2eUser.id, isDeviceUser: true, expiresIn: 2_592_000, user: e2eUser, }; export const emailLoginResponse = { token: "e2e-email-token", refreshToken: "e2e-email-refresh-token", user: e2eEmailUser, }; export const userEntitlementsResponse = { userId: e2eEmailUser.id, isGuest: false, isVip: false, vipExpiresAt: null, creditBalance: 0, dolBalance: 0, }; export const emptyChatHistoryResponse = { messages: [], total: 0, limit: 50, offset: 0, isVip: false, privateFreeLimit: 0, privateUsedToday: 0, privateCanViewFree: false, }; export const chatSendResponse = { reply: "Hello from the E2E boyfriend.", audioUrl: "", messageId: "msg_e2e_reply_001", isGuest: true, timestamp: 1_782_356_425_363, image: { type: null, url: null, }, lockDetail: { locked: false, showContent: true, showUpgrade: false, reason: null, hint: null, detail: null, }, }; export function createChatSendResponse(sendCount: number) { return { ...chatSendResponse, reply: `Hello from the E2E boyfriend. Reply ${sendCount}.`, messageId: `msg_e2e_reply_${String(sendCount).padStart(3, "0")}`, timestamp: chatSendResponse.timestamp + sendCount, }; } export function createWeeklyLimitChatSendResponse( usedMessageCount: number, limit: number, ) { return { reply: "", audioUrl: "", messageId: "", isGuest: true, timestamp: chatSendResponse.timestamp + usedMessageCount, image: { type: null, url: null, }, lockDetail: { locked: true, showContent: false, showUpgrade: true, reason: "weekly_limit", hint: "Free message limit reached.", detail: { type: "weekly_msg_limit", usedThisWeek: usedMessageCount, limit, }, }, }; } export const paidImageMessageId = "msg_photo_paywall_001"; export const paidImageUrl = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII="; export const paidImageChatSendResponse = { reply: "I can show you that photo after you activate VIP.", audioUrl: "", messageId: paidImageMessageId, isGuest: true, timestamp: 1_782_180_725_000, image: { type: "elio_schedule", url: paidImageUrl, }, lockDetail: { locked: true, showContent: true, showUpgrade: true, reason: "image", hint: "Activate VIP to unlock the full photo.", detail: null, }, }; export function createPaidImageHistoryResponse(unlocked: boolean) { return { messages: [ { role: "assistant", type: "image", content: unlocked ? "" : "I can show you that photo after you activate VIP.", id: paidImageMessageId, created_at: "2026-06-30T00:00:00.000Z", audioUrl: null, image: { type: "elio_schedule", url: paidImageUrl, }, lockDetail: unlocked ? { locked: false, showContent: true, showUpgrade: false, reason: null, hint: null, detail: null, } : paidImageChatSendResponse.lockDetail, }, ], total: 1, limit: 50, offset: 0, isVip: unlocked, privateFreeLimit: 0, privateUsedToday: 0, privateCanViewFree: false, }; } export const paidImageUnlockHistoryResponse = { unlocked: true, reason: "ok", totalLocked: 1, unlockedCount: 1, privateCount: 0, imageCount: 1, voiceCount: 0, requiredCredits: 0, currentCredits: 0, remainingCredits: 0, shortfallCredits: 0, costsByMessage: { [paidImageMessageId]: 0, }, messageIds: [paidImageMessageId], }; export const paidVoiceMessageId = "msg_voice_paywall_001"; export const paidVoiceAudioUrl = "data:audio/mpeg;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCA"; export const paidVoiceHistoryResponse = { messages: [ { role: "assistant", type: "voice", content: "", id: paidVoiceMessageId, created_at: "2026-07-01T00:00:00.000Z", audioUrl: paidVoiceAudioUrl, image: { type: null, url: null, }, lockDetail: { locked: true, showContent: true, showUpgrade: true, reason: "voice_message", hint: "Unlock this voice message with credits.", detail: null, }, }, ], total: 1, limit: 50, offset: 0, isVip: false, privateFreeLimit: 0, privateUsedToday: 0, privateCanViewFree: false, }; export const insufficientCreditsUnlockVoiceResponse = { unlocked: false, content: "", reason: "insufficient_balance", creditBalance: 3, creditsCharged: 0, requiredCredits: 20, shortfallCredits: 17, lockDetail: { locked: true, showContent: true, showUpgrade: true, reason: "voice_message", hint: "Unlock this voice message with credits.", detail: null, }, }; export const paymentPlansResponse = { plans: [ { plan_id: "vip_monthly", plan_name: "Monthly", order_type: "vip_monthly", amount_cents: 999, original_amount_cents: 1999, daily_price_cents: 33, currency: "USD", vip_days: 30, dol_amount: null, }, { plan_id: "vip_quarterly", plan_name: "Quarterly", order_type: "vip_quarterly", amount_cents: 2499, original_amount_cents: 5999, daily_price_cents: 28, currency: "USD", vip_days: 90, dol_amount: null, }, { plan_id: "dol_voice_30", plan_name: "Voice Pack", order_type: "dol_voice", amount_cents: 499, original_amount_cents: null, daily_price_cents: null, currency: "USD", vip_days: null, dol_amount: 30, }, ], }; export const paymentOrderId = "order_e2e_vip_monthly"; export const createPaymentOrderResponse = { orderId: paymentOrderId, payParams: { provider: "stripe", clientSecret: "pi_e2e_secret_mock", }, }; export const paidPaymentOrderStatusResponse = { orderId: paymentOrderId, status: "paid", orderType: "vip_monthly", planId: "vip_monthly", }; export const vipStatusResponse = { isVip: false, expiresAt: null, };