export function generatePermissions(moduleName: string, commandNames: string[]): string {
  const sorted = [...commandNames].sort();
  const entries = sorted.map((name) => `  "${name}",`).join("\n");

  return `// @generated — do not edit
import { definePermissions } from "@tailor-platform/erp-kit/module";

export const { permissions, own, all } = definePermissions("${moduleName}", [
${entries}
] as const);
`;
}
