fix: 整合本地单据校验与离线身份修复

从旧审查分支选择仍未进入主分支的单据修复,保留主分支较新的工作流与插件分发实现。
兼容费用类型包装树,统一创建预演与执行,修正核销净支付,并将真实规格校验接入复制及送审。
注册 whoami 离线参数,补充写入契约和完整入口回归,保留旧分支与工作区。

验证:bun test 876 pass / 0 fail;bun run check、check:version、git diff --check 通过。
This commit is contained in:
gitea committed 2026-10-28 15:00:37 +08:00
1 parent c2d36733fb
commit ebeec98f6d
12 files changed
+369 -54

No files matched your search

+3 -2
View File
@@ -1,4 +1,4 @@
import { createBillDraft } from "../../../domains/bill/create.js";
import { createBillDraft, prepareBillDraft } from "../../../domains/bill/create.js";
import { isDryRun } from "../../mutation.js";
import { stringOption } from "../../parser.js";
import { printJson } from "../../printer.js";
@@ -22,7 +22,8 @@ export async function handleCreate(ctx: BillActionContext): Promise<CliResult> {
const feeTypeName = stringOption(parsed.options, ["fee-type", "feeType"]);
if (isDryRun(parsed, runtime)) {
const preview = { template: templateId, title: title ?? "(模板名称)", amount, reason: reason ?? "", feeType: feeTypeName ?? "简单费用" };
const prepared = await prepareBillDraft(await ctx.getClient(), corpId, { templateId, title, amount, reason, feeTypeName });
const preview = { template: templateId, title: prepared.title, amount: prepared.amount, reason: reason ?? "", feeType: prepared.feeType };
if (runtime.jsonMode) {
return { stdout: printJson({ dryRun: true, ...preview }, runtime.outputOptions), stderr: "", exitCode: 0 };
}