完善借款、编号、付款与预算并发及验收(09-06-release-gate-integrity)

汇总已落盘的借款本金与还款、兼容历史编号的周期化编号、付款责任与回单核验、报销进度和排序、PWA/采购事务、错误原因与日期校验及ERP退役。
统一共享预算池锁序和锁后判断,恢复差旅原预算选择,补原因码固定夹具及反向完整性检查。
纳入配套迁移、测试、受管QA、分层验收合同、规约及任务记录;原始证据留在ignored artifacts。

关联任务:09-17-company-loan-principal-repayment、09-17-erp-exclusive-retirement、09-18-reimbursement-periodic-numbering、09-08-reimbursement-payment-closeout、09-18-local-concurrency-product-fixes、09-19-budget-pool-concurrency、09-05-error-explainability-payment-readiness。
预算补审由Claude定向验证2文件928项通过,原4446/28及r6结果仍仅对应各自历史输入;本轮未重跑测试。
完整新候选门禁、R1真实入口接入与12项公网义务仍开放。生产编号未启用、差旅仍冻结;不推送、不部署,不宣称发布资格。
这个提交包含在:
2026-09-19 13:11:04 +08:00
父节点 729d90576f
当前提交 1f8d5b658a
共修改 367 个文件,包含 21079 行新增和 12287 行删除
@@ -10,15 +10,15 @@ export class ReimbursementDetailPageObject {
}
get overview() {
return this.page.getByTestId(TEST_IDS.reimbursement.overview);
return this.page.getByTestId("reimbursement-desktop-workspace");
}
get summary() {
return this.page.getByTestId(TEST_IDS.reimbursement.summary);
return this.overview.locator("section.workbench-hero");
}
get itemsTable() {
return this.page.getByTestId(TEST_IDS.reimbursement.items);
return this.page.getByTestId("reimbursement-expense-items");
}
get addItemBtn() {
@@ -34,7 +34,7 @@ export class ReimbursementDetailPageObject {
}
get invoices() {
return this.page.getByTestId(TEST_IDS.reimbursement.invoices);
return this.page.getByTestId("approval-invoices");
}
get invoiceAddBtn() {
@@ -53,10 +53,6 @@ export class ReimbursementDetailPageObject {
return this.page.getByTestId(TEST_IDS.reimbursement.invoiceUploadSubmit);
}
get erpExport() {
return this.page.getByTestId(TEST_IDS.reimbursement.erpExport);
}
get submitBtn() {
return this.page.getByTestId(TEST_IDS.reimbursement.submit);
}
@@ -79,7 +75,7 @@ export class ReimbursementDetailPageObject {
}
async uploadInvoicePdf(fileName: string, buffer: Buffer) {
const invoiceCards = this.invoices.locator(":scope > div");
const invoiceCards = this.invoices.getByTestId("approval-invoice-evidence");
const invoiceCountBeforeUpload = await invoiceCards.count();
await this.invoiceAddBtn.click();
await expect(this.invoiceDialog).toBeVisible();
@@ -103,20 +99,50 @@ export class ReimbursementDetailPageObject {
throw new Error(`上传发票后未返回票据 ID: ${JSON.stringify(uploadPayload)}`);
}
await expect(invoiceCards).toHaveCount(invoiceCountBeforeUpload + 1, { timeout: 90_000 });
await this.page.keyboard.press("Escape");
// OCR selects the invoice; binding remains an explicit user action.
const invoiceRow = this.invoiceDialog.locator("label").filter({ hasText: fileName });
await expect(invoiceRow.getByRole("checkbox")).toBeChecked({ timeout: 90_000 });
const target = invoiceRow.getByRole("combobox", { name: "添加到哪条明细" });
const existingItems = target.locator('option:not([value=""])');
await expect(existingItems).toHaveCount(1);
await target.selectOption((await existingItems.getAttribute("value"))!);
await this.invoiceDialog.getByRole("button", { name: "添加到报销单", exact: true }).click();
await expect(invoiceCards).toHaveCount(invoiceCountBeforeUpload + 1);
await expect(this.itemsTable.getByTestId("approval-item-evidence")).toHaveCount(1);
await expect(this.invoiceDialog).toHaveCount(0);
return invoiceId;
}
// 当前 seed 保证 precheck 不触发 warn/manual_review;若 seed 变更,此处需相应调整。
async submitReimbursement(acceptConfirm = true) {
const dialogPromise = acceptConfirm
? this.page.waitForEvent("dialog", { timeout: 2_000 }).then((dialog) => dialog.accept()).catch(() => undefined)
: Promise.resolve();
async addItem(amount = "10.00") {
await this.addItemBtn.click();
const expenseType = this.page.getByTestId("reimbursement-item-expense-type");
await expect(expenseType.locator("option")).not.toHaveCount(1);
const value = await expenseType.locator("option").evaluateAll(options =>
(options as HTMLOptionElement[]).find(option => option.textContent === "邮寄快递")?.value);
expect(value, "synthetic fixture requires the seeded courier expense type").toBeTruthy();
await expenseType.selectOption(value!);
await this.page.getByTestId("reimbursement-item-amount").fill(amount);
await this.page.getByTestId("reimbursement-item-description").fill("合成快递费用,低于票面金额部分为非报销支出");
await this.page.getByTestId("reimbursement-item-save").click();
await expect(this.page.getByTestId("reimbursement-item-editor")).toHaveCount(0);
await expect(this.itemsTable.getByTestId("approval-item-evidence")).toHaveCount(1);
}
async submitReimbursement() {
const precheck = this.page.waitForResponse(response =>
new URL(response.url()).pathname.endsWith("/precheck") && response.request().method() === "POST");
const submitted = this.page.waitForResponse(response =>
new URL(response.url()).pathname.endsWith("/submit") && response.request().method() === "POST");
await this.submitBtn.click();
await dialogPromise;
const check = await precheck;
expect(check.ok()).toBe(true);
const data = (await check.json()).data;
if (data?.decision === "warn" || data?.decision === "manual_review" || data?.standardChecks?.some((item: {exceeded: boolean; controlMode: string}) => item.exceeded && item.controlMode === "warn")) {
await this.page.getByRole("dialog", { name: "确认提交报销单?" }).getByRole("button", { name: "确认提交", exact: true }).click();
}
const response = await submitted;
expect(response.ok(), `synthetic submit HTTP ${response.status()}`).toBe(true);
return (await response.json()).data as {currentTaskId: string};
}
}