feat: Q4 测试覆盖 + 插件生态 — 集成测试/E2E/进销存插件/热更新
Q4 成熟度路线图全部完成:
1. 集成测试框架 (Testcontainers + PostgreSQL):
- auth_tests: 用户 CRUD、租户隔离、用户名唯一性
- plugin_tests: 动态表创建查询、租户数据隔离
2. Playwright E2E 测试:
- 登录页面渲染和表单验证测试
- 用户管理、插件管理、多租户隔离占位测试
3. 进销存插件 (erp-plugin-inventory):
- 6 实体: 产品/仓库/库存/供应商/采购单/销售单
- 12 权限、6 页面、完整 manifest
- WASM 编译验证通过
4. 插件热更新:
- POST /api/v1/admin/plugins/{id}/upgrade
- manifest 对比 + 增量 DDL + WASM 热加载
- 失败保持旧版本继续运行
5. 文档更新: CLAUDE.md + wiki/index.md 同步 Q2-Q4 进度
This commit is contained in:
29
crates/erp-plugin-inventory/src/lib.rs
Normal file
29
crates/erp-plugin-inventory/src/lib.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
//! 进销存管理插件 — WASM Guest 实现
|
||||
|
||||
wit_bindgen::generate!({
|
||||
path: "../erp-plugin-prototype/wit/plugin.wit",
|
||||
world: "plugin-world",
|
||||
});
|
||||
|
||||
use crate::exports::erp::plugin::plugin_api::Guest;
|
||||
|
||||
struct InventoryPlugin;
|
||||
|
||||
impl Guest for InventoryPlugin {
|
||||
fn init() -> Result<(), String> {
|
||||
// 进销存插件初始化:当前无需创建默认数据
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn on_tenant_created(_tenant_id: String) -> Result<(), String> {
|
||||
// 为新租户创建进销存默认数据:当前无需创建默认数据
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_event(_event_type: String, _payload: Vec<u8>) -> Result<(), String> {
|
||||
// 进销存 V1: 无事件处理
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
export!(InventoryPlugin);
|
||||
Reference in New Issue
Block a user