支持企微通讯录缺失手机号(07-26-internal-ops-recovery-baseline)

这个提交包含在:
2026-07-27 13:05:27 +08:00
父节点 9875bc37a4
当前提交 2526052e73
共修改 24 个文件,包含 845 行新增和 63 行删除
@@ -67,6 +67,38 @@ describe("wecom HR master sync helpers", () => {
expect(profile.missingRequiredFields).toContain("email");
});
it("accepts a profile with no phone and does not plan clearing an existing phone", () => {
const profile = normalizeWecomHrProfile({
contact: {
userid: "missing-phone",
name: "缺手机号成员",
biz_mail: "[email protected]",
department: [1],
enable: 1,
},
staff: {},
departmentMap: new Map([["1", { externalId: "1", name: "行政部" }]]),
});
expect(profile.phone).toBe("");
expect(profile.missingRequiredFields).toEqual([]);
const changes = __testables.buildEmployeeChanges(
{
id: "employee-1",
name: profile.name,
phone: "19900000009",
email: profile.email,
department_id: "department-1",
title: "员工",
wecom_identity_binding: { external_user_id: profile.externalUserId },
},
profile,
{ id: "department-1", name: "行政部" },
);
expect(changes).not.toHaveProperty("phone");
});
it("marks inactive WeCom members as confirmation-required instead of active", () => {
const profile = normalizeWecomHrProfile({
contact: {