export interface DingTalkConfigFormValues {
  agentId: string;
  appSecret?: string;
  corpId: string;
}

export const isAppSecretRequired = (hasSavedConfig: boolean) => !hasSavedConfig;

export const buildDingTalkConfigPayload = (values: DingTalkConfigFormValues) => ({
  corpId: values.corpId.trim(),
  agentId: values.agentId.trim(),
  appSecret: values.appSecret?.trim() || undefined,
});
