feat(ledger): add bookkeeping workbench and transaction views

- Add transactions_dirty table and zero-tolerance cleansing action

- Implement bookkeeping workbench (/bookkeeping) with searchable Combobox channel selector and card suffix / account identifier

- Implement transaction ledger (/transactions) with date groupings, multi-currency metrics, and filters

- Update AGENTS.md guidelines for Base UI Select and Combobox bindings
This commit is contained in:
2026-09-06 23:23:29 +08:00
parent 1ccee1414c
commit c33857ffac
42 changed files with 3329 additions and 598 deletions
+13 -13
View File
@@ -1,4 +1,4 @@
import type { NextAuthConfig } from "next-auth";
import type { NextAuthConfig } from "next-auth"
export const authConfig = {
pages: {
@@ -7,37 +7,37 @@ export const authConfig = {
},
callbacks: {
authorized({ auth, request: { nextUrl } }) {
const isLoggedIn = !!auth?.user;
const pathname = nextUrl.pathname;
const publicPaths = ["/login", "/register", "/api/auth"];
const isLoggedIn = !!auth?.user
const pathname = nextUrl.pathname
const publicPaths = ["/login", "/register", "/api/auth"]
const isPublic = publicPaths.some(
(path) => pathname === path || pathname.startsWith("/api/auth/")
);
)
// 已登录用户在登录/注册页时重定向到首页
if (isLoggedIn && (pathname === "/login" || pathname === "/register")) {
return Response.redirect(new URL("/", nextUrl));
return Response.redirect(new URL("/", nextUrl))
}
// 访问受保护页面必须已登录
if (!isLoggedIn && !isPublic) {
return false;
return false
}
return true;
return true
},
jwt({ token, user }) {
if (user?.id) {
token.id = user.id;
token.id = user.id
}
return token;
return token
},
session({ session, token }) {
if (session.user && token.id) {
session.user.id = token.id as string;
session.user.id = token.id as string
}
return session;
return session
},
},
providers: [],
} satisfies NextAuthConfig;
} satisfies NextAuthConfig