feat(bill): support full invoice validation details, datalink cards, and department paths (v0.7.3)

This commit is contained in:
gitea committed 2026-09-07 15:47:44 +08:00
1 parent 5e06429d6c
commit a8e32cff32
12 files changed
+313 -56

No files matched your search

+42 -1
View File
@@ -18,7 +18,7 @@ function flowLookupSelect(): string {
}
function flowDetailSelect(): string {
return "flowId(form(`...`),logs(operatorId,nextOperatorId,`...`),plan(`...`),`...`),`...`";
return "flowId(form(specificationId(id,name,code),`...`),logs(operatorId,nextOperatorId,`...`),plan(`...`),`...`),`...`";
}
export async function listActiveStaffCatalog(
@@ -396,3 +396,44 @@ export async function listEntitySchemas(
const parsed = EntityListResponseSchema.parse(json);
return parsed.items;
}
// ── 发票票面查验详情与商品明细 API ──────────────────────────────────────────────
export async function getInvoiceValidationDetail(
client: KyInstance,
corpId: string,
invoiceId: string
): Promise<Record<string, unknown> | undefined> {
try {
const response = await client.get(`api/v2/invoice/validation/$${encodeURIComponent(invoiceId)}`, {
searchParams: { masterId: invoiceId, corpId }
});
return (await response.json()) as Record<string, unknown>;
} catch {
return undefined;
}
}
// ── 数据连接业务对象与卡片详情 API ──────────────────────────────────────────────
export async function getDatalinkCard(
client: KyInstance,
corpId: string,
entityId: string,
type = "CARD"
): Promise<Record<string, unknown> | undefined> {
try {
const response = await client.get(`api/v2/datalink/detail/$${encodeURIComponent(entityId)}/$${encodeURIComponent(type)}`, {
searchParams: {
entityId,
type,
join: "data.dataLink.entityId,entity,/v2/datalink/entity",
corpId,
}
});
const json = (await response.json()) as { value?: Record<string, unknown> };
return json?.value ?? undefined;
} catch {
return undefined;
}
}