docs/test(P18A-5,P18A-6): 收口资产矩阵文档与回归
这个提交包含在:
@@ -130,4 +130,27 @@ describe("documentSequence service", () => {
|
||||
expect(issued.config.source).toBe("document_category");
|
||||
expect(issued.documentNumber).toMatch(/^CG-\d{8}-0001$/);
|
||||
});
|
||||
|
||||
|
||||
it("falls back to default asset category code for asset cards", async () => {
|
||||
const prisma = buildPrisma({
|
||||
categoryMap: {
|
||||
ASSET_CARD_DEFAULT: {
|
||||
code: "ASSET_CARD_DEFAULT",
|
||||
entity_type: "asset_card",
|
||||
sequence_prefix: "ZC",
|
||||
number_length: 4,
|
||||
reset_period: "yearly",
|
||||
enabled: true,
|
||||
archived_at: null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const config = await resolveDocumentSequenceConfig(prisma, { documentType: "asset_card" });
|
||||
|
||||
expect(config.source).toBe("document_category");
|
||||
expect(config.documentCategoryCode).toBe("ASSET_CARD_DEFAULT");
|
||||
expect(config.prefix).toBe("ZC");
|
||||
});
|
||||
});
|
||||
|
||||
在新工单中引用
屏蔽一个用户