GuDingZiChan/backend/src/utils/organization.ts
2026-03-23 11:54:41 +08:00

23 lines
691 B
TypeScript

export const HR_SOURCE_SYSTEM = 'ding_hr'
export const HR_BUSINESS_DEPARTMENT_SOURCE_SYSTEM = 'ding_hr_business'
export const OTHER_DEPARTMENT_NAME = '其他'
export const BUSINESS_DEPARTMENT_SOURCE_SYSTEMS = [
null,
HR_BUSINESS_DEPARTMENT_SOURCE_SYSTEM
] as const
export const isBusinessDepartmentSourceSystem = (value: string | null | undefined) =>
!value || value === HR_BUSINESS_DEPARTMENT_SOURCE_SYSTEM
export const buildBusinessDepartmentWhere = () => ({
OR: [
{ source_system: null },
{ source_system: HR_BUSINESS_DEPARTMENT_SOURCE_SYSTEM }
]
})
export const buildSyncedBusinessDepartmentWhere = () => ({
source_system: HR_BUSINESS_DEPARTMENT_SOURCE_SYSTEM
})