fix(intake): 商品企划候选人排除供应商账号

This commit is contained in:
WuYongJie 2026-10-06 17:55:24 +08:00
parent 5cd69fb9db
commit 57b2b405cf
2 changed files with 29 additions and 1 deletions

View File

@ -153,4 +153,28 @@ describe('intake-owner-options.service', () => {
listIntakeOwnerOptionNamesByDepartmentScope('merchandisePlanning'),
).resolves.toEqual(['内部A'])
})
it('excludes supplier accounts from merchandise planning candidates', async () => {
mockedFindMany.mockResolvedValue([
{
name: '兰考华兰家具',
businessRoles: ['SUPPLIER'],
department: null,
team: null,
},
{
name: '内部A',
businessRoles: [],
department: {
name: '产品研发部',
fullPath: '江苏简尚品牌管理有限公司 > 产品研发部',
},
team: null,
},
])
await expect(
listIntakeOwnerOptionNamesByDepartmentScope('merchandisePlanning'),
).resolves.toEqual(['内部A'])
})
})

View File

@ -119,8 +119,12 @@ export async function listIntakeOwnerOptionNamesByDepartmentScope(
if (isOptionExternalIntakeUser) return false;
// 供应商自注册账号(SUPPLIER 角色)不是内部人员,
// 不应出现在任何内部负责人候选里。
if (user.businessRoles?.includes("SUPPLIER")) return false;
// 商品企划部已解散(2026-10 用户口径):商品企划不再按部门圈定候选人,
// 直接开放为全部内部人员可搜索填写;外部人员已在上面排除。
// 直接开放为全部内部人员可搜索填写;外部人员与供应商已在上面排除。
if (scope === "merchandisePlanning") {
return true;
}