From 45d932b791666623bfeb29ed77589aa7478a49b1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 6 Jul 2026 15:38:29 +0200 Subject: [PATCH] =?UTF-8?q?Avant=20de=20revoir=20la=20s=C3=A9curit=C3=A9?= =?UTF-8?q?=20du=20syst=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/controllers/walletController.ts | 9 +- .../src/repositories/transactionRepository.ts | 37 ++- backend/src/services/walletService.ts | 12 +- prediqo_web/src/features/faq/FaqAdminPage.tsx | 11 +- prediqo_web/src/features/faq/FaqPage.tsx | 5 +- .../src/features/faq/faqCategoryI18n.ts | 6 + .../src/features/reports/ReportDetailPage.tsx | 7 +- .../src/features/reports/ReportsHubPage.tsx | 29 +- .../src/features/reports/reportCatalogI18n.ts | 22 ++ .../src/features/wallet/WalletPage.tsx | 41 ++- .../wallet/components/TransactionList.tsx | 8 +- .../features/wallet/hooks/useWalletData.ts | 12 +- prediqo_web/src/features/wallet/types.ts | 3 + prediqo_web/src/shared/i18n/locales/en.ts | 29 +- prediqo_web/src/shared/i18n/locales/fr.ts | 29 +- .../src/shared/i18n/locales/reportCatalog.ts | 299 ++++++++++++++++++ 16 files changed, 509 insertions(+), 50 deletions(-) create mode 100644 prediqo_web/src/features/faq/faqCategoryI18n.ts create mode 100644 prediqo_web/src/features/reports/reportCatalogI18n.ts create mode 100644 prediqo_web/src/shared/i18n/locales/reportCatalog.ts diff --git a/backend/src/controllers/walletController.ts b/backend/src/controllers/walletController.ts index bf611ae6..3439e544 100644 --- a/backend/src/controllers/walletController.ts +++ b/backend/src/controllers/walletController.ts @@ -72,12 +72,17 @@ export async function getTransactions(req: AuthRequest, res: Response): Promise< const offset = parseInt(req.query.offset as string) || 0; const paginated = req.query.paginated === 'true' || req.query.paginated === '1'; + const categoryRaw = req.query.category as string | undefined; + const category = + categoryRaw === 'deposits' || categoryRaw === 'withdrawals' || categoryRaw === 'predictions' + ? categoryRaw + : undefined; if (paginated) { - const result = await walletService.listUserTransactionsPaginated(userId, limit, offset); + const result = await walletService.listUserTransactionsPaginated(userId, limit, offset, category); res.json(result); return; } - const list = await walletService.listUserTransactions(userId, limit, offset); + const list = await walletService.listUserTransactions(userId, limit, offset, category); res.json(list); } catch (e) { res.status(500).json({ error: e instanceof Error ? e.message : 'Failed' }); diff --git a/backend/src/repositories/transactionRepository.ts b/backend/src/repositories/transactionRepository.ts index 218ede66..1fce9b64 100644 --- a/backend/src/repositories/transactionRepository.ts +++ b/backend/src/repositories/transactionRepository.ts @@ -1,6 +1,28 @@ import { query } from '../db/connection'; import { Transaction } from '../models'; +/** Wallet activity tabs on the player UI. */ +export type TransactionActivityCategory = 'deposits' | 'withdrawals' | 'predictions'; + +function activityCategoryFilter(category?: TransactionActivityCategory): string { + switch (category) { + case 'deposits': + return ` AND ( + type IN ('deposit', 'bonus', 'admin_adjustment') + OR (type = 'transfer' AND COALESCE(metadata->>'direction', '') = 'in') + )`; + case 'withdrawals': + return ` AND ( + type = 'withdrawal' + OR (type = 'transfer' AND COALESCE(metadata->>'direction', '') = 'out') + )`; + case 'predictions': + return ` AND type IN ('game_stake', 'game_payout', 'game_refund')`; + default: + return ''; + } +} + /** * Repository for blockchain transaction records. * Persists deposits, withdrawals, and transfers with status and confirmation tracking. @@ -112,18 +134,25 @@ export async function findById(id: string): Promise { * @param offset - Number of rows to skip for pagination (default 0). * @returns Array of transaction records. */ -export async function listByUserId(userId: string, limit: number = 50, offset: number = 0): Promise { +export async function listByUserId( + userId: string, + limit: number = 50, + offset: number = 0, + category?: TransactionActivityCategory +): Promise { + const categorySql = activityCategoryFilter(category); return query( `SELECT id, user_id, wallet_type_id, type, amount::text, fee::text, status, blockchain_tx_id, from_address, to_address, confirmations, required_confirmations, metadata, created_at, updated_at - FROM transactions WHERE user_id = $1 ORDER BY created_at DESC LIMIT $2 OFFSET $3`, + FROM transactions WHERE user_id = $1${categorySql} ORDER BY created_at DESC LIMIT $2 OFFSET $3`, [userId, limit, offset] ); } /** Total transaction count for a user (pagination). */ -export async function countByUserId(userId: string): Promise { +export async function countByUserId(userId: string, category?: TransactionActivityCategory): Promise { + const categorySql = activityCategoryFilter(category); const rows = await query<{ count: string }[]>( - 'SELECT COUNT(*)::text AS count FROM transactions WHERE user_id = $1', + `SELECT COUNT(*)::text AS count FROM transactions WHERE user_id = $1${categorySql}`, [userId] ); return parseInt(rows[0]?.count ?? '0', 10); diff --git a/backend/src/services/walletService.ts b/backend/src/services/walletService.ts index 1e953f79..b57f149a 100644 --- a/backend/src/services/walletService.ts +++ b/backend/src/services/walletService.ts @@ -110,19 +110,21 @@ export async function getUserBalances(userId: string): Promise< export async function listUserTransactions( userId: string, limit: number, - offset: number + offset: number, + category?: transactionRepository.TransactionActivityCategory ): Promise { - return transactionRepository.listByUserId(userId, limit, offset); + return transactionRepository.listByUserId(userId, limit, offset, category); } export async function listUserTransactionsPaginated( userId: string, limit: number, - offset: number + offset: number, + category?: transactionRepository.TransactionActivityCategory ): Promise<{ items: Transaction[]; total: number; limit: number; offset: number }> { const [items, total] = await Promise.all([ - transactionRepository.listByUserId(userId, limit, offset), - transactionRepository.countByUserId(userId), + transactionRepository.listByUserId(userId, limit, offset, category), + transactionRepository.countByUserId(userId, category), ]); return { items, total, limit, offset }; } diff --git a/prediqo_web/src/features/faq/FaqAdminPage.tsx b/prediqo_web/src/features/faq/FaqAdminPage.tsx index a22efc6d..1aeaeeae 100644 --- a/prediqo_web/src/features/faq/FaqAdminPage.tsx +++ b/prediqo_web/src/features/faq/FaqAdminPage.tsx @@ -40,6 +40,7 @@ import { adminUpdateFaqCategory, } from './api/faqApi'; import { FaqRichEditor } from './components/FaqRichEditor'; +import { faqCategoryLabel } from './faqCategoryI18n'; import type { FaqCategory, FaqEntry } from './types'; type TabKey = 'entries' | 'categories'; @@ -246,7 +247,7 @@ export function FaqAdminPage() { {t('admin.faqAdmin.allCategories')} {categories.map((c) => ( - {c.name} + {faqCategoryLabel(t, c.slug, c.name)} ))} @@ -281,7 +282,11 @@ export function FaqAdminPage() { {entry.question} - + {categories.map((c) => ( - {c.name} + {faqCategoryLabel(t, c.slug, c.name)} ))} diff --git a/prediqo_web/src/features/faq/FaqPage.tsx b/prediqo_web/src/features/faq/FaqPage.tsx index f562221d..898e6d89 100644 --- a/prediqo_web/src/features/faq/FaqPage.tsx +++ b/prediqo_web/src/features/faq/FaqPage.tsx @@ -30,6 +30,7 @@ import { recordFaqView, } from './api/faqApi'; import { FaqAnswerHtml } from './components/FaqAnswerHtml'; +import { faqCategoryLabel } from './faqCategoryI18n'; import type { FaqEntry } from './types'; import { readAuth } from '../../shared/auth/tokenStorage'; @@ -228,7 +229,7 @@ export function FaqPage({ showPublicHeader = false }: FaqPageProps) { {(categoriesQ.data ?? []).map((cat) => ( setCategorySlug(cat.slug)} variant={categorySlug === cat.slug ? 'filled' : 'outlined'} @@ -292,7 +293,7 @@ export function FaqPage({ showPublicHeader = false }: FaqPageProps) { {entry.question} - {entry.categoryName} + {faqCategoryLabel(t, entry.categorySlug, entry.categoryName)} {entry.viewCount > 0 ? ` · ${t('faq.views', { count: entry.viewCount })}` : ''} diff --git a/prediqo_web/src/features/faq/faqCategoryI18n.ts b/prediqo_web/src/features/faq/faqCategoryI18n.ts new file mode 100644 index 00000000..1ccda0f1 --- /dev/null +++ b/prediqo_web/src/features/faq/faqCategoryI18n.ts @@ -0,0 +1,6 @@ +import type { TFunction } from 'i18next'; + +/** Localized FAQ category label (seed slugs + fallback to API name). */ +export function faqCategoryLabel(t: TFunction, slug: string, fallback?: string): string { + return t(`faq.categories.${slug}`, { defaultValue: fallback ?? slug }); +} diff --git a/prediqo_web/src/features/reports/ReportDetailPage.tsx b/prediqo_web/src/features/reports/ReportDetailPage.tsx index 36e4fe2a..fa2d2af4 100644 --- a/prediqo_web/src/features/reports/ReportDetailPage.tsx +++ b/prediqo_web/src/features/reports/ReportDetailPage.tsx @@ -67,6 +67,7 @@ import { api } from '../../shared/services/api'; import { formatRawUsdtCell } from '../../shared/utils/moneyFormat'; import { formatReportDate } from '../../shared/utils/dateFormat'; import { reportUsesPeriodParams } from './reportPeriodScope'; +import { reportDescription, reportTitle } from './reportCatalogI18n'; function toDateInputValue(value: string): string { if (!value) return ''; @@ -801,15 +802,15 @@ export function ReportDetailPage() { - {q.data?.title ?? reportKey} + {reportTitle(t, reportKey, q.data?.title)} - {q.data?.description && ( + {reportDescription(t, reportKey, q.data?.description) && ( - {q.data.description} + {reportDescription(t, reportKey, q.data?.description)} diff --git a/prediqo_web/src/features/reports/ReportsHubPage.tsx b/prediqo_web/src/features/reports/ReportsHubPage.tsx index d03fda8a..4fcc49ad 100644 --- a/prediqo_web/src/features/reports/ReportsHubPage.tsx +++ b/prediqo_web/src/features/reports/ReportsHubPage.tsx @@ -16,6 +16,7 @@ import { useQuery } from '@tanstack/react-query'; import { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { api } from '../../shared/services/api'; +import { reportCategoryLabel, reportDescription, reportTitle } from './reportCatalogI18n'; type CatalogResponse = { categories: { @@ -26,7 +27,7 @@ type CatalogResponse = { }; export function ReportsHubPage() { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); const [search, setSearch] = useState(''); const q = useQuery({ queryKey: ['admin-reports-catalog'], @@ -43,19 +44,23 @@ export function ReportsHubPage() { return categories .map((cat) => { + const label = reportCategoryLabel(t, cat.id, cat.label); const categoryMatch = - cat.label.toLowerCase().includes(query) || cat.id.toLowerCase().includes(query); - const reports = cat.reports.filter( - (r) => + label.toLowerCase().includes(query) || cat.id.toLowerCase().includes(query); + const reports = cat.reports.filter((r) => { + const title = reportTitle(t, r.key, r.title); + const description = reportDescription(t, r.key, r.description); + return ( categoryMatch || - r.title.toLowerCase().includes(query) || - r.description.toLowerCase().includes(query) || + title.toLowerCase().includes(query) || + description.toLowerCase().includes(query) || r.key.toLowerCase().includes(query) - ); + ); + }); return { ...cat, reports }; }) .filter((cat) => cat.reports.length > 0); - }, [q.data?.categories, search]); + }, [q.data?.categories, search, t, i18n.language]); const totalVisible = filteredCategories.reduce((sum, cat) => sum + cat.reports.length, 0); @@ -96,7 +101,7 @@ export function ReportsHubPage() { {filteredCategories.map((cat) => ( - {cat.label} + {reportCategoryLabel(t, cat.id, cat.label)} {cat.reports.map((r) => ( @@ -106,10 +111,12 @@ export function ReportsHubPage() { - {r.title} + + {reportTitle(t, r.key, r.title)} + - {r.description} + {reportDescription(t, r.key, r.description)} diff --git a/prediqo_web/src/features/reports/reportCatalogI18n.ts b/prediqo_web/src/features/reports/reportCatalogI18n.ts new file mode 100644 index 00000000..855213c9 --- /dev/null +++ b/prediqo_web/src/features/reports/reportCatalogI18n.ts @@ -0,0 +1,22 @@ +import type { TFunction } from 'i18next'; + +/** Localized category heading for the reports hub. */ +export function reportCategoryLabel(t: TFunction, categoryId: string, fallback?: string): string { + return t(`admin.reports.catalog.categories.${categoryId}`, { + defaultValue: fallback ?? categoryId, + }); +} + +/** Localized report card / detail title. */ +export function reportTitle(t: TFunction, reportKey: string, fallback?: string): string { + return t(`admin.reports.catalog.items.${reportKey}.title`, { + defaultValue: fallback ?? reportKey, + }); +} + +/** Localized report card / detail description. */ +export function reportDescription(t: TFunction, reportKey: string, fallback?: string): string { + return t(`admin.reports.catalog.items.${reportKey}.description`, { + defaultValue: fallback ?? '', + }); +} diff --git a/prediqo_web/src/features/wallet/WalletPage.tsx b/prediqo_web/src/features/wallet/WalletPage.tsx index 993ae89a..9dcb3b9d 100644 --- a/prediqo_web/src/features/wallet/WalletPage.tsx +++ b/prediqo_web/src/features/wallet/WalletPage.tsx @@ -31,6 +31,7 @@ import { TransferDialog } from './components/TransferDialog'; import { WithdrawDialog } from './components/WithdrawDialog'; import { TransactionList } from './components/TransactionList'; import { DEFAULT_TX_PAGE_SIZE, useBalances, useTransactions } from './hooks/useWalletData'; +import type { WalletActivityCategory } from './types'; import { USDT_WALLET_CODE } from './utils/walletCapabilities'; import { rawToHuman, shortSymbol } from './utils/walletFormat'; @@ -39,12 +40,13 @@ type DialogKind = 'receive' | 'transfer' | 'withdraw' | null; export function WalletPage() { const { t } = useTranslation(); const [tab, setTab] = useState(0); + const [activityCategory, setActivityCategory] = useState('deposits'); const [dialog, setDialog] = useState(null); const [toast, setToast] = useState(null); const [txPage, setTxPage] = useState(0); const balancesQ = useBalances(); - const txQ = useTransactions(txPage, DEFAULT_TX_PAGE_SIZE); + const txQ = useTransactions(txPage, DEFAULT_TX_PAGE_SIZE, activityCategory); const healthQ = useQuery({ queryKey: ['health'], @@ -209,15 +211,34 @@ export function WalletPage() { )} {tab === 1 && ( - + + { + setActivityCategory(value); + setTxPage(0); + }} + variant="scrollable" + scrollButtons="auto" + allowScrollButtonsMobile + sx={{ mb: 2 }} + > + + + + + + )} setDialog(null)} onCopied={setToast} /> diff --git a/prediqo_web/src/features/wallet/components/TransactionList.tsx b/prediqo_web/src/features/wallet/components/TransactionList.tsx index 2ba19b1e..a473750d 100644 --- a/prediqo_web/src/features/wallet/components/TransactionList.tsx +++ b/prediqo_web/src/features/wallet/components/TransactionList.tsx @@ -32,6 +32,8 @@ type TransactionListProps = { pageSize: number; total: number; onPageChange: (page: number) => void; + emptyMessage?: string; + emptyHint?: string; }; /** Maps wallet_type_id to wallet type metadata for display. */ @@ -53,6 +55,8 @@ export function TransactionList({ pageSize, total, onPageChange, + emptyMessage, + emptyHint, }: TransactionListProps) { const { t } = useTranslation(); const pageCount = Math.max(1, Math.ceil(total / pageSize)); @@ -79,9 +83,9 @@ export function TransactionList({ border: '1px solid rgba(255,255,255,0.08)', }} > - {t('wallet.transactions.empty')} + {emptyMessage ?? t('wallet.transactions.empty.deposits')} - {t('wallet.transactions.emptyHint')} + {emptyHint ?? t('wallet.transactions.emptyHint.deposits')} ); diff --git a/prediqo_web/src/features/wallet/hooks/useWalletData.ts b/prediqo_web/src/features/wallet/hooks/useWalletData.ts index 1d5740c3..28519131 100644 --- a/prediqo_web/src/features/wallet/hooks/useWalletData.ts +++ b/prediqo_web/src/features/wallet/hooks/useWalletData.ts @@ -4,7 +4,7 @@ */ import { useQuery } from '@tanstack/react-query'; import { api } from '../../../shared/services/api'; -import type { BalanceEntry, DepositAddressResponse, WalletTransaction } from '../types'; +import type { BalanceEntry, DepositAddressResponse, WalletActivityCategory, WalletTransaction } from '../types'; export type PaginatedTransactions = { items: WalletTransaction[]; @@ -55,13 +55,17 @@ const DEFAULT_TX_PAGE_SIZE = 10; * @param page Zero-based page index * @param pageSize Rows per page (default 10) */ -export function useTransactions(page: number, pageSize = DEFAULT_TX_PAGE_SIZE) { +export function useTransactions( + page: number, + pageSize = DEFAULT_TX_PAGE_SIZE, + category: WalletActivityCategory = 'deposits' +) { const offset = page * pageSize; return useQuery({ - queryKey: ['wallet-transactions', page, pageSize], + queryKey: ['wallet-transactions', page, pageSize, category], queryFn: async () => { const res = await api.get('/api/v1/transactions', { - params: { limit: pageSize, offset, paginated: 'true' }, + params: { limit: pageSize, offset, paginated: 'true', category }, }); return res.data; }, diff --git a/prediqo_web/src/features/wallet/types.ts b/prediqo_web/src/features/wallet/types.ts index cf43ae2a..39c6b9a5 100644 --- a/prediqo_web/src/features/wallet/types.ts +++ b/prediqo_web/src/features/wallet/types.ts @@ -31,6 +31,9 @@ export type DepositAddressResponse = { walletType: WalletType; }; +/** Activity sub-tabs on the wallet page. */ +export type WalletActivityCategory = 'deposits' | 'withdrawals' | 'predictions'; + /** Ledger transaction from GET /transactions. */ export type WalletTransaction = { id: string; diff --git a/prediqo_web/src/shared/i18n/locales/en.ts b/prediqo_web/src/shared/i18n/locales/en.ts index 9a838c3e..77fdd79c 100644 --- a/prediqo_web/src/shared/i18n/locales/en.ts +++ b/prediqo_web/src/shared/i18n/locales/en.ts @@ -1,3 +1,5 @@ +import { reportCatalogEn } from './reportCatalog'; + export const en = { common: { loading: 'Loading…', @@ -217,6 +219,11 @@ export const en = { withdraw: 'Withdraw', tabAsset: 'Asset', tabActivity: 'Activity', + activityTab: { + deposits: 'Deposits', + withdrawals: 'Withdrawals', + predictions: 'Predictions', + }, receiveDialog: { title: 'Receive USDT', info: 'Send USDT on {{network}} only. This balance is used for Candle Predict stakes.', @@ -293,8 +300,16 @@ export const en = { disabled: 'Test wallet requests are currently disabled by the platform.', }, transactions: { - empty: 'No transactions yet', - emptyHint: 'Deposits, predictions, and withdrawals will appear here.', + empty: { + deposits: 'No deposits yet', + withdrawals: 'No withdrawals yet', + predictions: 'No predictions yet', + }, + emptyHint: { + deposits: 'On-chain deposits and incoming transfers will appear here.', + withdrawals: 'Withdrawals and outgoing transfers will appear here.', + predictions: 'Stakes, wins, and refunds from Candle Predict will appear here.', + }, types: { deposit: 'Deposit', withdrawal: 'Withdrawal', @@ -716,6 +731,15 @@ export const en = { subtitle: 'Find quick answers to the most common questions.', searchPlaceholder: 'Search for a question…', allCategories: 'All', + categories: { + account: 'Account', + deposits: 'Deposits', + withdrawals: 'Withdrawals', + predictions: 'Predictions', + referral: 'Referrals', + bonus: 'Bonuses', + security: 'Security', + }, popular: 'Popular questions', loadError: 'Could not load FAQ. Please try again later.', noResults: 'No questions match your search.', @@ -1411,6 +1435,7 @@ export const en = { searchPlaceholder: 'Search for a report (title, description, category…)', loading: 'Loading catalog…', noResults: 'No report matches « {{query}} ».', + catalog: reportCatalogEn, detail: { back: 'Back', filters: 'Filters', diff --git a/prediqo_web/src/shared/i18n/locales/fr.ts b/prediqo_web/src/shared/i18n/locales/fr.ts index 76c41cdf..fdaa7250 100644 --- a/prediqo_web/src/shared/i18n/locales/fr.ts +++ b/prediqo_web/src/shared/i18n/locales/fr.ts @@ -1,3 +1,5 @@ +import { reportCatalogFr } from './reportCatalog'; + export const fr = { common: { loading: 'Chargement…', @@ -224,6 +226,11 @@ export const fr = { withdraw: 'Retirer', tabAsset: 'Actif', tabActivity: 'Activité', + activityTab: { + deposits: 'Dépôts', + withdrawals: 'Retraits', + predictions: 'Prédictions', + }, receiveDialog: { title: 'Recevoir USDT', info: 'Envoyez des USDT sur {{network}} uniquement. Ce solde sert aux mises Candle Predict.', @@ -300,8 +307,16 @@ export const fr = { disabled: 'Les demandes de portefeuille test sont actuellement désactivées par la plateforme.', }, transactions: { - empty: 'Aucune transaction pour le moment', - emptyHint: 'Dépôts, prédictions et retraits apparaîtront ici.', + empty: { + deposits: 'Aucun dépôt pour le moment', + withdrawals: 'Aucun retrait pour le moment', + predictions: 'Aucune prédiction pour le moment', + }, + emptyHint: { + deposits: 'Les dépôts on-chain et transferts entrants apparaîtront ici.', + withdrawals: 'Les retraits et transferts sortants apparaîtront ici.', + predictions: 'Les mises, gains et remboursements Candle Predict apparaîtront ici.', + }, types: { deposit: 'Dépôt', withdrawal: 'Retrait', @@ -728,6 +743,15 @@ export const fr = { subtitle: 'Trouvez rapidement des réponses aux questions les plus fréquentes.', searchPlaceholder: 'Rechercher une question…', allCategories: 'Toutes', + categories: { + account: 'Compte', + deposits: 'Dépôts', + withdrawals: 'Retraits', + predictions: 'Prédictions', + referral: 'Parrainage', + bonus: 'Bonus', + security: 'Sécurité', + }, popular: 'Questions populaires', loadError: 'Impossible de charger les FAQ. Réessayez plus tard.', noResults: 'Aucune question ne correspond à votre recherche.', @@ -1422,6 +1446,7 @@ export const fr = { searchPlaceholder: 'Rechercher un rapport (titre, description, catégorie…)', loading: 'Chargement du catalogue…', noResults: 'Aucun rapport ne correspond à « {{query}} ».', + catalog: reportCatalogFr, detail: { back: 'Retour', filters: 'Filtres', diff --git a/prediqo_web/src/shared/i18n/locales/reportCatalog.ts b/prediqo_web/src/shared/i18n/locales/reportCatalog.ts new file mode 100644 index 00000000..e9f77ffa --- /dev/null +++ b/prediqo_web/src/shared/i18n/locales/reportCatalog.ts @@ -0,0 +1,299 @@ +/** Report hub catalog labels (EN/FR) — keyed by category id and report key from the API. */ + +export const reportCatalogEn = { + categories: { + users: 'User reports', + financial: 'Financial reports', + games: 'Game reports', + geography: 'Geography reports', + }, + items: { + 'users-all': { + title: 'All registered users', + description: 'Every account registered on the platform (no date filter).', + }, + 'users-active': { + title: 'Active accounts (status)', + description: 'Accounts in good standing with no restrictions (not tied to activity in a period).', + }, + 'users-active-period': { + title: 'Active users (period)', + description: 'Accounts with at least one login or prediction during the selected date range.', + }, + 'users-inactive': { + title: 'Inactive for 30 days', + description: 'No recorded activity for at least 30 days.', + }, + 'users-inactive-period': { + title: 'Inactive users (period)', + description: 'Accounts with no activity before the start of the selected period (dashboard KPI aligned).', + }, + 'users-online-now': { + title: 'On game now', + description: 'Users with an active WebSocket session on Candle Predict (game / predictions page).', + }, + 'users-online-app': { + title: 'Connected (app session)', + description: 'Users signed in to the app, including without an active prediction.', + }, + 'users-staff': { + title: 'Administrators & moderators', + description: 'Admin and moderator accounts — role, status, and last login.', + }, + 'users-new-period': { + title: 'New registrations (period)', + description: 'Accounts created during the selected date range.', + }, + 'users-suspended': { + title: 'Suspended accounts', + description: 'Locked, under surveillance, or restricted accounts.', + }, + 'users-email-unverified': { + title: 'Unverified emails', + description: 'Users who have not confirmed their email address.', + }, + 'users-2fa-on': { + title: '2FA enabled', + description: 'Users with two-factor authentication enabled.', + }, + 'users-2fa-off': { + title: '2FA disabled', + description: 'Users without two-factor authentication.', + }, + 'users-under-surveillance': { + title: 'Under investigation', + description: 'Accounts flagged for surveillance.', + }, + 'financial-deposits': { + title: 'Deposit history', + description: 'Completed deposit transactions in the selected period.', + }, + 'financial-deposit-users': { + title: 'Depositing users', + description: 'Distinct users who made at least one deposit in the period.', + }, + 'financial-withdrawals': { + title: 'Withdrawal history', + description: 'Completed withdrawal transactions.', + }, + 'financial-bonuses': { + title: 'Bonus history', + description: 'Bonus credits and referral commissions.', + }, + 'financial-adjustments': { + title: 'Admin adjustments', + description: 'Approved administrative balance adjustments.', + }, + 'financial-wallet-balances': { + title: 'Wallet balances', + description: 'Main, bonus, and test balances per user.', + }, + 'games-participants': { + title: 'Participants (period)', + description: 'Distinct users who placed at least one prediction in the period.', + }, + 'games-test-users': { + title: 'Test wallet users (period)', + description: 'Distinct users who played with the test wallet in the period.', + }, + 'games-predictions': { + title: 'Prediction history', + description: 'All Candle Predict predictions (including test wallet).', + }, + 'games-predictions-real': { + title: 'Predictions — real wallets', + description: 'Predictions on main and bonus wallets (excluding test account).', + }, + 'games-wins': { + title: 'Win history', + description: 'Winning predictions.', + }, + 'games-losses': { + title: 'Loss history', + description: 'Losing predictions.', + }, + 'games-auto': { + title: 'Auto predictions', + description: 'Bets placed via Auto Prediction.', + }, + 'games-manual': { + title: 'Manual predictions', + description: 'Single-candle bets placed manually by players.', + }, + 'games-multi-candle': { + title: 'Multi-candle predictions', + description: 'Multi-candle bets.', + }, + 'games-test': { + title: 'Test accounts', + description: 'Predictions using the test wallet.', + }, + 'geo-users': { + title: 'Users by country', + description: 'Registered users grouped by country.', + }, + 'geo-deposits': { + title: 'Deposits by country', + description: 'Deposit amounts aggregated by country.', + }, + 'geo-withdrawals': { + title: 'Withdrawals by country', + description: 'Withdrawal amounts aggregated by country.', + }, + 'geo-pnl': { + title: 'Net P/L by country', + description: 'Net player performance by country.', + }, + }, +} as const; + +export const reportCatalogFr = { + categories: { + users: 'Rapports utilisateurs', + financial: 'Rapports financiers', + games: 'Rapports des jeux', + geography: 'Rapports géographiques', + }, + items: { + 'users-all': { + title: 'Tous les inscrits', + description: 'Ensemble des comptes inscrits sur la plateforme (sans filtre de période).', + }, + 'users-active': { + title: 'Comptes actifs (statut)', + description: 'Comptes en bon état sans restriction (indépendant de l’activité sur une période).', + }, + 'users-active-period': { + title: 'Utilisateurs actifs (période)', + description: + 'Comptes ayant au moins une connexion ou une prédiction durant la période (filtres Du/Au).', + }, + 'users-inactive': { + title: 'Inactifs depuis 30 jours', + description: 'Aucune activité enregistrée depuis au moins 30 jours.', + }, + 'users-inactive-period': { + title: 'Utilisateurs inactifs (période)', + description: + 'Comptes sans activité enregistrée avant le début de la période sélectionnée (aligné sur le KPI dashboard).', + }, + 'users-online-now': { + title: 'Sur le jeu maintenant', + description: + 'Utilisateurs avec une session WebSocket active sur Candle Predict (page jeu / prédictions).', + }, + 'users-online-app': { + title: 'Connectés (session app)', + description: + 'Utilisateurs connectés à l’application (session authentifiée), y compris sans prédiction en cours.', + }, + 'users-staff': { + title: 'Administrateurs & modérateurs', + description: 'Comptes admin et modérateur — rôle, statut et dernière connexion.', + }, + 'users-new-period': { + title: 'Nouvelles inscriptions (période)', + description: 'Comptes créés durant la période sélectionnée (filtres Du/Au).', + }, + 'users-suspended': { + title: 'Comptes suspendus', + description: 'Comptes verrouillés, sous surveillance ou restreints.', + }, + 'users-email-unverified': { + title: 'E-mails non vérifiés', + description: 'Utilisateurs n’ayant pas confirmé leur adresse e-mail.', + }, + 'users-2fa-on': { + title: '2FA activé', + description: 'Utilisateurs avec l’authentification à deux facteurs.', + }, + 'users-2fa-off': { + title: '2FA désactivé', + description: 'Utilisateurs sans authentification à deux facteurs.', + }, + 'users-under-surveillance': { + title: 'Sous enquête', + description: 'Comptes marqués sous surveillance.', + }, + 'financial-deposits': { + title: 'Historique des dépôts', + description: 'Transactions de dépôt complétées sur la période sélectionnée.', + }, + 'financial-deposit-users': { + title: 'Utilisateurs déposants', + description: 'Utilisateurs distincts ayant effectué au moins un dépôt sur la période.', + }, + 'financial-withdrawals': { + title: 'Historique des retraits', + description: 'Transactions de retrait complétées.', + }, + 'financial-bonuses': { + title: 'Historique des bonus', + description: 'Crédits bonus et commissions de parrainage.', + }, + 'financial-adjustments': { + title: 'Ajustements admin', + description: 'Ajustements administratifs approuvés.', + }, + 'financial-wallet-balances': { + title: 'Soldes des wallets', + description: 'Soldes principal, bonus et test par utilisateur.', + }, + 'games-participants': { + title: 'Participants (période)', + description: 'Utilisateurs distincts ayant placé au moins une prédiction sur la période.', + }, + 'games-test-users': { + title: 'Utilisateurs wallet test (période)', + description: 'Utilisateurs distincts ayant joué avec le wallet de test sur la période.', + }, + 'games-predictions': { + title: 'Historique des prédictions', + description: 'Toutes les prédictions Candle Predict (y compris wallet test).', + }, + 'games-predictions-real': { + title: 'Prédictions — wallets réels', + description: 'Prédictions sur wallets principal et bonus (hors compte test).', + }, + 'games-wins': { + title: 'Historique des gains', + description: 'Prédictions gagnantes.', + }, + 'games-losses': { + title: 'Historique des pertes', + description: 'Prédictions perdantes.', + }, + 'games-auto': { + title: 'Prédictions automatiques', + description: 'Paris placés via Auto Prediction.', + }, + 'games-manual': { + title: 'Prédictions manuelles', + description: 'Paris simples (une bougie) placés manuellement par les joueurs.', + }, + 'games-multi-candle': { + title: 'Prédictions multi-candles', + description: 'Paris multi-bougies (Multi-candles).', + }, + 'games-test': { + title: 'Comptes de test', + description: 'Prédictions avec le wallet de test.', + }, + 'geo-users': { + title: 'Utilisateurs par pays', + description: 'Répartition des inscrits par pays.', + }, + 'geo-deposits': { + title: 'Dépôts par pays', + description: 'Montants déposés agrégés par pays.', + }, + 'geo-withdrawals': { + title: 'Retraits par pays', + description: 'Montants retirés agrégés par pays.', + }, + 'geo-pnl': { + title: 'Net P/L par pays', + description: 'Performance nette des joueurs par pays.', + }, + }, +} as const;