fix: address Codex PR review findings
This commit is contained in:
1 parent
0f164b6de5
commit
a7974abb08
44 files changed
+3317
-667
No files matched your search
@@ -207,20 +207,23 @@ export async function handleTrace(ctx: BillActionContext): Promise<CliResult> {
|
||||
}
|
||||
|
||||
const client = await ctx.getClient();
|
||||
const skipInvoices = booleanOption(parsed.options, ["no-invoice", "noInvoice", "basic"]);
|
||||
const report = await traceBillFlowDetail(client, corpId, target, { skipInvoices });
|
||||
const legacyInvoiceOption = ["no-invoice", "noInvoice", "basic"].some((key) => Object.hasOwn(parsed.options, key));
|
||||
const compatibilityNotice = legacyInvoiceOption
|
||||
? "提示: --no-invoice/--noInvoice/--basic 仅为旧版兼容参数;穿透诊断不补充加载发票详情,传入这些参数不会改变结果。\n"
|
||||
: "";
|
||||
const report = await traceBillFlowDetail(client, corpId, target);
|
||||
|
||||
if (!report.found) {
|
||||
if (runtime.jsonMode) {
|
||||
return {
|
||||
stdout: printJson(report, runtime.outputOptions),
|
||||
stderr: "",
|
||||
stderr: compatibilityNotice,
|
||||
exitCode: 1,
|
||||
};
|
||||
}
|
||||
return {
|
||||
stdout: "",
|
||||
stderr: `[NOT FOUND] 在企业 [${corp.name}] 下未找到匹配 [${target}] 的单据或审批流实例\n 诊断提示: ${report.diagnostic.advice}\n`,
|
||||
stderr: `${compatibilityNotice}[NOT FOUND] 在企业 [${corp.name}] 下未找到匹配 [${target}] 的单据或审批流实例\n 诊断提示: ${report.diagnostic.advice}\n`,
|
||||
exitCode: 1,
|
||||
};
|
||||
}
|
||||
@@ -235,7 +238,7 @@ export async function handleTrace(ctx: BillActionContext): Promise<CliResult> {
|
||||
},
|
||||
runtime.outputOptions
|
||||
),
|
||||
stderr: "",
|
||||
stderr: compatibilityNotice,
|
||||
exitCode: 0,
|
||||
};
|
||||
}
|
||||
@@ -294,7 +297,7 @@ export async function handleTrace(ctx: BillActionContext): Promise<CliResult> {
|
||||
|
||||
return {
|
||||
stdout: `${lines.join("\n")}\n`,
|
||||
stderr: "",
|
||||
stderr: compatibilityNotice,
|
||||
exitCode: 0,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user