新增财务角色与财务报表并完善后台权限

This commit is contained in:
yml2213
2026-09-02 13:58:03 +08:00
parent de63daf1ac
commit bf167d98ed
29 changed files with 1242 additions and 69 deletions
@@ -2,6 +2,10 @@ import { query, withTransaction } from '../../db/client.js'
import { createHttpError } from '../../utils/http.js'
export const ADMIN_PERMISSION_KEYS = [
'finance.view',
'finance.review',
'finance.config',
'finance.export',
'worker_order.view',
'worker_order.edit',
'worker_order.configure_share',
@@ -112,7 +116,7 @@ export async function updateAdminRolePermissions(roleKey: unknown, permissionKey
const normalizedRole = String(roleKey || '')
.trim()
.toLowerCase()
if (!['admin', 'operator', 'support'].includes(normalizedRole)) {
if (!['admin', 'operator', 'support', 'finance'].includes(normalizedRole)) {
throw createHttpError('角色不存在或不可修改', {
statusCode: 400,
errorCode: 'admin_role_invalid',