Avant de revoir la sécurité du système
This commit is contained in:
parent
58b58c39a2
commit
45d932b791
@ -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' });
|
||||
|
||||
@ -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<Transaction | null> {
|
||||
* @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<Transaction[]> {
|
||||
export async function listByUserId(
|
||||
userId: string,
|
||||
limit: number = 50,
|
||||
offset: number = 0,
|
||||
category?: TransactionActivityCategory
|
||||
): Promise<Transaction[]> {
|
||||
const categorySql = activityCategoryFilter(category);
|
||||
return query<Transaction[]>(
|
||||
`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<number> {
|
||||
export async function countByUserId(userId: string, category?: TransactionActivityCategory): Promise<number> {
|
||||
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);
|
||||
|
||||
@ -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<Transaction[]> {
|
||||
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 };
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
<MenuItem value="">{t('admin.faqAdmin.allCategories')}</MenuItem>
|
||||
{categories.map((c) => (
|
||||
<MenuItem key={c.id} value={c.id}>
|
||||
{c.name}
|
||||
{faqCategoryLabel(t, c.slug, c.name)}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
@ -281,7 +282,11 @@ export function FaqAdminPage() {
|
||||
<Box sx={{ flex: 1, minWidth: 0 }}>
|
||||
<Stack direction="row" spacing={1} useFlexGap sx={{ alignItems: 'center', flexWrap: 'wrap' }}>
|
||||
<Typography sx={{ fontWeight: 800 }}>{entry.question}</Typography>
|
||||
<Chip size="small" label={entry.categoryName} variant="outlined" />
|
||||
<Chip
|
||||
size="small"
|
||||
label={faqCategoryLabel(t, entry.categorySlug, entry.categoryName)}
|
||||
variant="outlined"
|
||||
/>
|
||||
<Chip
|
||||
size="small"
|
||||
label={entry.isActive ? t('admin.faqAdmin.entryActive') : t('admin.faqAdmin.entryInactive')}
|
||||
@ -375,7 +380,7 @@ export function FaqAdminPage() {
|
||||
>
|
||||
{categories.map((c) => (
|
||||
<MenuItem key={c.id} value={c.id}>
|
||||
{c.name}
|
||||
{faqCategoryLabel(t, c.slug, c.name)}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
|
||||
@ -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) => (
|
||||
<Chip
|
||||
key={cat.id}
|
||||
label={cat.name}
|
||||
label={faqCategoryLabel(t, cat.slug, cat.name)}
|
||||
color={categorySlug === cat.slug ? 'primary' : 'default'}
|
||||
onClick={() => setCategorySlug(cat.slug)}
|
||||
variant={categorySlug === cat.slug ? 'filled' : 'outlined'}
|
||||
@ -292,7 +293,7 @@ export function FaqPage({ showPublicHeader = false }: FaqPageProps) {
|
||||
<Stack spacing={0.25} sx={{ minWidth: 0, pr: 1 }}>
|
||||
<Typography sx={{ fontWeight: 700 }}>{entry.question}</Typography>
|
||||
<Typography variant="caption" sx={{ opacity: 0.6 }}>
|
||||
{entry.categoryName}
|
||||
{faqCategoryLabel(t, entry.categorySlug, entry.categoryName)}
|
||||
{entry.viewCount > 0 ? ` · ${t('faq.views', { count: entry.viewCount })}` : ''}
|
||||
</Typography>
|
||||
</Stack>
|
||||
|
||||
6
prediqo_web/src/features/faq/faqCategoryI18n.ts
Normal file
6
prediqo_web/src/features/faq/faqCategoryI18n.ts
Normal file
@ -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 });
|
||||
}
|
||||
@ -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() {
|
||||
|
||||
<Typography variant={isCompact ? 'h6' : 'h5'} sx={{ fontWeight: 900 }}>
|
||||
|
||||
{q.data?.title ?? reportKey}
|
||||
{reportTitle(t, reportKey, q.data?.title)}
|
||||
|
||||
</Typography>
|
||||
|
||||
{q.data?.description && (
|
||||
{reportDescription(t, reportKey, q.data?.description) && (
|
||||
|
||||
<Typography variant="body2" sx={{ opacity: 0.7 }}>
|
||||
|
||||
{q.data.description}
|
||||
{reportDescription(t, reportKey, q.data?.description)}
|
||||
|
||||
</Typography>
|
||||
|
||||
|
||||
@ -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) => (
|
||||
<Box key={cat.id}>
|
||||
<Typography variant="h6" sx={{ fontWeight: 800, mb: 1.5 }}>
|
||||
{cat.label}
|
||||
{reportCategoryLabel(t, cat.id, cat.label)}
|
||||
</Typography>
|
||||
<Grid container spacing={2}>
|
||||
{cat.reports.map((r) => (
|
||||
@ -106,10 +111,12 @@ export function ReportsHubPage() {
|
||||
<CardContent>
|
||||
<Stack direction="row" spacing={1} sx={{ alignItems: 'flex-start', mb: 1 }}>
|
||||
<AssessmentRoundedIcon color="primary" fontSize="small" />
|
||||
<Typography sx={{ fontWeight: 800 }}>{r.title}</Typography>
|
||||
<Typography sx={{ fontWeight: 800 }}>
|
||||
{reportTitle(t, r.key, r.title)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Typography variant="body2" sx={{ opacity: 0.72 }}>
|
||||
{r.description}
|
||||
{reportDescription(t, r.key, r.description)}
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</CardActionArea>
|
||||
|
||||
22
prediqo_web/src/features/reports/reportCatalogI18n.ts
Normal file
22
prediqo_web/src/features/reports/reportCatalogI18n.ts
Normal file
@ -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 ?? '',
|
||||
});
|
||||
}
|
||||
@ -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<WalletActivityCategory>('deposits');
|
||||
const [dialog, setDialog] = useState<DialogKind>(null);
|
||||
const [toast, setToast] = useState<string | null>(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 && (
|
||||
<TransactionList
|
||||
transactions={transactions}
|
||||
balances={balances}
|
||||
loading={txQ.isLoading}
|
||||
page={txPage}
|
||||
pageSize={DEFAULT_TX_PAGE_SIZE}
|
||||
total={txTotal}
|
||||
onPageChange={setTxPage}
|
||||
/>
|
||||
<Box>
|
||||
<Tabs
|
||||
value={activityCategory}
|
||||
onChange={(_, value: WalletActivityCategory) => {
|
||||
setActivityCategory(value);
|
||||
setTxPage(0);
|
||||
}}
|
||||
variant="scrollable"
|
||||
scrollButtons="auto"
|
||||
allowScrollButtonsMobile
|
||||
sx={{ mb: 2 }}
|
||||
>
|
||||
<Tab value="deposits" label={t('wallet.activityTab.deposits')} />
|
||||
<Tab value="withdrawals" label={t('wallet.activityTab.withdrawals')} />
|
||||
<Tab value="predictions" label={t('wallet.activityTab.predictions')} />
|
||||
</Tabs>
|
||||
<TransactionList
|
||||
transactions={transactions}
|
||||
balances={balances}
|
||||
loading={txQ.isLoading}
|
||||
page={txPage}
|
||||
pageSize={DEFAULT_TX_PAGE_SIZE}
|
||||
total={txTotal}
|
||||
onPageChange={setTxPage}
|
||||
emptyMessage={t(`wallet.transactions.empty.${activityCategory}`)}
|
||||
emptyHint={t(`wallet.transactions.emptyHint.${activityCategory}`)}
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
<ReceiveDialog open={dialog === 'receive'} onClose={() => setDialog(null)} onCopied={setToast} />
|
||||
|
||||
@ -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)',
|
||||
}}
|
||||
>
|
||||
<Typography sx={{ opacity: 0.7 }}>{t('wallet.transactions.empty')}</Typography>
|
||||
<Typography sx={{ opacity: 0.7 }}>{emptyMessage ?? t('wallet.transactions.empty.deposits')}</Typography>
|
||||
<Typography variant="body2" sx={{ opacity: 0.5, mt: 0.5 }}>
|
||||
{t('wallet.transactions.emptyHint')}
|
||||
{emptyHint ?? t('wallet.transactions.emptyHint.deposits')}
|
||||
</Typography>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@ -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<PaginatedTransactions>('/api/v1/transactions', {
|
||||
params: { limit: pageSize, offset, paginated: 'true' },
|
||||
params: { limit: pageSize, offset, paginated: 'true', category },
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 <b>USDT</b> on <b>{{network}}</b> 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',
|
||||
|
||||
@ -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 <b>USDT</b> sur <b>{{network}}</b> 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',
|
||||
|
||||
299
prediqo_web/src/shared/i18n/locales/reportCatalog.ts
Normal file
299
prediqo_web/src/shared/i18n/locales/reportCatalog.ts
Normal file
@ -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;
|
||||
Loading…
Reference in New Issue
Block a user