refactor(types): 重构类型系统,统一共享类型定义

feat(types): 新增共享类型中心,包含用户、产品、订单等核心领域类型
fix(types): 修复类型定义错误,统一各模块类型引用
style(types): 优化类型文件格式和注释
docs(types): 更新类型文档和变更日志
test(types): 添加类型测试用例
build(types): 配置类型共享路径
chore(types): 清理重复类型定义文件
This commit is contained in:
2026-03-20 17:53:46 +08:00
parent 989c4b13a6
commit 427becbc8f
222 changed files with 25676 additions and 6328 deletions

View File

@@ -6,6 +6,7 @@ export interface Supplier {
id: string;
name: string;
contact: string;
contactName?: string;
email: string;
phone: string;
address: string;
@@ -14,19 +15,24 @@ export interface Supplier {
status: 'active' | 'inactive' | 'pending';
paymentTerms: string;
leadTime: number;
minOrder?: number;
minOrderQty: number;
notes?: string;
createdAt: string;
}
export interface SupplierProduct {
id: string;
supplierId: string;
supplierId?: string;
sku: string;
productName: string;
costPrice: number;
name: string;
productName?: string;
price: number;
costPrice?: number;
stock: number;
moq: number;
leadTime: number;
quality: 'A' | 'B' | 'C';
quality?: 'A' | 'B' | 'C';
}
export interface ISuppliersDataSource {
@@ -59,9 +65,9 @@ class MockSuppliersDataSource implements ISuppliersDataSource {
async fetchSupplierProducts(supplierId: string): Promise<SupplierProduct[]> {
return [
{ id: 'sp_001', supplierId, sku: 'SKU-001', productName: 'Wireless Headphones', costPrice: 12.50, moq: 100, leadTime: 15, quality: 'A' },
{ id: 'sp_002', supplierId, sku: 'SKU-002', productName: 'USB-C Cable', costPrice: 1.80, moq: 500, leadTime: 10, quality: 'A' },
{ id: 'sp_003', supplierId, sku: 'SKU-003', productName: 'Phone Case', costPrice: 2.50, moq: 200, leadTime: 12, quality: 'B' },
{ id: 'sp_001', supplierId, sku: 'SKU-001', name: 'Wireless Headphones', productName: 'Wireless Headphones', price: 12.50, costPrice: 12.50, stock: 1000, moq: 100, leadTime: 15, quality: 'A' },
{ id: 'sp_002', supplierId, sku: 'SKU-002', name: 'USB-C Cable', productName: 'USB-C Cable', price: 1.80, costPrice: 1.80, stock: 5000, moq: 500, leadTime: 10, quality: 'A' },
{ id: 'sp_003', supplierId, sku: 'SKU-003', name: 'Phone Case', productName: 'Phone Case', price: 2.50, costPrice: 2.50, stock: 2000, moq: 200, leadTime: 12, quality: 'B' },
];
}
}