feat: 增加通用报价咨询能力插件
This commit is contained in:
1 parent
044f2cd530
commit
15df8ed821
3 files changed
+33
-1
No files matched your search
@@ -122,6 +122,27 @@ test("admin can update declared capability status with authorization and audit",
|
|||||||
await prisma.capabilityAuditLog.deleteMany({ where: { brandId } });
|
await prisma.capabilityAuditLog.deleteMany({ where: { brandId } });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("admin can install optional quote capability without industry-specific branching", async () => {
|
||||||
|
const login = await request("/admin/session/login", {
|
||||||
|
method: "POST",
|
||||||
|
payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD },
|
||||||
|
});
|
||||||
|
const token = JSON.parse(login.body).token;
|
||||||
|
const response = await request("/admin/workspace/capabilities/quote-request", {
|
||||||
|
method: "PATCH",
|
||||||
|
headers: { authorization: `Bearer ${token}` },
|
||||||
|
payload: { capabilityVersion: "1.0.0", status: "enabled", config: { currency: "CNY" } },
|
||||||
|
});
|
||||||
|
assert.equal(response.statusCode, 200);
|
||||||
|
assert.equal(JSON.parse(response.body).capabilityKey, "quote-request");
|
||||||
|
await prisma.capabilityInstallation.deleteMany({
|
||||||
|
where: { brandId, capabilityKey: "quote-request" },
|
||||||
|
});
|
||||||
|
await prisma.capabilityAuditLog.deleteMany({
|
||||||
|
where: { brandId, capabilityKey: "quote-request" },
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test("admin capability list includes template defaults and brand overrides", async () => {
|
test("admin capability list includes template defaults and brand overrides", async () => {
|
||||||
await prisma.capabilityInstallation.deleteMany({ where: { brandId } });
|
await prisma.capabilityInstallation.deleteMany({ where: { brandId } });
|
||||||
const login = await request("/admin/session/login", {
|
const login = await request("/admin/session/login", {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
- 后续行业差异继续通过模板、模块、能力插件和声明式字段表达。
|
- 后续行业差异继续通过模板、模块、能力插件和声明式字段表达。
|
||||||
- [x] `personal`、`food`、`doors` 三模板均通过结构、内容和视觉 fixture 验收。
|
- [x] `personal`、`food`、`doors` 三模板均通过结构、内容和视觉 fixture 验收。
|
||||||
- [x] 门窗示例内容支持预览、幂等导入和审计。
|
- [x] 门窗示例内容支持预览、幂等导入和审计。
|
||||||
|
- [x] 注册通用 `quote-request` 能力插件,可由品牌独立启用,不绑定行业模板。
|
||||||
|
|
||||||
## 交付门槛
|
## 交付门槛
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export const configPackageName = "personal-brand-config";
|
|||||||
|
|
||||||
export type BrandTemplateKey = "personal" | "food" | "doors";
|
export type BrandTemplateKey = "personal" | "food" | "doors";
|
||||||
export type VisualTemplateKey = "linjing-editorial" | "minimal-neutral";
|
export type VisualTemplateKey = "linjing-editorial" | "minimal-neutral";
|
||||||
export type CapabilityKey = "offerings" | "inquiry" | "booking";
|
export type CapabilityKey = "offerings" | "inquiry" | "booking" | "quote-request";
|
||||||
|
|
||||||
export interface WorkflowDefinition {
|
export interface WorkflowDefinition {
|
||||||
key: string;
|
key: string;
|
||||||
@@ -36,6 +36,7 @@ export const capabilityRegistry = {
|
|||||||
offerings: { key: "offerings", version: "1.0.0" },
|
offerings: { key: "offerings", version: "1.0.0" },
|
||||||
inquiry: { key: "inquiry", version: "1.0.0" },
|
inquiry: { key: "inquiry", version: "1.0.0" },
|
||||||
booking: { key: "booking", version: "1.0.0", workflowKey: "booking.basic" },
|
booking: { key: "booking", version: "1.0.0", workflowKey: "booking.basic" },
|
||||||
|
"quote-request": { key: "quote-request", version: "1.0.0" },
|
||||||
} as const satisfies Record<CapabilityKey, CapabilityDefinition>;
|
} as const satisfies Record<CapabilityKey, CapabilityDefinition>;
|
||||||
|
|
||||||
export const capabilityPlugins = {
|
export const capabilityPlugins = {
|
||||||
@@ -48,6 +49,15 @@ export const capabilityPlugins = {
|
|||||||
apiContract: "/customer/inquiry-submissions",
|
apiContract: "/customer/inquiry-submissions",
|
||||||
configSchema: "capability.inquiry.v1",
|
configSchema: "capability.inquiry.v1",
|
||||||
},
|
},
|
||||||
|
"quote-request": {
|
||||||
|
key: "quote-request",
|
||||||
|
version: "1.0.0",
|
||||||
|
displayName: "报价咨询",
|
||||||
|
purpose: "quote-request",
|
||||||
|
requiredModules: ["inquiry", "records", "success-summary"],
|
||||||
|
apiContract: "/customer/inquiry-submissions",
|
||||||
|
configSchema: "capability.quote-request.v1",
|
||||||
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type BrandTemplateModuleType = "identity" | "trust" | "offering" | "inquiry" | "contact";
|
export type BrandTemplateModuleType = "identity" | "trust" | "offering" | "inquiry" | "contact";
|
||||||
|
|||||||
Reference in new issue
Block a user