const fs = require('fs');

const file = 'src/modules/book-generator/book-generator.store.ts';
let content = fs.readFileSync(file, 'utf8');

// Fix first occurrence - line 259
content = content.replace(
  'await prisma.bookChapter.create({ {',
  'await prisma.bookChapter.create({\n        data: {'
);

// Fix closing brace for first one
content = content.replace(
  `        status: 'pending',
        },
      });
    }
  }

  /**
   * 创建章节条目`,
  `        status: 'pending',
        },
      });
    }
  }

  /**
   * 创建章节条目`
);

fs.writeFileSync(file, content, 'utf8');
console.log('✅ 修复完成');
