feat(api, agents, i18n): enhance settlement features and multi-language support

Added new types and API functions for settlement period summaries and credit ledgers, improving the management of agent settlements. Updated the admin console to reflect these changes, enhancing user experience with better navigation and data presentation. Additionally, expanded multi-language support by incorporating new translations in English, Nepali, and Chinese for settlement-related terms, ensuring consistency across the platform.
This commit is contained in:
2026-06-05 18:00:59 +08:00
parent 65eaeecf8c
commit af982bb9f7
73 changed files with 4307 additions and 2494 deletions

View File

@@ -1,54 +1,30 @@
"use client";
import { useEffect, useState } from "react";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
import { PRD_RULES_ODDS_ACCESS_ANY } from "@/lib/admin-prd";
import { ConfigDocPage } from "@/modules/config/config-doc-page";
import { OddsConfigDocScreen } from "@/modules/config/doc/odds-config-doc-screen";
import { RebateConfigDocScreen } from "@/modules/config/doc/rebate-config-doc-screen";
import { useOddsConfigWorkspace } from "@/modules/config/use-odds-config-workspace";
import { RulesPageShell } from "@/modules/rules/rules-page-shell";
/** 赔率与回水:共用赔率版本线,主栏步骤 + 右侧配置摘要。 */
/** 赔率与回水:共用赔率版本线,主栏步骤 + 右侧配置摘要。 */
export function RulesOddsConfigScreen() {
const { t } = useTranslation("config");
const [sharedVersionId, setSharedVersionId] = useState("");
const workspace = useOddsConfigWorkspace(sharedVersionId, setSharedVersionId);
useEffect(() => {
const scrollToRebate = () => {
if (window.location.hash !== "#rebate") {
return;
}
document.getElementById("rebate")?.scrollIntoView({ behavior: "smooth", block: "start" });
};
scrollToRebate();
window.addEventListener("hashchange", scrollToRebate);
return () => window.removeEventListener("hashchange", scrollToRebate);
}, []);
const rebateSection = (
<div id="rebate">
<RebateConfigDocScreen embedded mergedSection workspace={workspace} />
</div>
);
return (
<RulesPageShell>
<AdminPermissionGate requiredAny={PRD_RULES_ODDS_ACCESS_ANY}>
<ConfigDocPage
title={t("nav.rulesOddsTitle")}
description={t("nav.rulesOddsDescription")}
description={t("nav.rulesOddsDescriptionShort")}
contentClassName="pt-2"
>
<OddsConfigDocScreen
embedded
mergedLayout
workspace={workspace}
rebateSection={rebateSection}
/>
<OddsConfigDocScreen embedded mergedLayout workspace={workspace} />
</ConfigDocPage>
</AdminPermissionGate>
</RulesPageShell>