refactor(api): enforce layered architecture by moving db queries to core services

This commit is contained in:
yiling
2026-08-01 16:25:01 +08:00
parent fb66166b49
commit 97069042b2
26 changed files with 256 additions and 363 deletions
+5 -11
View File
@@ -41,17 +41,11 @@ vi.mock('@shumai/core/src/auditLog/auditLog', () => ({
},
}))
vi.mock('@shumai/db', async (importOriginal) => {
const actual = await importOriginal<typeof import('@shumai/db')>()
return {
...actual,
prisma: {
project: {
findUnique: vi.fn().mockResolvedValue({ teamId: 't1' }),
},
},
}
})
vi.mock('@shumai/core/src/project/project', () => ({
projectService: {
getProjectTeam: vi.fn().mockResolvedValue('t1'),
},
}))
describe('Share API', () => {
const app = new Hono()